// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var n,i,p,o,l=a.getSpan(),u=[],s=[],g=[],m=function(e,r){e.forEach(function(e){var t,n,i,p,o,l,u,s,g,m,d=a.getDetachedSpan(""+e).allInnerTags("td7");""+d==""+a.getNullSpan()&&(d=a.getDetachedSpan(""+e).allInnerTags("td8")),""+d!=""+a.getNullSpan()&&([,t,n]=d[1].tagContents().innerCapture(/([0-9A-Z]{2})(\d{3,4})/),[,i,p]=d[3].tagContents().innerCapture(/(.*)\s(.*)/),[,o,l]=d[4].tagContents().innerCapture(/(.*)\s\((.*)\),/),[,u,s]=d[5].tagContents().innerCapture(/(.*)\s(.*)/),[,g,m]=d[6].tagContents().innerCapture(/(.*)\s\((.*)\),/),r({airlineName:""+d[0].tagContents(),airlineCode:t,flightNumber:n,departureDateTime:a.getDetachedSpan(""+i+" "+p).innerDate(),departureAirport:""+o,departureAirportCode:""+l,arrivalDateTime:a.getDetachedSpan(""+u+" "+s).innerDate(),arrivalAirport:""+g,arrivalAirportCode:""+m,seatNumber:null,seatType:null}))})},d=l.nextText(t.passengerNameHeader).parentAnyTag("table").allInnerTags("tr7");return 0===d.length&&(d=l.nextText(t.passengerNameHeader).parentAnyTag("table").allInnerTags("tr8")),d.slice(1).forEach(function(e){u.push({name:(""+e.nextAnyTag("td").tagContents().innerCapture(/(.*)/,1)).replace(t.underNamePersonSuffixRegExp,"")})}),n=l.innerCapture(regExpFormatted(/\1\s(.*?)\s/,t.reservationIdPrefix),1),o=l.innerCapture(regExpFormatted(/\1\s(.*?)\s/,t.ticketNumberPrefix),1),[,p,i]=l.innerCapture(regExpFormatted(/\1\s?([\d,.]+)\s?(\D)/,t.pricePrefix)),d=l.nextText(t.flightSummaryBlockPrefix).nextTag("table7").allInnerTags("tr7"),s.push(d.slice(1)),d=l.nextText(t.flightSummaryBlockPrefix).nextText(t.flightNextSummaryBlockPrefix).nextText(t.flightSummaryBlockPrefix).nextTag("table8").allInnerTags("tr8"),""+d!=""+a.getNullSpan()&&s.push(d.slice(1)),u.forEach(function(e){m(s,function(r){ASSERT(e.name,r.flightNumber,r.departureAirportCode||r.departureAirport,r.departureDateTime,r.arrivalAirportCode||r.arrivalAirport,r.arrivalDateTime)&&g.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:r.airlineName,airlineCode:r.airlineCode,flightNumber:r.flightNumber,departureAirportFuzzy:r.departureAirport,departureAirportCode:r.departureAirportCode,departureTime:r.departureDateTime,arrivalAirportFuzzy:r.arrivalAirport,arrivalAirportCode:r.arrivalAirportCode,arrivalTime:r.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:e.name},reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:i,priceCurrency:p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:o,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:r.seatNumber,seatingType:r.seatType}}})})}),g.length>=1?g:CONTINUE}}).call();