(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var n,i,p,o,g,d,s,u,l,m,C,h,y,T,v,c,A,f,x,$=[],b=[];for(n=a.getSpan().next(t.reservationId).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s+(.*)/,t.reservationId),1),m=a.getSpan().next(t.checkInUrl).nextLink(),i=a.getSpan().next(t.itinerary).parentTag("table4").allInnerCapture(regExpFormatted(/(\1)/,t.flight),1),y=a.getSpan().next(t.passengerInfo).parentAnyTag("table").allInnerTags("tr6"),p=0;p<y.length-1;p++){for(h={},h.name=y[p].nextTag("td7").tagContents().innerCapture(/(.+)\n?/,1).trim(),h.seat={},h.seatingType={},f=y[p].allInnerCapture(/(\D{2,3}-\D{2,3})/,1),T=0;T<f.length;T++)v=f[T].previousAnyTag("td").tagContents().innerCapture(/(\d+)/,1),h.seat[v]=f[T].nextAnyTag("td").tagContents(),h.seatingType[v]=h.seat[v].nextAnyTag("td").tagContents();b.push(h)}for(s=a.getSpan().next(t.price).nextAnyTag("td").tagContents().innerCapture(/($<currency>[^\d,.]+)($<price>[\d,.]+)/),u=s.$price,l=s.$currency,p=0;p<i.length;p++){o={},g=i[p].previousAnyTag("td").tagContents().innerCapture(regExpFormatted(/($<departureAirport>.*)\(($<departureCode>.*)\)\s\1\s+($<arrivalAirport>.*)\(($<arrivalCode>.*)\)/,t.to)),o.departureAirportFuzzy=g.$departureAirport.trim(),o.departureAirportCode=g.$departureCode,o.arrivalAirportFuzzy=g.$arrivalAirport.trim(),o.arrivalAirportCode=g.$arrivalCode,c=i[p].previousAnyTag("td").firstDate(),A=a.getDateDD(i[p].previousAnyTag("td").lastInnerDate()),o.departureTime=combineDateAndTime(c,A.iso8601),o.arrivalTime=combineDateAndTime(c,A.endIso8601);var z=i[p].previousAnyTag("td").innerCapture(t.plusDay,1);z.exists()&&(o.arrivalTime=modifyDate(o.arrivalTime,z,0,0,0)),o.seatingType=i[p].nextAnyTag("td").tagContents().innerCapture(/\n(.*)/,1),d=i[p].parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s($<airlineCode>\D+)($<flightNumber>\d+)/,t.flight)),o.airlineCode=d.$airlineCode.trim(),o.flightNumber=d.$flightNumber,ASSERT(o.departureAirportCode,o.arrivalAirportCode,o.departureTime,o.arrivalTime,o.airlineCode,o.flightNumber)&&$.push(o)}C=a.getSpan().next(t.ticketNumber).nextAnyTag("td").tagContents();var F=[];for(x="Confirmed",a.getSpan().next(t.pending).exists()&&(x="Pending"),p=0;p<$.length;p++)for(o=$[p],T=0;T<b.length;T++){h=b[T];var N={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:o.airlineName,airlineCode:o.airlineCode,flightNumber:o.flightNumber,departureAirportFuzzy:o.departureAirportFuzzy,departureAirportCode:o.departureAirportCode,departureTime:o.departureTime,arrivalAirportFuzzy:o.arrivalAirportFuzzy,arrivalAirportCode:o.arrivalAirportCode,arrivalTime:o.arrivalTime},underName:{"@type":"http://schema.org/Person",name:h.name},checkinUrl:m,reservationId:n,reservationStatus:"http://schema.org/Reservation"+x,totalPrice:u,priceCurrency:l,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:C,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:h.seat[""+o.flightNumber],seatingType:h.seatingType[""+o.flightNumber]}}};F.push(N)}if(F.length)return F}}).call();