// 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,s,p,g,l,m,d,u,h,c,C,T,y,v,x,b,A,N=[],f={};m="Eastar Jet",l=a.getSpan(),i=l.next(t.reservationId_prefix).nextTag("td1").tagContents(),p=l.next(t.passenger),s=p.nextTag("td1").tagContents(),p=l.next(t.flightExit),v=p.nextTag("td1").tagContents(),v&&(v=v.innerCapture(t.totalPrice_prefix),v&&3===v.length&&(x=v[2],v=v[1])),ASSERT(s)&&(f[""+s]={name:s,seats:{},seatingType:null,ticketNumber:null,totalPrice:v,priceCurrency:x});var S=l.next(t.flightSummary);p=S.nextAnyTag("tr");do{if(g=p.innerTag("td1"),""+g.trim()=="")break;g=p.allInnerTags("td1"),A=p.nextAnyTag("td").nextAnyTag("td"),b=A.tagContents().innerCapture(/($<airlineCode>\w+)\s*($<flightNumber>\d+)/),g=b.$flightNumber,d=b.$airlineCode,A=A.nextAnyTag("td"),u=A.tagContents(),A=A.nextAnyTag("td"),h=A.tagContents(),A=A.nextAnyTag("td"),C=A.tagContents(),A=A.nextAnyTag("td"),T=A.tagContents(),c=null,y=null,ASSERT(g,h,u,T,C)&&N.push({reservationId:i,airlineName:m,airlineCode:d,flightNumber:g,departureAirport:h,departureCode:c,departureTime:u,arrivalAirport:T,arrivalCode:y,arrivalTime:C,passengers:f}),p=p.nextAnyTag("tr")}while(null!==p.nextAnyTag("td").tagContents().innerCapture(t.oneFlight));for(var k=[],F=0;F<N.length;F++)for(var z=N[F],P=Object.keys(z.passengers),I=0;I<P.length;I++){var E=z.passengers[P[I]],R={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:z.airlineName,airlineCode:z.airlineCode,flightNumber:z.flightNumber,departureAirportFuzzy:z.departureAirport,departureAirportCode:z.departureCode,departureTime:z.departureTime,arrivalAirportFuzzy:z.arrivalAirport,arrivalAirportCode:z.arrivalCode,arrivalTime:z.arrivalTime},underName:{"@type":"http://schema.org/Person",name:E.name},checkinUrl:o,reservationId:z.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:E.totalPrice,priceCurrency:E.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:n,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:E.seats[z.flightNumber],seatingType:E.seatingType}}};valid(E.membershipNumber,E.programName)&&(R.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:E.membershipNumber,programName:E.programName}),k.push(R)}if(k.length)return k}}).call();