(function(){return function(e,r,t){if(/(?:Your Delta itinerary has changed|Schedule Changes That Impact)/.test(e.subject)){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p,s,g,m,o,l,h,u,d=[],T={};if(p=a.getSpan().nextTag("td4").nextTag("td4").getString().match(/([A-Z]{2,})/g))for(k=0;k<p.length;k++){var n=p[k];T[n]={name:n,seats:{},seatingType:{}}}i=a.getSpan().innerCapture(t.confirmationNumber,1);for(var c=a.getSpan().nextTag("table11"),v=c;(c=c.nextTag("table11")).exists();)v=c;for(v=v.nextTag("table8");(v=v.nextTag("table8")).exists();){var b=v.allInnerTagsFiltered("td8");if(b.length>2){s=b[2].getString().replace(/<[^>]+?>/,"").trim().split(",");for(var f=b[0].innerCapture(/(\d+)/,1),x=0;x<s.length;x++)T[p[x]].seatingType[f]=b[1].getString(),T[p[x]].seats[f]=s[x]}}for(c=a.getSpan().nextTag("table11");c.exists();){var N=c.allInnerTagsFiltered("tr11");for(w=0;w<N.length;w+=2){var y=N[w],C=y.nextDate();o=combineDateAndTime(C,C.nextDate()),h=C.nextDate().nextDate();var S=h.nextDate();h=S.exists()?combineDateAndTime(S,h):combineDateAndTime(C,h),m=y.innerCapture(/(\w+)/,1),g=y.innerCapture(/\w+\s+(\d+)/,1);var A=y.nextTag("td11");l=A.innerCapture(/((?:[\w -]+)?, ?\w+ ?\w*)/,1),A=A.nextTag("td11"),u=A.innerCapture(/((?:[\w -]+)?, ?\w+ ?\w*)/,1),ASSERT(m,g,l,o,u,h)&&d.push({airlineName:m,airlineCode:"DELTA"==m.getString()?"DL":null,flightNumber:g,departureAirport:l,departureTime:o,arrivalAirport:u,arrivalTime:h,passengers:T})}c=c.nextTag("table11")}for(var D=[],w=0;w<d.length;w++)for(var F=d[w],z=Object.keys(F.passengers),k=0;k<z.length;k++){var I=F.passengers[z[k]],L={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:F.airlineName,airlineCode:F.airlineCode,flightNumber:F.flightNumber,departureAirportFuzzy:F.departureAirport,departureAirportCode:F.departureCode,departureTime:F.departureTime,arrivalAirportFuzzy:F.arrivalAirport,arrivalAirportCode:F.arrivalCode,arrivalTime:F.arrivalTime},underName:{"@type":"http://schema.org/Person",name:I.name},reservationId:i,reservationStatus:"http://schema.org/ReservationConfirmed",reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:I.seats[F.flightNumber],seatingType:I.seatingType[F.flightNumber]}}};valid(I.membershipNumber,I.programName)&&(L.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:I.membershipNumber,programName:I.programName}),D.push(L)}if(D.length)return D}}}).call();