airport-one-widgets 0.2.50 → 0.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -668,4 +668,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
668
668
|
}`;function _P(){var e=wN,t=TN,n=Q.cssPrefix,r=Q.replacementClass,i=gP;if(n!==e||r!==t){var a=RegExp(`\\.${e}\\-`,`g`),o=RegExp(`\\--${e}\\-`,`g`),s=RegExp(`\\.${t}`,`g`);i=i.replace(a,`.${n}-`).replace(o,`--${n}-`).replace(s,`.${r}`)}return i}var vP=!1;function yP(){Q.autoAddCss&&!vP&&(aP(_P()),vP=!0)}var bP={mixout:function(){return{dom:{css:_P,insertCss:yP}}},hooks:function(){return{beforeDOMElementCreation:function(){yP()},beforeI2svg:function(){yP()}}}},xP=nM||{};xP[SN]||(xP[SN]={}),xP[SN].styles||(xP[SN].styles={}),xP[SN].hooks||(xP[SN].hooks={}),xP[SN].shims||(xP[SN].shims=[]);var SP=xP[SN],CP=[],wP=function(){rM.removeEventListener(`DOMContentLoaded`,wP),TP=1,CP.map(function(e){return e()})},TP=!1;oM&&(TP=(rM.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(rM.readyState),TP||rM.addEventListener(`DOMContentLoaded`,wP));function EP(e){oM&&(TP?setTimeout(e,0):CP.push(e))}function DP(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,a=i===void 0?[]:i;return typeof e==`string`?uP(e):`<${t} ${dP(r)}>${a.map(DP).join(``)}</${t}>`}function OP(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var kP=function(e,t){return function(n,r,i,a){return e.call(t,n,r,i,a)}},AP=function(e,t,n,r){var i=Object.keys(e),a=i.length,o=r===void 0?t:kP(t,r),s,c,l;for(n===void 0?(s=1,l=e[i[0]]):(s=0,l=n);s<a;s++)c=i[s],l=o(l,e[c],c,e);return l};function jP(e){return Wj(e).length===1?e.codePointAt(0).toString(16):null}function MP(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function NP(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).skipHooks,r=n===void 0?!1:n,i=MP(t);typeof SP.hooks.addPack==`function`&&!r?SP.hooks.addPack(e,MP(t)):SP.styles[e]=Z(Z({},SP.styles[e]||{}),i),e===`fas`&&NP(`fa`,t)}var PP=SP.styles,FP=SP.shims,IP=Object.keys(HN),LP=IP.reduce(function(e,t){return e[t]=Object.keys(HN[t]),e},{}),RP=null,zP={},BP={},VP={},HP={},UP={};function WP(e){return~YN.indexOf(e)}function GP(e,t){var n=t.split(`-`),r=n[0],i=n.slice(1).join(`-`);return r===e&&i!==``&&!WP(i)?i:null}var KP=function(){var e=function(e){return AP(PP,function(t,n,r){return t[r]=AP(n,e,{}),t},{})};zP=e(function(e,t,n){return t[3]&&(e[t[3]]=n),t[2]&&t[2].filter(function(e){return typeof e==`number`}).forEach(function(t){e[t.toString(16)]=n}),e}),BP=e(function(e,t,n){return e[n]=n,t[2]&&t[2].filter(function(e){return typeof e==`string`}).forEach(function(t){e[t]=n}),e}),UP=e(function(e,t,n){var r=t[2];return e[n]=n,r.forEach(function(t){e[t]=n}),e});var t=`far`in PP||Q.autoFetchSvg,n=AP(FP,function(e,n){var r=n[0],i=n[1],a=n[2];return i===`far`&&!t&&(i=`fas`),typeof r==`string`&&(e.names[r]={prefix:i,iconName:a}),typeof r==`number`&&(e.unicodes[r.toString(16)]={prefix:i,iconName:a}),e},{names:{},unicodes:{}});VP=n.names,HP=n.unicodes,RP=tF(Q.styleDefault,{family:Q.familyDefault})};nP(function(e){RP=tF(e.styleDefault,{family:Q.familyDefault})}),KP();function qP(e,t){return(zP[e]||{})[t]}function JP(e,t){return(BP[e]||{})[t]}function YP(e,t){return(UP[e]||{})[t]}function XP(e){return VP[e]||{prefix:null,iconName:null}}function ZP(e){var t=HP[e],n=qP(`fas`,e);return t||(n?{prefix:`fas`,iconName:n}:null)||{prefix:null,iconName:null}}function QP(){return RP}var $P=function(){return{prefix:null,iconName:null,rest:[]}};function eF(e){var t=mM,n=IP.reduce(function(e,t){return e[t]=`${Q.cssPrefix}-${t}`,e},{});return QM.forEach(function(r){(e.includes(n[r])||e.some(function(e){return LP[r].includes(e)}))&&(t=r)}),t}function tF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).family,n=t===void 0?mM:t,r=RN[n][e];if(n===hM&&!e)return`fad`;var i=BN[n][e]||BN[n][r],a=e in SP.styles?e:null;return i||a||null}function nF(e){var t=[],n=null;return e.forEach(function(e){var r=GP(Q.cssPrefix,e);r?n=r:e&&t.push(e)}),{iconName:n,rest:t}}function rF(e){return e.sort().filter(function(e,t,n){return n.indexOf(e)===t})}var iF=gN.concat(rN);function aF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).skipLookups,n=t===void 0?!1:t,r=null,i=rF(e.filter(function(e){return iF.includes(e)})),a=rF(e.filter(function(e){return!iF.includes(e)})),o=Uj(i.filter(function(e){return r=e,!pM.includes(e)}),1)[0],s=o===void 0?null:o,c=eF(i),l=Z(Z({},nF(a)),{},{prefix:tF(s,{family:c})});return Z(Z(Z({},l),lF({values:e,family:c,styles:PP,config:Q,canonical:l,givenPrefix:r})),oF(n,r,l))}function oF(e,t,n){var r=n.prefix,i=n.iconName;if(e||!r||!i)return{prefix:r,iconName:i};var a=t===`fa`?XP(i):{},o=YP(r,i);return i=a.iconName||o||i,r=a.prefix||r,r===`far`&&!PP.far&&PP.fas&&!Q.autoFetchSvg&&(r=`fas`),{prefix:r,iconName:i}}var sF=QM.filter(function(e){return e!==mM||e!==hM}),cF=Object.keys(hN).filter(function(e){return e!==mM}).map(function(e){return Object.keys(hN[e])}).flat();function lF(e){var t=e.values,n=e.family,r=e.canonical,i=e.givenPrefix,a=i===void 0?``:i,o=e.styles,s=o===void 0?{}:o,c=e.config,l=c===void 0?{}:c,u=n===hM,d=t.includes(`fa-duotone`)||t.includes(`fad`),f=l.familyDefault===`duotone`,p=r.prefix===`fad`||r.prefix===`fa-duotone`;return!u&&(d||f||p)&&(r.prefix=`fad`),(t.includes(`fa-brands`)||t.includes(`fab`))&&(r.prefix=`fab`),!r.prefix&&sF.includes(n)&&(Object.keys(s).find(function(e){return cF.includes(e)})||l.autoFetchSvg)&&(r.prefix=tN.get(n).defaultShortPrefixId,r.iconName=YP(r.prefix,r.iconName)||r.iconName),(r.prefix===`fa`||a===`fa`)&&(r.prefix=QP()||`fas`),r}var uF=function(){function e(){Nj(this,e),this.definitions={}}return Fj(e,[{key:`add`,value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.reduce(this._pullDefinitions,{});Object.keys(i).forEach(function(t){e.definitions[t]=Z(Z({},e.definitions[t]||{}),i[t]),NP(t,i[t]);var n=HN[mM][t];n&&NP(n,i[t]),KP()})}},{key:`reset`,value:function(){this.definitions={}}},{key:`_pullDefinitions`,value:function(e,t){var n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map(function(t){var r=n[t],i=r.prefix,a=r.iconName,o=r.icon,s=o[2];e[i]||(e[i]={}),s.length>0&&s.forEach(function(t){typeof t==`string`&&(e[i][t]=o)}),e[i][a]=o}),e}}])}(),dF=[],fF={},pF={},mF=Object.keys(pF);function hF(e,t){var n=t.mixoutsTo;return dF=e,fF={},Object.keys(pF).forEach(function(e){mF.indexOf(e)===-1&&delete pF[e]}),dF.forEach(function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(function(e){typeof t[e]==`function`&&(n[e]=t[e]),qj(t[e])===`object`&&Object.keys(t[e]).forEach(function(r){n[e]||(n[e]={}),n[e][r]=t[e][r]})}),e.hooks){var r=e.hooks();Object.keys(r).forEach(function(e){fF[e]||(fF[e]=[]),fF[e].push(r[e])})}e.provides&&e.provides(pF)}),n}function gF(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(fF[e]||[]).forEach(function(e){t=e.apply(null,[t].concat(r))}),t}function _F(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(fF[e]||[]).forEach(function(e){e.apply(null,n)})}function vF(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return pF[e]?pF[e].apply(null,t):void 0}function yF(e){e.prefix===`fa`&&(e.prefix=`fas`);var t=e.iconName,n=e.prefix||QP();if(t)return t=YP(n,t)||t,OP(bF.definitions,n,t)||OP(SP.styles,n,t)}var bF=new uF,xF={noAuto:function(){Q.autoReplaceSvg=!1,Q.observeMutations=!1,_F(`noAuto`)},config:Q,dom:{i2svg:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oM?(_F(`beforeI2svg`,e),vF(`pseudoElements2svg`,e),vF(`i2svg`,e)):Promise.reject(Error(`Operation requires a DOM of some kind.`))},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;Q.autoReplaceSvg===!1&&(Q.autoReplaceSvg=!0),Q.observeMutations=!0,EP(function(){SF({autoReplaceSvgRoot:t}),_F(`watch`,e)})}},parse:{icon:function(e){if(e===null)return null;if(qj(e)===`object`&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:YP(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf(`fa-`)===0?e[1].slice(3):e[1],n=tF(e[0]);return{prefix:n,iconName:YP(n,t)||t}}if(typeof e==`string`&&(e.indexOf(`${Q.cssPrefix}-`)>-1||e.match(WN))){var r=aF(e.split(` `),{skipLookups:!0});return{prefix:r.prefix||QP(),iconName:YP(r.prefix,r.iconName)||r.iconName}}if(typeof e==`string`){var i=QP();return{prefix:i,iconName:YP(i,e)||e}}}},library:bF,findIconDefinition:yF,toHtml:DP},SF=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).autoReplaceSvgRoot,t=e===void 0?rM:e;(Object.keys(SP.styles).length>0||Q.autoFetchSvg)&&oM&&Q.autoReplaceSvg&&xF.dom.i2svg({node:t})};function CF(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(e){return DP(e)})}}),Object.defineProperty(e,"node",{get:function(){if(oM){var t=rM.createElement(`div`);return t.innerHTML=e.html,t.children}}}),e}function wF(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(pP(o)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};i.style=fP(Z(Z({},a),{},{"transform-origin":`${s.x+o.x/16}em ${s.y+o.y/16}em`}))}return[{tag:`svg`,attributes:i,children:t}]}function TF(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol,o=a===!0?`${t}-${Q.cssPrefix}-${n}`:a;return[{tag:`svg`,attributes:{style:`display: none;`},children:[{tag:`symbol`,attributes:Z(Z({},i),{},{id:o}),children:r}]}]}function EF(e){return[`aria-label`,`aria-labelledby`,`title`,`role`].some(function(t){return t in e})}function DF(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,o=e.transform,s=e.symbol,c=e.maskId,l=e.extra,u=e.watchable,d=u===void 0?!1:u,f=r.found?r:n,p=f.width,m=f.height,h=[Q.replacementClass,a?`${Q.cssPrefix}-${a}`:``].filter(function(e){return l.classes.indexOf(e)===-1}).filter(function(e){return e!==``||!!e}).concat(l.classes).join(` `),g={children:[],attributes:Z(Z({},l.attributes),{},{"data-prefix":i,"data-icon":a,class:h,role:l.attributes.role||`img`,viewBox:`0 0 ${p} ${m}`})};!EF(l.attributes)&&!l.attributes[`aria-hidden`]&&(g.attributes[`aria-hidden`]=`true`),d&&(g.attributes[EN]=``);var _=Z(Z({},g),{},{prefix:i,iconName:a,main:n,mask:r,maskId:c,transform:o,symbol:s,styles:Z({},l.styles)}),v=r.found&&n.found?vF(`generateAbstractMask`,_)||{children:[],attributes:{}}:vF(`generateAbstractIcon`,_)||{children:[],attributes:{}},y=v.children,b=v.attributes;return _.children=y,_.attributes=b,s?TF(_):wF(_)}function OF(e){var t=e.content,n=e.width,r=e.height,i=e.transform,a=e.extra,o=e.watchable,s=o===void 0?!1:o,c=Z(Z({},a.attributes),{},{class:a.classes.join(` `)});s&&(c[EN]=``);var l=Z({},a.styles);pP(i)&&(l.transform=hP({transform:i,startCentered:!0,width:n,height:r}),l[`-webkit-transform`]=l.transform);var u=fP(l);u.length>0&&(c.style=u);var d=[];return d.push({tag:`span`,attributes:c,children:[t]}),d}function kF(e){var t=e.content,n=e.extra,r=Z(Z({},n.attributes),{},{class:n.classes.join(` `)}),i=fP(n.styles);i.length>0&&(r.style=i);var a=[];return a.push({tag:`span`,attributes:r,children:[t]}),a}var AF=SP.styles;function jF(e){var t=e[0],n=e[1],r=Uj(e.slice(4),1)[0],i=null;return i=Array.isArray(r)?{tag:`g`,attributes:{class:`${Q.cssPrefix}-${JN.GROUP}`},children:[{tag:`path`,attributes:{class:`${Q.cssPrefix}-${JN.SECONDARY}`,fill:`currentColor`,d:r[0]}},{tag:`path`,attributes:{class:`${Q.cssPrefix}-${JN.PRIMARY}`,fill:`currentColor`,d:r[1]}}]}:{tag:`path`,attributes:{fill:`currentColor`,d:r}},{found:!0,width:t,height:n,icon:i}}var MF={found:!1,width:512,height:512};function NF(e,t){!FN&&!Q.showMissingIcons&&e&&console.error(`Icon with name "${e}" and prefix "${t}" is missing.`)}function PF(e,t){var n=t;return t===`fa`&&Q.styleDefault!==null&&(t=QP()),new Promise(function(r,i){if(n===`fa`){var a=XP(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&AF[t]&&AF[t][e]){var o=AF[t][e];return r(jF(o))}NF(e,t),r(Z(Z({},MF),{},{icon:Q.showMissingIcons&&e&&vF(`missingIconAbstract`)||{}}))})}var FF=function(){},IF=Q.measurePerformance&&aM&&aM.mark&&aM.measure?aM:{mark:FF,measure:FF},LF=`FA "7.2.0"`,RF=function(e){return IF.mark(`${LF} ${e} begins`),function(){return zF(e)}},zF=function(e){IF.mark(`${LF} ${e} ends`),IF.measure(`${LF} ${e}`,`${LF} ${e} begins`,`${LF} ${e} ends`)},BF={begin:RF,end:zF},VF=function(){};function HF(e){return typeof(e.getAttribute?e.getAttribute(EN):null)==`string`}function UF(e){var t=e.getAttribute?e.getAttribute(kN):null,n=e.getAttribute?e.getAttribute(AN):null;return t&&n}function WF(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Q.replacementClass)}function GF(){return Q.autoReplaceSvg===!0?XF.replace:XF[Q.autoReplaceSvg]||XF.replace}function KF(e){return rM.createElementNS(`http://www.w3.org/2000/svg`,e)}function qF(e){return rM.createElement(e)}function JF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).ceFn,n=t===void 0?e.tag===`svg`?KF:qF:t;if(typeof e==`string`)return rM.createTextNode(e);var r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(t){r.setAttribute(t,e.attributes[t])}),(e.children||[]).forEach(function(e){r.appendChild(JF(e,{ceFn:n}))}),r}function YF(e){var t=` ${e.outerHTML} `;return t=`${t}Font Awesome fontawesome.com `,t}var XF={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(e){t.parentNode.insertBefore(JF(e),t)}),t.getAttribute(EN)===null&&Q.keepOriginalSource){var n=rM.createComment(YF(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){var t=e[0],n=e[1];if(~lP(t).indexOf(Q.replacementClass))return XF.replace(e);var r=RegExp(`${Q.cssPrefix}-.*`);if(delete n[0].attributes.id,n[0].attributes.class){var i=n[0].attributes.class.split(` `).reduce(function(e,t){return t===Q.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e},{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(` `),i.toNode.length===0?t.removeAttribute(`class`):t.setAttribute(`class`,i.toNode.join(` `))}var a=n.map(function(e){return DP(e)}).join(`
|
|
669
669
|
`);t.setAttribute(EN,``),t.innerHTML=a}};function ZF(e){e()}function QF(e,t){var n=typeof t==`function`?t:VF;if(e.length===0)n();else{var r=ZF;Q.mutateApproach===MN&&(r=nM.requestAnimationFrame||ZF),r(function(){var t=GF(),r=BF.begin(`mutate`);e.map(t),r(),n()})}}var $F=!1;function eI(){$F=!0}function tI(){$F=!1}var nI=null;function rI(e){if(iM&&Q.observeMutations){var t=e.treeCallback,n=t===void 0?VF:t,r=e.nodeCallback,i=r===void 0?VF:r,a=e.pseudoElementsCallback,o=a===void 0?VF:a,s=e.observeMutationsRoot,c=s===void 0?rM:s;nI=new iM(function(e){if(!$F){var t=QP();cP(e).forEach(function(e){if(e.type===`childList`&&e.addedNodes.length>0&&!HF(e.addedNodes[0])&&(Q.searchPseudoElements&&o(e.target),n(e.target)),e.type===`attributes`&&e.target.parentNode&&Q.searchPseudoElements&&o([e.target],!0),e.type===`attributes`&&HF(e.target)&&~qN.indexOf(e.attributeName))if(e.attributeName===`class`&&UF(e.target)){var r=aF(lP(e.target)),a=r.prefix,s=r.iconName;e.target.setAttribute(kN,a||t),s&&e.target.setAttribute(AN,s)}else WF(e.target)&&i(e.target)})}}),oM&&nI.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function iI(){nI&&nI.disconnect()}function aI(e){var t=e.getAttribute(`style`),n=[];return t&&(n=t.split(`;`).reduce(function(e,t){var n=t.split(`:`),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(`:`).trim()),e},{})),n}function oI(e){var t=e.getAttribute(`data-prefix`),n=e.getAttribute(`data-icon`),r=e.innerText===void 0?``:e.innerText.trim(),i=aF(lP(e));return i.prefix||=QP(),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix?i:(i.prefix&&r.length>0&&(i.iconName=JP(i.prefix,e.innerText)||qP(i.prefix,jP(e.innerText))),!i.iconName&&Q.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data),i)}function sI(e){return cP(e.attributes).reduce(function(e,t){return e.name!==`class`&&e.name!==`style`&&(e[t.name]=t.value),e},{})}function cI(){return{iconName:null,prefix:null,transform:iP,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function lI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=oI(e),r=n.iconName,i=n.prefix,a=n.rest,o=sI(e),s=gF(`parseNodeAttributes`,{},e);return Z({iconName:r,prefix:i,transform:iP,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:t.styleParser?aI(e):[],attributes:o}},s)}var uI=SP.styles;function dI(e){var t=Q.autoReplaceSvg===`nest`?lI(e,{styleParser:!1}):lI(e);return~t.extra.classes.indexOf(GN)?vF(`generateLayersText`,e,t):vF(`generateSvgReplacementMutation`,e,t)}function fI(){return[].concat(Wj(rN),Wj(gN))}function pI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!oM)return Promise.resolve();var n=rM.documentElement.classList,r=function(e){return n.add(`${jN}-${e}`)},i=function(e){return n.remove(`${jN}-${e}`)},a=Q.autoFetchSvg?fI():pM.concat(Object.keys(uI));a.includes(`fa`)||a.push(`fa`);var o=[`.${GN}:not([${EN}])`].concat(a.map(function(e){return`.${e}:not([${EN}])`})).join(`, `);if(o.length===0)return Promise.resolve();var s=[];try{s=cP(e.querySelectorAll(o))}catch{}if(s.length>0)r(`pending`),i(`complete`);else return Promise.resolve();var c=BF.begin(`onTree`),l=s.reduce(function(e,t){try{var n=dI(t);n&&e.push(n)}catch(e){FN||e.name===`MissingIcon`&&console.error(e)}return e},[]);return new Promise(function(e,n){Promise.all(l).then(function(n){QF(n,function(){r(`active`),r(`complete`),i(`pending`),typeof t==`function`&&t(),c(),e()})}).catch(function(e){c(),n(e)})})}function mI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;dI(e).then(function(e){e&&QF([e],t)})}function hI(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:yF(t||{}),i=n.mask;return i&&=(i||{}).icon?i:yF(i||{}),e(r,Z(Z({},n),{},{mask:i}))}}var gI=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?iP:n,i=t.symbol,a=i===void 0?!1:i,o=t.mask,s=o===void 0?null:o,c=t.maskId,l=c===void 0?null:c,u=t.classes,d=u===void 0?[]:u,f=t.attributes,p=f===void 0?{}:f,m=t.styles,h=m===void 0?{}:m;if(e){var g=e.prefix,_=e.iconName,v=e.icon;return CF(Z({type:`icon`},e),function(){return _F(`beforeDOMElementCreation`,{iconDefinition:e,params:t}),DF({icons:{main:jF(v),mask:s?jF(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:g,iconName:_,transform:Z(Z({},iP),r),symbol:a,maskId:l,extra:{attributes:p,styles:h,classes:d}})})}},_I={mixout:function(){return{icon:hI(gI)}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=pI,e.nodeCallback=mI,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=t===void 0?rM:t,r=e.callback;return pI(n,r===void 0?function(){}:r)},e.generateSvgReplacementMutation=function(e,t){var n=t.iconName,r=t.prefix,i=t.transform,a=t.symbol,o=t.mask,s=t.maskId,c=t.extra;return new Promise(function(t,l){Promise.all([PF(n,r),o.iconName?PF(o.iconName,o.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(o){var l=Uj(o,2),u=l[0],d=l[1];t([e,DF({icons:{main:u,mask:d},prefix:r,iconName:n,transform:i,symbol:a,maskId:s,extra:c,watchable:!0})])}).catch(l)})},e.generateAbstractIcon=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.transform,a=e.styles,o=fP(a);o.length>0&&(n.style=o);var s;return pP(i)&&(s=vF(`generateAbstractTransformGrouping`,{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),t.push(s||r.icon),{children:t,attributes:n}}}},vI={mixout:function(){return{layer:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.classes,r=n===void 0?[]:n;return CF({type:`layer`},function(){_F(`beforeDOMElementCreation`,{assembler:e,params:t});var n=[];return e(function(e){Array.isArray(e)?e.map(function(e){n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:`span`,attributes:{class:[`${Q.cssPrefix}-layers`].concat(Wj(r)).join(` `)},children:n}]})}}}},yI={mixout:function(){return{counter:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.title,r=n===void 0?null:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return CF({type:`counter`,content:e},function(){return _F(`beforeDOMElementCreation`,{content:e,params:t}),kF({content:e.toString(),title:r,extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-counter`].concat(Wj(a))}})})}}}},bI={mixout:function(){return{text:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?iP:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return CF({type:`text`,content:e},function(){return _F(`beforeDOMElementCreation`,{content:e,params:t}),OF({content:e,transform:Z(Z({},iP),r),extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-text`].concat(Wj(a))}})})}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.transform,r=t.extra,i=null,a=null;if(sM){var o=parseInt(getComputedStyle(e).fontSize,10),s=e.getBoundingClientRect();i=s.width/o,a=s.height/o}return Promise.resolve([e,OF({content:e.innerHTML,width:i,height:a,transform:n,extra:r,watchable:!0})])}}},xI=RegExp(`"`,`ug`),SI=[1105920,1112319],CI=Z(Z(Z(Z({},{FontAwesome:{normal:`fas`,400:`fas`}}),eN),xN),sN),wI=Object.keys(CI).reduce(function(e,t){return e[t.toLowerCase()]=CI[t],e},{}),TI=Object.keys(wI).reduce(function(e,t){var n=wI[t];return e[t]=n[900]||Wj(Object.entries(n))[0][1],e},{});function EI(e){return jP(Wj(e.replace(xI,``))[0]||``)}function DI(e){var t=e.getPropertyValue(`font-feature-settings`).includes(`ss01`),n=e.getPropertyValue(`content`).replace(xI,``),r=n.codePointAt(0),i=r>=SI[0]&&r<=SI[1],a=n.length===2?n[0]===n[1]:!1;return i||a||t}function OI(e,t){var n=e.replace(/^['"]|['"]$/g,``).toLowerCase(),r=parseInt(t),i=isNaN(r)?`normal`:r;return(wI[n]||{})[i]||TI[n]}function kI(e,t){var n=`${ON}${t.replace(`:`,`-`)}`;return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var a=cP(e.children).filter(function(e){return e.getAttribute(DN)===t})[0],o=nM.getComputedStyle(e,t),s=o.getPropertyValue(`font-family`),c=s.match(KN),l=o.getPropertyValue(`font-weight`),u=o.getPropertyValue(`content`);if(a&&!c)return e.removeChild(a),r();if(c&&u!==`none`&&u!==``){var d=o.getPropertyValue(`content`),f=OI(s,l),p=EI(d),m=c[0].startsWith(`FontAwesome`),h=DI(o),g=qP(f,p),_=g;if(m){var v=ZP(p);v.iconName&&v.prefix&&(g=v.iconName,f=v.prefix)}if(g&&!h&&(!a||a.getAttribute(kN)!==f||a.getAttribute(AN)!==_)){e.setAttribute(n,_),a&&e.removeChild(a);var y=cI(),b=y.extra;b.attributes[DN]=t,PF(g,f).then(function(i){var a=DF(Z(Z({},y),{},{icons:{main:i,mask:$P()},prefix:f,iconName:_,extra:b,watchable:!0})),o=rM.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t===`::before`?e.insertBefore(o,e.firstChild):e.appendChild(o),o.outerHTML=a.map(function(e){return DP(e)}).join(`
|
|
670
670
|
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function AI(e){return Promise.all([kI(e,`::before`),kI(e,`::after`)])}function jI(e){return e.parentNode!==document.head&&!~NN.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(DN)&&(!e.parentNode||e.parentNode.tagName!==`svg`)}var MI=function(e){return!!e&&PN.some(function(t){return e.includes(t)})},NI=function(e){if(!e)return[];var t=new Set,n=e.split(/,(?![^()]*\))/).map(function(e){return e.trim()});n=n.flatMap(function(e){return e.includes(`(`)?e:e.split(`,`).map(function(e){return e.trim()})});var r=Ij(n),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;if(MI(a)){var o=PN.reduce(function(e,t){return e.replace(t,``)},a);o!==``&&o!==`*`&&t.add(o)}}}catch(e){r.e(e)}finally{r.f()}return t};function PI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(oM){var n;if(t)n=e;else if(Q.searchPseudoElementsFullScan)n=e.querySelectorAll(`*`);else{var r=new Set,i=Ij(document.styleSheets),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;try{var s=Ij(o.cssRules),c;try{for(s.s();!(c=s.n()).done;){var l=c.value,u=Ij(NI(l.selectorText)),d;try{for(u.s();!(d=u.n()).done;){var f=d.value;r.add(f)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){s.e(e)}finally{s.f()}}catch(e){Q.searchPseudoElementsWarnings&&console.warn(`Font Awesome: cannot parse stylesheet: ${o.href} (${e.message})
|
|
671
|
-
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=cP(n).filter(jI).map(AI),i=BF.begin(`searchPseudoElements`);eI(),Promise.all(r).then(function(){i(),tI(),e()}).catch(function(){i(),tI(),t()})})}}var FI={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=PI,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?rM:t;Q.searchPseudoElements&&PI(n)}}},II=!1,LI={mixout:function(){return{dom:{unwatch:function(){eI(),II=!0}}}},hooks:function(){return{bootstrap:function(){rI(gF(`mutationObserverCallbacks`,{}))},noAuto:function(){iI()},watch:function(e){var t=e.observeMutationsRoot;II?tI():rI(gF(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},RI=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i;break}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},zI={mixout:function(){return{parse:{transform:function(e){return RI(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=RI(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},BI={x:0,y:0,width:`100%`,height:`100%`};function VI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function HI(e){return e.tag===`g`?e.children:[e]}hF([bP,_I,vI,yI,bI,FI,LI,zI,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?aF(n.split(` `).map(function(e){return e.trim()})):$P();return r.prefix||=QP(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=mP({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},BI),{},{fill:`white`})},p=c.children?{children:c.children.map(VI)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[VI(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||sP()}`,_=`clip-${a||sP()}`,v={tag:`mask`,attributes:Z(Z({},BI),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:HI(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},BI)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;nM.matchMedia&&(t=nM.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``?!0:n,e}}}}],{mixoutsTo:xF}),xF.noAuto;var UI=xF.config;xF.library,xF.dom;var WI=xF.parse;xF.findIconDefinition,xF.toHtml;var GI=xF.icon;xF.layer,xF.text,xF.counter;function KI(e){return e-=0,e===e}function qI(e){return KI(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var JI=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function YI(e){return e.charAt(0).toUpperCase()+e.slice(1)}var XI=new Map,ZI=1e3;function QI(e){if(XI.has(e))return XI.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=qI(n);t[e.startsWith(`webkit`)?YI(e):e]=r}}}n=a+1}if(XI.size===ZI){let e=XI.keys().next().value;e&&XI.delete(e)}return XI.set(e,t),t}function $I(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),$I(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=QI(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[qI(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(JI)))}return e(t.tag,{...a,...u},...r)}var eL=$I.bind(null,K.createElement),tL=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},nL=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var rL=`searchPseudoElementsFullScan`in UI&&typeof UI.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,iL=Number.parseInt(rL)>=7,aL=()=>iL,oL=`fa`,sL={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`},cL={left:`fa-pull-left`,right:`fa-pull-right`},lL={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},uL={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},dL={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`},fL={default:`fa-layers`};function pL(e){let t=UI.cssPrefix||UI.familyPrefix||oL;return t===oL?e:e.replace(new RegExp(String.raw`(?<=^|\s)${oL}-`,`g`),`${t}-`)}function mL(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,className:b}=e,x=[];return b&&x.push(...b.split(` `)),t&&x.push(sL.beat),n&&x.push(sL.fade),r&&x.push(sL.beatFade),i&&x.push(sL.bounce),a&&x.push(sL.shake),o&&x.push(sL.spin),c&&x.push(sL.spinReverse),s&&x.push(sL.spinPulse),l&&x.push(sL.pulse),u&&x.push(dL.fixedWidth),d&&x.push(dL.inverse),f&&x.push(dL.border),p===!0&&x.push(dL.flip),(p===`horizontal`||p===`both`)&&x.push(dL.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(dL.flipVertical),m!=null&&x.push(uL[m]),h!=null&&h!==0&&x.push(lL[h]),g!=null&&x.push(cL[g]),_&&x.push(dL.swapOpacity),aL()?(v&&x.push(dL.rotateBy),y&&x.push(dL.widthAuto),(UI.cssPrefix||UI.familyPrefix||oL)===oL?x:x.map(pL)):x}var hL=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function gL(e){if(e)return hL(e)?e:WI.icon(e)}function _L(e){return Object.keys(e)}var vL=new nL(`FontAwesomeIcon`),yL={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1},bL=new Set(Object.keys(yL)),xL=K.forwardRef((e,t)=>{let n={...yL,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=tL(c,!!i),d=tL(s,!!o),f=gL(r);if(!f)return vL.error(`Icon lookup is undefined`,r),null;let p=mL(n),m=typeof l==`string`?WI.transform(l):l,h=gL(i),g=GI(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return vL.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of _L(n))bL.has(e)||(v[e]=n[e]);return eL(_[0],v)});xL.displayName=`FontAwesomeIcon`,`${fL.default}${dL.fixedWidth}`;function SL({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(xL,{icon:Dj,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var CL=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return zm(c)?Nm(c):null},wL=/^\d{2}\/\d{2}\/\d{2}$/,TL=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),EL=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},DL=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},OL=e=>{if(!wL.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&TL(Nm(t))===e?Nm(t):null};function kL({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),[y,b]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,K.useState)(``),[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(p||null),[j,M]=(0,K.useState)(m||null),[N,P]=(0,K.useState)(!1),[ee,F]=(0,K.useState)(p||null),[te,ne]=(0,K.useState)(!1),[re,I]=(0,K.useState)(!1),[ie]=(0,K.useState)(()=>p||new Date),ae=(0,K.useRef)(n),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(0),ue=(0,K.useRef)(null),de=(0,K.useRef)(null),fe=()=>Date.now()<le.current,pe=()=>{fe()||P(!0)},me=()=>{le.current=Date.now()+250,P(!1)},he=e=>{if(e){pe();return}me()};(0,K.useEffect)(()=>{ae.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let ge=Nm(new Date),_e=wm(ge,6),ve=e=>{S(e);let t=OL(e);return e===``||!e?(E(null),A(null),!0):t?Nh(t,ge)?(E(`Date cannot be in the past`),A(null),!1):Mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&Nh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&Nh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ye=e=>{if(i)return!0;w(e);let t=OL(e);return e===``||!e?(O(null),M(null),!0):t?Nh(t,ge)?(O(`Date cannot be in the past`),M(null),!1):Mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?Nh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&Nh(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},L=()=>ve(x),be=()=>ye(C),R=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Lm(e,k)&&Lm(e,j)?(A(e),M(null)):Nh(e,j)&&Nh(e,Cm(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ae.current(null,null)};(0,K.useEffect)(()=>{ae.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(TL(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(TL(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=dj(),we=(0,K.useId)(),Te=`${we}-description`,Ee=(0,q.jsxs)(`div`,{ref:ce,onClick:pe,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=EL(e.target.value,x);S(t),E(null),F(CL(t)),ae.current(null,j)},onFocus:()=>{ne(!0),pe()},onBlur:e=>{let t=DL(e.target.value);S(t);let n=ve(t);ne(!1),!n&&ue.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),ue.current=null},onKeyDown:e=>{e.key===`Tab`&&(ue.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),L(),e.target.blur())}}),T&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SL,{message:T,buttonRef:oe})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=EL(e.target.value,C);w(t),O(null),F(CL(t)),ae.current(k,null)},onFocus:()=>{I(!0),pe()},onBlur:e=>{let t=DL(e.target.value);w(t);let n=ye(t);I(!1),!n&&de.current===`forward`&&requestAnimationFrame(()=>se.current?.focus()),de.current=null},onKeyDown:e=>{e.key===`Tab`&&(de.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),be(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SL,{message:D,buttonRef:se})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,q.jsxs)(ij,{open:N,onOpenChange:he,children:[Ee,(0,q.jsxs)(rj,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:he,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,q.jsx)(aj,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(vj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:me,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(oj,{open:N,onOpenChange:he,children:[(0,q.jsx)(lj,{asChild:!0,children:Ee}),(0,q.jsxs)(cj,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&ce.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(vj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:me,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Te,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function AL(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var jL=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),ML=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i})=>{let[a,o]=(0,K.useState)(!1);return(0,q.jsxs)(oj,{open:a,onOpenChange:o,children:[(0,q.jsx)(sj,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:border-gray-200 aone:dark:border-gray-600 aone:text-foreground`,"data-testid":`time-picker-trigger`,children:[(0,q.jsx)(`span`,{children:e?AL(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(xL,{icon:a?bj:Ej,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(cj,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,children:[(0,q.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,q.jsx)(`div`,{className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:jL.map(n=>(0,q.jsx)(`button`,{type:`button`,className:`py-2 px-2 rounded-md text-sm w-full text-left transition ${e===n?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-background text-foreground border border-transparent hover:bg-muted`}`,onClick:()=>{t(n),o(!1)},"data-testid":`time-picker-option-${n.replace(`:`,`-`)}`,children:AL(n)},n))})})]})]})};function NL({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,q.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,q.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,q.jsx)(`div`,{className:`aone:grow`,children:(0,q.jsx)(kL,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,q.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,q.jsx)(ML,{value:n,onChange:i,portalContainer:f})})]})]})}function PL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FL(){return FL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FL.apply(null,arguments)}var IL=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),LL=s(((e,t)=>{var n=IL();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),RL=s(((e,t)=>{t.exports=LL()()})),zL=s((e=>{})),BL=s(((e,t)=>{t.exports=zL()})),$=u(RL(),1);BL();var VL=e=>typeof e==`object`&&!!e&&e.nodeType===1,HL=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,UL=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return HL(n.overflowY,t)||HL(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},WL=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,GL=e=>e.parentElement??(e.getRootNode().host||null),KL=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!VL(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;VL(u)&&s(u);){if(u=GL(u),u===c){l.push(u);break}u!=null&&u===document.body&&UL(u)&&!UL(document.documentElement)||u!=null&&UL(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!UL(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?WL(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:WL(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?WL(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:WL(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},qL=0;function JL(){return String(qL++)}function YL(e){var t=K.useRef(e);return t.current=e,t}function XL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function ZL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function QL(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var $L=QL(function(e){eR(e).textContent=``},500);function eR(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function tR(e,t){if(!(!e||!t)){var n=eR(t);n.textContent=e,$L(t)}}function nR(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function rR(){}var iR=rR;function aR(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},FL({},e)):e}function oR(e,t){e&&KL(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function sR(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&!t.startsWith(`Arrow`)?`Arrow`+t:t}function cR(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?cR(t?a-1:0,t,n,r):-1}function lR(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=cR(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function uR(e,t,n,r){return r===void 0&&(r=!0),!!n&&t.some(function(t){return t&&(dR(t,e,n)||r&&dR(t,n.document.activeElement,n))})}function dR(e,t,n){return e===t||t instanceof n.Node&&e.contains(t)}function fR(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function pR(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];mR(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}typeof t.onStateChange==`function`&&Object.keys(a).length&&t.onStateChange(FL({type:i},a))}function mR(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+fR(e)+`Change`];if(typeof a==`function`){var o=t.type;a(FL({type:o},i))}}}function hR(e,t,n,r){var i=K.useRef({}),a=K.useRef(),o=K.useCallback(function(t,n){a.current=n,t=aR(t,n.props);var r=e(t,n),i=n.props.stateReducer(t,FL({},n,{changes:r}));return FL({},t,i)},[e]),s=K.useReducer(o,t,n),c=s[0],l=s[1],u=YL(t),d=K.useCallback(function(e){return l(FL({},e,{props:u.current}))},[u]),f=a.current;return K.useEffect(function(){var e=aR(i.current,f?.props);f&&!r(e,c)&&pR(f,f.props,e,c),i.current=c},[c,f,r]),[c,d]}function gR(e,t,n,r){var i=hR(e,t,n,r),a=i[0],o=i[1];return[aR(a,t),o]}function _R(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function vR(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}var yR={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function bR(e,t){return e===void 0?t:e}function xR(e,t,n,r){return e===void 0?t===void 0?n===void 0?r:n:t:e}var SR=QL(function(e,t){tR(e,t)},200);function CR(e,t,n,r){var i=r?.document,a=vR();K.useEffect(function(){!e||a||!i||SR(e(t),i)},n),K.useEffect(function(){return function(){SR.cancel(),nR(i)}},[i])}var wR=FL({},yR,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),TR={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},isItemDisabled:function(e){return!1},stateReducer:function(e,t){return t.changes},scrollIntoView:oR,environment:typeof window>`u`?void 0:window},ER={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},DR=FL({},K).useId,OR=typeof DR==`function`?kR:AR;function kR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+DR();return t||=s,K.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function AR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=K.useRef(t??`downshift-`+JL()).current;return K.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}function jR(e,t,n){var r=bR(n,ER.highlightedIndex);return e[r]&&t(e[r],r)?-1:r}function MR(e,t,n,r,i,a){return FL({isOpen:!1,highlightedIndex:-1},e.length&&i>=0&&FL({selectedItem:e[i],isOpen:bR(n,ER.isOpen),highlightedIndex:bR(r,ER.highlightedIndex)},a&&{inputValue:t(e[i])}))}function NR(e,t,n,r,i,a,o,s){return e.length===0?-1:t!==void 0&&o===t&&e[t]&&!r(e[t],t)?t:n!==void 0&&e[n]&&!r(e[n],n)?n:a?e.findIndex(function(e){return i(a)===i(e)}):s<0&&e[e.length-1]&&!r(e[e.length-1],e.length-1)?e.length-1:s>0&&e[0]&&!r(e[0],0)?0:-1}function PR(e){var t=xR(e.selectedItem,e.initialSelectedItem,e.defaultSelectedItem,ER.selectedItem),n=xR(e.isOpen,e.initialIsOpen,e.defaultIsOpen,ER.isOpen),r=FR(e),i=xR(e.inputValue,e.initialInputValue,e.defaultInputValue,ER.inputValue);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function FR(e){var t=xR(e.highlightedIndex,e.initialHighlightedIndex,e.defaultHighlightedIndex,ER.highlightedIndex);return t>-1&&e.items[t]&&e.isItemDisabled(e.items[t],t)?-1:t}var IR=rR;function LR(e,t,n){var r=K.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=K.useCallback(function(){return n.map(function(e){return e.current})},[n]);return K.useEffect(function(){if(!e)return rR;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,uR(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!uR(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r.current}var RR=function(){return rR},zR=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function BR(e,t,n,r,i,a){var o=K.useRef(!0);return zR(function(){if(!(t<0||!n||!Object.keys(i).length))if(o.current){var s=i[a(t)];s&&r&&e(s,r)}else o.current=!0},[t]),K.useCallback(function(){o.current=!1},[])}function VR(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function HR(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NR(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:NR(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:var o=n.highlightedIndex;a={highlightedIndex:t.isItemDisabled(t.items[o],o)?-1:o};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:jR(t.items,t.isItemDisabled,t.defaultHighlightedIndex),isOpen:bR(t.defaultIsOpen,ER.isOpen),selectedItem:bR(t.defaultSelectedItem,ER.selectedItem),inputValue:bR(t.defaultInputValue,ER.inputValue)};break;default:throw Error(`Reducer called without proper action type.`)}return FL({},e,a)}var UR=FL({},wR,{items:$.default.array.isRequired,isItemDisabled:$.default.func});function WR(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var GR=0,KR=1,qR=2,JR=3,YR=4,XR=5,ZR=6,QR=7,$R=8,ez=9,tz=10,nz=11,rz=12,iz=13,az=14,oz=15,sz=16,cz=17,lz=18,uz=19,dz=20,fz=21,pz=Object.freeze({__proto__:null,FunctionCloseMenu:cz,FunctionOpenMenu:sz,FunctionReset:fz,FunctionSelectItem:uz,FunctionSetHighlightedIndex:lz,FunctionSetInputValue:dz,FunctionToggleMenu:oz,ItemClick:az,ItemMouseMove:iz,MenuMouseLeave:rz,ToggleButtonBlur:nz,ToggleButtonClick:GR,ToggleButtonKeyDownArrowDown:KR,ToggleButtonKeyDownArrowUp:qR,ToggleButtonKeyDownCharacter:JR,ToggleButtonKeyDownEnd:ZR,ToggleButtonKeyDownEnter:QR,ToggleButtonKeyDownEscape:YR,ToggleButtonKeyDownHome:XR,ToggleButtonKeyDownPageDown:tz,ToggleButtonKeyDownPageUp:ez,ToggleButtonKeyDownSpaceButton:$R});function mz(e,t){var n=t.type,r=t.props,i;switch(n){case az:i={isOpen:bR(r.defaultIsOpen,ER.isOpen),highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index]};break;case JR:var a=t.key,o=``+e.inputValue+a;i={inputValue:o,highlightedIndex:WR({keysSoFar:o,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex(function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)}):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case KR:var s=t.altKey;i={highlightedIndex:e.isOpen?lR(e.highlightedIndex,1,r.items,r.isItemDisabled):s&&e.selectedItem==null?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:!0};break;case qR:var c=t.altKey;i=e.isOpen&&c?MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?lR(e.highlightedIndex,-1,r.items,r.isItemDisabled):NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:!0};break;case QR:case $R:i=MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1);break;case XR:i={highlightedIndex:cR(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case ZR:i={highlightedIndex:cR(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case ez:i={highlightedIndex:lR(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case tz:i={highlightedIndex:lR(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case YR:i={isOpen:!1,highlightedIndex:-1};break;case nz:i=FL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&{selectedItem:r.items[e.highlightedIndex]});break;case uz:i={selectedItem:t.selectedItem};break;default:return HR(e,r,t,pz)}return FL({},e,i)}var hz=[`onClick`],gz=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],_z=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`,`disabled`],vz=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];yz.stateChangeTypes=pz;function yz(e){e===void 0&&(e={}),iR(e,yz,UR);var t=FL({},TR,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=gR(mz,t,PR,VR),o=a[0],s=a[1],c=o.isOpen,l=o.highlightedIndex,u=o.selectedItem,d=o.inputValue,f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=OR(t),_=YL({state:o,props:t});CR(i,o,[c,l,u,d],r);var v=BR(n,l,c,p.current,m.current,g.getItemId);(0,K.useEffect)(function(){return h.current=QL(function(e){e({type:dz,inputValue:``})},500),function(){var e;(e=h.current)==null||e.cancel()}},[]),(0,K.useEffect)(function(){d&&(h.current==null||h.current(s))},[s,d]),IR({props:t,state:o}),(0,K.useEffect)(function(){xR(t.isOpen,t.initialIsOpen,t.defaultIsOpen,ER.isOpen)&&f.current&&f.current.focus()},[]);var y=LR(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:nz})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),b=RR(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var x=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:KR,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:qR,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:XR})},End:function(e){e.preventDefault(),s({type:ZR})},Escape:function(){_.current.state.isOpen&&s({type:YR})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?QR:GR})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:ez}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:tz}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:GR});return}t.inputValue?s({type:JR,key:` `}):s({type:$R})}}},[s,_]),S=(0,K.useCallback)(function(e){var t=e??{},n=t.onClick,r=PL(t,hz);return FL({id:g.labelId,htmlFor:g.toggleButtonId,onClick:ZL(n,function(){var e;(e=f.current)==null||e.focus()})},r)},[g]),C=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,c=r.ref,l=r[`aria-label`],u=PL(r,gz),d=(t??{}).suppressRefError;return b(`getMenuProps`,d===void 0?!1:d,o,p),FL((n={},n[o]=XL(c,function(e){p.current=e}),n.id=g.menuId,n.role=`listbox`,n[`aria-label`]=l,n[`aria-labelledby`]=l?void 0:``+g.labelId,n.onMouseLeave=ZL(i,function(){s({type:rz})}),n),u)},[s,b,g]),w=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,c=r.refKey,l=c===void 0?`ref`:c,u=r.ref,d=r.disabled,p=PL(r,_z),m=(t??{}).suppressRefError,h=m===void 0?!1:m,v=_.current.state,S=function(){s({type:GR})},C=function(){v.isOpen&&!y.isMouseDown&&s({type:nz})},w=function(e){var t=sR(e);t&&t in x?x[t](e):/^\S{1}$/.test(t)&&s({type:JR,key:t})},T=FL((n={},n[l]=XL(u,function(e){f.current=e}),n[`aria-activedescendant`]=v.isOpen&&v.highlightedIndex>-1?g.getItemId(v.highlightedIndex):``,n[`aria-controls`]=g.menuId,n[`aria-expanded`]=_.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=p[`aria-label`]?void 0:``+g.labelId,n.id=g.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=ZL(i,C),n.disabled=d,n),p);return d||Object.assign(T,{onClick:ZL(a,S),onKeyDown:ZL(o,w)}),b(`getToggleButtonProps`,h,l,f),T},[s,g,_,y,b,x]),T=(0,K.useCallback)(function(e){var t,n=e??{},r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick,c=n.onMouseDown;n.onPress;var l=n.refKey,u=l===void 0?`ref`:l,d=n.disabled,f=n.ref,p=PL(n,vz);d!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var h=_.current,b=h.state,x=h.props,S=_R(r,i,x.items,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=x.isItemDisabled(C,w),E=function(){y.isTouchEnd||w===b.highlightedIndex||(v(),s({type:iz,index:w,disabled:T}))},D=function(){s({type:az,index:w})},O=FL((t={},t[u]=XL(f,function(e){e&&(m.current[g.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===b.selectedItem,t.id=g.getItemId(w),t.role=`option`,t.onMouseMove=ZL(a,E),t.onMouseDown=ZL(c,function(e){return e.preventDefault()}),t),p);return T||Object.assign(O,{onClick:ZL(o,D)}),O},[_,g,y,v,s]),E=(0,K.useCallback)(function(){s({type:oz})},[s]),D=(0,K.useCallback)(function(){s({type:cz})},[s]);return{getToggleButtonProps:w,getLabelProps:S,getMenuProps:C,getItemProps:T,toggleMenu:E,openMenu:(0,K.useCallback)(function(){s({type:sz})},[s]),closeMenu:D,setHighlightedIndex:(0,K.useCallback)(function(e){s({type:lz,highlightedIndex:e})},[s]),selectItem:(0,K.useCallback)(function(e){s({type:uz,selectedItem:e})},[s]),reset:(0,K.useCallback)(function(){s({type:fz})},[s]),setInputValue:(0,K.useCallback)(function(e){s({type:dz,inputValue:e})},[s]),highlightedIndex:l,isOpen:c,selectedItem:u,inputValue:d}}function bz(e){var t=PR(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),FL({},t,{inputValue:r})}var xz=0,Sz=1,Cz=2,wz=3,Tz=4,Ez=5,Dz=6,Oz=7,kz=8,Az=9,jz=10,Mz=11,Nz=12,Pz=13,Fz=14,Iz=15,Lz=16,Rz=17,zz=18,Bz=19,Vz=20,Hz=21,Uz=22,Wz=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:Uz,FunctionCloseMenu:Rz,FunctionOpenMenu:Lz,FunctionReset:Hz,FunctionSelectItem:Bz,FunctionSetHighlightedIndex:zz,FunctionSetInputValue:Vz,FunctionToggleMenu:Iz,InputBlur:Az,InputChange:kz,InputClick:jz,InputKeyDownArrowDown:xz,InputKeyDownArrowUp:Sz,InputKeyDownEnd:Tz,InputKeyDownEnter:Oz,InputKeyDownEscape:Cz,InputKeyDownHome:wz,InputKeyDownPageDown:Dz,InputKeyDownPageUp:Ez,ItemClick:Pz,ItemMouseMove:Nz,MenuMouseLeave:Mz,ToggleButtonClick:Fz});function Gz(e,t,n,r){var i=(0,K.useRef)(null),a=hR(e,t,n,r),o=a[0],s=a[1],c=vR();return(0,K.useEffect)(function(){t.selectedItem!==void 0&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:Uz,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[aR(o,t),s]}var Kz=FL({},wR,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function qz(e,t){var n=t.type,r=t.props,i;switch(n){case Pz:i={isOpen:bR(r.defaultIsOpen,ER.isOpen),highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case xz:i=e.isOpen?{highlightedIndex:lR(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:t.altKey&&e.selectedItem==null?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:r.items.length>=0};break;case Sz:i=e.isOpen?t.altKey?MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0):{highlightedIndex:lR(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:r.items.length>=0};break;case Oz:i=MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0);break;case Cz:i=FL({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case Ez:i={highlightedIndex:lR(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case Dz:i={highlightedIndex:lR(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case wz:i={highlightedIndex:cR(0,!1,r.items,r.isItemDisabled)};break;case Tz:i={highlightedIndex:cR(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Az:i=FL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case kz:i={isOpen:!0,highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),inputValue:t.inputValue};break;case jz:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case Bz:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Uz:i={inputValue:t.inputValue};break;default:return HR(e,r,t,Wz)}return FL({},e,i)}var Jz=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],Yz=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],Xz=[`onClick`,`onPress`,`refKey`,`ref`,`disabled`],Zz=[`aria-label`,`disabled`,`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];Qz.stateChangeTypes=Wz;function Qz(e){e===void 0&&(e={}),iR(e,Qz,Kz);var t=FL({},TR,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=Gz(qz,t,bz,VR),s=o[0],c=o[1],l=s.isOpen,u=s.highlightedIndex,d=s.selectedItem,f=s.inputValue,p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=vR(),v=OR(t),y=(0,K.useRef)(),b=YL({state:s,props:t});CR(a,s,[l,u,d,f],i);var x=BR(r,u,l,p.current,m.current,v.getItemId);IR({state:s,props:t}),(0,K.useEffect)(function(){xR(t.isOpen,t.initialIsOpen,t.defaultIsOpen,ER.isOpen)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var S=LR(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:Az})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),C=RR(`getInputProps`,`getMenuProps`);(0,K.useEffect)(function(){l||(m.current={})},[l]),(0,K.useEffect)(function(){var e;!l||!(i!=null&&i.document)||!((e=h.current)!=null&&e.focus)||i.document.activeElement!==h.current&&h.current.focus()},[l,i]);var w=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),c({type:xz,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Sz,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:wz}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Tz}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:Cz}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:Oz}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ez}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Dz}))}}},[c,b]),T=(0,K.useCallback)(function(e){return FL({id:v.labelId,htmlFor:v.inputId},e)},[v]),E=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,l=r[`aria-label`],u=PL(r,Jz),d=(t??{}).suppressRefError;return C(`getMenuProps`,d===void 0?!1:d,o,p),FL((n={},n[o]=XL(s,function(e){p.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-label`]=l,n[`aria-labelledby`]=l?void 0:``+v.labelId,n.onMouseLeave=ZL(i,function(){c({type:Mz})}),n),u)},[c,C,v]),D=(0,K.useCallback)(function(e){var t,n,r=e??{},i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,l=r.ref,u=r.onMouseMove,d=r.onMouseDown,f=r.onClick;r.onPress;var p=r.disabled,h=PL(r,Yz);p!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var g=b.current,_=g.props,y=g.state,C=_R(i,a,_.items,`Pass either item or index to getItemProps!`),w=C[0],T=C[1],E=_.isItemDisabled(w,T),D=`onClick`,O=f;return FL((t={},t[s]=XL(l,function(e){e&&(m.current[v.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===y.highlightedIndex,t.id=v.getItemId(T),t.role=`option`,t),!E&&(n={},n[D]=ZL(O,function(){c({type:Pz,index:T})}),n),{onMouseMove:ZL(u,function(){S.isTouchEnd||T===y.highlightedIndex||(x(),c({type:Nz,index:T,disabled:E}))}),onMouseDown:ZL(d,function(e){return e.preventDefault()})},h)},[c,v,b,S,x]),O=(0,K.useCallback)(function(e){var t,n=e??{},r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=n.disabled,l=PL(n,Xz),u=b.current.state;return FL((t={},t[a]=XL(o,function(e){g.current=e}),t[`aria-controls`]=v.menuId,t[`aria-expanded`]=u.isOpen,t.id=v.toggleButtonId,t.tabIndex=-1,t),!s&&FL({},{onClick:ZL(r,function(){c({type:Fz})})}),{disabled:s},l)},[c,b,v]),k=(0,K.useCallback)(function(e,t){var n,r=e??{},a=r[`aria-label`],o=r.disabled,s=r.onKeyDown,l=r.onChange,u=r.onInput,d=r.onBlur;r.onChangeText;var f=r.onClick,p=r.refKey,m=p===void 0?`ref`:p,g=r.ref,_=PL(r,Zz),y=(t??{}).suppressRefError;C(`getInputProps`,y===void 0?!1:y,m,h);var x=b.current.state,T=function(e){var t=sR(e);t&&t in w&&w[t](e)},E=function(e){c({type:kz,inputValue:e.target.value})},D=function(e){i!=null&&i.document&&x.isOpen&&!S.isMouseDown&&c({type:Az,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},O=function(){c({type:jz})},k=`onChange`,A={};if(!o){var j;A=(j={},j[k]=ZL(l,u,E),j.onKeyDown=ZL(s,T),j.onBlur=ZL(d,D),j.onClick=ZL(f,O),j)}return FL((n={},n[m]=XL(g,function(e){h.current=e}),n[`aria-activedescendant`]=x.isOpen&&x.highlightedIndex>-1?v.getItemId(x.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=x.isOpen,n[`aria-labelledby`]=a?void 0:v.labelId,n[`aria-label`]=a,n.autoComplete=`off`,n.disabled=o,n.id=v.inputId,n.role=`combobox`,n.value=x.inputValue,n),A,_)},[c,v,i,w,b,S,C]),A=(0,K.useCallback)(function(){c({type:Iz})},[c]),j=(0,K.useCallback)(function(){c({type:Rz})},[c]),M=(0,K.useCallback)(function(){c({type:Lz})},[c]),N=(0,K.useCallback)(function(e){c({type:zz,highlightedIndex:e})},[c]),P=(0,K.useCallback)(function(e){c({type:Bz,selectedItem:e})},[c]);return{getItemProps:D,getLabelProps:T,getMenuProps:E,getInputProps:k,getToggleButtonProps:O,toggleMenu:A,openMenu:M,closeMenu:j,setHighlightedIndex:N,setInputValue:(0,K.useCallback)(function(e){c({type:Vz,inputValue:e})},[c]),selectItem:P,reset:(0,K.useCallback)(function(){c({type:Hz})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var $z={activeIndex:-1,selectedItems:[]};function eB(e){return{activeIndex:xR(e.activeIndex,e.initialActiveIndex,e.defaultActiveIndex,$z.activeIndex),selectedItems:xR(e.selectedItems,e.initialSelectedItems,e.defaultSelectedItems,$z.selectedItems)}}function tB(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function nB(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}wR.stateReducer,wR.itemToKey,wR.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var rB={itemToKey:TR.itemToKey,stateReducer:TR.stateReducer,environment:TR.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},iB=rR,aB=0,oB=1,sB=2,cB=3,lB=4,uB=5,dB=6,fB=7,pB=8,mB=9,hB=10,gB=11,_B=12,vB=Object.freeze({__proto__:null,DropdownClick:fB,DropdownKeyDownBackspace:dB,DropdownKeyDownNavigationPrevious:uB,FunctionAddSelectedItem:pB,FunctionRemoveSelectedItem:mB,FunctionReset:_B,FunctionSetActiveIndex:gB,FunctionSetSelectedItems:hB,SelectedItemClick:aB,SelectedItemKeyDownBackspace:sB,SelectedItemKeyDownDelete:oB,SelectedItemKeyDownNavigationNext:cB,SelectedItemKeyDownNavigationPrevious:lB});function yB(e,t){var n=t.type,r=t.index,i=t.selectedItem,a=t.props,o=e.activeIndex,s=e.selectedItems,c;switch(n){case aB:c={activeIndex:r};break;case lB:c={activeIndex:o-1<0?0:o-1};break;case cB:c={activeIndex:o+1>=s.length?-1:o+1};break;case sB:case oB:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=FL({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case uB:c={activeIndex:s.length-1};break;case dB:c={selectedItems:s.slice(0,s.length-1)};break;case pB:c={selectedItems:[].concat(s,[i])};break;case fB:c={activeIndex:-1};break;case mB:var u=o,d=s.findIndex(function(e){return a.itemToKey(e)===a.itemToKey(i)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case hB:c={selectedItems:t.selectedItems};break;case gB:c={activeIndex:t.activeIndex};break;case _B:c={activeIndex:bR(a.defaultActiveIndex,$z.activeIndex),selectedItems:bR(a.defaultSelectedItems,$z.selectedItems)};break;default:throw Error(`Reducer called without proper action type.`)}return FL({},e,c)}var bB=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],xB=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];SB.stateChangeTypes=vB;function SB(e){e===void 0&&(e={}),iB(e,SB);var t=FL({},rB,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=gR(yB,t,eB,nB),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=vR(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=YL({state:s,props:t});CR(n,s,[l,u],r),(0,K.useEffect)(function(){d||(l===-1&&f.current?f.current.focus():p.current[l]&&p.current[l].focus())},[l]),IR({props:t,state:s});var h=RR(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:lB})},e[i]=function(){c({type:cB})},e.Delete=function(){c({type:oB})},e.Backspace=function(){c({type:sB})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){tB(e)&&c({type:uB})},e.Backspace=function(e){tB(e)&&c({type:dB})},e},[c,a]);return{getSelectedItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,l=n.selectedItem,u=n.index,d=PL(n,bB),f=m.current.state,h=_R(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return FL((t={},t[i]=XL(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=ZL(o,function(){c({type:aB,index:h})}),t.onKeyDown=ZL(s,function(e){var t=sR(e);t&&g[t]&&g[t](e)}),t),d)},[c,m,g]),getDropdownProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,p=PL(r,xB),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),FL((n={},n[a]=XL(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:ZL(s,function(e){var t=sR(e);t&&_[t]&&_[t](e)}),onClick:ZL(l,function(){c({type:fB})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:pB,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:mB,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:hB,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:gB,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:_B})},[c]),selectedItems:u,activeIndex:l}}var CB=0,wB=1,TB=2,EB=3,DB=4,OB=5,kB=6,AB=Object.freeze({__proto__:null,FunctionAddItem:kB,TagClick:CB,TagGroupKeyDownArrowLeft:wB,TagGroupKeyDownArrowRight:TB,TagGroupKeyDownBackspace:DB,TagGroupKeyDownDelete:EB,TagRemoveClick:OB});function jB(e,t){var n=t.type,r;switch(n){case CB:r={activeIndex:t.index};break;case wB:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case TB:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case DB:case EB:var i=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),a=i.length===0?-1:i.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:a};break;case OB:var o=[].concat(e.items.slice(0,t.index),e.items.slice(t.index+1));r={items:o,activeIndex:o.length===0?-1:o.length===t.index?t.index-1:t.index};break;case kB:var s=[];s=t.index===void 0?[].concat(e.items,[t.item]):[].concat(e.items.slice(0,t.index),[t.item],e.items.slice(t.index));var c=e.activeIndex===-1?s.length-1:e.activeIndex;r={items:s,activeIndex:c};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return FL({},e,r)}var MB=FL({},K).useId,NB=typeof MB==`function`?PB:FB;function PB(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+MB();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function FB(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+JL()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function IB(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function LB(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var RB=`tag-group-a11y-description`;function zB(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,RB),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function BB(e){return FL({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function VB(e,t,n){var r=K.useRef({}),i=K.useRef(e),a=K.useRef(t);return K.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var HB={isItemDisabled:$.default.func},UB=[`onKeyDown`],WB=[`index`,`refKey`,`ref`,`onClick`],GB=[`index`,`onClick`],KB=function(e){e===void 0&&(e={}),iR(e,KB,HB);var t=BB(e),n=gR(jB,t,IB,LB),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=YL({state:r,props:t}),c=NB({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});zB(t.environment?.document,t.removeElementDescription);var l=VB(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=PL(t,UB);return FL({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:ZL(n,function(e){switch(e.key){case`ArrowLeft`:i({type:wB});break;case`ArrowRight`:i({type:TB});break;case`Delete`:i({type:EB});break;case`Backspace`:i({type:DB});break}})},r)},[i,c.tagGroupId]),d=(0,K.useCallback)(function(e){var t,n=e.index,r=e.refKey,a=r===void 0?`ref`:r,o=e.ref,u=e.onClick,d=PL(e,WB);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:CB,index:n})},m=c.getTagId(n);return FL((t={"aria-describedby":RB},t[a]=XL(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=ZL(u,p),t.tabIndex=f.activeIndex===n?0:-1,t),d)},[i,c,s,l]),f=(0,K.useCallback)(function(e){var t=e.index,n=e.onClick,r=PL(e,GB);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:OB,index:t})},o=c.getTagId(t),s=o+`-remove`;return FL({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:ZL(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:kB,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};KB.stateChangeTypes=AB;function qB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function y(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function b(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function x(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function S(e){if(e.type===`airport`){let n=e;return t?.length>1?x(n):n.country_code===`US`?`${n.city} (${x(n)})`:`${n.city}, ${n.country_code} (${x(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let C=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function w(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return C?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:T,getDropdownProps:E,removeSelectedItem:D}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=Qz({environment:c?w(c):void 0,items:v,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?S(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:return n;case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:return n;case Qz.stateChangeTypes.InputBlur:return n;case Qz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case Qz.stateChangeTypes.InputKeyDownEscape:return n;case Qz.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case Qz.stateChangeTypes.MenuMouseLeave:case Qz.stateChangeTypes.ItemMouseMove:break;case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:break;case Qz.stateChangeTypes.InputBlur:break;case Qz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),P=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(O&&v.length>0){let e=v.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return O&&v.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,O,v.length,u]),ee=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),F=i?`${i}, search airports and places`:`Search airports and places`,te=i?`${i} suggestions`:`Search results`,ne=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>S(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),re=[h,g,_].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let I=!!s;function ie(){let e=A({...E(),id:m,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":O,"aria-controls":O?p:void 0,"aria-activedescendant":O&&M!=null&&M>-1?`${p}-${M}`:void 0,"aria-label":F,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];D(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!I&&t.length===0?a:``,...e,"aria-describedby":re,disabled:I})}return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...T({selectedItem:e,index:n}),"aria-label":`Selected location: ${S(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:S(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${S(e)}`,onClick:t=>{t.stopPropagation(),!s&&D(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:h,className:`aone:sr-only`,children:ne}),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:ee}),ie()]}),O&&v.length>0&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`ul`,{ref:f,...k(),id:p,role:`listbox`,"aria-multiselectable":`true`,"aria-label":te,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:v.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=M===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${b(r)}, ${x(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:Tj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:x(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[b(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=M===n,a=V_(r.kayak?.apicode),o=y(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:kj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}})})})]})}function JB({hideByDefault:e=!0}){return(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var YB=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),XB=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),ZB=s(((e,t)=>{var n=XB(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),QB=s(((e,t)=>{var n=ZB();t.exports=function(){return n.Date.now()}})),$B=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),eV=s(((e,t)=>{var n=$B(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),tV=s(((e,t)=>{t.exports=ZB().Symbol})),nV=s(((e,t)=>{var n=tV(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),rV=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),iV=s(((e,t)=>{var n=tV(),r=nV(),i=rV(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),aV=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),oV=s(((e,t)=>{var n=iV(),r=aV(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),sV=s(((e,t)=>{var n=eV(),r=YB(),i=oV(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),cV=u(s(((e,t)=>{var n=YB(),r=QB(),i=sV(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);async function lV({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[bS]=n),r&&(a[xS]=r);let o=await fetch(`${t}/api/iata-auto-complete?${i}`,{headers:a});if(!o.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:o.status,statusText:o.statusText}),Error(`Unable to fetch airport suggestions`);let s=await o.json();return Jg.parse(s)}async function uV(e,t,n,r,i){if(!t)return[];let a=await lV({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:am.AIRPORT,iata_code:e.airportIata,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIata+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function dV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a}){let o=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),s={};i&&(s[bS]=i),a&&(s[xS]=a);let c=await fetch(`${r}/api/iata-directs?${o}`,{headers:s});if(!c.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:c.status,statusText:c.statusText}),Error(`Unable to fetch airport suggestions`);let l=await c.json();return um.parse(l)}async function fV(e,t,n,r,i,a){if(!t)return[];let o=await dV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:am.AIRPORT,iata_code:e.airportIata,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIata+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function pV(e){return Math.PI/180*e}function mV(e){return e*.621371}function hV(e,t,n,r){let i=pV(n-e),a=pV(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(pV(e))*Math.cos(pV(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function gV(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==am.METRO)return!1;let n=B_(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function _V(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>gV(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=mV(hV(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function vV(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=B_(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set,p=l.toUpperCase();for(let t of n){let n=t.toUpperCase(),l=u(t);if(n===p){l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t));continue}l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let m=d.filter(e=>e.kayak_shimmed),h=d.filter(e=>!e.kayak_shimmed);h.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...m,...h]}async function yV({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function bV(e,t=H_.Hotels){if(!e?.length||e.length<3)return[];let n=_V((await yV({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:am.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:am.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:am.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>gV(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=mV(hV(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:am.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)vV(e);return n}function xV({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=bx(),{clickId:c}=Oy(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,cV.default)(u,a),[a]),{data:f,status:p}=px({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===G_.schedule_data&&n?.length&&n?.length===3?uV(l,n,t,s,c):n?.length&&n?.length===3&&(r?.length||0)>0&&(i?.length||0)>0&&r?.every(e=>e===`G4`)&&i?.every(e=>e===`G4`)?fV(l,n,i[0],t,s,c):bV(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function SV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function CV({value:e,onChange:t}){return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,q.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,q.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function wV({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=Cx(),[i,a]=(0,K.useState)(`same-location`),[o,s]=(0,K.useState)(t.toUpperCase()),[c,l]=(0,K.useState)(t.toUpperCase()),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`12:00`),[m,h]=(0,K.useState)(``),[g,_]=(0,K.useState)(`12:00`),v=(0,K.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,K.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=xV({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=xV({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[j,M]=(0,K.useState)(!1);(0,K.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,K.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,K.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,K.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,K.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,K.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,q.jsx)(CV,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(JB,{hideByDefault:!1})})]}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(qB,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(Vy,{}):(0,q.jsx)(SV,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(qB,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(Vy,{}):(0,q.jsx)(SV,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,q.jsx)(NL,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,q.jsx)(NL,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{h(e?e.toISOString().split(`T`)[0]??``:``)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,q.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(SV,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var TV=new Yb;function EV({children:e,props:t}){return(0,q.jsx)(Qb,{client:TV,children:(0,q.jsx)(Sx,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function DV(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(EV,{props:e,children:[(0,q.jsx)(`style`,{children:wx}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(hx,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(Vy,{}),children:(0,q.jsx)(wV,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var OV=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,ev,`id`],kV=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(OV)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await jv(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=Lv(n),s=window[rm],c=NS(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Ry(!0,{widget_runtime:`carfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${Ev}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`carfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&cv.test(r.primaryColor),s=r.secondaryColor!=null&&cv.test(r.secondaryColor);n.style.setProperty(`--primary`,o?dv(i):i),n.style.setProperty(`--secondary`,s?dv(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(DV,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,kV);function AV(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function jV(e){return Array.from(new Set([e,e.toLowerCase(),AV(e)]))}function MV(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function NV(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function PV({className:e,regMarkClassName:t}){return(0,q.jsxs)(`span`,{className:e,children:[`Fly`,(0,q.jsx)(`strong`,{children:`MyAirport`}),(0,q.jsx)(`sup`,{"aria-hidden":`true`,className:t||`aone:text-[0.5em] aone:ml-0.5 aone:leading-none`,children:`®`}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:` Registered`})]})}function FV(e,t=500){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}async function IV(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[bS]=n),r&&(a[xS]=r);let o=await fetch(i,{method:`POST`,headers:a,body:JSON.stringify(t)});if(!o.ok)throw Error(`Unable to get flight calendar`);let s=await o.json();return cm.parse(s)}function LV({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=bx(),{clickId:i}=Oy(),a=FV(t,n),o=typeof a.origin==`string`&&a.origin.trim().length>0,s=typeof a.destination==`string`&&a.destination.trim().length>0,c=!!a.startDate&&o&&s,l=a.startDate?Oh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=px({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??am.AIRPORT,a.arrivalLocationType??am.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=Oh(a.startDate,`yyyy-MM-dd`),n=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):void 0,o=sm.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??am.AIRPORT,arrivalLocationType:a.arrivalLocationType??am.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return IV(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function RV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var zV=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),BV=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),VV=s(((e,t)=>{var n=BV();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),HV=s(((e,t)=>{var n=VV(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),UV=s(((e,t)=>{var n=VV();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),WV=s(((e,t)=>{var n=VV();function r(e){return n(this.__data__,e)>-1}t.exports=r})),GV=s(((e,t)=>{var n=VV();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),KV=s(((e,t)=>{var n=zV(),r=HV(),i=UV(),a=WV(),o=GV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),qV=s(((e,t)=>{var n=KV();function r(){this.__data__=new n,this.size=0}t.exports=r})),JV=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),YV=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),XV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ZV=s(((e,t)=>{var n=iV(),r=YB(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),QV=s(((e,t)=>{t.exports=ZB()[`__core-js_shared__`]})),$V=s(((e,t)=>{var n=QV(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),eH=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),tH=s(((e,t)=>{var n=ZV(),r=$V(),i=YB(),a=eH(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),nH=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),rH=s(((e,t)=>{var n=tH(),r=nH();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),iH=s(((e,t)=>{t.exports=rH()(ZB(),`Map`)})),aH=s(((e,t)=>{t.exports=rH()(Object,`create`)})),oH=s(((e,t)=>{var n=aH();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),sH=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),cH=s(((e,t)=>{var n=aH(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),lH=s(((e,t)=>{var n=aH(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),uH=s(((e,t)=>{var n=aH(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),dH=s(((e,t)=>{var n=oH(),r=sH(),i=cH(),a=lH(),o=uH();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),fH=s(((e,t)=>{var n=dH(),r=KV(),i=iH();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),pH=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),mH=s(((e,t)=>{var n=pH();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),hH=s(((e,t)=>{var n=mH();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),gH=s(((e,t)=>{var n=mH();function r(e){return n(this,e).get(e)}t.exports=r})),_H=s(((e,t)=>{var n=mH();function r(e){return n(this,e).has(e)}t.exports=r})),vH=s(((e,t)=>{var n=mH();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),yH=s(((e,t)=>{var n=fH(),r=hH(),i=gH(),a=_H(),o=vH();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),bH=s(((e,t)=>{var n=KV(),r=iH(),i=yH(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),xH=s(((e,t)=>{var n=KV(),r=qV(),i=JV(),a=YV(),o=XV(),s=bH();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),SH=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),CH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),wH=s(((e,t)=>{var n=yH(),r=SH(),i=CH();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),TH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),EH=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),DH=s(((e,t)=>{var n=wH(),r=TH(),i=EH(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),OH=s(((e,t)=>{t.exports=ZB().Uint8Array})),kH=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),AH=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),jH=s(((e,t)=>{var n=tV(),r=OH(),i=BV(),a=DH(),o=kH(),s=AH(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),MH=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),NH=s(((e,t)=>{t.exports=Array.isArray})),PH=s(((e,t)=>{var n=MH(),r=NH();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),FH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),IH=s(((e,t)=>{function n(){return[]}t.exports=n})),LH=s(((e,t)=>{var n=FH(),r=IH(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),RH=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),zH=s(((e,t)=>{var n=iV(),r=aV(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),BH=s(((e,t)=>{var n=zH(),r=aV(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),VH=s(((e,t)=>{function n(){return!1}t.exports=n})),HH=s(((e,t)=>{var n=ZB(),r=VH(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),UH=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),WH=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),GH=s(((e,t)=>{var n=iV(),r=WH(),i=aV(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),KH=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),qH=s(((e,t)=>{var n=XB(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),JH=s(((e,t)=>{var n=GH(),r=KH(),i=qH(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),YH=s(((e,t)=>{var n=RH(),r=BH(),i=NH(),a=HH(),o=UH(),s=JH(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),XH=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),ZH=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),QH=s(((e,t)=>{t.exports=ZH()(Object.keys,Object)})),$H=s(((e,t)=>{var n=XH(),r=QH(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),eU=s(((e,t)=>{var n=ZV(),r=WH();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),tU=s(((e,t)=>{var n=YH(),r=$H(),i=eU();function a(e){return i(e)?n(e):r(e)}t.exports=a})),nU=s(((e,t)=>{var n=PH(),r=LH(),i=tU();function a(e){return n(e,i,r)}t.exports=a})),rU=s(((e,t)=>{var n=nU(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),iU=s(((e,t)=>{t.exports=rH()(ZB(),`DataView`)})),aU=s(((e,t)=>{t.exports=rH()(ZB(),`Promise`)})),oU=s(((e,t)=>{t.exports=rH()(ZB(),`Set`)})),sU=s(((e,t)=>{t.exports=rH()(ZB(),`WeakMap`)})),cU=s(((e,t)=>{var n=iU(),r=iH(),i=aU(),a=oU(),o=sU(),s=iV(),c=eH(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),lU=s(((e,t)=>{var n=xH(),r=DH(),i=jH(),a=rU(),o=cU(),s=NH(),c=HH(),l=JH(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),uU=s(((e,t)=>{var n=lU(),r=aV();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),dU=s(((e,t)=>{var n=xH(),r=uU(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),fU=s(((e,t)=>{var n=YB();function r(e){return e===e&&!n(e)}t.exports=r})),pU=s(((e,t)=>{var n=fU(),r=tU();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),mU=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),hU=s(((e,t)=>{var n=dU(),r=pU(),i=mU();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),gU=s(((e,t)=>{var n=NH(),r=oV(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),_U=s(((e,t)=>{var n=yH(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),vU=s(((e,t)=>{var n=_U(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),yU=s(((e,t)=>{var n=vU(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),bU=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),xU=s(((e,t)=>{var n=tV(),r=bU(),i=NH(),a=oV(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),SU=s(((e,t)=>{var n=xU();function r(e){return e==null?``:n(e)}t.exports=r})),CU=s(((e,t)=>{var n=NH(),r=gU(),i=yU(),a=SU();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),wU=s(((e,t)=>{var n=oV(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),TU=s(((e,t)=>{var n=CU(),r=wU();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),EU=s(((e,t)=>{var n=TU();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),DU=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),OU=s(((e,t)=>{var n=CU(),r=BH(),i=NH(),a=UH(),o=WH(),s=wU();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),kU=s(((e,t)=>{var n=DU(),r=OU();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),AU=s(((e,t)=>{var n=uU(),r=EU(),i=kU(),a=gU(),o=fU(),s=mU(),c=wU(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),jU=s(((e,t)=>{function n(e){return e}t.exports=n})),MU=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),NU=s(((e,t)=>{var n=TU();function r(e){return function(t){return n(t,e)}}t.exports=r})),PU=s(((e,t)=>{var n=MU(),r=NU(),i=gU(),a=wU();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),FU=s(((e,t)=>{var n=hU(),r=AU(),i=jU(),a=NH(),o=PU();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),IU=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),LU=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),RU=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),zU=s(((e,t)=>{var n=IU(),r=LU(),i=RU();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),BU=s(((e,t)=>{var n=zU();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),VU=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),HU=s(((e,t)=>{function n(){}t.exports=n})),UU=s(((e,t)=>{var n=oU(),r=HU(),i=AH();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),WU=s(((e,t)=>{var n=wH(),r=BU(),i=VU(),a=EH(),o=UU(),s=AH(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),GU=u(s(((e,t)=>{var n=FU(),r=WU();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),KU=new WeakMap,qU=new WeakMap,JU=`data-a1-flight-combobox-open`;function YU(e){let t=qU.get(e);t!=null&&(clearTimeout(t),qU.delete(e));let n=(KU.get(e)??0)+1;KU.set(e,n),e.setAttribute(JU,``)}function XU(e){let t=Math.max(0,(KU.get(e)??0)-1);if(t===0){KU.delete(e);let t=qU.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{qU.delete(e),e.removeAttribute(JU)},400);qU.set(e,n)}else KU.set(e,t)}function ZU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useId)(),[y,b]=(0,K.useState)({}),x=c??null,S=(0,K.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),b({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),C=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function w(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function T(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function E(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function D(e){if(e.type===`airport`){let n=e;return t?.length>1?E(n):n.country_code===`US`?`${n.city} (${E(n)})`:`${n.city}, ${n.country_code} (${E(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let O=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function k(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return O?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=Qz({environment:c?k(c):void 0,items:C,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?D(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:case Qz.stateChangeTypes.InputBlur:case Qz.stateChangeTypes.InputKeyDownEscape:return n;case Qz.stateChangeTypes.ItemMouseMove:return e;case Qz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case Qz.stateChangeTypes.MenuMouseLeave:case Qz.stateChangeTypes.ItemMouseMove:case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:case Qz.stateChangeTypes.InputBlur:case Qz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),re=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(N&&C.length>0){let e=C.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return N&&C.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,N,C.length,u]),I=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ie=i?`${i}, search airports and places`:`Search airports and places`,ae=i?`${i} suggestions`:`Search results`,oe=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>D(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),se=[g,_,v].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]),(0,K.useLayoutEffect)(()=>{if(!N||C.length===0||!x)return;S();let e=f.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(S):null;return e&&t?.observe(e),window.addEventListener(`scroll`,S,!0),window.addEventListener(`resize`,S),()=>{t?.disconnect(),window.removeEventListener(`scroll`,S,!0),window.removeEventListener(`resize`,S)}},[N,C.length,x,S]);let ce=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!ce||!x))return YU(e),()=>XU(e)},[ce,c,x]);let le=!!s;function ue(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function de(){let e=ee({...j(),id:h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?m:void 0,"aria-activedescendant":N&&te!=null&&te>-1?`${m}-${te}`:void 0,"aria-label":ie,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];M(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!le&&t.length===0?a:``,...e,"aria-describedby":se,disabled:le})}let fe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":ae,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:C.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=te===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>ue(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${T(r)}, ${E(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:Tj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:E(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[T(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=te===n,a=V_(r.kayak?.apicode),o=w(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>ue(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:kj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})});return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{ref:f,className:(0,J.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...A({selectedItem:e,index:n}),"aria-label":`Selected location: ${D(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:D(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${D(e)}`,onClick:t=>{t.stopPropagation(),!s&&M(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:oe}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:I}),de()]}),N&&C.length>0&&(x?(0,dC.createPortal)((0,q.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:y,children:fe}),x):(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:fe}))]})}var QU=100;function $U({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,placeholder:i,icon:a,disabled:o,shadowRoot:s}){let[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useRef)(null),h=(0,K.useMemo)(()=>e=>{m.current&&clearTimeout(m.current),e.trim()&&d(!0),m.current=setTimeout(()=>{n(e),d(!1),m.current=null},300)},[n]),g=(0,K.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+720*60*60*1e3),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(c?.trim()){let e=c.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,QU)},[c,e]),_=(0,K.useMemo)(()=>{let e={};return g.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[g]),v=e=>{let t=_[e];if(t===void 0||!f.current)return;let n=f.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},y=(0,K.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),b=(e,t)=>{e.preventDefault(),e.stopPropagation(),v(t)},x=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},S=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:C,getDropdownProps:w,removeSelectedItem:T}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=Qz({environment:s?S(s):void 0,items:g,itemToString:e=>e?x(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:c,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case Qz.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case Qz.stateChangeTypes.InputBlur:break}}}),j=!!o,M=t.length>0,N=(E||c.trim()&&g.length>0)&&g.length>10&&Object.keys(_).length>3,P=E||c.trim().length>0&&g.length>0;return(0,K.useEffect)(()=>{let e=s?.host;if(e instanceof HTMLElement&&P)return YU(e),()=>XU(e)},[P,s]),(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":o?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!o}),children:[a,t.map((e,t)=>(0,q.jsxs)(`span`,{...C({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:x(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!o||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!o&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!o}),"aria-label":`Remove ${x(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!o&&T(e)},children:`×`})]},t)),o&&(0,q.jsx)(`span`,{id:p,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=O({...w({preventKeyAction:E}),"aria-label":`autocomplete`,onKeyDown:e=>{if(e.key===`Backspace`&&!c&&t.length>0&&!o){let e=t[t.length-1];T(e)}}});return(0,q.jsx)(`input`,{className:`aone:outline-none aone:disabled:bg-transparent aone:text-base`,placeholder:j?``:i,...e,"aria-describedby":o?p:void 0,readOnly:M,disabled:j})})()]}),(E||c.trim()&&g.length>0)&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,q.jsxs)(`div`,{...D({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[N&&(0,q.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:y.map(e=>{let t=_[e]!==void 0;return(0,q.jsx)(`button`,{type:`button`,onClick:n=>t?b(n,e):void 0,className:(0,J.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,q.jsx)(`div`,{className:`aone:min-w-0`,ref:f,children:(0,q.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[u&&(0,q.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,q.jsx)(`span`,{children:`Searching airports...`})]})}),!u&&g.length>0&&g.map((e,n)=>{let r=e;return(0,q.jsxs)(`li`,{...k({item:e,index:n}),className:(0,J.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":A===e}),children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,q.jsx)(q.Fragment,{children:r.airlineCodes.length===1?(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(xL,{icon:xj,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,q.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,q.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-400 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!u&&g.length===0&&c.trim()&&(0,q.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,q.jsx)(xL,{icon:Tj,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,q.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:c})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function eW(...e){return tj(Ek(e))}function tW({className:e,...t}){return(0,q.jsx)(GS,{role:`status`,"aria-label":`Loading`,className:eW(`aone:size-4 aone:animate-spin`,e),...t})}var nW=K.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,K.useRef)(null);return(0,K.useImperativeHandle)(o,()=>s.current),(0,K.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,q.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,q.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,q.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});nW.displayName=`TopLayerDialog`;function rW({...e}){return(0,q.jsx)(BT,{"data-slot":`dialog`,...e})}function iW({...e}){return(0,q.jsx)(KT,{"data-slot":`dialog-portal`,...e})}function aW({className:e,...t}){return(0,q.jsx)(JT,{"data-slot":`dialog-overlay`,className:nj(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function oW({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,q.jsxs)(iW,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,q.jsx)(aW,{className:i}),(0,q.jsxs)(QT,{"data-slot":`dialog-content`,className:nj(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,q.jsxs)(sE,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,q.jsx)(JS,{}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function sW({className:e,...t}){return(0,q.jsx)(rE,{"data-slot":`dialog-title`,className:nj(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function cW({...e}){return(0,q.jsx)(bk,{"data-slot":`popover`,...e})}function lW({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(Ck,{container:r,children:(0,q.jsx)(wk,{"data-slot":`popover-content`,align:t,sideOffset:n,className:nj(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function uW({...e}){return(0,q.jsx)(xk,{"data-slot":`popover-anchor`,...e})}var dW=768;function fW(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<dW);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${dW-1}px)`),n=()=>{t(window.innerWidth<dW)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var pW=`aone:text-[#16A34A]`,mW=`aone:text-[#5895F7]`;function hW({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=Nm(new Date),d=l||u,f=t?Lm(e,t):!1,p=t&&n?Mh(e,Nm(t))&&Nh(e,n):!1,m=n?Lm(e,n):!1,h=Nh(e,d),g=s&&!f&&!m?Lm(e,s):!1,_=c?.filter(t=>Lm(Nm(e),Nm(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,q.jsx)(`span`,{children:e.getDate()}),y===0&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[pW]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[mW]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,q.jsx)(`div`,{className:(0,J.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function gW({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,K.useState)(Bm(n)),m=Oh(f,`MMMM yyyy`),h=Om(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Bm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Bm(t)))},[t]),(0,K.useEffect)(()=>{let e=Om(f);s(e,Cm(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>Cm(h,t));return(0,q.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,q.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Kg(f,{months:1})),"aria-label":`Previous month, go to ${Oh(Kg(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(pj,{})}),(0,q.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Tm(f,{months:1})),"aria-label":`Next month, go to ${Oh(Tm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(mj,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:tv.map((e,t)=>(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=Oh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(hW,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function _W({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(xL,{icon:Dj,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var vW=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return zm(c)?Nm(c):null},yW=/^\d{2}\/\d{2}\/\d{2}$/,bW=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),xW=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},SW=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},CW=e=>{if(!yW.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&bW(Nm(t))===e?Nm(t):null};function wW({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),y=(0,K.useRef)(null),b=(0,K.useRef)(0),[x,S]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>S(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(``),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(null),[j,M]=(0,K.useState)(p||null),[N,P]=(0,K.useState)(m||null),[ee,F]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(p||null),[re,I]=(0,K.useState)(!1),[ie,ae]=(0,K.useState)(!1),[oe]=(0,K.useState)(()=>p||new Date),se=(0,K.useRef)(n),ce=()=>Date.now()<b.current,le=()=>{ce()||F(!0)},ue=()=>{b.current=Date.now()+250,F(!1)},de=e=>{if(e){le();return}ue()};(0,K.useEffect)(()=>{se.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{P(null),E(``),A(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!j&&p&&M(p),!N&&m&&P(m)})},[p,m,j,N]);let fe=Nm(new Date),pe=wm(fe,6),me=e=>{w(e);let t=CW(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(Nh(t,fe)){O(`Date cannot be in the past`),M(null);return}if(Mh(t,pe)){O(`Date must be within 6 months`),M(null);return}if(g&&Nh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&Nh(N,t)&&(P(null),E(``))},he=e=>{if(i)return;E(e);let t=CW(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(Nh(t,fe)){A(`Date cannot be in the past`),P(null);return}if(Mh(t,pe)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(Nh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&Nh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},ge=()=>me(C),_e=()=>he(T),ve=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(Lm(e,j)&&Lm(e,N)?(M(e),P(null)):Nh(e,N)&&Nh(e,Cm(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ye=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),se.current(null,null)};(0,K.useEffect)(()=>{se.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(bW(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(bW(N)),A(null)):k||E(``)})},[N]);let L={};o&&(L[`--color-primary`]=o),s&&(L[`--color-secondary`]=s);let be=fW(),R=(0,K.useId)(),xe=`${R}-description`,Se=(0,q.jsxs)(`div`,{ref:y,onClick:le,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ee,"aone:border-2 aone:border-gray-200":!ee}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:C,"aria-label":c,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!D}),onChange:e=>{let t=xW(e.target.value,C);w(t),O(null),ne(vW(t)),se.current(null,N)},onFocus:()=>{I(!0),le()},onBlur:e=>{let t=SW(e.target.value);w(t),me(t),I(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ge(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(_W,{message:D})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:T,"aria-label":l,"aria-invalid":k?`true`:void 0,placeholder:ie?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!k}),onChange:e=>{let t=xW(e.target.value,T);E(t),A(null),ne(vW(t)),se.current(j,null)},onFocus:()=>{ae(!0),le()},onBlur:e=>{let t=SW(e.target.value);E(t),he(t),ae(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_e(),e.target.blur())}}),k&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(_W,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:L,role:`group`,"aria-label":`Date range picker`,"aria-describedby":xe,children:[be?(0,q.jsxs)(rW,{open:ee,onOpenChange:de,children:[Se,(0,q.jsxs)(nW,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:de,"aria-labelledby":R,"aria-describedby":void 0,children:[(0,q.jsx)(sW,{id:R,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(gW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ye,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ue,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(cW,{open:ee,onOpenChange:de,children:[(0,q.jsx)(uW,{asChild:!0,children:Se}),(0,q.jsxs)(lW,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&y.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:x,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(gW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ye,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ue,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:xe,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}var TW=W({apiDomain:V(),locationId:V().optional(),origin:V().nullable().optional(),destination:V().nullable().optional(),destinations:V().optional(),primaryColor:V().optional(),secondaryColor:V().optional(),airlines:V().nullable().optional(),providers:V().nullable().optional(),workerUrl:V().optional(),theme:zf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:Ap(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:V().optional(),consentDataSharing:U().optional(),consentAnalytics:U().optional(),consentAdvertising:U().optional(),consentFunctional:U().optional(),onOriginChange:Ap(e=>typeof e==`function`).optional(),onDestinationChange:Ap(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:zf(q_).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:zf(P_).optional()}),EW=new Yb;function DW(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function OW({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,departureDateLabel:c=`Departure Date`,returnDateLabel:l=`Return Date`,workerUrl:u=`https://worker-v2.flymyairport.com`,theme:d=`light`,channel:f,defaultNearbyDatesForLowerFares:p,shadowRoot:m,subscribingAirport:h,consentDataSharing:g=!0,consentAnalytics:_=!0,consentAdvertising:v=!0,consentFunctional:y=!0,onOriginChange:b=()=>{},onDestinationChange:x=()=>{},fmaDomain:S=`https://flymyairport.com`,hideBranding:C=!1,hideCarButton:w=!1,disableOrigins:T=!0,disableDestinations:E=!0,autocompleteType:D=G_.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=Oy(),j=(0,K.useMemo)(()=>{let e=DW(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=DW(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===am.METRO&&N?.iata_code),F=!!(P?.itemType===am.METRO&&P?.iata_code);if(!R_.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let te=t?.toLocaleUpperCase(),ne=n?.toLocaleUpperCase(),re=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),I=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i===r&&i?.length===2&&r?.length===2,[ae,oe]=(0,K.useState)(!1),se=ae?!!ne:!!te,ce=ae?!!te:!!ne,[le,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),pe=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),me=e=>D===G_.schedule_data?(0,q.jsx)($U,{shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,q.jsx)(ZU,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:he,status:ge,setQuery:_e}=xV({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:I,airlinesArr:re,autocompleteType:D}),ve=(0,K.useMemo)(()=>D===G_.schedule_data?he?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,GU.default)(he?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:am.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[he,D]),{data:ye,status:L,setQuery:be}=xV({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:I||[],airlinesArr:re||[],autocompleteType:D}),R=(0,K.useMemo)(()=>D===G_.schedule_data?ye?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,GU.default)(ye?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:am.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ye,D]),xe=(0,K.useMemo)(()=>le?Im([le,new Date]):null,[le]),Se=(0,K.useMemo)(()=>O.startDate?Cm(O.startDate,1):null,[O.startDate]),Ce=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:xe||void 0,endDate:de||void 0,departureLocationType:ee?am.METRO:am.AIRPORT,arrivalLocationType:F?am.METRO:am.AIRPORT}),[j,M,xe,de,ee,F]),we=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Se||void 0,endDate:de||void 0,departureLocationType:F?am.METRO:am.AIRPORT,arrivalLocationType:ee?am.METRO:am.AIRPORT}),[M,j,Se,de,F,ee]),{data:Te,status:Ee}=LV({apiDomain:e,params:Ce}),{data:De,status:Oe}=LV({apiDomain:e,params:we});(0,K.useEffect)(()=>{if(te&&yV({query:te,searchType:H_.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===te.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?am.METRO:am.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>yV({query:e,searchType:H_.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?am.METRO:am.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:E}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&k(e=>({...e,destinations:t}))})}},[te,ne,T,E]);let ke=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Kv({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[O,t,j,M]),Ae=(0,K.useCallback)((e,t)=>{ue(t=>t&&t.getTime()===e.getTime()?t:e),fe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),je=()=>{let{origins:e,destinations:t}=O;oe(e=>!e),k({...O,origins:t,destinations:e})},Me=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=j,a=M,s=O.startDate,c=O.endDate,l=O.oneWay;if(!i||!a||!s||!c&&!l)throw Error(`All fields must be filled out`);let d=s.toISOString().split(`T`)[0],p=c?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!ie){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=sv({worker_domain:u,airport_iata:h||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:d||``,returnDate:p||``,cabin:m||void 0,pax:b||void 0,filterState:{providers:I?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:U_({airport:h||t||i,channel:f||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:g,consent_analytics:_,consent_advertising:v,consent_functional:y,departure_location_type:ee?am.METRO:am.AIRPORT,arrival_location_type:F?am.METRO:am.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Kv({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:s?.toISOString(),return_date:O.endDate?.toISOString()}}),window.open(x,`_blank`)},Ne=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:nv.enum.economy},{display:`Premium Economy`,value:nv.enum.premium},{display:`Business`,value:nv.enum.business},{display:`First`,value:nv.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:rv.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),z=(0,q.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Ie.map((e,t)=>(0,q.jsx)(K.Fragment,{children:(0,q.jsx)(`a`,{href:t>0?`${S}/${Le}/${h}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,J.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t))}),Re=(0,q.jsx)(JB,{hideByDefault:!0}),ze=(0,q.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start aone:text-[35px] aone:text-foreground`,children:(0,q.jsx)(PV,{regMarkClassName:`aone:text-[16px] aone:ml-0.5 aone:leading-none`})})}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":S!==``}),children:z}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:z}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:re&&re.length>0?null:(0,q.jsx)(`div`,{children:Re})})]});return(0,q.jsxs)(Qb,{client:EW,children:[(0,q.jsx)(`div`,{"data-mode":d,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,q.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:Me,children:[!C&&ze,(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,q.jsx)(`select`,{"aria-label":`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{k(t=>({...t,oneWay:e.target.value===`one-way`}))},children:Ne.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`pax`,"aria-label":`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Fe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`cabin`,"aria-label":`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Pe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!ie&&(0,q.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),`\xA0\xA0Show nearby dates for lower fares`]})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!O.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":O.oneWay}),children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-center aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:w-full aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:me({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:ge===`pending`?(0,q.jsx)(tW,{}):(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:xj,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:se,items:ve||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Kv({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,origins:n||[]}))}})}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:je,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(RV,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:me({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:L===`pending`?(0,q.jsx)(tW,{}):(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:yj,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:ce,items:R||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Kv({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,destinations:n||[]}))}})})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,q.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,q.jsx)(wW,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:ke,onMonthViewChange:Ae,oneWay:O.oneWay,shadowRoot:m,onlyDirects:I&&re&&I?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Te:De,flightCalendarStatus:!O.startDate||O.oneWay?Ee:Oe})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ie&&(0,q.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),(0,q.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,q.jsxs)(`button`,{"aria-label":pe?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!pe,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{pe||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${pe?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,q.jsx)(SV,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&Re})]})}var kW=Object.keys(TW.shape);function AW(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function jW(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function MW(e,t){return jV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``)}function NW(e,t,n){let r={...n},i=MW(e,`origin`),a=MW(e,`destination`)??MW(e,`destinations`);AW(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of kW){let n=jV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return AW(r),a&&!i?delete r.origin:r.origin==null&&!jW(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase()),typeof r.defaultNearbyDatesForLowerFares==`string`&&(r.defaultNearbyDatesForLowerFares=MV(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=MV(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=MV(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=MV(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=MV(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=MV(r.hideCarButton,!1)),r.consentAnalytics===void 0&&(r.consentAnalytics=!0),r.consentAdvertising===void 0&&(r.consentAdvertising=!0),r.consentFunctional===void 0&&(r.consentFunctional=!0),r.consentDataSharing===void 0&&(r.consentDataSharing=!0),r}function PW(e,t,n,r){return{...NW(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var FW=new Yb;function IW(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(Qb,{client:FW,children:(0,q.jsxs)(yx,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:wx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(OW,{...n})]})})}function LW(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var RW=Object.keys(TW.shape),zW=[...new Set([...RW.flatMap(e=>jV(e)),`borderradius`,`border-radius`,`theme`,ev,`id`])],BW=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(zW)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.background=`none`,this.style.backgroundColor=`transparent`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await jv(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=zv(n),s=window[rm],c=PW(this,`https://flymyairport.vercel.app`,s,o),l=LW(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Ry(!0,{widget_runtime:`airfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${Ev}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`airfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&cv.test(r.primaryColor),a=r.secondaryColor!=null&&cv.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?dv(o):o,l=a?dv(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,NV(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(IW,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,BW);var VW=new Map,HW=3600*1e3,UW=3600*12*1e3;function WW(){let e=Date.now(),t=e-HW,n=e+UW;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function GW(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:WW()}function KW(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function qW(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function JW(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:YW(n)}function YW(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=KW(e.airlines);if(!t)return null;let n=qW(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function XW(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function ZW(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function QW(e,t){let n=XW();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=GW(t),i=ZW(e,r),a=VW.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=JW(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{VW.delete(i)}})();return VW.set(i,u),u}var $W={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`};function eG(e){let t=e?.trim();return t&&t.length>0?t:void 0}function tG(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function nG(e){let t={...$W};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:tG(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:tG(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:tG(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:tG(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:tG(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function rG(e,t={}){let n=e?.variables,r=eG(t.primaryColor),i=eG(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...$W});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...$W});let s=o.theme;return a(nG(s))}function iG(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var aG={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},oG={prefix:`fas`,iconName:`bell`,icon:[448,512,[128276,61602],`f0f3`,`M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z`]},sG={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]};function cG(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function lG(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function uG(e){let{gate:t,terminal:n}=cG(e);return t.length>0||n.length>0}function dG(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=lG(r,n),o=lG(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return uG(r)?r:o&&uG(i)?i:r;if(!a&&o&&uG(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(uG(r))return r;if(uG(i))return i}return r??i}if(e.direction===`arrival`){if(o)return uG(i)?i:a&&uG(r)?r:i;if(!o&&a&&uG(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(uG(i))return i;if(uG(r))return r}return i??r}}function fG(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function pG(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var mG={kind:`on-time`};function hG(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/60),r=t%60,i=[];return n>0&&i.push(`${n} ${n===1?`hour`:`hours`}`),r>0&&i.push(`${r} ${r===1?`minute`:`minutes`}`),i.length===0?`0 minutes`:i.join(` `)}function gG(e){return e.departureGatePunctuality??mG}function _G(e){return e.arrivalGatePunctuality??mG}function vG(e){if(e.kind===`on-time`)return`On-time`;let t=hG(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function yG(e){let t=e.direction===`departure`?gG(e):_G(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:vG(t),tone:n}}function bG(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function xG(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function SG(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function CG(e,t){if(!e)return`—`;try{let n=pG(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(xG(n,r)===xG(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return SG(n,r)!==SG(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}var wG=`https://flymyairport.vercel.app`.replace(/\/$/,``)||`https://flymyairport.com`,TG={display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,flexShrink:0,width:72,maxWidth:72,minWidth:0,boxSizing:`border-box`,textDecoration:`none`,color:`inherit`};function EG(e){return e===`arrivals`?`arrival`:`departure`}function DG(e,t,n){let r=S_(e,EG(n));return r?T_(wG,t,r):null}function OG(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}function kG(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function AG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function jG(e){let t=AG(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function MG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function NG(e,t){let n=MG(e);return n&&t[n]?.name?.trim()||null}function PG(e,t){let n=MG(e);return n&&t[n]?.iconUrl?.trim()||null}function FG(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function IG(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function LG(e,t){let n=dG(e,t);return{gate:IG(n?.gate)||`—`,terminal:IG(n?.terminal)||`—`}}function RG(e,t){return IG(dG(e,t)?.terminal).length>0}function zG(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function BG(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function VG(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function HG(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function UG(e,t,n){if(e.displayTime){let n=bG(e.displayTime.punctuality,t);return{timeLabel:HG(e.displayTime.label)??e.displayTime.label,scheduledLabel:HG(e.displayTime.scheduledLabel),statusText:e.displayTime.statusLabel,punctualityColor:n}}let r=yG(e),i=CG(BG(e),n),a=CG(VG(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:bG(r.tone,t)}:{timeLabel:CG(zG(e),n),statusText:r.text,punctualityColor:bG(r.tone,t)}}function WG(e,t){let n=e?.trim().toUpperCase()??``,r=t.accentTextColor,i=t.mutedTextColor,a=t.primaryTextColor;switch(n){case`CANCELLED`:return{label:`Cancelled`,dotStyle:{backgroundColor:`#fb923c`},textStyle:{color:`#fdba74`}};case`DIVERTED`:case`REDIRECTED`:return{label:n===`DIVERTED`?`Diverted`:`Redirected`,dotStyle:{backgroundColor:`#fbbf24`},textStyle:{color:`#fde68a`}};case`LANDED`:return{label:`Landed`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`ACTIVE`:return{label:`In Flight`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`On-time`,dotStyle:{backgroundColor:r},textStyle:{color:r}};case`UNKNOWN`:return{label:`Unknown`,dotStyle:{backgroundColor:i},textStyle:{color:i}};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,dotStyle:{backgroundColor:r},textStyle:{color:r}}:{label:`—`,dotStyle:{backgroundColor:i},textStyle:{color:i}}}}function GG(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function KG(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function qG(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function JG(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function YG({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=qG(s,i),d=r===null?null:JG(r,l);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(xL,{icon:t===`departure`?sG:aG,style:{width:22,height:22,color:`#ffffff`}})}),(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,q.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:n.accentTextColor,lineHeight:1},children:u}),d===null?null:(0,q.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:iG(n.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,q.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function XG({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=iG(r.primaryTextColor),s=(0,K.useRef)(null),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width,n=f.current,r=n;n?t>=784&&(r=!1):t<760&&(r=!0),r!==n&&(f.current=r,d(r))};if(t(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,t),()=>globalThis.removeEventListener(`resize`,t);let n=new ResizeObserver(()=>{t()});return n.observe(e),()=>n.disconnect()},[]);let p={width:`100%`,maxWidth:`100%`,minWidth:0,paddingLeft:u?12:20,paddingRight:u?12:20,paddingBottom:16,boxSizing:`border-box`},m={display:`grid`,gridTemplateColumns:u?`34px minmax(0, 1fr)`:`38px minmax(0, 1.35fr) minmax(0, 2fr) minmax(0, auto)`,alignItems:`center`,gap:u?`14px 10px`:18,width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`,overflow:`hidden`,padding:u?`14px`:`16px 18px`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:o,boxShadow:`none`,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`},h=a===`arrivals`,g=e.some(e=>RG(e,i)),_=+!!g+1+ +!!h,v=a===`arrivals`?`Arrival`:`Departs`,y={color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`};return(0,q.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`},children:(0,q.jsx)(`div`,{style:p,children:e.length===0?(0,q.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:e.map(e=>{let o=e.flightId,s=WG(e.status,r),d=NG(e,t),f=PG(e,t),p=e.callsign?.trim()??``,b=UG(e,r,kG(i,n)),x=LG(e,i),S=String(s.dotStyle.backgroundColor??r.accentTextColor),C=c===o,w=DG(e,i,a),T={part:`fids-board-row-notifications`,"aria-label":`Sign up for flight alerts on FlyMyAirport`,title:`Sign up for flight alerts on FlyMyAirport`,style:{...TG,...w?{cursor:`pointer`}:{cursor:`default`}}},E=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`},children:`Alerts`}),(0,q.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:r.headerIconTileBackgroundColor},children:(0,q.jsx)(`span`,{"aria-label":`Flight alerts`,title:`Flight alerts`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24},children:(0,q.jsx)(xL,{icon:oG,style:{width:14,height:14}})})})]});return(0,q.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>l(o),onMouseLeave:()=>l(null),onFocus:()=>l(o),onBlur:()=>l(null),style:{...m,...C?{borderColor:r.accentTextColor,boxShadow:`0 6px 14px rgba(15, 23, 42, 0.06)`,transform:`translateY(-1px)`}:{}},children:[(0,q.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!f,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:34,height:34,overflow:`hidden`,...u?{gridColumn:1,gridRow:1,alignSelf:`center`}:{}},children:f?(0,q.jsx)(`img`,{src:f,alt:d?`${d} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),(0,q.jsxs)(`div`,{style:{minWidth:0,color:r.primaryTextColor,...u?{gridColumn:`2 / -1`,gridRow:1,alignSelf:`center`,display:`flex`,flexDirection:`column`,justifyContent:`center`}:{}},children:[(0,q.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{fontSize:`1.05rem`,fontWeight:700,lineHeight:1.15,overflowWrap:`break-word`},children:__(e,n)}),(0,q.jsxs)(`div`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,marginTop:4,fontSize:`0.78rem`,lineHeight:1.2,color:r.mutedTextColor},children:[d?(0,q.jsx)(`span`,{style:{fontWeight:700},children:d}):null,(0,q.jsx)(`span`,{className:`aone:tabular-nums`,children:jG(e)}),p?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,children:p}):null]})]}),(0,q.jsxs)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,gridColumn:u?`1 / -1`:void 0,gridRow:u?2:void 0,gridTemplateColumns:`repeat(${_+1}, minmax(0, 1fr))`,justifyItems:u?`center`:void 0,gap:12,minWidth:0},children:[(0,q.jsx)(QG,{label:v,scheduledLabel:b.scheduledLabel,timeLabel:b.timeLabel,theme:r,labelStyle:y}),g?(0,q.jsx)(ZG,{label:`Terminal`,value:x.terminal,theme:r}):null,(0,q.jsx)(ZG,{label:`Gate`,value:x.gate,theme:r}),h?(0,q.jsx)(ZG,{label:`Baggage`,value:FG(e),theme:r}):null]}),(0,q.jsxs)(`div`,{style:{display:`grid`,gridColumn:u?`1 / -1`:void 0,gridRow:u?3:void 0,gridTemplateColumns:`minmax(0, 1fr) auto`,alignItems:`center`,gap:12,minWidth:0,maxWidth:`100%`,width:`100%`,boxSizing:`border-box`},children:[(0,q.jsx)(`div`,{part:`fids-board-row-status`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:0,maxWidth:`100%`,minHeight:28,padding:`5px 14px`,borderRadius:999,color:GG(S),backgroundColor:S,fontSize:`0.75rem`,fontWeight:800,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:s.label}),w?(0,q.jsx)(`a`,{...T,href:w,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:E}):(0,q.jsx)(`span`,{...T,children:E})]})]},o)})})})})}function ZG({label:e,value:t,theme:n}){return(0,q.jsxs)(`div`,{style:{minWidth:0},children:[(0,q.jsx)(`div`,{style:{marginBottom:6,color:n.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},children:e}),(0,q.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 9px`,borderRadius:6,backgroundColor:iG(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`},children:t})]})}function QG({label:e,scheduledLabel:t,timeLabel:n,theme:r,labelStyle:i}){return(0,q.jsxs)(`div`,{part:`fids-board-row-time`,style:{minWidth:0},children:[(0,q.jsx)(`div`,{part:`fids-board-row-time-label`,style:{...i,marginBottom:6},children:e}),(0,q.jsxs)(`div`,{className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1},children:[t?(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.9rem`,fontWeight:500,textDecorationLine:`line-through`},children:t}):null,(0,q.jsx)(`span`,{children:n})]})]})}function $G({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel:l}){return(0,q.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(YG,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,q.jsx)(XG,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function eK({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=$W,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,q.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,q.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:iG(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=e.airlines,u=e.airports??{},d=KG(e.iata,u),f=fG(d);return(0,q.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,q.jsx)($G,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,q.jsx)($G,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,OG(e.asOfUtc),` · `,e.iata]})]})}function tK(e){return(0,q.jsx)(eK,{...e})}var nK=[`consent-analytics`,`consent-advertising`,`consent-functional`,ev,`id`],rK=12e4,iK=3e4;function aK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function oK(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:aK(n.consentAnalytics),consentAdvertising:aK(n.consentAdvertising),consentFunctional:aK(n.consentFunctional)}}var sK=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=$W;_publicConsentAnalytics;static get observedAttributes(){return Array.from(nK)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.width=`100%`,this.style.maxWidth=`100%`,this.style.minWidth=`0`,this.style.boxSizing=`border-box`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=rK+Math.floor(Math.random()*iK),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=wv(this);if(!e||e!==this._activeInstanceId)return;let t=await QW(e);!this.isConnected||e!==this._activeInstanceId||(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=XW(),r=window[rm],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=rG(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await jv(e);o=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=rG(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=rG(null,i);if(!this.isConnected)return;let c=oK(a);this._publicConsentAnalytics=c.consentAnalytics;let l=Sv(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Ry(!0,{widget_runtime:`fids-board`,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${Ev}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await QW(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`fids-board`,public_config_unavailable:a===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=wx,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.style.display=`block`,t.style.width=`100%`,t.style.maxWidth=`100%`,t.style.minWidth=`0`,t.style.boxSizing=`border-box`,t.parentNode!==e&&e.appendChild(t);let n=Sv(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=yv.createRoot(t)).render((0,q.jsx)(tK,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,sK);var cK=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function lK(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function uK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function dK(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function fK(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function pK(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function mK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function hK(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function gK(e){let t=e?.trim().toLowerCase();if(t)return cK.includes(t)?t:void 0}function _K(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=lK(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=lK(e.iata)??lK(e.sourceIata);n&&(t.iata=n);let i=uK(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=uK(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=uK(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=mK(e.label);s&&(t.label=s);let c=uK(e.enableCars);c!==void 0&&(t.enableCars=c);let l=uK(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=uK(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=dK(e.position);d&&(t.position=d);let f=fK(e.edgeStyle)??fK(e[`edge-style`]);f&&(t.edgeStyle=f);let p=pK(e.primaryColor);p&&(t.primaryColor=p);let m=pK(e.secondaryColor);m&&(t.secondaryColor=m);let h=mK(e.airfareSearchWidgetInstanceId)??mK(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=hK(e.primaryButtonContent)??hK(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=hK(e.secondaryButtonContent)??hK(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=gK(e.primaryIcon)??gK(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function vK(e){return lK(e.sourceIataAttribute)??lK(e.publicIata)??lK(e.globalIata??void 0)}function yK(e){return uK(e.consentAttribute??void 0)??e.publicConsent??!0}function bK(e){return mK(e.labelAttribute)??mK(e.publicLabel)??`Plan your trip`}function xK(e){return uK(e.rawAttribute??void 0)??e.publicToggle??!0}function SK(e){return mK(e.rawAttribute)??mK(e.publicAirfareSearchWidgetInstanceId)}function CK(e){return dK(e.rawAttribute)??e.publicPosition??`bottom-right`}function wK(e){return fK(e.rawAttribute)??e.publicEdgeStyle??`floating`}function TK(e){return hK(e.rawAttribute)??e.publicMode??`both`}function EK(e){return gK(e.rawAttribute)??e.publicIcon??`plane`}function DK(e){return pK(e.primaryColorAttribute)??pK(e.publicPrimaryColor)??pK(e.globalPrimaryColor)??`#b91c1c`}function OK(e){return pK(e.secondaryColorAttribute)??pK(e.publicSecondaryColor)??pK(e.globalSecondaryColor)??`#b91c1c`}function kK(e,t){let n=lK(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function AK(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var jK=kk(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function MK({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?$S:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:nj(jK({variant:t,size:n,className:e})),...i})}var NK={plane:Tj,"plane-departure":xj,compass:Oj,"earth-americas":Sj,"location-dot":kj,suitcase:Cj};function PK({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1),S=(0,K.useCallback)(()=>{y(!1),AK(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,K.useCallback)(()=>{y(!0),AK(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,K.useCallback)(()=>{v?S():C()},[S,v,C]);(0,K.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(AK(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),AK(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:WS},{vertical:`packages`,label:`Packages`,Icon:qS},{vertical:`hotels`,label:`Hotels`,Icon:US}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,re=(0,K.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),I=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},ie=(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,q.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:re,children:[v?(0,q.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(MK,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,q.jsx)(KS,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,q.jsx)(MK,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,q.jsxs)(`a`,{"aria-label":j?void 0:n,href:kK(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,q.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,q.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${I(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,q.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,q.jsxs)(MK,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,q.jsx)(xL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:wj}):(0,q.jsx)(xL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:NK[h]}):null,k?(0,q.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,q.jsx)(rW,{onOpenChange:n=>{x(n),n||AK(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,q.jsxs)(oW,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,q.jsx)(sW,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,q.jsx)(`div`,{className:`aone:p-4`,children:e?(0,K.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,q.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,q.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:ie}):ie}function FK({shadowRoot:e,userStyleBlock:t,...n}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{children:wx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(PK,{dialogPortalContainer:e,...n})]})}var IK=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,ev,`id`,`data-preview-contained`],LK=`--fyf-fab-shell-bottom`,RK=`--fyf-fab-shell-right`,zK=`fma-fab`;function BK(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function VK(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(zK).join(`:host`)}var HK=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(IK)}attributeChangedCallback(e,t,n){t===n||!this.isConnected||this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(ev)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=Av(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await jv(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=BK(i?.shellBottom),o=BK(i?.shellRight);a?this.style.setProperty(LK,a):this.style.removeProperty(LK),o?this.style.setProperty(RK,o):this.style.removeProperty(RK);let s=window[rm],c=_K(n),l=VK(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=vK({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=yK({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=yK({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=yK({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=bK({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=xK({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=xK({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=xK({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=CK({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=wK({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=DK({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=OK({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=SK({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=TK({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=TK({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=EK({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${Ev}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${Ev}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(FK,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};return customElements.get(`fma-fab`)||customElements.define(`fma-fab`,HK),e.AirfareContent=MS,e.AirfareSearch=BW,e.CarfareSearch=kV,e.FidsBoardElement=sK,e.FlyMyAirportFabElement=HK,e})({});
|
|
671
|
+
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=cP(n).filter(jI).map(AI),i=BF.begin(`searchPseudoElements`);eI(),Promise.all(r).then(function(){i(),tI(),e()}).catch(function(){i(),tI(),t()})})}}var FI={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=PI,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?rM:t;Q.searchPseudoElements&&PI(n)}}},II=!1,LI={mixout:function(){return{dom:{unwatch:function(){eI(),II=!0}}}},hooks:function(){return{bootstrap:function(){rI(gF(`mutationObserverCallbacks`,{}))},noAuto:function(){iI()},watch:function(e){var t=e.observeMutationsRoot;II?tI():rI(gF(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},RI=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i;break}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},zI={mixout:function(){return{parse:{transform:function(e){return RI(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=RI(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},BI={x:0,y:0,width:`100%`,height:`100%`};function VI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function HI(e){return e.tag===`g`?e.children:[e]}hF([bP,_I,vI,yI,bI,FI,LI,zI,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?aF(n.split(` `).map(function(e){return e.trim()})):$P();return r.prefix||=QP(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=mP({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},BI),{},{fill:`white`})},p=c.children?{children:c.children.map(VI)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[VI(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||sP()}`,_=`clip-${a||sP()}`,v={tag:`mask`,attributes:Z(Z({},BI),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:HI(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},BI)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;nM.matchMedia&&(t=nM.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``?!0:n,e}}}}],{mixoutsTo:xF}),xF.noAuto;var UI=xF.config;xF.library,xF.dom;var WI=xF.parse;xF.findIconDefinition,xF.toHtml;var GI=xF.icon;xF.layer,xF.text,xF.counter;function KI(e){return e-=0,e===e}function qI(e){return KI(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var JI=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function YI(e){return e.charAt(0).toUpperCase()+e.slice(1)}var XI=new Map,ZI=1e3;function QI(e){if(XI.has(e))return XI.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=qI(n);t[e.startsWith(`webkit`)?YI(e):e]=r}}}n=a+1}if(XI.size===ZI){let e=XI.keys().next().value;e&&XI.delete(e)}return XI.set(e,t),t}function $I(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),$I(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=QI(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[qI(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(JI)))}return e(t.tag,{...a,...u},...r)}var eL=$I.bind(null,K.createElement),tL=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},nL=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var rL=`searchPseudoElementsFullScan`in UI&&typeof UI.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,iL=Number.parseInt(rL)>=7,aL=()=>iL,oL=`fa`,sL={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`},cL={left:`fa-pull-left`,right:`fa-pull-right`},lL={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},uL={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},dL={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`},fL={default:`fa-layers`};function pL(e){let t=UI.cssPrefix||UI.familyPrefix||oL;return t===oL?e:e.replace(new RegExp(String.raw`(?<=^|\s)${oL}-`,`g`),`${t}-`)}function mL(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,className:b}=e,x=[];return b&&x.push(...b.split(` `)),t&&x.push(sL.beat),n&&x.push(sL.fade),r&&x.push(sL.beatFade),i&&x.push(sL.bounce),a&&x.push(sL.shake),o&&x.push(sL.spin),c&&x.push(sL.spinReverse),s&&x.push(sL.spinPulse),l&&x.push(sL.pulse),u&&x.push(dL.fixedWidth),d&&x.push(dL.inverse),f&&x.push(dL.border),p===!0&&x.push(dL.flip),(p===`horizontal`||p===`both`)&&x.push(dL.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(dL.flipVertical),m!=null&&x.push(uL[m]),h!=null&&h!==0&&x.push(lL[h]),g!=null&&x.push(cL[g]),_&&x.push(dL.swapOpacity),aL()?(v&&x.push(dL.rotateBy),y&&x.push(dL.widthAuto),(UI.cssPrefix||UI.familyPrefix||oL)===oL?x:x.map(pL)):x}var hL=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function gL(e){if(e)return hL(e)?e:WI.icon(e)}function _L(e){return Object.keys(e)}var vL=new nL(`FontAwesomeIcon`),yL={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1},bL=new Set(Object.keys(yL)),xL=K.forwardRef((e,t)=>{let n={...yL,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=tL(c,!!i),d=tL(s,!!o),f=gL(r);if(!f)return vL.error(`Icon lookup is undefined`,r),null;let p=mL(n),m=typeof l==`string`?WI.transform(l):l,h=gL(i),g=GI(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return vL.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of _L(n))bL.has(e)||(v[e]=n[e]);return eL(_[0],v)});xL.displayName=`FontAwesomeIcon`,`${fL.default}${dL.fixedWidth}`;function SL({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(xL,{icon:Dj,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var CL=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return zm(c)?Nm(c):null},wL=/^\d{2}\/\d{2}\/\d{2}$/,TL=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),EL=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},DL=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},OL=e=>{if(!wL.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&TL(Nm(t))===e?Nm(t):null};function kL({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),[y,b]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,K.useState)(``),[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(p||null),[j,M]=(0,K.useState)(m||null),[N,P]=(0,K.useState)(!1),[ee,F]=(0,K.useState)(p||null),[te,ne]=(0,K.useState)(!1),[re,I]=(0,K.useState)(!1),[ie]=(0,K.useState)(()=>p||new Date),ae=(0,K.useRef)(n),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(0),ue=(0,K.useRef)(null),de=(0,K.useRef)(null),fe=()=>Date.now()<le.current,pe=()=>{fe()||P(!0)},me=()=>{le.current=Date.now()+250,P(!1)},he=e=>{if(e){pe();return}me()};(0,K.useEffect)(()=>{ae.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let ge=Nm(new Date),_e=wm(ge,6),ve=e=>{S(e);let t=OL(e);return e===``||!e?(E(null),A(null),!0):t?Nh(t,ge)?(E(`Date cannot be in the past`),A(null),!1):Mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&Nh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&Nh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ye=e=>{if(i)return!0;w(e);let t=OL(e);return e===``||!e?(O(null),M(null),!0):t?Nh(t,ge)?(O(`Date cannot be in the past`),M(null),!1):Mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?Nh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&Nh(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},L=()=>ve(x),be=()=>ye(C),R=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Lm(e,k)&&Lm(e,j)?(A(e),M(null)):Nh(e,j)&&Nh(e,Cm(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ae.current(null,null)};(0,K.useEffect)(()=>{ae.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(TL(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(TL(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=dj(),we=(0,K.useId)(),Te=`${we}-description`,Ee=(0,q.jsxs)(`div`,{ref:ce,onClick:pe,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=EL(e.target.value,x);S(t),E(null),F(CL(t)),ae.current(null,j)},onFocus:()=>{ne(!0),pe()},onBlur:e=>{let t=DL(e.target.value);S(t);let n=ve(t);ne(!1),!n&&ue.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),ue.current=null},onKeyDown:e=>{e.key===`Tab`&&(ue.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),L(),e.target.blur())}}),T&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SL,{message:T,buttonRef:oe})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=EL(e.target.value,C);w(t),O(null),F(CL(t)),ae.current(k,null)},onFocus:()=>{I(!0),pe()},onBlur:e=>{let t=DL(e.target.value);w(t);let n=ye(t);I(!1),!n&&de.current===`forward`&&requestAnimationFrame(()=>se.current?.focus()),de.current=null},onKeyDown:e=>{e.key===`Tab`&&(de.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),be(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SL,{message:D,buttonRef:se})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,q.jsxs)(ij,{open:N,onOpenChange:he,children:[Ee,(0,q.jsxs)(rj,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:he,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,q.jsx)(aj,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(vj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:me,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(oj,{open:N,onOpenChange:he,children:[(0,q.jsx)(lj,{asChild:!0,children:Ee}),(0,q.jsxs)(cj,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&ce.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(vj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:xe,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:me,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Te,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function AL(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var jL=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),ML=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i})=>{let[a,o]=(0,K.useState)(!1);return(0,q.jsxs)(oj,{open:a,onOpenChange:o,children:[(0,q.jsx)(sj,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:border-gray-200 aone:dark:border-gray-600 aone:text-foreground`,"data-testid":`time-picker-trigger`,children:[(0,q.jsx)(`span`,{children:e?AL(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(xL,{icon:a?bj:Ej,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(cj,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,children:[(0,q.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,q.jsx)(`div`,{className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:jL.map(n=>(0,q.jsx)(`button`,{type:`button`,className:`py-2 px-2 rounded-md text-sm w-full text-left transition ${e===n?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-background text-foreground border border-transparent hover:bg-muted`}`,onClick:()=>{t(n),o(!1)},"data-testid":`time-picker-option-${n.replace(`:`,`-`)}`,children:AL(n)},n))})})]})]})};function NL({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,q.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,q.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,q.jsx)(`div`,{className:`aone:grow`,children:(0,q.jsx)(kL,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,q.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,q.jsx)(ML,{value:n,onChange:i,portalContainer:f})})]})]})}function PL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FL(){return FL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FL.apply(null,arguments)}var IL=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),LL=s(((e,t)=>{var n=IL();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),RL=s(((e,t)=>{t.exports=LL()()})),zL=s((e=>{})),BL=s(((e,t)=>{t.exports=zL()})),$=u(RL(),1);BL();var VL=e=>typeof e==`object`&&!!e&&e.nodeType===1,HL=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,UL=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return HL(n.overflowY,t)||HL(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},WL=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,GL=e=>e.parentElement??(e.getRootNode().host||null),KL=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!VL(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;VL(u)&&s(u);){if(u=GL(u),u===c){l.push(u);break}u!=null&&u===document.body&&UL(u)&&!UL(document.documentElement)||u!=null&&UL(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!UL(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?WL(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:WL(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?WL(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:WL(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},qL=0;function JL(){return String(qL++)}function YL(e){var t=K.useRef(e);return t.current=e,t}function XL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function ZL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function QL(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var $L=QL(function(e){eR(e).textContent=``},500);function eR(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function tR(e,t){if(!(!e||!t)){var n=eR(t);n.textContent=e,$L(t)}}function nR(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function rR(){}var iR=rR;function aR(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},FL({},e)):e}function oR(e,t){e&&KL(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function sR(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&!t.startsWith(`Arrow`)?`Arrow`+t:t}function cR(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?cR(t?a-1:0,t,n,r):-1}function lR(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=cR(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function uR(e,t,n,r){return r===void 0&&(r=!0),!!n&&t.some(function(t){return t&&(dR(t,e,n)||r&&dR(t,n.document.activeElement,n))})}function dR(e,t,n){return e===t||t instanceof n.Node&&e.contains(t)}function fR(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function pR(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];mR(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}typeof t.onStateChange==`function`&&Object.keys(a).length&&t.onStateChange(FL({type:i},a))}function mR(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+fR(e)+`Change`];if(typeof a==`function`){var o=t.type;a(FL({type:o},i))}}}function hR(e,t,n,r){var i=K.useRef({}),a=K.useRef(),o=K.useCallback(function(t,n){a.current=n,t=aR(t,n.props);var r=e(t,n),i=n.props.stateReducer(t,FL({},n,{changes:r}));return FL({},t,i)},[e]),s=K.useReducer(o,t,n),c=s[0],l=s[1],u=YL(t),d=K.useCallback(function(e){return l(FL({},e,{props:u.current}))},[u]),f=a.current;return K.useEffect(function(){var e=aR(i.current,f?.props);f&&!r(e,c)&&pR(f,f.props,e,c),i.current=c},[c,f,r]),[c,d]}function gR(e,t,n,r){var i=hR(e,t,n,r),a=i[0],o=i[1];return[aR(a,t),o]}function _R(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function vR(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}var yR={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function bR(e,t){return e===void 0?t:e}function xR(e,t,n,r){return e===void 0?t===void 0?n===void 0?r:n:t:e}var SR=QL(function(e,t){tR(e,t)},200);function CR(e,t,n,r){var i=r?.document,a=vR();K.useEffect(function(){!e||a||!i||SR(e(t),i)},n),K.useEffect(function(){return function(){SR.cancel(),nR(i)}},[i])}var wR=FL({},yR,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),TR={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},isItemDisabled:function(e){return!1},stateReducer:function(e,t){return t.changes},scrollIntoView:oR,environment:typeof window>`u`?void 0:window},ER={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},DR=FL({},K).useId,OR=typeof DR==`function`?kR:AR;function kR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+DR();return t||=s,K.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function AR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=K.useRef(t??`downshift-`+JL()).current;return K.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}function jR(e,t,n){var r=bR(n,ER.highlightedIndex);return e[r]&&t(e[r],r)?-1:r}function MR(e,t,n,r,i,a){return FL({isOpen:!1,highlightedIndex:-1},e.length&&i>=0&&FL({selectedItem:e[i],isOpen:bR(n,ER.isOpen),highlightedIndex:bR(r,ER.highlightedIndex)},a&&{inputValue:t(e[i])}))}function NR(e,t,n,r,i,a,o,s){return e.length===0?-1:t!==void 0&&o===t&&e[t]&&!r(e[t],t)?t:n!==void 0&&e[n]&&!r(e[n],n)?n:a?e.findIndex(function(e){return i(a)===i(e)}):s<0&&e[e.length-1]&&!r(e[e.length-1],e.length-1)?e.length-1:s>0&&e[0]&&!r(e[0],0)?0:-1}function PR(e){var t=xR(e.selectedItem,e.initialSelectedItem,e.defaultSelectedItem,ER.selectedItem),n=xR(e.isOpen,e.initialIsOpen,e.defaultIsOpen,ER.isOpen),r=FR(e),i=xR(e.inputValue,e.initialInputValue,e.defaultInputValue,ER.inputValue);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function FR(e){var t=xR(e.highlightedIndex,e.initialHighlightedIndex,e.defaultHighlightedIndex,ER.highlightedIndex);return t>-1&&e.items[t]&&e.isItemDisabled(e.items[t],t)?-1:t}var IR=rR;function LR(e,t,n){var r=K.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=K.useCallback(function(){return n.map(function(e){return e.current})},[n]);return K.useEffect(function(){if(!e)return rR;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,uR(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!uR(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r.current}var RR=function(){return rR},zR=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function BR(e,t,n,r,i,a){var o=K.useRef(!0);return zR(function(){if(!(t<0||!n||!Object.keys(i).length))if(o.current){var s=i[a(t)];s&&r&&e(s,r)}else o.current=!0},[t]),K.useCallback(function(){o.current=!1},[])}function VR(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function HR(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NR(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:NR(t.items,t.initialHighlightedIndex,t.defaultHighlightedIndex,t.isItemDisabled,t.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:var o=n.highlightedIndex;a={highlightedIndex:t.isItemDisabled(t.items[o],o)?-1:o};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:jR(t.items,t.isItemDisabled,t.defaultHighlightedIndex),isOpen:bR(t.defaultIsOpen,ER.isOpen),selectedItem:bR(t.defaultSelectedItem,ER.selectedItem),inputValue:bR(t.defaultInputValue,ER.inputValue)};break;default:throw Error(`Reducer called without proper action type.`)}return FL({},e,a)}var UR=FL({},wR,{items:$.default.array.isRequired,isItemDisabled:$.default.func});function WR(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var GR=0,KR=1,qR=2,JR=3,YR=4,XR=5,ZR=6,QR=7,$R=8,ez=9,tz=10,nz=11,rz=12,iz=13,az=14,oz=15,sz=16,cz=17,lz=18,uz=19,dz=20,fz=21,pz=Object.freeze({__proto__:null,FunctionCloseMenu:cz,FunctionOpenMenu:sz,FunctionReset:fz,FunctionSelectItem:uz,FunctionSetHighlightedIndex:lz,FunctionSetInputValue:dz,FunctionToggleMenu:oz,ItemClick:az,ItemMouseMove:iz,MenuMouseLeave:rz,ToggleButtonBlur:nz,ToggleButtonClick:GR,ToggleButtonKeyDownArrowDown:KR,ToggleButtonKeyDownArrowUp:qR,ToggleButtonKeyDownCharacter:JR,ToggleButtonKeyDownEnd:ZR,ToggleButtonKeyDownEnter:QR,ToggleButtonKeyDownEscape:YR,ToggleButtonKeyDownHome:XR,ToggleButtonKeyDownPageDown:tz,ToggleButtonKeyDownPageUp:ez,ToggleButtonKeyDownSpaceButton:$R});function mz(e,t){var n=t.type,r=t.props,i;switch(n){case az:i={isOpen:bR(r.defaultIsOpen,ER.isOpen),highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index]};break;case JR:var a=t.key,o=``+e.inputValue+a;i={inputValue:o,highlightedIndex:WR({keysSoFar:o,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex(function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)}):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case KR:var s=t.altKey;i={highlightedIndex:e.isOpen?lR(e.highlightedIndex,1,r.items,r.isItemDisabled):s&&e.selectedItem==null?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:!0};break;case qR:var c=t.altKey;i=e.isOpen&&c?MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?lR(e.highlightedIndex,-1,r.items,r.isItemDisabled):NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:!0};break;case QR:case $R:i=MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!1);break;case XR:i={highlightedIndex:cR(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case ZR:i={highlightedIndex:cR(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case ez:i={highlightedIndex:lR(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case tz:i={highlightedIndex:lR(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case YR:i={isOpen:!1,highlightedIndex:-1};break;case nz:i=FL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&{selectedItem:r.items[e.highlightedIndex]});break;case uz:i={selectedItem:t.selectedItem};break;default:return HR(e,r,t,pz)}return FL({},e,i)}var hz=[`onClick`],gz=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],_z=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`,`disabled`],vz=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];yz.stateChangeTypes=pz;function yz(e){e===void 0&&(e={}),iR(e,yz,UR);var t=FL({},TR,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=gR(mz,t,PR,VR),o=a[0],s=a[1],c=o.isOpen,l=o.highlightedIndex,u=o.selectedItem,d=o.inputValue,f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=OR(t),_=YL({state:o,props:t});CR(i,o,[c,l,u,d],r);var v=BR(n,l,c,p.current,m.current,g.getItemId);(0,K.useEffect)(function(){return h.current=QL(function(e){e({type:dz,inputValue:``})},500),function(){var e;(e=h.current)==null||e.cancel()}},[]),(0,K.useEffect)(function(){d&&(h.current==null||h.current(s))},[s,d]),IR({props:t,state:o}),(0,K.useEffect)(function(){xR(t.isOpen,t.initialIsOpen,t.defaultIsOpen,ER.isOpen)&&f.current&&f.current.focus()},[]);var y=LR(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:nz})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),b=RR(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var x=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:KR,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:qR,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:XR})},End:function(e){e.preventDefault(),s({type:ZR})},Escape:function(){_.current.state.isOpen&&s({type:YR})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?QR:GR})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:ez}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:tz}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:GR});return}t.inputValue?s({type:JR,key:` `}):s({type:$R})}}},[s,_]),S=(0,K.useCallback)(function(e){var t=e??{},n=t.onClick,r=PL(t,hz);return FL({id:g.labelId,htmlFor:g.toggleButtonId,onClick:ZL(n,function(){var e;(e=f.current)==null||e.focus()})},r)},[g]),C=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,c=r.ref,l=r[`aria-label`],u=PL(r,gz),d=(t??{}).suppressRefError;return b(`getMenuProps`,d===void 0?!1:d,o,p),FL((n={},n[o]=XL(c,function(e){p.current=e}),n.id=g.menuId,n.role=`listbox`,n[`aria-label`]=l,n[`aria-labelledby`]=l?void 0:``+g.labelId,n.onMouseLeave=ZL(i,function(){s({type:rz})}),n),u)},[s,b,g]),w=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,c=r.refKey,l=c===void 0?`ref`:c,u=r.ref,d=r.disabled,p=PL(r,_z),m=(t??{}).suppressRefError,h=m===void 0?!1:m,v=_.current.state,S=function(){s({type:GR})},C=function(){v.isOpen&&!y.isMouseDown&&s({type:nz})},w=function(e){var t=sR(e);t&&t in x?x[t](e):/^\S{1}$/.test(t)&&s({type:JR,key:t})},T=FL((n={},n[l]=XL(u,function(e){f.current=e}),n[`aria-activedescendant`]=v.isOpen&&v.highlightedIndex>-1?g.getItemId(v.highlightedIndex):``,n[`aria-controls`]=g.menuId,n[`aria-expanded`]=_.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=p[`aria-label`]?void 0:``+g.labelId,n.id=g.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=ZL(i,C),n.disabled=d,n),p);return d||Object.assign(T,{onClick:ZL(a,S),onKeyDown:ZL(o,w)}),b(`getToggleButtonProps`,h,l,f),T},[s,g,_,y,b,x]),T=(0,K.useCallback)(function(e){var t,n=e??{},r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick,c=n.onMouseDown;n.onPress;var l=n.refKey,u=l===void 0?`ref`:l,d=n.disabled,f=n.ref,p=PL(n,vz);d!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var h=_.current,b=h.state,x=h.props,S=_R(r,i,x.items,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=x.isItemDisabled(C,w),E=function(){y.isTouchEnd||w===b.highlightedIndex||(v(),s({type:iz,index:w,disabled:T}))},D=function(){s({type:az,index:w})},O=FL((t={},t[u]=XL(f,function(e){e&&(m.current[g.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===b.selectedItem,t.id=g.getItemId(w),t.role=`option`,t.onMouseMove=ZL(a,E),t.onMouseDown=ZL(c,function(e){return e.preventDefault()}),t),p);return T||Object.assign(O,{onClick:ZL(o,D)}),O},[_,g,y,v,s]),E=(0,K.useCallback)(function(){s({type:oz})},[s]),D=(0,K.useCallback)(function(){s({type:cz})},[s]);return{getToggleButtonProps:w,getLabelProps:S,getMenuProps:C,getItemProps:T,toggleMenu:E,openMenu:(0,K.useCallback)(function(){s({type:sz})},[s]),closeMenu:D,setHighlightedIndex:(0,K.useCallback)(function(e){s({type:lz,highlightedIndex:e})},[s]),selectItem:(0,K.useCallback)(function(e){s({type:uz,selectedItem:e})},[s]),reset:(0,K.useCallback)(function(){s({type:fz})},[s]),setInputValue:(0,K.useCallback)(function(e){s({type:dz,inputValue:e})},[s]),highlightedIndex:l,isOpen:c,selectedItem:u,inputValue:d}}function bz(e){var t=PR(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),FL({},t,{inputValue:r})}var xz=0,Sz=1,Cz=2,wz=3,Tz=4,Ez=5,Dz=6,Oz=7,kz=8,Az=9,jz=10,Mz=11,Nz=12,Pz=13,Fz=14,Iz=15,Lz=16,Rz=17,zz=18,Bz=19,Vz=20,Hz=21,Uz=22,Wz=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:Uz,FunctionCloseMenu:Rz,FunctionOpenMenu:Lz,FunctionReset:Hz,FunctionSelectItem:Bz,FunctionSetHighlightedIndex:zz,FunctionSetInputValue:Vz,FunctionToggleMenu:Iz,InputBlur:Az,InputChange:kz,InputClick:jz,InputKeyDownArrowDown:xz,InputKeyDownArrowUp:Sz,InputKeyDownEnd:Tz,InputKeyDownEnter:Oz,InputKeyDownEscape:Cz,InputKeyDownHome:wz,InputKeyDownPageDown:Dz,InputKeyDownPageUp:Ez,ItemClick:Pz,ItemMouseMove:Nz,MenuMouseLeave:Mz,ToggleButtonClick:Fz});function Gz(e,t,n,r){var i=(0,K.useRef)(null),a=hR(e,t,n,r),o=a[0],s=a[1],c=vR();return(0,K.useEffect)(function(){t.selectedItem!==void 0&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:Uz,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[aR(o,t),s]}var Kz=FL({},wR,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function qz(e,t){var n=t.type,r=t.props,i;switch(n){case Pz:i={isOpen:bR(r.defaultIsOpen,ER.isOpen),highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case xz:i=e.isOpen?{highlightedIndex:lR(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:t.altKey&&e.selectedItem==null?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,1),isOpen:r.items.length>=0};break;case Sz:i=e.isOpen?t.altKey?MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0):{highlightedIndex:lR(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,-1),isOpen:r.items.length>=0};break;case Oz:i=MR(r.items,r.itemToString,r.defaultIsOpen,r.defaultHighlightedIndex,e.highlightedIndex,!0);break;case Cz:i=FL({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case Ez:i={highlightedIndex:lR(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case Dz:i={highlightedIndex:lR(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case wz:i={highlightedIndex:cR(0,!1,r.items,r.isItemDisabled)};break;case Tz:i={highlightedIndex:cR(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Az:i=FL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case kz:i={isOpen:!0,highlightedIndex:jR(r.items,r.isItemDisabled,r.defaultHighlightedIndex),inputValue:t.inputValue};break;case jz:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NR(r.items,r.initialHighlightedIndex,r.defaultHighlightedIndex,r.isItemDisabled,r.itemToKey,e.selectedItem,e.highlightedIndex,0)};break;case Bz:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Uz:i={inputValue:t.inputValue};break;default:return HR(e,r,t,Wz)}return FL({},e,i)}var Jz=[`onMouseLeave`,`refKey`,`ref`,`aria-label`],Yz=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],Xz=[`onClick`,`onPress`,`refKey`,`ref`,`disabled`],Zz=[`aria-label`,`disabled`,`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];Qz.stateChangeTypes=Wz;function Qz(e){e===void 0&&(e={}),iR(e,Qz,Kz);var t=FL({},TR,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=Gz(qz,t,bz,VR),s=o[0],c=o[1],l=s.isOpen,u=s.highlightedIndex,d=s.selectedItem,f=s.inputValue,p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=vR(),v=OR(t),y=(0,K.useRef)(),b=YL({state:s,props:t});CR(a,s,[l,u,d,f],i);var x=BR(r,u,l,p.current,m.current,v.getItemId);IR({state:s,props:t}),(0,K.useEffect)(function(){xR(t.isOpen,t.initialIsOpen,t.defaultIsOpen,ER.isOpen)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var S=LR(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:Az})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),C=RR(`getInputProps`,`getMenuProps`);(0,K.useEffect)(function(){l||(m.current={})},[l]),(0,K.useEffect)(function(){var e;!l||!(i!=null&&i.document)||!((e=h.current)!=null&&e.focus)||i.document.activeElement!==h.current&&h.current.focus()},[l,i]);var w=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),c({type:xz,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Sz,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:wz}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Tz}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:Cz}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:Oz}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ez}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Dz}))}}},[c,b]),T=(0,K.useCallback)(function(e){return FL({id:v.labelId,htmlFor:v.inputId},e)},[v]),E=(0,K.useCallback)(function(e,t){var n,r=e??{},i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,l=r[`aria-label`],u=PL(r,Jz),d=(t??{}).suppressRefError;return C(`getMenuProps`,d===void 0?!1:d,o,p),FL((n={},n[o]=XL(s,function(e){p.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-label`]=l,n[`aria-labelledby`]=l?void 0:``+v.labelId,n.onMouseLeave=ZL(i,function(){c({type:Mz})}),n),u)},[c,C,v]),D=(0,K.useCallback)(function(e){var t,n,r=e??{},i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,l=r.ref,u=r.onMouseMove,d=r.onMouseDown,f=r.onClick;r.onPress;var p=r.disabled,h=PL(r,Yz);p!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var g=b.current,_=g.props,y=g.state,C=_R(i,a,_.items,`Pass either item or index to getItemProps!`),w=C[0],T=C[1],E=_.isItemDisabled(w,T),D=`onClick`,O=f;return FL((t={},t[s]=XL(l,function(e){e&&(m.current[v.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===y.highlightedIndex,t.id=v.getItemId(T),t.role=`option`,t),!E&&(n={},n[D]=ZL(O,function(){c({type:Pz,index:T})}),n),{onMouseMove:ZL(u,function(){S.isTouchEnd||T===y.highlightedIndex||(x(),c({type:Nz,index:T,disabled:E}))}),onMouseDown:ZL(d,function(e){return e.preventDefault()})},h)},[c,v,b,S,x]),O=(0,K.useCallback)(function(e){var t,n=e??{},r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=n.disabled,l=PL(n,Xz),u=b.current.state;return FL((t={},t[a]=XL(o,function(e){g.current=e}),t[`aria-controls`]=v.menuId,t[`aria-expanded`]=u.isOpen,t.id=v.toggleButtonId,t.tabIndex=-1,t),!s&&FL({},{onClick:ZL(r,function(){c({type:Fz})})}),{disabled:s},l)},[c,b,v]),k=(0,K.useCallback)(function(e,t){var n,r=e??{},a=r[`aria-label`],o=r.disabled,s=r.onKeyDown,l=r.onChange,u=r.onInput,d=r.onBlur;r.onChangeText;var f=r.onClick,p=r.refKey,m=p===void 0?`ref`:p,g=r.ref,_=PL(r,Zz),y=(t??{}).suppressRefError;C(`getInputProps`,y===void 0?!1:y,m,h);var x=b.current.state,T=function(e){var t=sR(e);t&&t in w&&w[t](e)},E=function(e){c({type:kz,inputValue:e.target.value})},D=function(e){i!=null&&i.document&&x.isOpen&&!S.isMouseDown&&c({type:Az,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},O=function(){c({type:jz})},k=`onChange`,A={};if(!o){var j;A=(j={},j[k]=ZL(l,u,E),j.onKeyDown=ZL(s,T),j.onBlur=ZL(d,D),j.onClick=ZL(f,O),j)}return FL((n={},n[m]=XL(g,function(e){h.current=e}),n[`aria-activedescendant`]=x.isOpen&&x.highlightedIndex>-1?v.getItemId(x.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=x.isOpen,n[`aria-labelledby`]=a?void 0:v.labelId,n[`aria-label`]=a,n.autoComplete=`off`,n.disabled=o,n.id=v.inputId,n.role=`combobox`,n.value=x.inputValue,n),A,_)},[c,v,i,w,b,S,C]),A=(0,K.useCallback)(function(){c({type:Iz})},[c]),j=(0,K.useCallback)(function(){c({type:Rz})},[c]),M=(0,K.useCallback)(function(){c({type:Lz})},[c]),N=(0,K.useCallback)(function(e){c({type:zz,highlightedIndex:e})},[c]),P=(0,K.useCallback)(function(e){c({type:Bz,selectedItem:e})},[c]);return{getItemProps:D,getLabelProps:T,getMenuProps:E,getInputProps:k,getToggleButtonProps:O,toggleMenu:A,openMenu:M,closeMenu:j,setHighlightedIndex:N,setInputValue:(0,K.useCallback)(function(e){c({type:Vz,inputValue:e})},[c]),selectItem:P,reset:(0,K.useCallback)(function(){c({type:Hz})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var $z={activeIndex:-1,selectedItems:[]};function eB(e){return{activeIndex:xR(e.activeIndex,e.initialActiveIndex,e.defaultActiveIndex,$z.activeIndex),selectedItems:xR(e.selectedItems,e.initialSelectedItems,e.defaultSelectedItems,$z.selectedItems)}}function tB(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function nB(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}wR.stateReducer,wR.itemToKey,wR.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var rB={itemToKey:TR.itemToKey,stateReducer:TR.stateReducer,environment:TR.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},iB=rR,aB=0,oB=1,sB=2,cB=3,lB=4,uB=5,dB=6,fB=7,pB=8,mB=9,hB=10,gB=11,_B=12,vB=Object.freeze({__proto__:null,DropdownClick:fB,DropdownKeyDownBackspace:dB,DropdownKeyDownNavigationPrevious:uB,FunctionAddSelectedItem:pB,FunctionRemoveSelectedItem:mB,FunctionReset:_B,FunctionSetActiveIndex:gB,FunctionSetSelectedItems:hB,SelectedItemClick:aB,SelectedItemKeyDownBackspace:sB,SelectedItemKeyDownDelete:oB,SelectedItemKeyDownNavigationNext:cB,SelectedItemKeyDownNavigationPrevious:lB});function yB(e,t){var n=t.type,r=t.index,i=t.selectedItem,a=t.props,o=e.activeIndex,s=e.selectedItems,c;switch(n){case aB:c={activeIndex:r};break;case lB:c={activeIndex:o-1<0?0:o-1};break;case cB:c={activeIndex:o+1>=s.length?-1:o+1};break;case sB:case oB:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=FL({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case uB:c={activeIndex:s.length-1};break;case dB:c={selectedItems:s.slice(0,s.length-1)};break;case pB:c={selectedItems:[].concat(s,[i])};break;case fB:c={activeIndex:-1};break;case mB:var u=o,d=s.findIndex(function(e){return a.itemToKey(e)===a.itemToKey(i)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case hB:c={selectedItems:t.selectedItems};break;case gB:c={activeIndex:t.activeIndex};break;case _B:c={activeIndex:bR(a.defaultActiveIndex,$z.activeIndex),selectedItems:bR(a.defaultSelectedItems,$z.selectedItems)};break;default:throw Error(`Reducer called without proper action type.`)}return FL({},e,c)}var bB=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],xB=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];SB.stateChangeTypes=vB;function SB(e){e===void 0&&(e={}),iB(e,SB);var t=FL({},rB,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=gR(yB,t,eB,nB),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=vR(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=YL({state:s,props:t});CR(n,s,[l,u],r),(0,K.useEffect)(function(){d||(l===-1&&f.current?f.current.focus():p.current[l]&&p.current[l].focus())},[l]),IR({props:t,state:s});var h=RR(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:lB})},e[i]=function(){c({type:cB})},e.Delete=function(){c({type:oB})},e.Backspace=function(){c({type:sB})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){tB(e)&&c({type:uB})},e.Backspace=function(e){tB(e)&&c({type:dB})},e},[c,a]);return{getSelectedItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,l=n.selectedItem,u=n.index,d=PL(n,bB),f=m.current.state,h=_R(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return FL((t={},t[i]=XL(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=ZL(o,function(){c({type:aB,index:h})}),t.onKeyDown=ZL(s,function(e){var t=sR(e);t&&g[t]&&g[t](e)}),t),d)},[c,m,g]),getDropdownProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,p=PL(r,xB),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),FL((n={},n[a]=XL(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:ZL(s,function(e){var t=sR(e);t&&_[t]&&_[t](e)}),onClick:ZL(l,function(){c({type:fB})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:pB,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:mB,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:hB,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:gB,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:_B})},[c]),selectedItems:u,activeIndex:l}}var CB=0,wB=1,TB=2,EB=3,DB=4,OB=5,kB=6,AB=Object.freeze({__proto__:null,FunctionAddItem:kB,TagClick:CB,TagGroupKeyDownArrowLeft:wB,TagGroupKeyDownArrowRight:TB,TagGroupKeyDownBackspace:DB,TagGroupKeyDownDelete:EB,TagRemoveClick:OB});function jB(e,t){var n=t.type,r;switch(n){case CB:r={activeIndex:t.index};break;case wB:r={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case TB:r={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case DB:case EB:var i=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),a=i.length===0?-1:i.length===e.activeIndex?e.activeIndex-1:e.activeIndex;r={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:a};break;case OB:var o=[].concat(e.items.slice(0,t.index),e.items.slice(t.index+1));r={items:o,activeIndex:o.length===0?-1:o.length===t.index?t.index-1:t.index};break;case kB:var s=[];s=t.index===void 0?[].concat(e.items,[t.item]):[].concat(e.items.slice(0,t.index),[t.item],e.items.slice(t.index));var c=e.activeIndex===-1?s.length-1:e.activeIndex;r={items:s,activeIndex:c};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return FL({},e,r)}var MB=FL({},K).useId,NB=typeof MB==`function`?PB:FB;function PB(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+MB();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function FB(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+JL()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function IB(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function LB(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var RB=`tag-group-a11y-description`;function zB(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,RB),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function BB(e){return FL({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function VB(e,t,n){var r=K.useRef({}),i=K.useRef(e),a=K.useRef(t);return K.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var HB={isItemDisabled:$.default.func},UB=[`onKeyDown`],WB=[`index`,`refKey`,`ref`,`onClick`],GB=[`index`,`onClick`],KB=function(e){e===void 0&&(e={}),iR(e,KB,HB);var t=BB(e),n=gR(jB,t,IB,LB),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=YL({state:r,props:t}),c=NB({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});zB(t.environment?.document,t.removeElementDescription);var l=VB(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=PL(t,UB);return FL({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:ZL(n,function(e){switch(e.key){case`ArrowLeft`:i({type:wB});break;case`ArrowRight`:i({type:TB});break;case`Delete`:i({type:EB});break;case`Backspace`:i({type:DB});break}})},r)},[i,c.tagGroupId]),d=(0,K.useCallback)(function(e){var t,n=e.index,r=e.refKey,a=r===void 0?`ref`:r,o=e.ref,u=e.onClick,d=PL(e,WB);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:CB,index:n})},m=c.getTagId(n);return FL((t={"aria-describedby":RB},t[a]=XL(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=ZL(u,p),t.tabIndex=f.activeIndex===n?0:-1,t),d)},[i,c,s,l]),f=(0,K.useCallback)(function(e){var t=e.index,n=e.onClick,r=PL(e,GB);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:OB,index:t})},o=c.getTagId(t),s=o+`-remove`;return FL({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:ZL(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:kB,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};KB.stateChangeTypes=AB;function qB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function y(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function b(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function x(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function S(e){if(e.type===`airport`){let n=e;return t?.length>1?x(n):n.country_code===`US`?`${n.city} (${x(n)})`:`${n.city}, ${n.country_code} (${x(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let C=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function w(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return C?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:T,getDropdownProps:E,removeSelectedItem:D}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=Qz({environment:c?w(c):void 0,items:v,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?S(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:return n;case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:return n;case Qz.stateChangeTypes.InputBlur:return n;case Qz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case Qz.stateChangeTypes.InputKeyDownEscape:return n;case Qz.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case Qz.stateChangeTypes.MenuMouseLeave:case Qz.stateChangeTypes.ItemMouseMove:break;case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:break;case Qz.stateChangeTypes.InputBlur:break;case Qz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),P=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(O&&v.length>0){let e=v.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return O&&v.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,O,v.length,u]),ee=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),F=i?`${i}, search airports and places`:`Search airports and places`,te=i?`${i} suggestions`:`Search results`,ne=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>S(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),re=[h,g,_].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let I=!!s;function ie(){let e=A({...E(),id:m,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":O,"aria-controls":O?p:void 0,"aria-activedescendant":O&&M!=null&&M>-1?`${p}-${M}`:void 0,"aria-label":F,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];D(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!I&&t.length===0?a:``,...e,"aria-describedby":re,disabled:I})}return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...T({selectedItem:e,index:n}),"aria-label":`Selected location: ${S(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:S(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${S(e)}`,onClick:t=>{t.stopPropagation(),!s&&D(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:h,className:`aone:sr-only`,children:ne}),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:ee}),ie()]}),O&&v.length>0&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`ul`,{ref:f,...k(),id:p,role:`listbox`,"aria-multiselectable":`true`,"aria-label":te,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:v.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=M===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${b(r)}, ${x(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:Tj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:x(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[b(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=M===n,a=V_(r.kayak?.apicode),o=y(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:kj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}})})})]})}function JB({hideByDefault:e=!0}){return(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var YB=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),XB=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),ZB=s(((e,t)=>{var n=XB(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),QB=s(((e,t)=>{var n=ZB();t.exports=function(){return n.Date.now()}})),$B=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),eV=s(((e,t)=>{var n=$B(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),tV=s(((e,t)=>{t.exports=ZB().Symbol})),nV=s(((e,t)=>{var n=tV(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),rV=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),iV=s(((e,t)=>{var n=tV(),r=nV(),i=rV(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),aV=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),oV=s(((e,t)=>{var n=iV(),r=aV(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),sV=s(((e,t)=>{var n=eV(),r=YB(),i=oV(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),cV=u(s(((e,t)=>{var n=YB(),r=QB(),i=sV(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);async function lV({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[bS]=n),r&&(a[xS]=r);let o=await fetch(`${t}/api/iata-auto-complete?${i}`,{headers:a});if(!o.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:o.status,statusText:o.statusText}),Error(`Unable to fetch airport suggestions`);let s=await o.json();return Jg.parse(s)}async function uV(e,t,n,r,i){if(!t)return[];let a=await lV({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:am.AIRPORT,iata_code:e.airportIata,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIata+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function dV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a}){let o=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),s={};i&&(s[bS]=i),a&&(s[xS]=a);let c=await fetch(`${r}/api/iata-directs?${o}`,{headers:s});if(!c.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:c.status,statusText:c.statusText}),Error(`Unable to fetch airport suggestions`);let l=await c.json();return um.parse(l)}async function fV(e,t,n,r,i,a){if(!t)return[];let o=await dV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:am.AIRPORT,iata_code:e.airportIata,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIata+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIata,types:[`airport`],nearbyAirports:[{name:e.airportIata+` (`+e.city+`)`,iata_code:e.airportIata,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function pV(e){return Math.PI/180*e}function mV(e){return e*.621371}function hV(e,t,n,r){let i=pV(n-e),a=pV(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(pV(e))*Math.cos(pV(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function gV(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==am.METRO)return!1;let n=B_(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function _V(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>gV(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=mV(hV(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function vV(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=B_(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set,p=l.toUpperCase();for(let t of n){let n=t.toUpperCase(),l=u(t);if(n===p){l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t));continue}l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let m=d.filter(e=>e.kayak_shimmed),h=d.filter(e=>!e.kayak_shimmed);h.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...m,...h]}async function yV({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function bV(e,t=H_.Hotels){if(!e?.length||e.length<3)return[];let n=_V((await yV({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:am.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:am.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:am.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>gV(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=mV(hV(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:am.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)vV(e);return n}function xV({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=bx(),{clickId:c}=Oy(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,cV.default)(u,a),[a]),{data:f,status:p}=px({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===G_.schedule_data&&n?.length&&n?.length===3?uV(l,n,t,s,c):n?.length&&n?.length===3&&(r?.length||0)>0&&(i?.length||0)>0&&r?.every(e=>e===`G4`)&&i?.every(e=>e===`G4`)?fV(l,n,i[0],t,s,c):bV(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function SV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function CV({value:e,onChange:t}){return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,q.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,q.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function wV({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=Cx(),[i,a]=(0,K.useState)(`same-location`),[o,s]=(0,K.useState)(t.toUpperCase()),[c,l]=(0,K.useState)(t.toUpperCase()),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`12:00`),[m,h]=(0,K.useState)(``),[g,_]=(0,K.useState)(`12:00`),v=(0,K.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,K.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=xV({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=xV({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[j,M]=(0,K.useState)(!1);(0,K.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,K.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,K.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,K.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,K.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,K.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,q.jsx)(CV,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(JB,{hideByDefault:!1})})]}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(qB,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(Vy,{}):(0,q.jsx)(SV,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(qB,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(Vy,{}):(0,q.jsx)(SV,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,q.jsx)(NL,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,q.jsx)(NL,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{h(e?e.toISOString().split(`T`)[0]??``:``)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,q.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(SV,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var TV=new Yb;function EV({children:e,props:t}){return(0,q.jsx)(Qb,{client:TV,children:(0,q.jsx)(Sx,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function DV(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(EV,{props:e,children:[(0,q.jsx)(`style`,{children:wx}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(hx,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(Vy,{}),children:(0,q.jsx)(wV,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var OV=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,ev,`id`],kV=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(OV)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await jv(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=Lv(n),s=window[rm],c=NS(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Ry(!0,{widget_runtime:`carfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${Ev}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`carfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&cv.test(r.primaryColor),s=r.secondaryColor!=null&&cv.test(r.secondaryColor);n.style.setProperty(`--primary`,o?dv(i):i),n.style.setProperty(`--secondary`,s?dv(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(DV,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,kV);function AV(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function jV(e){return Array.from(new Set([e,e.toLowerCase(),AV(e)]))}function MV(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function NV(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function PV({className:e,regMarkClassName:t}){return(0,q.jsxs)(`span`,{className:e,children:[`Fly`,(0,q.jsx)(`strong`,{children:`MyAirport`}),(0,q.jsx)(`sup`,{"aria-hidden":`true`,className:t||`aone:text-[0.5em] aone:ml-0.5 aone:leading-none`,children:`®`}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:` Registered`})]})}function FV(e,t=500){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}async function IV(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[bS]=n),r&&(a[xS]=r);let o=await fetch(i,{method:`POST`,headers:a,body:JSON.stringify(t)});if(!o.ok)throw Error(`Unable to get flight calendar`);let s=await o.json();return cm.parse(s)}function LV({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=bx(),{clickId:i}=Oy(),a=FV(t,n),o=typeof a.origin==`string`&&a.origin.trim().length>0,s=typeof a.destination==`string`&&a.destination.trim().length>0,c=!!a.startDate&&o&&s,l=a.startDate?Oh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=px({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??am.AIRPORT,a.arrivalLocationType??am.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=Oh(a.startDate,`yyyy-MM-dd`),n=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):void 0,o=sm.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??am.AIRPORT,arrivalLocationType:a.arrivalLocationType??am.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return IV(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function RV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var zV=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),BV=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),VV=s(((e,t)=>{var n=BV();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),HV=s(((e,t)=>{var n=VV(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),UV=s(((e,t)=>{var n=VV();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),WV=s(((e,t)=>{var n=VV();function r(e){return n(this.__data__,e)>-1}t.exports=r})),GV=s(((e,t)=>{var n=VV();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),KV=s(((e,t)=>{var n=zV(),r=HV(),i=UV(),a=WV(),o=GV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),qV=s(((e,t)=>{var n=KV();function r(){this.__data__=new n,this.size=0}t.exports=r})),JV=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),YV=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),XV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ZV=s(((e,t)=>{var n=iV(),r=YB(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),QV=s(((e,t)=>{t.exports=ZB()[`__core-js_shared__`]})),$V=s(((e,t)=>{var n=QV(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),eH=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),tH=s(((e,t)=>{var n=ZV(),r=$V(),i=YB(),a=eH(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),nH=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),rH=s(((e,t)=>{var n=tH(),r=nH();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),iH=s(((e,t)=>{t.exports=rH()(ZB(),`Map`)})),aH=s(((e,t)=>{t.exports=rH()(Object,`create`)})),oH=s(((e,t)=>{var n=aH();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),sH=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),cH=s(((e,t)=>{var n=aH(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),lH=s(((e,t)=>{var n=aH(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),uH=s(((e,t)=>{var n=aH(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),dH=s(((e,t)=>{var n=oH(),r=sH(),i=cH(),a=lH(),o=uH();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),fH=s(((e,t)=>{var n=dH(),r=KV(),i=iH();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),pH=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),mH=s(((e,t)=>{var n=pH();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),hH=s(((e,t)=>{var n=mH();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),gH=s(((e,t)=>{var n=mH();function r(e){return n(this,e).get(e)}t.exports=r})),_H=s(((e,t)=>{var n=mH();function r(e){return n(this,e).has(e)}t.exports=r})),vH=s(((e,t)=>{var n=mH();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),yH=s(((e,t)=>{var n=fH(),r=hH(),i=gH(),a=_H(),o=vH();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),bH=s(((e,t)=>{var n=KV(),r=iH(),i=yH(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),xH=s(((e,t)=>{var n=KV(),r=qV(),i=JV(),a=YV(),o=XV(),s=bH();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),SH=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),CH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),wH=s(((e,t)=>{var n=yH(),r=SH(),i=CH();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),TH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),EH=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),DH=s(((e,t)=>{var n=wH(),r=TH(),i=EH(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),OH=s(((e,t)=>{t.exports=ZB().Uint8Array})),kH=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),AH=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),jH=s(((e,t)=>{var n=tV(),r=OH(),i=BV(),a=DH(),o=kH(),s=AH(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),MH=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),NH=s(((e,t)=>{t.exports=Array.isArray})),PH=s(((e,t)=>{var n=MH(),r=NH();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),FH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),IH=s(((e,t)=>{function n(){return[]}t.exports=n})),LH=s(((e,t)=>{var n=FH(),r=IH(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),RH=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),zH=s(((e,t)=>{var n=iV(),r=aV(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),BH=s(((e,t)=>{var n=zH(),r=aV(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),VH=s(((e,t)=>{function n(){return!1}t.exports=n})),HH=s(((e,t)=>{var n=ZB(),r=VH(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),UH=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),WH=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),GH=s(((e,t)=>{var n=iV(),r=WH(),i=aV(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),KH=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),qH=s(((e,t)=>{var n=XB(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),JH=s(((e,t)=>{var n=GH(),r=KH(),i=qH(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),YH=s(((e,t)=>{var n=RH(),r=BH(),i=NH(),a=HH(),o=UH(),s=JH(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),XH=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),ZH=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),QH=s(((e,t)=>{t.exports=ZH()(Object.keys,Object)})),$H=s(((e,t)=>{var n=XH(),r=QH(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),eU=s(((e,t)=>{var n=ZV(),r=WH();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),tU=s(((e,t)=>{var n=YH(),r=$H(),i=eU();function a(e){return i(e)?n(e):r(e)}t.exports=a})),nU=s(((e,t)=>{var n=PH(),r=LH(),i=tU();function a(e){return n(e,i,r)}t.exports=a})),rU=s(((e,t)=>{var n=nU(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),iU=s(((e,t)=>{t.exports=rH()(ZB(),`DataView`)})),aU=s(((e,t)=>{t.exports=rH()(ZB(),`Promise`)})),oU=s(((e,t)=>{t.exports=rH()(ZB(),`Set`)})),sU=s(((e,t)=>{t.exports=rH()(ZB(),`WeakMap`)})),cU=s(((e,t)=>{var n=iU(),r=iH(),i=aU(),a=oU(),o=sU(),s=iV(),c=eH(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),lU=s(((e,t)=>{var n=xH(),r=DH(),i=jH(),a=rU(),o=cU(),s=NH(),c=HH(),l=JH(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),uU=s(((e,t)=>{var n=lU(),r=aV();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),dU=s(((e,t)=>{var n=xH(),r=uU(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),fU=s(((e,t)=>{var n=YB();function r(e){return e===e&&!n(e)}t.exports=r})),pU=s(((e,t)=>{var n=fU(),r=tU();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),mU=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),hU=s(((e,t)=>{var n=dU(),r=pU(),i=mU();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),gU=s(((e,t)=>{var n=NH(),r=oV(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),_U=s(((e,t)=>{var n=yH(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),vU=s(((e,t)=>{var n=_U(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),yU=s(((e,t)=>{var n=vU(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),bU=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),xU=s(((e,t)=>{var n=tV(),r=bU(),i=NH(),a=oV(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),SU=s(((e,t)=>{var n=xU();function r(e){return e==null?``:n(e)}t.exports=r})),CU=s(((e,t)=>{var n=NH(),r=gU(),i=yU(),a=SU();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),wU=s(((e,t)=>{var n=oV(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),TU=s(((e,t)=>{var n=CU(),r=wU();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),EU=s(((e,t)=>{var n=TU();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),DU=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),OU=s(((e,t)=>{var n=CU(),r=BH(),i=NH(),a=UH(),o=WH(),s=wU();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),kU=s(((e,t)=>{var n=DU(),r=OU();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),AU=s(((e,t)=>{var n=uU(),r=EU(),i=kU(),a=gU(),o=fU(),s=mU(),c=wU(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),jU=s(((e,t)=>{function n(e){return e}t.exports=n})),MU=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),NU=s(((e,t)=>{var n=TU();function r(e){return function(t){return n(t,e)}}t.exports=r})),PU=s(((e,t)=>{var n=MU(),r=NU(),i=gU(),a=wU();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),FU=s(((e,t)=>{var n=hU(),r=AU(),i=jU(),a=NH(),o=PU();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),IU=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),LU=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),RU=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),zU=s(((e,t)=>{var n=IU(),r=LU(),i=RU();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),BU=s(((e,t)=>{var n=zU();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),VU=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),HU=s(((e,t)=>{function n(){}t.exports=n})),UU=s(((e,t)=>{var n=oU(),r=HU(),i=AH();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),WU=s(((e,t)=>{var n=wH(),r=BU(),i=VU(),a=EH(),o=UU(),s=AH(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),GU=u(s(((e,t)=>{var n=FU(),r=WU();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),KU=new WeakMap,qU=new WeakMap,JU=`data-a1-flight-combobox-open`;function YU(e){let t=qU.get(e);t!=null&&(clearTimeout(t),qU.delete(e));let n=(KU.get(e)??0)+1;KU.set(e,n),e.setAttribute(JU,``)}function XU(e){let t=Math.max(0,(KU.get(e)??0)-1);if(t===0){KU.delete(e);let t=qU.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{qU.delete(e),e.removeAttribute(JU)},400);qU.set(e,n)}else KU.set(e,t)}function ZU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useId)(),[y,b]=(0,K.useState)({}),x=c??null,S=(0,K.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),b({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),C=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function w(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function T(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function E(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function D(e){if(e.type===`airport`){let n=e;return t?.length>1?E(n):n.country_code===`US`?`${n.city} (${E(n)})`:`${n.city}, ${n.country_code} (${E(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let O=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function k(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return O?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=Qz({environment:c?k(c):void 0,items:C,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?D(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:case Qz.stateChangeTypes.InputBlur:case Qz.stateChangeTypes.InputKeyDownEscape:return n;case Qz.stateChangeTypes.ItemMouseMove:return e;case Qz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case Qz.stateChangeTypes.MenuMouseLeave:case Qz.stateChangeTypes.ItemMouseMove:case Qz.stateChangeTypes.InputKeyDownArrowDown:case Qz.stateChangeTypes.InputKeyDownArrowUp:case Qz.stateChangeTypes.InputBlur:case Qz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),re=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(N&&C.length>0){let e=C.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return N&&C.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,N,C.length,u]),I=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ie=i?`${i}, search airports and places`:`Search airports and places`,ae=i?`${i} suggestions`:`Search results`,oe=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>D(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),se=[g,_,v].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]),(0,K.useLayoutEffect)(()=>{if(!N||C.length===0||!x)return;S();let e=f.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(S):null;return e&&t?.observe(e),window.addEventListener(`scroll`,S,!0),window.addEventListener(`resize`,S),()=>{t?.disconnect(),window.removeEventListener(`scroll`,S,!0),window.removeEventListener(`resize`,S)}},[N,C.length,x,S]);let ce=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!ce||!x))return YU(e),()=>XU(e)},[ce,c,x]);let le=!!s;function ue(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function de(){let e=ee({...j(),id:h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?m:void 0,"aria-activedescendant":N&&te!=null&&te>-1?`${m}-${te}`:void 0,"aria-label":ie,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];M(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!le&&t.length===0?a:``,...e,"aria-describedby":se,disabled:le})}let fe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":ae,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:C.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=te===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>ue(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${T(r)}, ${E(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:Tj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:E(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[T(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=te===n,a=V_(r.kayak?.apicode),o=w(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>ue(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:kj}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})});return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{ref:f,className:(0,J.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...A({selectedItem:e,index:n}),"aria-label":`Selected location: ${D(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:D(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${D(e)}`,onClick:t=>{t.stopPropagation(),!s&&M(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:oe}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:I}),de()]}),N&&C.length>0&&(x?(0,dC.createPortal)((0,q.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:y,children:fe}),x):(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:fe}))]})}var QU=100;function $U({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,placeholder:i,icon:a,disabled:o,shadowRoot:s}){let[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useRef)(null),h=(0,K.useMemo)(()=>e=>{m.current&&clearTimeout(m.current),e.trim()&&d(!0),m.current=setTimeout(()=>{n(e),d(!1),m.current=null},300)},[n]),g=(0,K.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+720*60*60*1e3),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(c?.trim()){let e=c.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,QU)},[c,e]),_=(0,K.useMemo)(()=>{let e={};return g.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[g]),v=e=>{let t=_[e];if(t===void 0||!f.current)return;let n=f.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},y=(0,K.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),b=(e,t)=>{e.preventDefault(),e.stopPropagation(),v(t)},x=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},S=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:C,getDropdownProps:w,removeSelectedItem:T}=SB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===SB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=Qz({environment:s?S(s):void 0,items:g,itemToString:e=>e?x(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:c,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case Qz.stateChangeTypes.InputKeyDownEnter:case Qz.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case Qz.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case Qz.stateChangeTypes.InputBlur:break}}}),j=!!o,M=t.length>0,N=(E||c.trim()&&g.length>0)&&g.length>10&&Object.keys(_).length>3,P=E||c.trim().length>0&&g.length>0;return(0,K.useEffect)(()=>{let e=s?.host;if(e instanceof HTMLElement&&P)return YU(e),()=>XU(e)},[P,s]),(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":o?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!o}),children:[a,t.map((e,t)=>(0,q.jsxs)(`span`,{...C({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:x(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!o||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!o&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!o}),"aria-label":`Remove ${x(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!o&&T(e)},children:`×`})]},t)),o&&(0,q.jsx)(`span`,{id:p,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=O({...w({preventKeyAction:E}),"aria-label":`autocomplete`,onKeyDown:e=>{if(e.key===`Backspace`&&!c&&t.length>0&&!o){let e=t[t.length-1];T(e)}}});return(0,q.jsx)(`input`,{className:`aone:outline-none aone:disabled:bg-transparent aone:text-base`,placeholder:j?``:i,...e,"aria-describedby":o?p:void 0,readOnly:M,disabled:j})})()]}),(E||c.trim()&&g.length>0)&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,q.jsxs)(`div`,{...D({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[N&&(0,q.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:y.map(e=>{let t=_[e]!==void 0;return(0,q.jsx)(`button`,{type:`button`,onClick:n=>t?b(n,e):void 0,className:(0,J.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,q.jsx)(`div`,{className:`aone:min-w-0`,ref:f,children:(0,q.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[u&&(0,q.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,q.jsx)(`span`,{children:`Searching airports...`})]})}),!u&&g.length>0&&g.map((e,n)=>{let r=e;return(0,q.jsxs)(`li`,{...k({item:e,index:n}),className:(0,J.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":A===e}),children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,q.jsx)(q.Fragment,{children:r.airlineCodes.length===1?(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(xL,{icon:xj,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,q.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,q.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-400 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!u&&g.length===0&&c.trim()&&(0,q.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,q.jsx)(xL,{icon:Tj,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,q.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:c})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function eW(...e){return tj(Ek(e))}function tW({className:e,...t}){return(0,q.jsx)(GS,{role:`status`,"aria-label":`Loading`,className:eW(`aone:size-4 aone:animate-spin`,e),...t})}var nW=K.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,K.useRef)(null);return(0,K.useImperativeHandle)(o,()=>s.current),(0,K.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,q.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,q.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,q.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});nW.displayName=`TopLayerDialog`;function rW({...e}){return(0,q.jsx)(BT,{"data-slot":`dialog`,...e})}function iW({...e}){return(0,q.jsx)(KT,{"data-slot":`dialog-portal`,...e})}function aW({className:e,...t}){return(0,q.jsx)(JT,{"data-slot":`dialog-overlay`,className:nj(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function oW({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,q.jsxs)(iW,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,q.jsx)(aW,{className:i}),(0,q.jsxs)(QT,{"data-slot":`dialog-content`,className:nj(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,q.jsxs)(sE,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,q.jsx)(JS,{}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function sW({className:e,...t}){return(0,q.jsx)(rE,{"data-slot":`dialog-title`,className:nj(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function cW({...e}){return(0,q.jsx)(bk,{"data-slot":`popover`,...e})}function lW({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(Ck,{container:r,children:(0,q.jsx)(wk,{"data-slot":`popover-content`,align:t,sideOffset:n,className:nj(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function uW({...e}){return(0,q.jsx)(xk,{"data-slot":`popover-anchor`,...e})}var dW=768;function fW(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<dW);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${dW-1}px)`),n=()=>{t(window.innerWidth<dW)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var pW=`aone:text-[#16A34A]`,mW=`aone:text-[#5895F7]`;function hW({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=Nm(new Date),d=l||u,f=t?Lm(e,t):!1,p=t&&n?Mh(e,Nm(t))&&Nh(e,n):!1,m=n?Lm(e,n):!1,h=Nh(e,d),g=s&&!f&&!m?Lm(e,s):!1,_=c?.filter(t=>Lm(Nm(e),Nm(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,q.jsx)(`span`,{children:e.getDate()}),y===0&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[pW]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[mW]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,q.jsx)(`div`,{className:(0,J.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function gW({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,K.useState)(Bm(n)),m=Oh(f,`MMMM yyyy`),h=Om(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Bm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Bm(t)))},[t]),(0,K.useEffect)(()=>{let e=Om(f);s(e,Cm(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>Cm(h,t));return(0,q.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,q.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Kg(f,{months:1})),"aria-label":`Previous month, go to ${Oh(Kg(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(pj,{})}),(0,q.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Tm(f,{months:1})),"aria-label":`Next month, go to ${Oh(Tm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(mj,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:tv.map((e,t)=>(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=Oh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(hW,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function _W({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(xL,{icon:Dj,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var vW=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return zm(c)?Nm(c):null},yW=/^\d{2}\/\d{2}\/\d{2}$/,bW=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),xW=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},SW=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},CW=e=>{if(!yW.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&bW(Nm(t))===e?Nm(t):null};function wW({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),y=(0,K.useRef)(null),b=(0,K.useRef)(0),[x,S]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>S(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(``),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(null),[j,M]=(0,K.useState)(p||null),[N,P]=(0,K.useState)(m||null),[ee,F]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(p||null),[re,I]=(0,K.useState)(!1),[ie,ae]=(0,K.useState)(!1),[oe]=(0,K.useState)(()=>p||new Date),se=(0,K.useRef)(n),ce=()=>Date.now()<b.current,le=()=>{ce()||F(!0)},ue=()=>{b.current=Date.now()+250,F(!1)},de=e=>{if(e){le();return}ue()};(0,K.useEffect)(()=>{se.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{P(null),E(``),A(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!j&&p&&M(p),!N&&m&&P(m)})},[p,m,j,N]);let fe=Nm(new Date),pe=wm(fe,6),me=e=>{w(e);let t=CW(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(Nh(t,fe)){O(`Date cannot be in the past`),M(null);return}if(Mh(t,pe)){O(`Date must be within 6 months`),M(null);return}if(g&&Nh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&Nh(N,t)&&(P(null),E(``))},he=e=>{if(i)return;E(e);let t=CW(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(Nh(t,fe)){A(`Date cannot be in the past`),P(null);return}if(Mh(t,pe)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(Nh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&Nh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},ge=()=>me(C),_e=()=>he(T),ve=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(Lm(e,j)&&Lm(e,N)?(M(e),P(null)):Nh(e,N)&&Nh(e,Cm(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ye=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),se.current(null,null)};(0,K.useEffect)(()=>{se.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(bW(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(bW(N)),A(null)):k||E(``)})},[N]);let L={};o&&(L[`--color-primary`]=o),s&&(L[`--color-secondary`]=s);let be=fW(),R=(0,K.useId)(),xe=`${R}-description`,Se=(0,q.jsxs)(`div`,{ref:y,onClick:le,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ee,"aone:border-2 aone:border-gray-200":!ee}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:C,"aria-label":c,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!D}),onChange:e=>{let t=xW(e.target.value,C);w(t),O(null),ne(vW(t)),se.current(null,N)},onFocus:()=>{I(!0),le()},onBlur:e=>{let t=SW(e.target.value);w(t),me(t),I(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ge(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(_W,{message:D})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(fj,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:T,"aria-label":l,"aria-invalid":k?`true`:void 0,placeholder:ie?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!k}),onChange:e=>{let t=xW(e.target.value,T);E(t),A(null),ne(vW(t)),se.current(j,null)},onFocus:()=>{ae(!0),le()},onBlur:e=>{let t=SW(e.target.value);E(t),he(t),ae(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_e(),e.target.blur())}}),k&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(_W,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:L,role:`group`,"aria-label":`Date range picker`,"aria-describedby":xe,children:[be?(0,q.jsxs)(rW,{open:ee,onOpenChange:de,children:[Se,(0,q.jsxs)(nW,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:de,"aria-labelledby":R,"aria-describedby":void 0,children:[(0,q.jsx)(sW,{id:R,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(gW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ye,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ue,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(cW,{open:ee,onOpenChange:de,children:[(0,q.jsx)(uW,{asChild:!0,children:Se}),(0,q.jsxs)(lW,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&y.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:x,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(gW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ye,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:ue,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:xe,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}var TW=W({apiDomain:V(),locationId:V().optional(),origin:V().nullable().optional(),destination:V().nullable().optional(),destinations:V().optional(),primaryColor:V().optional(),secondaryColor:V().optional(),airlines:V().nullable().optional(),providers:V().nullable().optional(),workerUrl:V().optional(),theme:zf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:Ap(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:V().optional(),consentDataSharing:U().optional(),consentAnalytics:U().optional(),consentAdvertising:U().optional(),consentFunctional:U().optional(),onOriginChange:Ap(e=>typeof e==`function`).optional(),onDestinationChange:Ap(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:zf(q_).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:zf(P_).optional()}),EW=new Yb;function DW(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function OW({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,departureDateLabel:c=`Departure Date`,returnDateLabel:l=`Return Date`,workerUrl:u=`https://worker-v2.flymyairport.com`,theme:d=`light`,channel:f,defaultNearbyDatesForLowerFares:p,shadowRoot:m,subscribingAirport:h,consentDataSharing:g=!0,consentAnalytics:_=!0,consentAdvertising:v=!0,consentFunctional:y=!0,onOriginChange:b=()=>{},onDestinationChange:x=()=>{},fmaDomain:S=`https://flymyairport.com`,hideBranding:C=!1,hideCarButton:w=!1,disableOrigins:T=!0,disableDestinations:E=!0,autocompleteType:D=G_.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=Oy(),j=(0,K.useMemo)(()=>{let e=DW(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=DW(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===am.METRO&&N?.iata_code),F=!!(P?.itemType===am.METRO&&P?.iata_code);if(!R_.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let te=t?.toLocaleUpperCase(),ne=n?.toLocaleUpperCase(),re=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),I=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i===r&&i?.length===2&&r?.length===2,[ae,oe]=(0,K.useState)(!1),se=ae?!!ne:!!te,ce=ae?!!te:!!ne,[le,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),pe=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),me=e=>D===G_.schedule_data?(0,q.jsx)($U,{shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,q.jsx)(ZU,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:he,status:ge,setQuery:_e}=xV({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:I,airlinesArr:re,autocompleteType:D}),ve=(0,K.useMemo)(()=>D===G_.schedule_data?he?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,GU.default)(he?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:am.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[he,D]),{data:ye,status:L,setQuery:be}=xV({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:I||[],airlinesArr:re||[],autocompleteType:D}),R=(0,K.useMemo)(()=>D===G_.schedule_data?ye?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,GU.default)(ye?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:am.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ye,D]),xe=(0,K.useMemo)(()=>le?Im([le,new Date]):null,[le]),Se=(0,K.useMemo)(()=>O.startDate?Cm(O.startDate,1):null,[O.startDate]),Ce=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:xe||void 0,endDate:de||void 0,departureLocationType:ee?am.METRO:am.AIRPORT,arrivalLocationType:F?am.METRO:am.AIRPORT}),[j,M,xe,de,ee,F]),we=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Se||void 0,endDate:de||void 0,departureLocationType:F?am.METRO:am.AIRPORT,arrivalLocationType:ee?am.METRO:am.AIRPORT}),[M,j,Se,de,F,ee]),{data:Te,status:Ee}=LV({apiDomain:e,params:Ce}),{data:De,status:Oe}=LV({apiDomain:e,params:we});(0,K.useEffect)(()=>{if(te&&yV({query:te,searchType:H_.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===te.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?am.METRO:am.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>yV({query:e,searchType:H_.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?am.METRO:am.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:E}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&k(e=>({...e,destinations:t}))})}},[te,ne,T,E]);let ke=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Kv({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[O,t,j,M]),Ae=(0,K.useCallback)((e,t)=>{ue(t=>t&&t.getTime()===e.getTime()?t:e),fe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),je=()=>{let{origins:e,destinations:t}=O;oe(e=>!e),k({...O,origins:t,destinations:e})},Me=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=j,a=M,s=O.startDate,c=O.endDate,l=O.oneWay;if(!i||!a||!s||!c&&!l)throw Error(`All fields must be filled out`);let d=s.toISOString().split(`T`)[0],p=c?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!ie){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=sv({worker_domain:u,airport_iata:h||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:d||``,returnDate:p||``,cabin:m||void 0,pax:b||void 0,filterState:{providers:I?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:U_({airport:h||t||i,channel:f||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:g,consent_analytics:_,consent_advertising:v,consent_functional:y,departure_location_type:ee?am.METRO:am.AIRPORT,arrival_location_type:F?am.METRO:am.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Kv({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:s?.toISOString(),return_date:O.endDate?.toISOString()}}),window.open(x,`_blank`)},Ne=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:nv.enum.economy},{display:`Premium Economy`,value:nv.enum.premium},{display:`Business`,value:nv.enum.business},{display:`First`,value:nv.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:rv.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),z=(0,q.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Ie.map((e,t)=>(0,q.jsx)(K.Fragment,{children:(0,q.jsx)(`a`,{href:t>0?`${S}/${Le}/${h}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,J.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t))}),Re=(0,q.jsx)(JB,{hideByDefault:!0}),ze=(0,q.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start aone:text-[35px] aone:text-foreground`,children:(0,q.jsx)(PV,{regMarkClassName:`aone:text-[16px] aone:ml-0.5 aone:leading-none`})})}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":S!==``}),children:z}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:z}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:re&&re.length>0?null:(0,q.jsx)(`div`,{children:Re})})]});return(0,q.jsxs)(Qb,{client:EW,children:[(0,q.jsx)(`div`,{"data-mode":d,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,q.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:Me,children:[!C&&ze,(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,q.jsx)(`select`,{"aria-label":`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{k(t=>({...t,oneWay:e.target.value===`one-way`}))},children:Ne.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`pax`,"aria-label":`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Fe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`cabin`,"aria-label":`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Pe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!ie&&(0,q.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),`\xA0\xA0Show nearby dates for lower fares`]})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!O.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":O.oneWay}),children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-center aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:w-full aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:me({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:ge===`pending`?(0,q.jsx)(tW,{}):(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:xj,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:se,items:ve||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Kv({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,origins:n||[]}))}})}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:je,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(RV,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:me({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:L===`pending`?(0,q.jsx)(tW,{}):(0,q.jsx)(xL,{className:`aone:w-6 aone:h-6`,icon:yj,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:ce,items:R||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Kv({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,destinations:n||[]}))}})})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,q.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,q.jsx)(wW,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:ke,onMonthViewChange:Ae,oneWay:O.oneWay,shadowRoot:m,onlyDirects:I&&re&&I?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Te:De,flightCalendarStatus:!O.startDate||O.oneWay?Ee:Oe})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ie&&(0,q.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),(0,q.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,q.jsxs)(`button`,{"aria-label":pe?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!pe,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{pe||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${pe?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,q.jsx)(SV,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&Re})]})}var kW=Object.keys(TW.shape);function AW(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function jW(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function MW(e,t){return jV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``)}function NW(e,t,n){let r={...n},i=MW(e,`origin`),a=MW(e,`destination`)??MW(e,`destinations`);AW(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of kW){let n=jV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return AW(r),a&&!i?delete r.origin:r.origin==null&&!jW(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase()),typeof r.defaultNearbyDatesForLowerFares==`string`&&(r.defaultNearbyDatesForLowerFares=MV(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=MV(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=MV(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=MV(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=MV(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=MV(r.hideCarButton,!1)),r.consentAnalytics===void 0&&(r.consentAnalytics=!0),r.consentAdvertising===void 0&&(r.consentAdvertising=!0),r.consentFunctional===void 0&&(r.consentFunctional=!0),r.consentDataSharing===void 0&&(r.consentDataSharing=!0),r}function PW(e,t,n,r){return{...NW(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var FW=new Yb;function IW(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(Qb,{client:FW,children:(0,q.jsxs)(yx,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:wx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(OW,{...n})]})})}function LW(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var RW=Object.keys(TW.shape),zW=[...new Set([...RW.flatMap(e=>jV(e)),`borderradius`,`border-radius`,`theme`,ev,`id`])],BW=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(zW)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.background=`none`,this.style.backgroundColor=`transparent`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await jv(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=zv(n),s=window[rm],c=PW(this,`https://flymyairport.vercel.app`,s,o),l=LW(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Ry(!0,{widget_runtime:`airfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${Ev}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`airfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&cv.test(r.primaryColor),a=r.secondaryColor!=null&&cv.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?dv(o):o,l=a?dv(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,NV(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(IW,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,BW);var VW=new Map,HW=3600*1e3,UW=3600*12*1e3;function WW(){let e=Date.now(),t=e-HW,n=e+UW;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function GW(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:WW()}function KW(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function qW(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function JW(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:YW(n)}function YW(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=KW(e.airlines);if(!t)return null;let n=qW(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function XW(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function ZW(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function QW(e,t){let n=XW();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=GW(t),i=ZW(e,r),a=VW.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=JW(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{VW.delete(i)}})();return VW.set(i,u),u}var $W={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`};function eG(e){let t=e?.trim();return t&&t.length>0?t:void 0}function tG(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function nG(e){let t={...$W};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:tG(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:tG(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:tG(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:tG(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:tG(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function rG(e,t={}){let n=e?.variables,r=eG(t.primaryColor),i=eG(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...$W});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...$W});let s=o.theme;return a(nG(s))}function iG(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var aG={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},oG={prefix:`fas`,iconName:`bell`,icon:[448,512,[128276,61602],`f0f3`,`M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z`]},sG={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]};function cG(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function lG(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function uG(e){let{gate:t,terminal:n}=cG(e);return t.length>0||n.length>0}function dG(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=lG(r,n),o=lG(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return uG(r)?r:o&&uG(i)?i:r;if(!a&&o&&uG(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(uG(r))return r;if(uG(i))return i}return r??i}if(e.direction===`arrival`){if(o)return uG(i)?i:a&&uG(r)?r:i;if(!o&&a&&uG(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(uG(i))return i;if(uG(r))return r}return i??r}}function fG(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var pG={kind:`on-time`};function mG(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/60),r=t%60,i=[];return n>0&&i.push(`${n} ${n===1?`hour`:`hours`}`),r>0&&i.push(`${r} ${r===1?`minute`:`minutes`}`),i.length===0?`0 minutes`:i.join(` `)}function hG(e){return e.departureGatePunctuality??pG}function gG(e){return e.arrivalGatePunctuality??pG}function _G(e){if(e.kind===`on-time`)return`On-time`;let t=mG(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function vG(e){let t=e.direction===`departure`?hG(e):gG(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:_G(t),tone:n}}function yG(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function bG(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function xG(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function SG(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function CG(e,t){if(!e)return`—`;try{let n=fG(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(xG(n,r)===xG(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return SG(n,r)!==SG(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}var wG=`https://flymyairport.com`,TG={display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,flexShrink:0,width:72,maxWidth:72,minWidth:0,boxSizing:`border-box`,textDecoration:`none`,color:`inherit`};function EG(e){return e===`arrivals`?`arrival`:`departure`}function DG(e,t,n){let r=S_(e,EG(n));return r?T_(wG,t,r):null}function OG(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}function kG(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function AG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function jG(e){let t=AG(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function MG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function NG(e,t){let n=MG(e);return n&&t[n]?.name?.trim()||null}function PG(e,t){let n=MG(e);return n&&t[n]?.iconUrl?.trim()||null}function FG(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function IG(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function LG(e,t){let n=dG(e,t);return{gate:IG(n?.gate)||`—`,terminal:IG(n?.terminal)||`—`}}function RG(e,t){return IG(dG(e,t)?.terminal).length>0}function zG(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function BG(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function VG(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function HG(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function UG(e,t,n){if(e.displayTime){let n=yG(e.displayTime.punctuality,t);return{timeLabel:HG(e.displayTime.label)??e.displayTime.label,scheduledLabel:HG(e.displayTime.scheduledLabel),statusText:e.displayTime.statusLabel,punctualityColor:n}}let r=vG(e),i=CG(BG(e),n),a=CG(VG(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:yG(r.tone,t)}:{timeLabel:CG(zG(e),n),statusText:r.text,punctualityColor:yG(r.tone,t)}}function WG(e,t){let n=e?.trim().toUpperCase()??``,r=t.accentTextColor,i=t.mutedTextColor,a=t.primaryTextColor;switch(n){case`CANCELLED`:return{label:`Cancelled`,dotStyle:{backgroundColor:`#fb923c`},textStyle:{color:`#fdba74`}};case`DIVERTED`:case`REDIRECTED`:return{label:n===`DIVERTED`?`Diverted`:`Redirected`,dotStyle:{backgroundColor:`#fbbf24`},textStyle:{color:`#fde68a`}};case`LANDED`:return{label:`Landed`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`ACTIVE`:return{label:`In Flight`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`On-time`,dotStyle:{backgroundColor:r},textStyle:{color:r}};case`UNKNOWN`:return{label:`Unknown`,dotStyle:{backgroundColor:i},textStyle:{color:i}};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,dotStyle:{backgroundColor:r},textStyle:{color:r}}:{label:`—`,dotStyle:{backgroundColor:i},textStyle:{color:i}}}}function GG(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function KG(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function qG(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function JG(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function YG({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=qG(s,i),d=r===null?null:JG(r,l);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(xL,{icon:t===`departure`?sG:aG,style:{width:22,height:22,color:`#ffffff`}})}),(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,q.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:n.accentTextColor,lineHeight:1},children:u}),d===null?null:(0,q.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:iG(n.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,q.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function XG({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=iG(r.primaryTextColor),s=(0,K.useRef)(null),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width,n=f.current,r=n;n?t>=784&&(r=!1):t<760&&(r=!0),r!==n&&(f.current=r,d(r))};if(t(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,t),()=>globalThis.removeEventListener(`resize`,t);let n=new ResizeObserver(()=>{t()});return n.observe(e),()=>n.disconnect()},[]);let p={width:`100%`,maxWidth:`100%`,minWidth:0,paddingLeft:u?12:20,paddingRight:u?12:20,paddingBottom:16,boxSizing:`border-box`},m={display:`grid`,gridTemplateColumns:u?`34px minmax(0, 1fr)`:`38px minmax(0, 1.35fr) minmax(0, 2fr) minmax(0, auto)`,alignItems:`center`,gap:u?`14px 10px`:18,width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`,overflow:`hidden`,padding:u?`14px`:`16px 18px`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:o,boxShadow:`none`,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`},h=a===`arrivals`,g=e.some(e=>RG(e,i)),_=+!!g+1+ +!!h,v=a===`arrivals`?`Arrival`:`Departs`,y={color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`};return(0,q.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`},children:(0,q.jsx)(`div`,{style:p,children:e.length===0?(0,q.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:e.map(e=>{let o=e.flightId,s=WG(e.status,r),d=NG(e,t),f=PG(e,t),p=e.callsign?.trim()??``,b=UG(e,r,kG(i,n)),x=LG(e,i),S=String(s.dotStyle.backgroundColor??r.accentTextColor),C=c===o,w=DG(e,i,a),T={part:`fids-board-row-notifications`,"aria-label":`Sign up for flight alerts on FlyMyAirport`,title:`Sign up for flight alerts on FlyMyAirport`,style:{...TG,...w?{cursor:`pointer`}:{cursor:`default`}}},E=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`},children:`Alerts`}),(0,q.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:r.headerIconTileBackgroundColor},children:(0,q.jsx)(`span`,{"aria-label":`Flight alerts`,title:`Flight alerts`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24},children:(0,q.jsx)(xL,{icon:oG,style:{width:14,height:14}})})})]});return(0,q.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>l(o),onMouseLeave:()=>l(null),onFocus:()=>l(o),onBlur:()=>l(null),style:{...m,...C?{borderColor:r.accentTextColor,boxShadow:`0 6px 14px rgba(15, 23, 42, 0.06)`,transform:`translateY(-1px)`}:{}},children:[(0,q.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!f,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:34,height:34,overflow:`hidden`,...u?{gridColumn:1,gridRow:1,alignSelf:`center`}:{}},children:f?(0,q.jsx)(`img`,{src:f,alt:d?`${d} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),(0,q.jsxs)(`div`,{style:{minWidth:0,color:r.primaryTextColor,...u?{gridColumn:`2 / -1`,gridRow:1,alignSelf:`center`,display:`flex`,flexDirection:`column`,justifyContent:`center`}:{}},children:[(0,q.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{fontSize:`1.05rem`,fontWeight:700,lineHeight:1.15,overflowWrap:`break-word`},children:__(e,n)}),(0,q.jsxs)(`div`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,marginTop:4,fontSize:`0.78rem`,lineHeight:1.2,color:r.mutedTextColor},children:[d?(0,q.jsx)(`span`,{style:{fontWeight:700},children:d}):null,(0,q.jsx)(`span`,{className:`aone:tabular-nums`,children:jG(e)}),p?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,children:p}):null]})]}),(0,q.jsxs)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,gridColumn:u?`1 / -1`:void 0,gridRow:u?2:void 0,gridTemplateColumns:`repeat(${_+1}, minmax(0, 1fr))`,justifyItems:u?`center`:void 0,gap:12,minWidth:0},children:[(0,q.jsx)(QG,{label:v,scheduledLabel:b.scheduledLabel,timeLabel:b.timeLabel,theme:r,labelStyle:y}),g?(0,q.jsx)(ZG,{label:`Terminal`,value:x.terminal,theme:r}):null,(0,q.jsx)(ZG,{label:`Gate`,value:x.gate,theme:r}),h?(0,q.jsx)(ZG,{label:`Baggage`,value:FG(e),theme:r}):null]}),(0,q.jsxs)(`div`,{style:{display:`grid`,gridColumn:u?`1 / -1`:void 0,gridRow:u?3:void 0,gridTemplateColumns:`minmax(0, 1fr) auto`,alignItems:`center`,gap:12,minWidth:0,maxWidth:`100%`,width:`100%`,boxSizing:`border-box`},children:[(0,q.jsx)(`div`,{part:`fids-board-row-status`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:0,maxWidth:`100%`,minHeight:28,padding:`5px 14px`,borderRadius:999,color:GG(S),backgroundColor:S,fontSize:`0.75rem`,fontWeight:800,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:s.label}),w?(0,q.jsx)(`a`,{...T,href:w,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:E}):(0,q.jsx)(`span`,{...T,children:E})]})]},o)})})})})}function ZG({label:e,value:t,theme:n}){return(0,q.jsxs)(`div`,{style:{minWidth:0},children:[(0,q.jsx)(`div`,{style:{marginBottom:6,color:n.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},children:e}),(0,q.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 9px`,borderRadius:6,backgroundColor:iG(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`},children:t})]})}function QG({label:e,scheduledLabel:t,timeLabel:n,theme:r,labelStyle:i}){return(0,q.jsxs)(`div`,{part:`fids-board-row-time`,style:{minWidth:0},children:[(0,q.jsx)(`div`,{part:`fids-board-row-time-label`,style:{...i,marginBottom:6},children:e}),(0,q.jsxs)(`div`,{className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1},children:[t?(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.9rem`,fontWeight:500,textDecorationLine:`line-through`},children:t}):null,(0,q.jsx)(`span`,{children:n})]})]})}function $G({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel:l}){return(0,q.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(YG,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,q.jsx)(XG,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function eK({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=$W,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,q.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,q.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:iG(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=e.airlines,u=e.airports??{},d=KG(e.iata,u),f=bG(d);return(0,q.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,q.jsx)($G,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,q.jsx)($G,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,OG(e.asOfUtc),` · `,e.iata]})]})}function tK(e){return(0,q.jsx)(eK,{...e})}var nK=[`consent-analytics`,`consent-advertising`,`consent-functional`,ev,`id`],rK=12e4,iK=3e4;function aK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function oK(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:aK(n.consentAnalytics),consentAdvertising:aK(n.consentAdvertising),consentFunctional:aK(n.consentFunctional)}}var sK=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=$W;_publicConsentAnalytics;static get observedAttributes(){return Array.from(nK)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.width=`100%`,this.style.maxWidth=`100%`,this.style.minWidth=`0`,this.style.boxSizing=`border-box`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=rK+Math.floor(Math.random()*iK),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=wv(this);if(!e||e!==this._activeInstanceId)return;let t=await QW(e);!this.isConnected||e!==this._activeInstanceId||(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=wv(this),t=Av(),n=XW(),r=window[rm],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=rG(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await jv(e);o=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=rG(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=rG(null,i);if(!this.isConnected)return;let c=oK(a);this._publicConsentAnalytics=c.consentAnalytics;let l=Sv(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Ry(!0,{widget_runtime:`fids-board`,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${Ev}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await QW(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,zy(!0,{widget_runtime:`fids-board`,public_config_unavailable:a===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=wx,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.style.display=`block`,t.style.width=`100%`,t.style.maxWidth=`100%`,t.style.minWidth=`0`,t.style.boxSizing=`border-box`,t.parentNode!==e&&e.appendChild(t);let n=Sv(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=yv.createRoot(t)).render((0,q.jsx)(tK,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,sK);var cK=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function lK(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function uK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function dK(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function fK(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function pK(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function mK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function hK(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function gK(e){let t=e?.trim().toLowerCase();if(t)return cK.includes(t)?t:void 0}function _K(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=lK(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=lK(e.iata)??lK(e.sourceIata);n&&(t.iata=n);let i=uK(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=uK(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=uK(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=mK(e.label);s&&(t.label=s);let c=uK(e.enableCars);c!==void 0&&(t.enableCars=c);let l=uK(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=uK(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=dK(e.position);d&&(t.position=d);let f=fK(e.edgeStyle)??fK(e[`edge-style`]);f&&(t.edgeStyle=f);let p=pK(e.primaryColor);p&&(t.primaryColor=p);let m=pK(e.secondaryColor);m&&(t.secondaryColor=m);let h=mK(e.airfareSearchWidgetInstanceId)??mK(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=hK(e.primaryButtonContent)??hK(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=hK(e.secondaryButtonContent)??hK(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=gK(e.primaryIcon)??gK(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function vK(e){return lK(e.sourceIataAttribute)??lK(e.publicIata)??lK(e.globalIata??void 0)}function yK(e){return uK(e.consentAttribute??void 0)??e.publicConsent??!0}function bK(e){return mK(e.labelAttribute)??mK(e.publicLabel)??`Plan your trip`}function xK(e){return uK(e.rawAttribute??void 0)??e.publicToggle??!0}function SK(e){return mK(e.rawAttribute)??mK(e.publicAirfareSearchWidgetInstanceId)}function CK(e){return dK(e.rawAttribute)??e.publicPosition??`bottom-right`}function wK(e){return fK(e.rawAttribute)??e.publicEdgeStyle??`floating`}function TK(e){return hK(e.rawAttribute)??e.publicMode??`both`}function EK(e){return gK(e.rawAttribute)??e.publicIcon??`plane`}function DK(e){return pK(e.primaryColorAttribute)??pK(e.publicPrimaryColor)??pK(e.globalPrimaryColor)??`#b91c1c`}function OK(e){return pK(e.secondaryColorAttribute)??pK(e.publicSecondaryColor)??pK(e.globalSecondaryColor)??`#b91c1c`}function kK(e,t){let n=lK(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function AK(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var jK=kk(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function MK({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?$S:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:nj(jK({variant:t,size:n,className:e})),...i})}var NK={plane:Tj,"plane-departure":xj,compass:Oj,"earth-americas":Sj,"location-dot":kj,suitcase:Cj};function PK({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1),S=(0,K.useCallback)(()=>{y(!1),AK(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,K.useCallback)(()=>{y(!0),AK(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,K.useCallback)(()=>{v?S():C()},[S,v,C]);(0,K.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(AK(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),AK(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:WS},{vertical:`packages`,label:`Packages`,Icon:qS},{vertical:`hotels`,label:`Hotels`,Icon:US}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,re=(0,K.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),I=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},ie=(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,q.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:re,children:[v?(0,q.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(MK,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,q.jsx)(KS,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,q.jsx)(MK,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,q.jsxs)(`a`,{"aria-label":j?void 0:n,href:kK(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,q.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,q.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${I(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,q.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,q.jsxs)(MK,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,q.jsx)(xL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:wj}):(0,q.jsx)(xL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:NK[h]}):null,k?(0,q.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,q.jsx)(rW,{onOpenChange:n=>{x(n),n||AK(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,q.jsxs)(oW,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,q.jsx)(sW,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,q.jsx)(`div`,{className:`aone:p-4`,children:e?(0,K.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,q.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,q.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:ie}):ie}function FK({shadowRoot:e,userStyleBlock:t,...n}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{children:wx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(PK,{dialogPortalContainer:e,...n})]})}var IK=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,ev,`id`,`data-preview-contained`],LK=`--fyf-fab-shell-bottom`,RK=`--fyf-fab-shell-right`,zK=`fma-fab`;function BK(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function VK(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(zK).join(`:host`)}var HK=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(IK)}attributeChangedCallback(e,t,n){t===n||!this.isConnected||this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(ev)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=Av(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await jv(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=BK(i?.shellBottom),o=BK(i?.shellRight);a?this.style.setProperty(LK,a):this.style.removeProperty(LK),o?this.style.setProperty(RK,o):this.style.removeProperty(RK);let s=window[rm],c=_K(n),l=VK(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=vK({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=yK({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=yK({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=yK({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=bK({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=xK({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=xK({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=xK({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=CK({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=wK({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=DK({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=OK({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=SK({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=TK({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=TK({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=EK({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${Ev}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${Ev}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=yv.createRoot(n)).render((0,q.jsx)(FK,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};return customElements.get(`fma-fab`)||customElements.define(`fma-fab`,HK),e.AirfareContent=MS,e.AirfareSearch=BW,e.CarfareSearch=kV,e.FidsBoardElement=sK,e.FlyMyAirportFabElement=HK,e})({});
|