(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,l,d,p,o,u,m,s,g,c,A=a.getSpan(),T=[],$=[],h=A.next(r.dates).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s*[\n]+($<firstDate>.*)\s-\s($<secondDate>.*)/,r.dates)),C=h?h.$firstDate:null;A.next(r.itNum).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s*[\n]+(.*)/,r.itNum),1);i=r.cancelled.test(e.plain)?"cancelled":"confirmed",h=A.next(r.confirmation).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s*[\n]+($<confirm>.*)\s*\(($<airlineName>.*)\)/,r.confirmation)),n=h?h.$confirm:null,l=h?h.airlineName:null;var f=(""+A.next(r.ticket).parentAnyTag("td").tagContents()).split("\n").filter(function(e){return e.length>0}).map(function(e){return e.replace(/(\d+)\s*\((.*)\)/,"$1")}),v=(""+A.next(r.ticket).parentAnyTag("td").tagContents()).split("\n").filter(function(e){return e.length>0}).map(function(e){return e.replace(/(\d+)\s*\((.*)\)/,"$2")});h=a.getSpan().next(r.departure).parentAnyTag("td").nextAnyTag("td").tagContents().innerCapture(/[a-zA-Z ]+($<flightNumber>\d+)\s(?:\1.*)?/);for(var b=1;b<f.length;b++)T.push({name:v[b],ticketNumber:f[b]});var x=A.next(r.dep).parentAnyTag("table"),y=A.next(r.ari).parentAnyTag("table"),N=function(e,t){for(var n,i=e.allInnerTagsFiltered("table8"),l=a.getDetachedSpan(""+A.next(t).parentAnyTag("table").innerDate()),c=!1,T=0;T<i.length;T+=2){var h=A.next(t).parentAnyTag("table").allInnerTagsFiltered("table8")[T].innerCapture(/($<dep>[a-zA-Z ]+)\s\(($<depCode>\w+)\)\s[\n]+\s*\[.*\]\s($<time>\d?\d:\d\d(?:am|pm)?)($<day>\s\+\d\s\w+)?/i);o=h?h.$dep:null,p=h?h.$time:null,u=h?h.$depCode:null,p=combineDateAndTime(l,p);var C=A.next(t).parentAnyTag("table").allInnerTagsFiltered("table8")[T+1].innerCapture(/($<dep>[a-zA-Z ]+)\s\(($<depCode>\w+)\)\s[\n]+\s*\[.*\]\s($<time>\d?\d:\d\d(?:am|pm)?)($<day>\s\+\d\s\w+)?/i);s=C?C.$dep:null,m=C?C.$time:null,g=C?C.$depCode:null;(C?C.$day:null).isNullSpan_?m=combineDateAndTime(l,m):(l=modifyDate(l,1),m=combineDateAndTime(l,m)),T>1&&(c=!0),n=c?A.next(o).next(o).next(o):A.next(o);var f=n.parentAnyTag("td").previousTag("td6").tagContents().innerCapture(regExpFormatted(/[a-zA-Z ]+($<flightNumber>\d+)\s?(?:\1.*)?/,r.op));d=f?f.$flightNumber:null,ASSERT(o,p,s,m)&&$.push({departureAirport:o,departureCode:u,departureTime:p,arrivalTime:m,arrivalAirport:s,flightNumber:d,arrivalCode:g})}};if(N(x,r.dep),N(y,r.ari),0===$.length)for(var F=A.next(r.departure).nextTag("table7"),z=A.next(r.departure).nextTag("table7").allInnerTagsFiltered("td8");!F.isNullSpan_&&0!==z.length;){h=z[0].innerCapture(/($<airlineName>[a-zA-Z\s]+)\s\(($<airlineCode>[\d\w]+)\)/),o=h?h.$airlineName:null,u=h?h.$airlineCode:null,p=z[1];var D=F.previousAnyTag("td").tagContents().innerCapture(regExpFormatted(/[a-zA-Z ]+($<flightNumber>\d+)\s?(?:\1.*)?/,r.op));d=D?D.$flightNumber:null,p=combineDateAndTime(a.getDetachedSpan(""+C),p),h=z[2].innerCapture(/($<airlineName>[a-zA-Z]+)\s\(($<airlineCode>[\d\w]+)\)/),s=h?h.$airlineName:null,g=h?h.$airlineCode:null,m=z[3],/\d?\d:\d{2}(?:AM|PM)?/i.test(m)||(m=z[4]),m=combineDateAndTime(a.getDetachedSpan(""+C),m),ASSERT(o,p,s,m)&&$.push({departureAirport:o,departureCode:u,departureTime:p,arrivalTime:m,arrivalAirport:s,flightNumber:d,arrivalCode:g}),F=F.nextTag("table7"),z=F.allInnerTagsFiltered("td8")}for(var S=[],c=0;c<$.length;c++)for(var E=$[c],Z=0;Z<T.length;Z++){var w={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:l,flightNumber:E.flightNumber,departureAirportFuzzy:E.departureAirport,departureAirportCode:E.departureCode,departureTime:E.departureTime,arrivalAirportFuzzy:E.arrivalAirport,arrivalAirportCode:E.arrivalCode,arrivalTime:E.arrivalTime},underName:{"@type":"http://schema.org/Person",name:T[Z].name},reservationId:n,ticketNumber:T[Z].ticketNumber,reservationStatus:"http://schema.org/Reservation"+i};S.push(w)}return S}}).call();