// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p,o,s,l,u,g,d,m,h=[],v=[],c=[],T="easyjet",A="U2";for(u=regExpFormatted(/\1\s*(.*)/,t.reservationId).exec(e.subject)[1],p=a.getSpan().allInnerCapture(t.itinerary,1),d=0;d<p.length;d++){var C={},f=p[d].nextTag("td5").tagContents().innerCapture(regExpFormatted(/($<departure>\w+)\s(?:\(.*\)\s)?\1\s($<arrival>[^\(]+?)(?:Flex|$|\()/,t.to));for(C.departureAirport=f.$departure.trim(),C.arrivalAirport=f.$arrival.trim(),C.flightNumber=p[d].nextTag("td6").tagContents().innerCapture(/(\d+)/,1),C.departureTime=p[d].next(t.departure).nextAnyTag("td").innerDate(),C.arrivalTime=p[d].next(t.arrival).nextAnyTag("td").innerDate(),v=[],i=p[d].nextTag("table5").nextTag("table5").allInnerTags("tr5"),m=0;m<i.length;m++){n={};var x=i[m].allInnerTags("td5");n.name=x[0].tagContents(),n.seat=x[1].tagContents().innerCapture(/\b(\d+\w+)\b/,1),ASSERT(n.name)&&v.push(n)}C.passengers=v,ASSERT(C.departureTime,C.arrivalTime,C.flightNumber,C.departureAirport,C.arrivalAirport)&&c.push(C)}for(d=0;d<c.length;d++)for(o=c[d],v=o.passengers,m=0;m<v.length;m++){n=v[m];var y={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:T,airlineCode:A,flightNumber:o.flightNumber,departureAirportFuzzy:o.departureAirport,departureAirportCode:o.departureAirportCode,departureTime:o.departureTime,arrivalAirportFuzzy:o.arrivalAirport,arrivalAirportCode:o.arrivalAirportCode,arrivalTime:o.arrivalTime},underName:{"@type":"http://schema.org/Person",name:n.name},reservationId:u,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:s,priceCurrency:l,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:g,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:n.seat}}};h.push(y)}if(h.length)return h}}).call();