(function(){return function(e,t,a){if(int(e.epoch)<1356998400)return STOP;var r=Scanner.fromMessage(e);r.setLocale(t);var n,l,i,d,s,p,g,o,c,m,T,h,u,A,f,v,y=[],x=[];n=r.getSpan().nextRegExp(a.bookingReference).nextAnyTag("td").tagContents(),a.checkinUrl&&(l=r.getSpan().nextText(a.checkinUrl).nextLink()),s=r.getSpan().next(a.payment).parentAnyTag("td").next(a.fare).parentAnyTag("td").tagContents();var S=(""+s).match(regExpFormatted(/\1\s*(.*)/,a.fare));S.length>1&&(S=S[1].match(/([a-zA-Z]{3})\s?([\d,.\s]+)/),v=S[1],f=S[2].trim());var b=[];if(x=r.getSpan().next(a.passengers).parentAnyTag("td").nextAnyTag("table").allInnerTagsFiltered("td7").filter(function(e){return/^(?:Mr|Miss|Mrs|Ms|M.|M|Mme|Prof|DR|Dr|Dr\.).*/.test(e)}),0===x.length)for(var D=r.getSpan().next(a.passengers).parentAnyTag("td").nextAnyTag("table").allInnerTagsFiltered("td7"),$=0;$<D.length;$++)1!==$&&2!==$&&x.push(D[$]);g=r.getSpan().next(a.itineraryDetails).parentAnyTag("td").next(a.dep).parentAnyTag("tr"),m=r.getSpan().next(a.itineraryDetails).parentAnyTag("td").next(a.ret).parentAnyTag("tr"),b=r.getSpan().next(a.itineraryDetails).parentAnyTag("td").allInnerTagsFiltered("table9");var C=/^([a-zA-Z]{2,3})(\d+)\s*\[.*\]\s*[a-zA-Z\.]*\s*(\d+.*\d+)/;"ja_JP"===t&&(C=/([a-zA-Z]{2,3})(\d+)\s*\[.*\]\s*[a-zA-Z\.]*\s*(\d+.*\d+).*/);var F,z=/^([a-zA-Z]{2,3})\s*(\d+:\d+)\s*([a-zA-Z]{2,3})\s*(\d+:\d+\s*\+?\d*).*[\n]{0,2}.*/,N=!1,k=0,R=0,Z=!1,E=!1,I=!1;if(g.isNullSpan_){if(g.isNullSpan_&&m.isNullSpan_)for(var M=(""+r.getSpan()).match(regExpFormatted(/\1\s*\d?\d+/g,a.flight)).length,_=1;_<M+1;_++){var P=a.flight+" "+_,U=r.getSpan().next(P).parentAnyTag("table").parentAnyTag("table"),L=(U.allInnerTagsFiltered("td8"),U.nextTag("table9").allInnerTagsFiltered("td9")),j=U.nextTag("table10").allInnerTagsFiltered("td10"),h=U.nextTag("table10").nextTag("table9").allInnerTagsFiltered("td9"),q=(""+U.nextTag("table10").nextTag("table9").nextTag("table9").allInnerTagsFiltered("td9")).match(regExpFormatted(/\1\s+(.*)/,a.seatRef));q=(""+q[q.length-1]).split(", ");var J=j[0].innerCapture(/($<codeDep>[a-zA-Z]+)\s*($<dateDep>\d?\d:\d{2})\s*($<codeAr>[a-zA-Z]+)\s*($<dateAr>\d?\d:\d{2})/),O=L[0].innerCapture(/($<code>[a-zA-Z]{2,3})($<flightNumber>\d+)/),u=L[1];if(A=J?J.$codeDep:null,c=J?J.$codeAr:null,o=J?J.$dateDep:null,T=J?J.$dateAr:null,null!==o&&(o=combineDateAndTime(u,o)),null!==T&&(T=combineDateAndTime(u,T)),p=O?O.$code:null,d=O?O.$flightNumbers:null,ASSERT(A,c,o,T)){var w={departureCode:A,arrivalCode:c,departureTime:o,arrivalTime:T,airlineCode:p,flightNumber:d};0!==h.length&&(w.seatingType=h[0],I=!0),0!==q.lenght&&(w.seats=q,E=!0),y.push(w)}}}else for(var _=0;_<b.length&&!(Z&&_+k>=b.length-1);_++)if(_%3==0)regExpFormatted(/\1/,a.request).test(b[_+k])?(N=!0,Z=!0,R=_+k+1):R=_+k,p=b[R].replace(C,"$1"),d=b[R].replace(C,"$2"),u=b[R].innerDate();else if(_%3==1){R=N?_+k+1:_+k,A=b[R].replace(z,"$1"),o=combineDateAndTime(unSpanDate_(u),b[R].replace(z,"$2")),c=b[R].replace(z,"$3"),T=b[R].replace(z,"$4").trim();var B=[];(B=(""+T).match(/(\d{2}:\d{2})\s*(\+\d+)?/))[B.length-1]?(u=modifyDate(u,1),T=T.replace(/(\d{2}:\d{2})\s*(\+\d+)?/,"$1"),T=combineDateAndTime(unSpanDate_(u),T)):T=combineDateAndTime(unSpanDate_(u),T)}else if(N?(R=_+k+1,k++):R=_+k,regExpFormatted(/^\1\s+.*/,a.seatRef).test(b[R+1])&&void 0!==b[R+1]&&(E=!0,F=(""+b[R+1]).match(regExpFormatted(/\1\s+(.*)/,a.seatRef)),F=(""+F[F.length-1]).split(", ")),h=b[R],N=!1,I=!0,ASSERT(p,d,o,A,T,c)){var G={airlineCode:p,flightNumber:d,departureTime:o,departureCode:A,arrivalTime:T,arrivalCode:c,seatingType:h};E&&(G.seats=F),y.push(G)}for(var H=[],_=0;_<y.length;_++){var K=y[_];E=!0;var i=K.seats;void 0===i&&(E=!1);for(var Q=0;Q<x.length;Q++){var V={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:K.airlineCode,flightNumber:K.flightNumber,departureAirportCode:""+K.departureCode,departureTime:K.departureTime,arrivalAirportCode:""+K.arrivalCode,arrivalTime:K.arrivalTime},underName:{"@type":"http://schema.org/Person",name:x[Q]},checkinUrl:l,reservationId:n,priceCurrency:v,totalPrice:f,reservationStatus:"http://schema.org/ReservationConfirmed"};I&&(V.reservedTicket=E?{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:K.seatingType,seatNumber:i[Q]}}:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:K.seatingType}}),H.push(V)}}return H}}).call();