// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t){var r=Scanner.fromMessage(e);r.setLocale(t);var a,n,s,o,c,p,i,m,u,h,g,S,d,$,v,l,E,x=r.getSpan();u=x.innerCapture(regExpFormatted(/Your order number for this purchase is (.*?)\./),1);var C=["PRINT YOUR TICKETS","Print my tickets"];for(var R in C)if(r.getSpan().nextText(C[R]).exists()){m=r.getSpan().innerCapture(RegExp(regExpEscape(C[R])+" <(.*)>"),1);break}return m||(m=r.getSpan().innerCapture(/Show complete order detail <(.*)>/,1)),o=r.getSpan().nextRegExp(/You purchased (.*) to:/).nextDate(),E=RegExp("You purchased ($<numSeats>.*) to:(?:[\\s_]+)\\b($<eventName>.*)\\s\\b($<address>.*)\\s(?:[\\s\\S]+)\\bOrder for: ($<name>.*)\\s\\bSeat location:(?: section ($<seatSection>.*?),?)?(?: row ($<seatRow>.*?),?)?(?: seats ($<seat>.*?))?\\s\\bTotal Charge: ($<priceCurrency>\\w+)?(.*?)($<price>[\\d.,]+)\\s"),h=r.getSpan().innerCapture(E),h&&(c=h.$eventName,g=h.$address,a=h.$name,i=h.$seatSection,l=h.$seatRow,p=h.$seat,n=h.$price,s=h.$priceCurrency),ASSERT(o,c)?[{"@context":"http://schema.org","@type":"http://schema.org/EventReservation",name:a,totalPrice:n,priceCurrency:s,reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:p,seatRow:l,seatSection:i},ticketToken:m,ticketNumber:u},reservationFor:{"@type":"http://schema.org/Event",eventStatus:"http://schema.org/EventConfirmed",name:c,url:S,startDate:o,endDate:v,location:{"@type":"http://schema.org/Place",name:d,telephone:$,address:g}}}]:CONTINUE}}).call();