new ReverseTemplateList([new ReverseTemplate("jal.com-confirmation-en",function(e){return/Reservation \/ Ticket Confirmation for .+/.test(e.subject)},function(e){if(!/Reservation \/ Ticket Confirmation for .+/.test(e.subject))return CONTINUE;var t="en_GB",r={};r.passengerBlockPrefix="Traveler Information";var a=Scanner.fromMessage(e);a.setLocale(t);var n,i=a.getSpan(),o=r.isCancellation?"Cancelled":"Confirmed",l=[],s=[],m=[];return i.next(r.passengerBlockPrefix).nextTag("table2").allInnerTags("td2").map(function(e){return e.tagContents()}).filter(function(e){return/^M/.test(""+e)}).forEach(function(e){l.push({name:e.tagContents()})}),i.withStart(i.next("Participate in the carbon offset program for this flight?").getEnd()).withEnd(i.next("Payment Summary").getStart()).allInnerTags("table2").forEach(function(e){var t,r,n,i,o,l,s,p,u,c=e.allInnerTags("td2").filter(function(e){return""!==(""+e.tagContents()).trim()});i=c[1].tagContents();var d=c[3].next("Flight:").nextTag("td3").tagContents().innerCapture(/($<airlineName>.*?)($<airlineCode>\w{2})\s($<flightNumber>\d+)/),f=d.$airlineName.trim();t=d.$airlineCode,r=d.$flightNumber,c=c[3].allInnerTags("td4").map(function(e){return e.tagContents()}),o=c[1],n=c[2],p=c[4],s=c[5],l=a.getDetachedSpan(i+" "+o).innerDate(),u=a.getDetachedSpan(i+" "+p).innerDate(),/\+\d+ day\(s\)/.test(""+p)&&(u=modifyDate(u,1)),m.push({airlineName:f,airlineCode:t,flightNumber:r,departureAirport:n.trim(),departureDateTime:l,arrivalAirport:s.trim(),arrivalDateTime:u})}),0===l.length&&l.push({}),m.forEach(function(e){l.forEach(function(t){ASSERT(e.airlineCode,e.flightNumber,e.departureAirport,e.departureDateTime),s.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:e.airlineCode,airlineName:e.airlineName,flightNumber:e.flightNumber,departureAirportFuzzy:e.departureAirport,departureAirportCode:e.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:t.name},reservationId:n,reservationStatus:"http://schema.org/Reservation"+o,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:t.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:t.seat,seatingType:null}}})})}),s},"0/1/2/3/4/5/6/152/206/695","SGdde2342f")]);