// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){if(!e||!r||!t)return CONTINUE;var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,o,p,l,u,s,d,g,m,v,h=[],c=[],C=/\s\((\w{3})\)/;for(i=a.getSpan().next(t.reservationId).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s+(\d+)/,t.reservationId),1),n=a.getSpan().allInnerCapture(t.cabin,1),d=0;d<n.length;d++)v=n[d],g={},p=v.previousDate(),g.arrivalCode=p.previousAnyTag("tr").innerCapture(C,1),o=g.arrivalCode.previousDate(),g.departureCode=o.previousAnyTag("td").innerCapture(C,1),m=g.departureCode.previousTag("td6").tagContents().innerCapture(/($<airline>.*)\s($<flightNumber>\d+)/),g.airlineName=m.$airline,g.flightNumber=m.$flightNumber,g.airlineName.previousAnyTag("td").innerCapture(t.date,1).exists()&&(l=g.airlineName.previousAnyTag("td").innerDate()),g.departureTime=combineDateAndTime(l,o),g.arrivalTime=combineDateAndTime(l,p),ASSERT(g.departureCode,g.arrivalCode,g.airlineName,g.flightNumber,g.arrivalTime,g.departureTime)&&h.push(g);for(s=a.getSpan().next(t.passengers).collapseToEnd().withEnd(a.getSpan().next(t.passengerEnd).getStart()).allInnerTags("td6"),d=0;d<s.length;d++)u=s[d].tagContents().innerCapture(/(.*)/,1),c.push(u);for(var T=[],d=0;d<h.length;d++){g=h[d];for(var N=0;N<c.length;N++){var u=c[N],y={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:g.airlineName,airlineCode:g.airlineCode,flightNumber:g.flightNumber,departureAirportFuzzy:g.departureAirport,departureAirportCode:g.departureCode,departureTime:g.departureTime,arrivalAirportFuzzy:g.arrivalAirport,arrivalAirportCode:g.arrivalCode,arrivalTime:g.arrivalTime},underName:{"@type":"http://schema.org/Person",name:u},checkinUrl:g.checkinUrl,reservationId:i,reservationStatus:"http://schema.org/Reservation"+(g.reservationStatus||"Confirmed"),totalPrice:null,priceCurrency:null,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:null,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:null,seatingType:g.seatingType}}};T.push(y)}}return T.length?T:void 0}}).call();