new ReverseTemplateList([new ReverseTemplate("kenya-reservation-en",function(e){return/^Confirmation for Reservation/.test(e.subject)||/^Cancellation of reservation/.test(e.subject)},function(e){if(/^Confirmation for Reservation/.test(e.subject)||/^Cancellation of reservation/.test(e.subject)){var t=Scanner.fromMessage(e);t.setLocale("en_US");var r,n=t.getSpan(),a=!1;/Confirmation/.test(e.subject)?r="Confirmed":(r="Cancelled",a=!0);var i,o,l,s,p,c,u,d,g,m,h,v,T,C,f,x,b,y,A,F,k,S,I=[],N={};for(o=n.nextText("Booking reservation number:").parentTag("td2").tagContents().innerCapture(regExpFormatted(/\1(.+)/,"Booking reservation number:"),1).trim(),d=a===!0?n.nextText("amount to be refunded").nextTag("td4").tagContents().innerCapture(/($<totalPrice>[\d,.]+)\s($<priceCurrency>[\w]+)/):n.nextText("Flight payment and ticket").nextTag("table3").nextTag("td3").tagContents().innerCapture(/($<totalPrice>[\d,.]+)\s($<priceCurrency>[\w]+)/),g=d?d.$totalPrice:null,m=d?d.$priceCurrency:null,p=n.withInterval(n.nextText("Traveller information").getEnd(),n.nextText("Contact Information").getStart()).allInnerTagsFiltered("td2"),k=0;k<p.length;k++)s=""+p[k],N[""+s]={name:s,totalPrice:g,priceCurrency:m};for(c=a===!0?n.withInterval(n.nextText("your flight selection").getEnd(),n.nextText("amount to be refunded").getStart()).allInnerTagsFiltered("table2"):n.withInterval(n.nextText("your flight selection").getEnd(),n.nextText("Flight payment and ticket").getStart()).allInnerTagsFiltered("table2"),k=0;k<c.length;k++)if(!/Your e-ticket and flight payment have been processed./.test(c[k])){T=c[k].innerDate(),[,h,v,u]=c[k].nextText("Airline").nextTag("td3").tagContents().innerCapture(/(.+)\s([A-Z0-9]{2})\s(\d+)/);var w=c[k].nextTag("table4").allInnerTagsFiltered("td4");C=w[1],[,f]=w[2].innerCapture(/(.+),/),b=w[4],[,y]=w[5].innerCapture(/(.+),/),A=w[5],C=combineDateAndTime(T,C),b=combineDateAndTime(T,b),ASSERT(u,C,b)&&I.push({airlineName:h,airlineCode:v,flightNumber:u,departureTime:C,departureCode:x,departureAirport:f.trim(),arrivalTime:b,arrivalCode:A,arrivalAirport:y.trim(),passengers:N})}var P=[];for(k=0;k<I.length;k++){var R=I[k],j=Object.keys(R.passengers);for(S=0;S<j.length;S++){F=R.passengers[j[S]];P.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.departureCode,departureTime:R.departureTime,arrivalAirportFuzzy:R.arrivalAirport,arrivalAirportCode:R.arrivalCode,arrivalTime:R.arrivalTime},underName:{"@type":"http://schema.org/Person",name:F.name},checkinUrl:l,reservationId:o,reservationStatus:"http://schema.org/Reservation"+r,totalPrice:F.totalPrice,priceCurrency:F.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:i,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:"",seatingType:""}}})}}if(P.length)return P}},"0/1/2/3/4/5/6/152/711/712","SG38f83958")]);