// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var n,i,o,p,l=a.getSpan(),u=[],s=[],d=[];return l.allInnerTags("table2").filter(function(e){return t.passengerCheckRegExp.test(e)}).forEach(function(e){u.push({name:e.allInnerTags("td2")[1].tagContents()})}),l.allInnerTags("table5").filter(function(e){return t.legCheckRegExp.test(e)}).forEach(function(e){var r,t,n,i,o,p,l,u,d,g=e.allInnerTags("td5");[,r,t,n]=g[2].tagContents().innerCapture(/(.+)(?:\s?(\D{2})\s?(\d{3,4}))?/),p=g[1].tagContents().innerCapture(/\((\D{3})\)/,1),d=g[5].tagContents().innerCapture(/\((\D{3})\)/,1),[,o,i]=g[0].tagContents().innerCapture(/(\d{2}:\d{2}\s.+),\s(\d{1,2}\s.+)/),[,u,l]=g[4].tagContents().innerCapture(/(\d{2}:\d{2}\s.+),\s(\d{1,2}\s.+)/),s.push({airlineName:r,airlineCode:t,flightNumber:n,departureDateTime:a.getDetachedSpan(""+o+" "+i+" "+(new Date).getFullYear()).innerDate(),departureAirport:null,departureAirportCode:p,arrivalDateTime:a.getDetachedSpan(""+l+" "+u+" "+(new Date).getFullYear()).innerDate(),arrivalAirport:null,arrivalAirportCode:d,seatNumber:null,seatType:g[7].tagContents().innerCapture(/\s-\s(.+)/,1)})}),u.forEach(function(e){s.forEach(function(r){r.flightNumber!==a.getNullSpan()&&ASSERT(e.name,r.flightNumber,r.departureAirportCode||r.departureAirport,r.departureDateTime,r.arrivalAirportCode||r.arrivalAirport,r.arrivalDateTime)&&d.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:r.airlineName,airlineCode:r.airlineCode,flightNumber:r.flightNumber,departureAirportFuzzy:r.departureAirport,departureAirportCode:r.departureAirportCode,departureTime:r.departureDateTime,arrivalAirportFuzzy:r.arrivalAirport,arrivalAirportCode:r.arrivalAirportCode,arrivalTime:r.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:e.name},reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:i,priceCurrency:o,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:p,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:r.seatNumber,seatingType:r.seatType}}})})}),d.length>=1?d:CONTINUE}}).call();