// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,o,g,l,p=a.getSpan(),m="Confirmed",s=[],T=[];return n=""+p.next(r.reservationId_prefix).parentAnyTag("td").tagContents(),n="en_GB"===t?/:\n(.*)\n/.exec(n):/: (.*)/.exec(n),2===n.length&&(n=n[1]),l="en_GB"===t?p.next(r.flightDetails_prefix).nextAnyTag("table").nextAnyTag("table").allInnerTags("tr5").filter(function(e){var t=""+e;return t.indexOf(r.airportsName_prefix)>-1}):p.next(r.flightDetails_prefix).nextAnyTag("table").nextAnyTag("table").allInnerTags("tr4").filter(function(e){var t=""+e;return t.indexOf(r.airportsName_prefix)>-1}),l.forEach(function(e){var a,n,i,o,g,l,m,T,d,x,u,A="Flybe",h="BE",y=e.nextAnyTag("td").innerDate(),c=(""+e.nextAnyTag("td").nextAnyTag("td").tagContents()).trim();a=/([0-9]{3,4})/.exec(c)[1];var f=e.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td"),b=r.airportsName_regex.exec(f.tagContents());g=b[1],d=b[2],i=e.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").innerDate(),m=e.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").innerDate(),o=combineDateAndTime(y,i),T=combineDateAndTime(y,m),l=p.next(c).next(c).nextAnyTag("td").tagContents(),x=p.next(c).next(c).nextAnyTag("td").nextAnyTag("td").tagContents(),u="en_GB"===t?p.next(r.flightDetails_prefix).nextAnyTag("table").nextAnyTag("table").nextAnyTag("table").allInnerTags("tr5").filter(function(e){return 1===e.allInnerTags("th5").length&&""+e.allInnerTags("th5")[0].tagContents()!=""}):p.next(r.flightDetails_prefix).nextAnyTag("table").nextAnyTag("table").nextAnyTag("table").allInnerTags("tr4").filter(function(e){return 1===e.allInnerTags("th4").length&&""+e.allInnerTags("th4")[0].tagContents()!=""}),u.forEach(function(e){var t;t=e.nextAnyTag("th").tagContents(),s.push({airlineName:A,airlineCode:h,flightNumber:a,departureDateTime:o,departureAirport:g,departureAirportCode:l,arrivalDateTime:T,arrivalAirport:d,arrivalAirportCode:x,ticketNumber:n,underPersonName:t})})}),s.forEach(function(e){ASSERT(e.departureDateTime,e.arrivalDateTime,e.departureAirport,e.arrivalAirport,e.flightNumber,e.airlineCode),T.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:e.airlineName,airlineCode:e.airlineCode,flightNumber:e.flightNumber,departureAirportFuzzy:e.departureAirport,departureAirportCode:e.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:e.underPersonName},checkinUrl:g,reservationId:n,reservationStatus:"http://schema.org/Reservation"+m,totalPrice:i,priceCurrency:o,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:e.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:e.seatNumber,seatingType:e.seatType}},programMembershipUsed:{"@type":"http://schema.org/ProgramMembership",membershipNumber:e.membershipNumber,programName:e.programName}})}),T.length>=1?T:CONTINUE}}).call();