// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var n=Scanner.fromMessage(e);n.setLocale(t);for(var a,i,g=n.getSpan().nextText(r.passengerNamePrefix).parentTag("table3").allInnerTags("tr3").filter(function(e){return e.tagContents().getLength()}),p=[],o=0;o<g.length;o++)i=g[o],a=i.nextText(r.passengerNamePrefix).parentTag("td3").tagContents().innerCapture(RegExp(regExpEscape(r.passengerNamePrefix)+": \\n(.+)"),1).trim(),p.push(a);var s=n.getSpan().nextText(r.flightDetailsHeader).nextText(r.reservationIdPrefix).parentTag("td2").tagContents().innerCapture(RegExp(regExpEscape(r.reservationIdPrefix)+": (\\w{6})"),1),x=n.getSpan().nextText(r.passengerNamePrefix).nextTag("table3"),d=x.firstTag("tr3").innerDate(),l=d.nextTag("tr3").nextTag("td3").nextTag("td3"),c=combineDateAndTime(d,l.innerDate()),m=n.getSpan().withInterval(l.tagContents().firstText(",").getEnd(),l.tagContents().getEnd()).trim(),T=m.innerCapture(/\((\w{3})\)/,1),u=l.nextTag("tr3").nextTag("td3").nextTag("td3"),h=combineDateAndTime(d,u.innerDate()),f=n.getSpan().withInterval(u.tagContents().firstText(",").getEnd(),u.tagContents().getEnd()).trim(),C=f.innerCapture(/\((\w{3})\)/,1),v=u.nextTag("table4").nextTag("td4").nextTag("td4").tagContents().innerCapture(/($<airlineName>.+)\(($<airlineCode>\w{2})\s+($<flightNumber>\d+)\)/),S=v.$airlineName.trim(),y=v.$airlineCode,E=v.$flightNumber,N=n.getSpan().nextText(r.pricePrefix).parentTag("td5").tagContents().innerCapture(/($<currency>\w{3}) ($<price>[\d,\.]+)/),$=N.$currency,P=N.$price;if(ASSERT(S,y,E,c,T,h,C)){for(var b=[],w=0;w<p.length;w++)b.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:S,airlineCode:y,flightNumber:E,departureAirportFuzzy:m,departureTime:c,departureAirportCode:T,arrivalAirportFuzzy:f,arrivalTime:h,arrivalAirportCode:C},underName:{"@type":"http://schema.org/Person",name:p[w]},reservationId:s,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:P,priceCurrency:$,reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat"}}});if(b.length)return b}}}).call();