// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,s,p,o,g,d,m,u,l,h,y,c,T,A,C,v,x,N,b,f=[],S={};u="air busan",m=a.getSpan(),g=m.next(r.reservationId_prefix).nextAnyTag("td"),i=g.tagContents(),g=m.next(r.fromPerson).nextAnyTag("tr").nextAnyTag("tr").nextAnyTag("tr"),p=g.nextAnyTag("td").tagContents(),g=m.next(r.payMethod).nextAnyTag("td"),[,v,x]=g.nextAnyTag("td").tagContents().innerCapture(/([,\d]+)(.*)/);var z=m.next(r.flightSummary);g=z.nextAnyTag("tr");do o=g.nextAnyTag("td").tagContents().innerCapture(/([\d-]+)\s*(\(.*\))/,1),y=g.nextAnyTag("td").nextAnyTag("td").tagContents(),C=y.innerCapture(/\s*(.*)\s.*\s(.*)/),y=C[1],c=null,A=C[2],C=null,g=g.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td"),b=g.tagContents(),b=b.innerCapture(/(\d+\:\d+)\s*.*?\s*(\d+\:\d+)/),h=o+" "+b[1],h=getFuzzyDate(a.getDetachedSpan(h).firstDate()),T=o+" "+b[2],T=a.getDetachedSpan(T).innerDate(),d=g.nextAnyTag("td").tagContents(),l=d.innerCapture(/\s*([A-z]+)(\d+)/,1),d=d.innerCapture(/\s*([A-z]+)(\d+)/,2),ASSERT(l,d,y,h,A,T)&&f.push({reservationId:i,airlineName:u,airlineCode:l,flightNumber:d,departureAirport:y,departureCode:c,departureTime:h,arrivalAirport:A,arrivalCode:C,arrivalTime:T,passengers:S}),g=g.nextAnyTag("tr");while(g.nextAnyTag("td3").tagContents().innerCapture(/^(\d+)\s*/,1)!==a.getNullSpan());ASSERT(p)&&(S[""+p]={name:p,seats:{},seatingType:N,ticketNumber:null,totalPrice:v,priceCurrency:x});for(var k=[],F=0;F<f.length;F++)for(var P=f[F],D=Object.keys(P.passengers),I=0;I<D.length;I++){var M=P.passengers[D[I]],R={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:P.airlineName,airlineCode:P.airlineCode,flightNumber:P.flightNumber,departureAirportFuzzy:P.departureAirport,departureAirportCode:P.departureCode,departureTime:P.departureTime,arrivalAirportFuzzy:P.arrivalAirport,arrivalAirportCode:P.arrivalCode,arrivalTime:P.arrivalTime},underName:{"@type":"http://schema.org/Person",name:M.name},checkinUrl:s,reservationId:P.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:M.totalPrice,priceCurrency:M.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:n,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:M.seats[P.flightNumber],seatingType:M.seatingType}}};valid(M.membershipNumber,M.programName)&&(R.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:M.membershipNumber,programName:M.programName}),k.push(R)}if(k.length)return k}}).call();