// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var n,i=a.getSpan(),o=[],p=[],u=[];n=i.innerCapture(t.reservationIdRegExp,1),i.next(t.underPersonNamePrefix).parentAnyTag("table").allInnerTags("tr3").slice(1).forEach(function(e){var r=e.allInnerTags("td3");o.push({name:r[1].tagContents()+" "+r[2].tagContents()})}),i=i.next(t.outBoundFlightPrefix).parentAnyTag("table");var l=i.allInnerTags("td4");return l.push(i.allInnerTags("th4")[0]),l=l.map(function(e){return e.tagContents()}),p.push({airlineName:l[0],airlineCode:l[11].innerCapture(/([A-Z0-9]{2})\d{1,4}/,1),flightNumber:l[11].innerCapture(/[A-Z0-9]{2}(\d{1,4})/,1),departureAirport:l[9],departureAirportCode:l[2],departureDateTime:a.getDetachedSpan(l[3]+" "+l[4]).innerDate(),arrivalAirport:l[10],arrivalAirportCode:l[6],arrivalDateTime:a.getDetachedSpan(l[7]+" "+l[8]).innerDate()}),i=a.getSpan().next(t.outBoundFlightPrefix).parentAnyTag("table"),l=i.allInnerTags("td4"),l.push(i.allInnerTags("th4")[0]),l=l.map(function(e){return e.tagContents()}),p.push({airlineName:l[0],airlineCode:l[11].innerCapture(/([A-Z0-9]{2})\d{1,4}/,1),flightNumber:l[11].innerCapture(/[A-Z0-9]{2}(\d{1,4})/,1),departureAirport:l[9],departureAirportCode:l[2],departureDateTime:a.getDetachedSpan(l[3]+" "+l[4]).innerDate(),arrivalAirport:l[10],arrivalAirportCode:l[6],arrivalDateTime:a.getDetachedSpan(l[7]+" "+l[8]).innerDate()}),p.forEach(function(e){ASSERT(e.airlineCode,e.flightNumber,e.departureAirportCode,e.departureDateTime),o.forEach(function(r){u.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:r.name},reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:r.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:""}}})})}),u}}).call();