// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r,a){if(!e||!t||!r)return CONTINUE;if(int(e.epoch)<1325376e3)return CONTINUE;var o=Scanner.fromMessage(e);o.setLocale(t);var s,n,l,i,c,p,d,m,v,h,j,u,H,f,g,S,C;u=loadHelper("starttime.js")(r,o),h=loadHelper("name.js")(e.subject,r,o).trim(),c=loadHelper("ticketnumber.js")(r,o);var k=loadHelper("usecaseenum.js");if(a===k.Confirmed&&ASSERT(u,h)||a===k.Cancelled&&ASSERT(c,h)){n=loadHelper("undername.js")(e.to,r,o),l=loadHelper("price.js")(r,o),i=loadHelper("pricecurrency.js")(r,o),p=loadHelper("tickettoken.js")(r,o),d=loadHelper("seat.js")(r,o),m=loadHelper("seatrow.js")(r,o),v=loadHelper("seatsection.js")(r,o),H=loadHelper("endtime.js")(r,o,u),g=loadHelper("place.js")(r,o),f=loadHelper("phone.js")(r,o),S=loadHelper("address.js")(r,o),C=loadHelper("reservationId.js")(r,o);var y,E;if(void 0!==r.movie)for(var T=0;T<r.movie.length&&(!y||!y.exists());T++)y=o.getSpan().next(r.movie[T]),y.exists()&&(E="MovieShowing",h={"@type":"http://schema.org/Movie",name:h});a===k.Confirmed?s="Confirmed":a===k.Cancelled&&(s="Cancelled");var N={"@context":"http://schema.org","@type":"http://schema.org/EventReservation",totalPrice:l,priceCurrency:i,reservationId:C,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:c,ticketToken:p,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:d,seatRow:m,seatSection:v}},reservationFor:{"@type":"http://schema.org/"+(E||"Event"),url:j,startDate:u,endDate:H,location:{"@type":"http://schema.org/Place",name:g,telephone:f,address:S}}};return y&&y.exists()?N.reservationFor.movie=h:(N.name=n,N.reservationFor.name=h,N.reservationFor.eventStatus="http://schema.org/Event"+(s||"Confirmed")),[N]}}}).call();