/*************************************************************************
Copyright (c) 2011. Adobe Systems Incorporated. All rights reserved.

You may distribute this file in source code or object code, solely in
unmodified form, and in all cases only as incorporated into your own
application created with the Adobe software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

**************************************************************************/
/*************************************************************************
 AdobePatentID="B1316"
 AdobePatentID="B1318"
 edge.authoring.0.0.1.min.js - version 0.1.1
**************************************************************************/
(function(f,h){function n(a){return h.compositionDefns[a]}var u=h.triggerDict={element:function(a,b,c){a&&(b=="document"?this.$(document).bind(c,a):this.$(b).bind(c,a))},timeline:function(a,b,c){if(a&&b){var d=this.getTimelineData(b),p=d.toState,d=d.fromState,g={};g[c]=a;this._getTimeline(b,p,d).addObserver(g)}}},l=h.Symbol=function(a,b){h.Notifier.call(this);this.widgetEventPrefix="edgeSym_";this.element=null;this.options={data:null,initialState:null};this.states={};this.timelines={};this.timelineCache=
{};this.timelineStateMap={};this.autoPlay={};this.defaultBaseState="Base State";this.baseState=null;this._init(a,b)};h.symbol=l;var s=h.PropertyTween,r=s.substituteParameters;l._substituteParameters=r;var t,o=h.symbolDefns={};h.baseDataName="edgeBaseData";f.extend(l.prototype,h.Notifier.prototype,{constructor:l,_init:function(a,b){if(b&&(f.extend(this.options,b),f.isArray(b.observers)&&b.observers.length))for(var c=b.observers.length,d=0;d<c;d++)this.addObserver(b.observers[d]);if(!this.options.data)return null;
this.element=a;this.composition=this.options.composition;d=this._createEvent();this.notifyObservers("onPreSymbolInit",d);c=this._createEvent();if(d.performDefaultAction){d=f(a);d.data("edgeSymbol",this);if(!d.get(0).id)d.get(0).id=l._makeUniqueID();var p=this,g=this.options.data;this.parameterValues=this._makeDefaultParameters();f.extend(this.parameterValues,this.options.parameters);var e=this._getSymbolParams();this.setParameter("_stage",e.symbolSelector);this.setParameter("_"+d[0].id,e.symbolSelector);
d.find("*").each(function(a,b){b.id&&p.setParameter("_"+b.id,"#"+b.id)});g.content&&this._injectMarkup();g.actions&&this._addActionsFromData(g.actions);g.timelines&&this._createTimelineSetFromData(g.timelines,g.states);g.bindings&&g.bindings.length&&this._addBindingsFromData(g.bindings);if(typeof this.options.opts.autoPlay=="object")for(var i in this.options.opts.autoPlay)this.options.opts.autoPlay.hasOwnProperty(i)&&this.setAutoPlay(this.options.opts.autoPlay[i],i);i=d[0].nodeName=="BODY";g.content&&
g.content.dom&&!i&&(i=d.css("position"),i!="absolute"&&i!="relative"&&d.css("position","relative"));this._goToInitialState();if(d[0].style&&(typeof d[0].style.webkitTransform=="undefined"||d[0].style.webkitTransform===""||d[0].style.webkitTransform=="none"))d[0].style.webkitTransform="translateZ(0)";this.notifyObservers("onPostSymbolInit",c);return this}else this.notifyObservers("onPostSymbolInit",c)},_createEvent:function(a){var b={Symbol:this,element:this.element,performDefaultAction:!0};f.extend(b,
a);return b},_makeDefaultParameters:function(){var a={},b=this.options.data.parameters;if(b)for(var c in b)if(b.hasOwnProperty(c))a[c]=b[c].defaultValue;f.extend(a,this._getSymbolParams());return a},_injectMarkup:function(a){var b=a,c=this._createEvent({markup:b});this.notifyObservers("onPreInjectMarkup",c);b=c.markup;a=this._createEvent({markup:b});if(c.performDefaultAction){var d,c=this.parameterValues;d=this.options.data.content;if(!b&&d)if(d.ref)b="",f(d.ref).each(function(a,c){b+=f(c).html()});
else if(d.markup)b=d.markup;else if(d.dom){var p=h.DeclareMarkup;if(p){var g=d.dom,e=d.symbolInstances,g=JSON.parse(JSON.stringify(d.dom)),e=[];d.symbolInstances&&(e=JSON.parse(JSON.stringify(d.symbolInstances)));var i=g.length;for(d=0;d<i;d++)this._reIdDOMElements(g[d],e);p.DOMNodeSeek(f(this.element).get(0),this.getSymbolTypeName());p.renderDOM(g,f(this.element).get(0),c,this.getSymbolTypeName(),e,this.composition);if(this.idLookup)for(var j in this.idLookup)this.idLookup.hasOwnProperty(j)&&(f(j).data("originalId",
this.idLookup[j]),f(j).data("symParent",this));e&&e.length>0&&this._processNestedSymbols(e);p.DOMNodeReset()}}if(b){if((j=this._getParentSymbol())&&j.options.data.actors&&j.options.data.actors.instance_parameters){p=j.options.data.actors.instance_parameters;g=p.length;for(d=0;d<g;d++)e=s.substituteParameters(p[d].selector,j._getSymbolParams()),f(e).filter(f(this.element)).length&&f.extend(c,p[d].parameters)}b=r(b,c);f(b).appendTo(this.element)}}this.notifyObservers("onPostInjectMarkup",a)},_processNestedSymbols:function(a){if(a){this.aSymbolInstances=
[];for(var b=a.length,c=0;c<b;c++){var d="#"+a[c].id;f(d).get(0)&&this.composition&&(this.composition.convertElementToSymbol(d,a[c].symbolName,{autoPlay:a[c].autoPlay}),this.aSymbolInstances.push(d))}}},_reIdDOMElements:function(a,b){if(a){var c=f(this.element).get(0).id,d=a.id;if(!d||d==="")d=l._makeUniqueID();for(var c=c+"_"+d,e=b.length,g=0;g<e;g++)if(b[g].id==a.id)b[g].id=c;this.idLookup=this.idLookup||{};this.idLookup["#"+c]=d;this.setParameter("_"+d,"#"+c);a.oldId=a.id;a.id=c;if(a.c){d=a.c.length;
for(c=0;c<d;c++)this._reIdDOMElements(a.c[c],b)}}},_getParentSymbol:function(){for(var a=f(this.element).parents(),b=a.length,c=0;c<b;c++){var d=l.get(a[c]);if(d)return d}return null},_createTimelineSetFromData:function(a,b){this.states=b;this.timelines=a;this.baseState=this.options.data.baseState;if(!this.baseState)this.baseState="Base State";return this},_addBindingFromData:function(a){var b=a[0];if(b[0]=="element"){var c=r(b[1],this.parameterValues);c!=b[1]&&(b=h.cloneJSONObject(b),b[1]=c)}if(c=
u[b[0]])(a=this._getActionCallbackFunc(b[0],b[1],a.slice(1)))&&c.apply(this,[a].concat(b.slice(1)))},_addBindingsFromData:function(a){for(var b=a.length,c=0;c<b;c++)this._addBindingFromData(a[c])},_getActionCallbackFunc:function(a,b,c){var d=this[c[0]],e=this;if(typeof d=="function")if(c.slice(1),a=="element")return function(){try{var a=Array.prototype.slice.call(arguments);a.unshift(e);return d.apply(e,a)}catch(b){}};else if(a=="timeline")return function(c,k){try{var i;i=k&&k.methodName&&/^trig_/.test(k.methodName)?
f.Event("trigger"):f.Event(a);k&&f.extend(i,k);i.timeline=c;var j=Array.prototype.slice.call(arguments);j.splice(0,0,i,b);j.unshift(e);return d.apply(e,j)}catch(h){}};return null},_addActionsFromData:function(a){f.extend(this,a)},_getSymbolParams:function(){return{symbolSelector:"#"+f(this.element).get(0).id}},_flushCache:function(){var a=this.timelines,b;for(b in a)a.hasOwnProperty(b)&&this._dirtyTimeline(b)},_goToInitialState:function(){var a={parameters:this.parameterValues},b=this.options.data.initialState;
if(!b)b=this.options.data.baseState;if(!l.useCSSAnimation)if(b)this._applyRules(this._buildStateForCache(null,b,a));else for(var c in this.timelines)if(this.timelines.hasOwnProperty(c)){a=this.getAutoPlay(c);if(typeof a=="undefined"&&(b=this.getTimelineData(c)))a=b.autoPlay;(typeof a=="undefined"||a==="true"||a===!0)&&this.seekTimeline(c,0)}},_getDefltTL:function(){return"Default Timeline"},_preNotify:function(a,b,c){var d={};f.extend(d,c);c=this._createEvent({tlName:b,tlOptions:d});this.notifyObservers(a,
c);if(c.performDefaultAction)return c.tlOptions;else d=c.tlOptions,b={Symbol:this,timelineName:b,tlOptions:d,performDefaultAction:!0},a=a.replace(/onPre/,"onPost"),this.notifyObservers(a,b)},_posToNum:function(a,b){if(typeof b==="string"){var c=this.getTimelineData(a);if(!c||!c.labels)return 0;return c.labels[b]}return b},play:function(a,b){var c=this._getDefltTL();this._stop(c,{dontNotify:!0});return this.playTimeline(c,a,b)},playTimeline:function(a,b,c){c=this._preNotify("onPreSymbolPlay",a,c);
if(typeof c!==void 0){b=this._posToNum(a,b);if(typeof a==="string"&&(this._rememberBaseStateForTimeline(a),b={parameters:this.parameterValues,startPos:b},f.extend(b,c),this.timelines)){var d=this._getTimeline(a);if(d)d.currentDirection="forward";this._play(a,b)}this.notifyObservers("onPostSymbolPlay",this._createEvent({timeline:a,tlOptions:c}));return this}},playReverse:function(a,b){this.stop(a,b);return this.playTimelineReverse(this._getDefltTL(),a,b)},playTimelineReverse:function(a,b,c){var d=
this._preNotify("onPreSymbolPlayReverse",a,c);if(typeof d!==void 0){c=c||{};l.startClock();c.externalClock=!0;var b=this._posToNum(a,b),e=this._getTimeline(a);if(typeof b==="undefined")b=e.currentPosition;if(b==0)this.stop(e.getDuration(),c),this.playTimelineReverse(a,e.getDuration(),c);else{if(typeof a==="string")b={parameters:this.parameterValues,playDirection:"reverse",startPos:b},f.extend(b,d),b.noTriggers=!0,e.currentDirection="reverse",e.play(b),b.noTriggers=!1;this.notifyObservers("onPostSymbolPlayReverse",
this._createEvent({timeline:a,tlOptions:d}));return this}}},seek:function(a,b){return this.seekTimeline(this._getDefltTL(),a,b)},seekTimeline:function(a,b,c){c=this._preNotify("onPreSymbolSeek",a,c);if(typeof c===void 0)return null;b=this._posToNum(a,b);if(typeof a==="string"){this._rememberBaseStateForTimeline(a);var d={parameters:this.parameterValues};f.extend(d,c);this.timelines&&this._seek(a,b,d)}this.notifyObservers("onPostSymbolSeek",this._createEvent({timeline:a,tlOptions:c}));return null},
stop:function(a,b){return this.stopTimeline(this._getDefltTL(),a,b)},stopTimeline:function(a,b,c){c=this._preNotify("onPreSymbolStop",a,c);if(typeof c===void 0)return null;if(typeof a==="string"){var d={parameters:this.parameterValues};f.extend(d,c);this.timelines&&(typeof b==="undefined"?this._stop(a):(typeof b==="string"&&(b=this._posToNum(a,b)),this._seek(a,b,d)))}},_stop:function(a,b){var c=this._getTimeline(a);c&&c.stop(b)},getPosition:function(){return this.getTimelinePosition(this._getDefltTL())},
getTimelinePosition:function(a){if(typeof a==="string"&&(a=this._getTimelineWithOwnStates(a)))return a.getCurrentPosition()},getDuration:function(){return this.getTimelineDuration(this._getDefltTL())},getTimelineDuration:function(a){if(typeof a==="string"&&(a=this._getTimelineWithOwnStates(a)))return a.getDuration()},isPlaying:function(){return this.isTimelinePlaying(this._getDefltTL())},isTimelinePlaying:function(a){if(typeof a==="string"){if(!this._getTimelineWithOwnStates(a).playing)return!1;return!0}},
isPlayDirectionReverse:function(){return this.isTimelinePlayDirectionReverse(this._getDefltTL())},isTimelinePlayDirectionReverse:function(a){if(typeof a==="string"){a=this._getTimelineWithOwnStates(a);if(a.currentContext){if(a.currentContext.playDirection=="reverse")return!0}else if(a.currentDirection=="reverse")return!0;return!1}},lookupSelector:function(a){if(typeof a==="string")try{return r("${_"+a+"}",this.parameterValues)}catch(b){}},getComposition:function(){return this.composition},getSymbolElementNode:function(){return f(this.element).get(0)},
getSymbolTypeName:function(){return this.options.data.typeName},setAutoPlay:function(a,b){if(!b||b.length===0)b=this._getDefltTL();this.autoPlay[b]=a},getAutoPlay:function(a){if(!a||a.length===0)a=this._getDefltTL();return this.autoPlay[a]},_playAuto:function(){for(var a in this.timelines)if(this.timelines.hasOwnProperty(a)){var b=this.getAutoPlay(a);if(typeof b=="undefined"){var c=this.getTimelineData(a);if(c)b=c.autoPlay}(typeof b=="undefined"||b==="true"||b===!0)&&this.playTimeline(a,0,{firstUpdate:!0})}},
getParameter:function(a){return this.parameterValues[a]},setParameter:function(a,b){this.parameterValues[a]=b},destroy:function(){f(this.ele).removeData("edgeSymbol");return this},_addState:function(a,b){this.states[a]=b},_addTimelineData:function(a,b){this.timelines[a]=b;if(b.fromState&&b.toState)this.timelineStateMap={}},_getTimelineFromStates:function(a,b){if(typeof this.timelineStateMap[a+"//"+b]=="undefined"){for(var c in this.timelines)if(this.timelines.hasOwnProperty(c)){var d=this.timelines[c];
this.timelineStateMap[d.fromState+"//"+d.toState]=c}typeof this.timelineStateMap[a+"//"+b]=="undefined"&&(this.timelineStateMap[a+"//"+b]=null);return this.timelineStateMap[a+"//"+b]}},_saveObservers:function(a){var b=this.timelines[a];if(b=this._getCachedTimeline(a,b.toState,b.fromState)){if(!this.timelineObservers)this.timelineObservers={};this.timelineObservers[a]=b.observers.slice(0)}},_restoreObservers:function(a,b){if(this.timelineObservers&&this.timelineObservers[a]){var c=this.timelineObservers[a];
if(c){var d,e=c.length;for(d=0;d<e;d++)b.addObserver(c[d])}}},_dirtyTimeline:function(a){this._saveObservers(a);this.timelineCache[this._makeTimelineKey(a)]=null;this.timelineStateMap={};this.toStateCache=this.fromStateCache=null},_isCacheDIrty:function(a){return this.timelineCache[this._makeTimelineKey(a)]===null},_getStateData:function(a){return this.states[a]},getTimelineData:function(a){return this.timelines[a]},_makeTimelineKey:function(a,b,c){var d=null;if(!b||!c)d=this.getTimelineData(a);if(d){if(!b)b=
d.toState;if(!c)c=d.fromState}return a+"-"+(b?b:"")+"-"+(c?c:"")},_getBaseStateData:function(){if(this.baseState)return this._getStateData(this.baseState);else for(var a in this.states)if(this.states[a].baseState)return this.baseState=a,this._getStateData(this.baseState);return this._getStateData(this.defaultBaseState)},_mergeBaseState:function(a){var b=h.cloneJSONObject(this._getBaseStateData()),c;for(c in a)a.hasOwnProperty(c)&&(b[c]||(b[c]=[]),b[c]=b[c].concat(a[c]));return b},_getTimelineWithOwnStates:function(a){var b=
this.getTimelineData(a);if(!b)return null;return this._getTimeline(a,b.toState,b.fromState)},_getCachedTimeline:function(a,b,c){return this.timelineCache[this._makeTimelineKey(a,b,c)]},_getTimeline:function(a,b,c){var d=this._makeTimelineKey(a,b,c);if(this.timelineCache[d])return this.timelineCache[d];if(!this.getTimelineData(a))return null;var e=this.getTimelineData(a).timeline;if(b||c)e=h.cloneJSONObject(e);for(var g=e.length,k={},i={},j,f,m=0,l,n=0;n<g;n++)if(f=e[n],f.tween&&(j=f.tween[1],k[j]||
(k[j]=[]),k[j].push(f),j=f.tween[0]+":"+f.tween[1]+":"+f.tween[2],i[j]||(i[j]=[]),i[j].push(f)),f.tween||f.trigger)l=f.duration||0,m=Math.max(m,f.position+l);f=function(a,b){return a.position-b.position};for(j in i)i.hasOwnProperty(j)&&i[j].sort(f);var v,r,o,s,t,u,w;if(b)for(v in b=this._mergeBaseState(this._getStateData(b)),b)if(b.hasOwnProperty(j)){n=b[v];l=k[v];r=n.length;for(u=0;u<r;u++){f=n[u];o=f[0];s=f[1];t=f[2];var q=null,x=-1,g=l.length;for(w=0;l&&w<g;w++)if(f=l[w],j=f.tween,j[0]==o&&j[2]==
s&&(x==-1||f.position+f.duration>x))q=f,x=f.position+f.duration;q&&q.tween.length>4&&q.tween[4]&&q.tween[4].copyToState&&(q.tween[3]=t)}}b={};if(c)for(v in c=this._getStateData(c),c)if(c.hasOwnProperty(v)){n=c[v];l=k[v];r=n.length;for(u=0;u<r;u++){f=n[u];o=f[0];s=f[1];t=f[2];b[o+":"+v+":"+s]=t;q=null;x=-1;if(l)g=l.length;for(w=0;l&&w<g;w++)if(f=l[w],j=f.tween,j[0]==o&&j[2]==s&&(x==-1||f.position<x))q=f,x=f.position;if(q&&(f=q.tween.length>4&&q.tween[4]&&q.tween[4].copyFromState,q.tween.length<4||
!q.tween[4]||typeof q.tween[4].fromValue=="undefined"||f))q.tween[4]||(q.tween[4]={}),q.tween[4].fromValue=t}}if(c)for(j in i)if(i.hasOwnProperty(j)&&i[j][0].position>0&&(c=b[j],c!==void 0))f=h.cloneJSONObject(i[j][0]),f.tween[3]=f.tween[4].fromValue=c,c=f.position,f.position=0,f.duration=c,e.push(f);i=this.getTimelineData(a);i.duration&&m<i.duration&&(f={id:"rest",tween:["style","${_stage}","-edge_resting","100%",{fromValue:"0%"}],position:m,duration:i.duration-m},e.push(f));e=this._createTimelineFromData(e);
this._restoreObservers(a,e);return this.timelineCache[d]=e},_createTimelineFromData:function(a){for(var b=jQuery.Edge.Timeline.createTimeline(),c=a.length,d=0;d<c;d++){var e=a[d],g=null;e.timeline?g=l.prototype._createTimelineFromData(e.timeline):e.tween?g=h.Timeline.createTween.apply(null,e.tween):e.trigger&&(g=e.trigger.slice(0,2),g.push(this),g=h.Timeline.createTrigger.apply(null,g));g&&b.add(g,e.position,e.duration,e.easing)}return b},_buildStateForCache:function(a,b){var c={};if(b){var d=this.states[b];
if(d){var e={},g,k,i;if(a){var j=this.getTimelineData(a).timeline,h=j.length;for(g=0;g<h;g++)i=j[g],i.tween&&(k=r(i.tween[1],this.parameterValues),k=i.tween[0]+":"+k+":"+i.tween[2],e[k]||(e[k]=[]),e[k].push(i))}for(var l in d)if(l!=="prototype"){e=d[l];for(g=0;g<e.length;g++)if(j=e[g],k=r(l,this.parameterValues),j[0]=="style"||j[0]=="transform"||j[0]=="color"){c[k]||(c[k]=[]);i=j[2];if(j[3]&&j[3].valueTemplate)if(h=s.prototype.parseTemplate.call(null,j[3].valueTemplate)){var n=h.length,u=[],v=j[2];
f.isArray(v)||(v=[v]);for(var o=0;o<n;o++)i=h[o],i.isPlaceholder?u.push(v[i.value]):u.push(i.value);i=u.join("")}else i=j[2].join("");c[k].push({decl:j,value:i})}}return c}}},_ensureState:function(a,b,c){var d=b+"Cache";this[d]||(this[d]={});var e=null;this[d][a]?e=this[d][a]:(b=this.getTimelineData(a)[b],e=this._buildStateForCache(a,b,c),!this._isParameterizedActorTL(a)&&!this._isParameterizedActorState(b)&&(this[d][a]=e));this._applyRules(e,c)},_applyRules:function(a,b){var c=this,d,e=function(){var a=
f(this),e={},g=f.data(this,"edgeBaseData");g||(c._rememberBaseState(a),g=f.data(this,"edgeBaseData"));f.extend(e,g.transformData,d);f.data(this,h.TransformTween.dataName,e);g=!1;if(b)g=b.dontForceZ;h.TransformTween.applyTransform(a,e,void 0,{dontForceZ:g});(e=f.data(this,"ui_visibility"))&&a.css("visibility",e)},g;for(g in a)if(a.hasOwnProperty(g)){var k=a[g],i=k.length;d=null;for(var j=0;j<i;j++){var l=k[j].decl,m=l[1];l[0]=="transform"?(d||(d={}),d[m]=k[j].value):(l=k[j].decl,l=k[j].value,f(g).css(m,
l))}d&&h.TransformTween&&f(g).each(e)}},_ensureFromState:function(a,b){this._ensureState(a,"fromState",b)},_ensureToState:function(a,b){this._ensureState(a,"toState",b)},_isParameterizedActorTL:function(a){for(var a=this.getTimelineData(a).timeline,b=a.length,c=0;c<b;c++){var d=a[c];if(d.tween&&typeof d.tween[1]=="string"&&d.tween[1].search(/\$\{/)!=-1)return!0}return!1},_isParameterizedActorState:function(a){if(!a)return!1;a=this.states[a];if(!a)return!1;for(var b in a)if(b.search(/\$\{/)!=-1)return!0;
return!1},_isReverse:function(a){return typeof a=="object"&&typeof a.playDirection=="string"&&a.playDirection=="reverse"},_play:function(a,b){l.startClock();b.externalClock=!0;var c=this.getTimelineData(a);if(c){var d=c.toState;if(a&&(c=this._getTimeline(a,d,c.fromState))){if(d&&!this._isReverse(b)){if(!this.tlPlayHandler){var e=this;this.tlPlayHandler={};this.tlPlayHandler.onComplete=function(){e._ensureToState(this.timelineName,this.opts);this.tl.removeObserver(e.tlPlayHandler)}}f.extend(this.tlPlayHandler,
{tl:c,timelineName:a,opts:b});c.addObserver(this.tlPlayHandler)}c.play(b)}}},_seek:function(a,b,c){var d=this._isCacheDIrty(a),e=this.getTimelineData(a);if(e){var g=e.toState,e=e.fromState;c||(c={});!d&&c.skipFromState?c.assumeStateUnchanged=!0:(this._ensureFromState(a,c),c.assumeStateUnchanged=!1);d=0;if(a&&(g=this._getTimeline(a,g,e)))d=g.getDuration(),g.seek(b,c);b>=d&&this._ensureToState(a,c)}},_rememberBaseStateForTimeline:function(a){if(a&&(a=this.getTimelineData(a)))for(var a=a.timeline,b=
a.length,c=0;c<b;c++){var d=a[c];d.tween&&this._rememberBaseState(r(d.tween[1],this.parameterValues))}},_executeSymbolAction:function(a,b){if(!(typeof b!="object"||b.length<3)){var c=b[0],d=h.Symbol.get(this.$(b[1]));if(d&&c){var e=b[2];if(!e||typeof e!="object")e=null;d[c].apply(d,e)}}},_rememberBaseState:function(a){f(a).each(function(){f(this);var a=f.data(this,"edgeBaseData");if(!a)a={},f.data(this,"edgeBaseData",a),a.transformData=h.TransformTween.prototype.buildTransformData.call(null,this)})},
compute:function(a,b,c,d,e){var g;if(a){var f=this.getTimelineData(a);(a=this._getTimeline(a,f.toState,f.fromState))&&(g=a.compute(b,c,d,e))}return g},findNext:function(a,b,c,d,e,g,f){if(a){var i=this.getTimelineData(a),d=d.toString();if(a=this._getTimeline(a,i.toState,i.fromState)){var h,i=a.getDuration()+10,d=parseFloat(d.replace(/[a-zA-Z%]+$/,"")),l=g+10;h=a.compute(b,c,g,f);for(var m=h[e],m=parseFloat(m.replace(/[a-zA-Z%]+$/,"")),l=g;l<=i;l+=10)if((h=a.compute(b,c,l,f))&&h.length){g=h[e];g=parseFloat(g.replace(/[a-zA-Z%]+$/,
""));if(d>=Math.min(m,g)&&d<=Math.max(m,g))return l;m=g}}}return-1},deleteSymbol:function(a){var a=a||{},b;this.composition&&(b=this.composition.getSymbols());if(b){var c=this._createEvent({});this.notifyObservers("onPreRemove",c);if(c.performDefaultAction){var d;if(this.aSymbolInstances){var e=this.aSymbolInstances.length;for(d=0;d<e;d++)this.composition.removeSymbol(this.aSymbolInstances[d],a)}d=this.element;f(d).removeData("edgeSymbol");a._keepElement?f(d).empty():f(d).remove();for(d=b.length;d>=
0;d--)b[d]==this&&b.splice(d,1);this.element=null;this.notifyObservers("onPostRemove",c)}}},getSymbol:function(a){a=this.$(a);return l.get(a)},$:function(a){var b=a;typeof a==="string"&&(a.search(/\$\{/)==-1?(b=this.lookupSelector(a),typeof b=="undefined"&&(b=a)):b=r(a,this.parameterValues));return f(b)}});l.get=function(a){return f(a).data("edgeSymbol")};l.getDefaultEasing=function(){return h.TimelineObject.defaultEasing};l.startClock=function(){if(!l.timerFunc){var a=1E3/h.Timeline.config.fps;l.timerFunc=
function(){h.Timeline.tick();setTimeout(l.timerFunc,a)};setTimeout(l.timerFunc,a)}};var y=function(a,b,c,d,e,g,f){var i=h.getCompositionSymbolDefns(a)[b];if(i){if(!i.actions)i.actions={};f=l._makeUniqueID();i.actions[f]=e;if(!i.bindings)i.bindings=[];c=[[g,c,d],f];i.bindings.push(c);if(null!=h.compositions&&(a=h.compositions[a],null!=a&&(a=a.getSymbols(),null!=a))){i=a.length;for(g=0;g<i;g++){var d=a[g],j=d.getSymbolTypeName();b==j&&(j={},j[f]=e,d._addActionsFromData(j),d._addBindingFromData(c))}}}else h.logError("$.Edge.Symbol."+
f+": symbol not found")};l.bindElementAction=function(a,b,c,d,e){y(a,b,c,d,e,"element","bindElementAction")};l.bindTimelineAction=function(a,b,c,d,e){y(a,b,c,d,e,"timeline","bindTimelineAction")};l.bindTriggerAction=function(a,b,c,d,e){var g=h.getCompositionSymbolDefns(a)[b];if(g)if(g=g.timelines[c].timeline){var f="trig_"+h.Symbol._makeUniqueID();g.push({trigger:[f,c],position:d,duration:0,id:f});y(a,b,c,f,e,"timeline","bindTriggerAction")}else h.logError("$.Edge.Symbol.bindTriggerAction: timeline not found");
else h.logError("$.Edge.Symbol.bindTriggerAction: symbol not found")};var z=(new Date).getTime(),A=function(){for(var a="eid_"+z++;f("#"+a).length>0;)a="eid_"+z++;return a};l._makeUniqueID=A;h.registerFonts=function(a){if(a){var b,c,d,e;if(!h.fonts)h.fonts={};for(fontName in a)if(!h.fonts[fontName]&&(d=a[fontName])&&d!=""){b=!1;for(sExistingFont in h.fonts)h.fonts[sExistingFont]==d&&(b=!0);if(!b)if(h.fonts[fontName]=d,b=d.indexOf("http://use.typekit.com/"),b>0){if(c=d.indexOf('"',b+1),c>0)sTKURL=
d.substring(b,c),d=document.createElement("script"),d.src=sTKURL,d.type="text/javascript",document.getElementsByTagName("head")[0].appendChild(d),e=function(){try{Typekit.load()}catch(a){setTimeout(e,100)}},setTimeout(e,100)}else f("head").append(d)}}};h.compositions=h.compositions||{};h.compositionDefns=h.compositionDefns||{};h.compositionFonts=h.compositionFonts||{};h.compositionReadyHandler=h.compositionReadyHandler||{};h.registerCompositionDefn=function(a,b,c){if(a&&a.length>0&&!h.compositionDefns[a])for(symbolName in h.compositionDefns[a]=
b,h.compositionFonts[a]=c,h.registerFonts(c),b)b[symbolName].typeName=symbolName};h.getCompositionSymbolDefns=n;h.getComposition=function(a){if(a)return h.compositions[a]};h.registerCompositionReadyHandler=function(a,b,c){c=c||{};if((!window.edge_authoring_mode||c._tool||window.edge_remote_authoring)&&a&&b)h.compositions[a]?h.compositions.ready(b):(h.compositionReadyHandler[a]=h.compositionReadyHandler[a]||[],h.compositionReadyHandler[a].push(b))};var B=h.Composition=function(a,b,c){c=c||{};if(!window.edge_authoring_mode||
c._tool||window.edge_remote_authoring){h.Notifier.call(this);var d,p=!1;d=0;var g,k=this,c=h.compositionReadyHandler[a];this.symbolDefns=n(a);this.symbolInstances=[];this.compId=a;this.imageRequestCount=0;this.imageRequestList=[];this.readyList=[];this.$loadCalled=this.readyCalled=!1;h.compositions[a]=this;f(window).load(function(){k.$loadCalled=!0;k.imageRequestCount<=0&&k.callReadyList()});e(o);for(g in b)if(d=f(b[g]),d.size()>0){p=!0;break}p||(p=f("body"),f(p).addClass(a));for(g in b)d=f(b[g]),
d.each(function(){k.convertElementToSymbol(this,g)});if(c)for(d=0;d<c.length;d++)this.ready(c[d])}};f.extend(B.prototype,h.Notifier.prototype,{play:function(a){if(!window.edge_authoring_mode||a)if(typeof h.autoPlay=="undefined"||h.autoPlay)for(var a=this.symbolInstances.length,b=0;b<a;b++)this.symbolInstances[b]._playAuto()},getSymbols:function(){return this.symbolInstances},ready:function(a){this.readyCalled?a.call():this.readyList&&this.readyList.push(a)},getCompId:function(){return this.compId},
requestImage:function(a){this.imageRequestCount++;var b=this,c=new Image;this.imageRequestList.push(c);f(c).load(function(){b.imageRequestCount--;b.imageRequestCount<=0&&b.$loadCalled&&setTimeout(function(){b.callReadyList()},0)});c.src=a;return null},callReadyList:function(){this.imageRequestList=[];this.readyCalled=!0;var a=jQuery.Event("compositionReady");a.compId=this.getCompId();for(jQuery(document).trigger(a);this.readyList.length>0;)this.readyList.shift().call();a=jQuery.Event("loaded");a.compId=
this.getCompId();jQuery(document).trigger(a)},getStage:function(){return l.get(f("."+this.getCompId()))},createSymbolChild:function(a,b,c,d){if(a&&b&&this.symbolInstances&&this.symbolDefns[a]){var e=[],g=this;f(b).each(function(){var b=f(this),i=document.createElement("div");(c||c===0)&&b.children().eq(c).get(0)?(b=b.children(),c<0?b.eq(c).after(i):b.eq(c).before(i)):b.append(i);var b={},h;d&&typeof d==="object"?b.autoPlay=d:typeof d==="string"?d==="false"?h=!1:d==="true"&&(h=!0):h=d;if(i=g.convertElementToSymbol(i,
a,b))typeof h==="boolean"&&i.setAutoPlay(h),e.push(i)});if(this.readyCalled)for(b=0;b<e.length;b++)e[b]._playAuto();return e}},convertElementToSymbol:function(a,b,c){if(a&&f(a)&&this.symbolInstances&&this.symbolDefns[b])return c=c||{},c.regenerateID=c.regenerateID||!0,a=new l(f(a),{data:this.symbolDefns[b],composition:this,opts:c}),this.symbolInstances.push(a),a},getSymbolDefnSymbols:function(a){var b=[];if(!this.symbolInstances)return b;if(this.symbolDefns.hasOwnProperty(a))for(var c=this.symbolInstances.length,
d=0;d<c;d++)this.symbolInstances[d].getSymbolTypeName()===a&&b.push(this.symbolInstances[d]);return b},removeSymbol:function(a,b){if(this.symbolInstances){var c=l.get(a);c&&c.deleteSymbol(b)}}});var e;h.initialize=function(a,b,c){if(!window.edge_authoring_mode||c||window.edge_remote_authoring){if(typeof t=="undefined")t=h.symbolInstances=[];f.extend(o,a);e(o);var a=t,d;for(d in o)if(o.hasOwnProperty(d)){o[d].typeName=d;var c=[],c=".symbol_"+d,c=b?f(b).find("*").andSelf().filter(c):f(c),p=c.size(),
g;for(g=0;c&&g<p;g++){var k=new l(f(c.get(g)),{data:o[d]});t.push(k);if(d=="stage")h.stage=k}}if(a.length===0||!h.stage)h.stage=new l(f("body"),{data:o.stage}),t.push(h.stage);window.runtimeReady&&window.runtimeReady()}};e=function(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b].timelines)for(var c in a[b].timelines)if(a[b].timelines.hasOwnProperty(c))for(var d=a[b].timelines[c].timeline,e=d.length,f=0;f<e;f++){var h=d[f];if(!h.id)h.id=A()}};h.play=function(a){if(!window.edge_authoring_mode||a)if(typeof h.autoPlay==
"undefined"||h.autoPlay)for(var a=this.symbolInstances.length,b=0;b<a;b++){var c=t[b],d=c.options.data.autoPlay;typeof d=="string"&&d!="true"?c.play(d):(typeof d=="undefined"||d===!0||d=="true")&&c.play("Default Timeline")}};h.logDebug=function(){};h.logInfo=function(){};h.logWarn=function(){};h.logError=function(){};h.logFatal=function(){};f.extend(h.TimelineObject.prototype,{compute:function(a,b,c,d){if(!this.dDuration){var e=this.duration,g=null;this.animation&&this.animation.getDuration&&(g=this.animation.getDuration());
this.dScale=e!=-1&&e!==0?g/e:1;this.dDuration=e!=-1?e:g}e=this.dDuration;e=e===0?1:e;c>=e&&(c=e);c<=0&&(c=0);if(this.animation)return e=f.easing[this.easing](c/e,c,0,1,e),this.animation.compute(a,b,c*this.dScale,e,d)}});f.extend(h.Timeline.prototype,{compute:function(a,b,c,d){for(var e=this.objects,g=e.length,h=[],i={obj:null,end:0},j={obj:null,start:this.getDuration()},l=0;l<g;l++){var m=e[l];if(!m.animation.isTrigger&&b==m.animation.property&&a==m.animation.elements)if(c>=m.position&&c<=m.position+
m.duration){if(m=m.compute(a,b,c-m.position,d))f.isArray(m)||(m=[m]),h=m}else if(c<m.position){if(m.position<=j.start)j.start=m.position,j.obj=m}else if(c>m.position+m.duration&&m.position+m.duration>=i.end)i.end=m.position,i.obj=m}if(!h||f.isArray(h)&&h.length===0)if(i.obj&&i.obj.animation.toValue)h=i.obj.animation.toValue;else if(j.obj&&j.obj.animation.fromValue)h=j.obj.animation.fromValue;f.isArray(h)||(h=[h]);return h}});f.extend(s.prototype,{compute:function(a,b,c,d){c=this.property;if(a!=this.elements||
b!=c)return null;for(var a=this.fromValues,b=this.toValues,c=this.filter,e=a.length,f=[],h=0;h<e;h++){var i=a[h],j=b[h];i+=(j.value-i)*d;c&&c[h]&&(i=c[h](i));f.push(i+j.unit)}return f}});f.extend(h.TransformTween.prototype,{compute:s.prototype.compute})})(jQuery,jQuery.Edge);(function(f,h){if(typeof h.DeclareMarkup=="undefined"){var n=function(){function h(e,a,b,c,d,l){var g=document.createElement(e);g.id=a;g.style.position="absolute";$eleNew=f(g);$eleNew.addClass(a+"_id");if(b.className)g.className=b.className;$eleNew.css("left",b.rect[0]+"px");$eleNew.css("top",b.rect[1]+"px");b.rect[2]>0&&$eleNew.css("width",b.rect[2]+"px");b.rect[3]>0&&$eleNew.css("height",b.rect[3]+"px");b.overflow&&($eleNew.css("overflow",b.overflow),(b.overflow=="hidden"||b.overflow=="scroll")&&
$eleNew.css("text-overflow","clip"));b.br&&(b.br.length==1?$eleNew.css("border-radius",b.br[0]+"px"):($eleNew.css("border-top-left-radius",b.br[0]),$eleNew.css("border-top-right-radius",b.br[1]),$eleNew.css("border-bottom-right-radius",b.br[2]),$eleNew.css("border-bottom-left-radius",b.br[3])));if(b.tf){for(var a=[],k=[[3,0],[3,0],[2,0],[3,1],[2,"50%"]],i=0;i<k.length;i++){a[i]=[];b.tf[i]||(b.tf[i]=[]);for(var j=0;j<k[i][0];j++)b.tf[i][j]||(b.tf[i][j]=k[i][1]),a[i][j]=b.tf[i][j]}k=typeof a[4][0]==
"string"?a[4][0]+" "+a[4][1]:a[4][0]+"px "+a[4][1]+"px";$eleNew.css("-webkit-transform-origin",k);$eleNew.css("-moz-transform-origin",k);$eleNew.css("-ms-transform-origin",k);$eleNew.css("-o-transform-origin",k);"webkitAppearance"in document.documentElement.style?$eleNew.css("-webkit-transform","translate3d("+a[0][0]+"px,"+a[0][1]+"px,"+a[0][2]+"px) rotateZ("+a[1][0]+"deg) rotateX("+a[1][1]+"deg) rotateY("+a[1][2]+"deg) skew("+a[2][0]+"deg,"+a[2][1]+"deg) scale3d("+a[3][0]+","+a[3][1]+","+a[3][2]+
")"):(k="translate("+a[0][0]+"px,"+a[0][1]+"px) rotate("+a[1][0]+"deg)  skewX("+a[2][0]+"deg) skewY("+a[2][1]+"deg) scale("+a[3][0]+","+b.tf[3][1]+")",$eleNew.css("-moz-transform",k),$eleNew.css("-ms-transform",k),$eleNew.css("-o-transform",k))}else g.style.webkitTransform="translateZ(0)";b.opacity&&$eleNew.css("opacity",b.opacity);b.stroke&&((a=b.stroke[0])||(a=0),(k=b.stroke[1])?typeof k=="string"&&(k=[k]):k=["rgba(0,0,0,0)"],(i=b.stroke[2])||(i="none"),$eleNew.css("border",""+a+"px "+i+" "+k[0]));
if(b.fill&&(a=b.fill[0],typeof a=="string"&&(a=[a]),(k=b.fill[1])||(k="solid"),k=="solid"&&a&&$eleNew.css("background-color",a[0]),b.fill[1]))if(a=b.fill[1],typeof a=="string"?a=[a]:typeof a=="object"&&((k=a[window.EdgeScreenProfile.name])||(k=a["default"]),a=k),b.tag&&b.tag=="img"){if(a[0])g.src=a[0]}else{if(a[0]){$eleNew.css("background-image","url("+a[0]+")");if(a[1]||a[2])a[1]||(a[1]="0px"),a[2]||(a[2]="0px"),$eleNew.css("background-position",a[1]+" "+a[2]);l.requestImage(a[0])}a[3]||$eleNew.css("background-repeat",
"no-repeat");a[4]&&a[4]!="scroll"&&$eleNew.css("background-attachment",a[4])}b.source&&(g.setAttribute("src",b.source),e=="video"&&g.setAttribute("controls","controls"),e=="audio"&&g.setAttribute("autoplay","autoplay"));$eleNew.css("-webkit-tap-highlight-color","rgba(0, 0, 0, 0)");if(c){if(!c.appendChild)return g;c.firstChild&&d>=0&&c.children&&d<c.children.length?c.insertBefore(g,c.children[d]):c.appendChild(g)}return g}function l(e,a,b,c,d,l,g){var j;z(a,c);var k=null;b&&b.nodeName&&b.nodeName.toLowerCase()==
"canvas"&&(j=k=n.stageLookup[b.id],b=j);var i=null,k="div";if(a.tag)k=a.tag;switch(a.t){case "def":break;case "rect":case "elipse":case "group":i=h(k,e,a,b,d,l,g);break;case "image":i=h(k,e,a,b,d,l,g);break;case "video":i=h("video",e,a,b,d,l,g);break;case "audio":i=h("audio",e,a,b,d,l,g);break;case "text":i=h(k,e,a,b,d,l,g);b=f(i);a.font&&(a.font[0]&&a.font[0]!==""&&b.css("font-family",a.font[0]),typeof a.font[1]!="object"&&(a.font[1]=[a.font[1]]),a.font[1][1]||(a.font[1][1]="px"),a.font[1][0]&&a.font[1][0]!==
""&&b.css("font-size",a.font[1][0]+a.font[1][1]),a.font[2]&&a.font[2]!==""&&b.css("color",a.font[2]),a.font[3]&&a.font[3]!==""&&b.css("font-weight",a.font[3]),a.font[4]&&a.font[4]!==""&&b.css("text-decoration",a.font[4]),a.font[5]&&a.font[5]!==""&&b.css("font-style",a.font[5]));a.align&&b.css("text-align",a.align);if(a.position)i.style.position=a.position;(!a.rect[2]||a.rect[2]<=0)&&(!a.rect[3]||a.rect[3]<=0)&&b.css("white-space","nowrap");i.appendChild(document.createTextNode(a.text));break;case "canvas":i=
h("canvas",e,a,b,d,l,g);k={def:a,params:c,stage:new A(i),children:{}};k.obj=k.stage;k.obj.width=a.rect[2];k.obj.height=a.rect[3];n.stageLookup[e]=k;break;case "line":break;case "shape":if(!b)break;i={def:a,params:c,obj:new B,stage:b.stage,children:{}};i.obj.x=a.rect[0];i.obj.y=a.rect[1];i.obj.width=a.rect[2];i.obj.height=a.rect[3];b.children[a.id]=i;b.obj.addChild(i.obj);break;default:alert("unhandled type == "+a.t)}return i}function s(e,a,b,c,d,f,g){if(b=l(e,a,c,d,f||0,g)){n.nodeSymbolInstanceLookup[e]?
n.DOMNodeStarted(b,c,a,n.nodeSymbolInstanceLookup[e].symbolName,n.nodeSymbolInstanceLookup[e].autoPlay):n.DOMNodeStarted(b,c,a);if(a.c)for(e=0;e<a.c.length;e++)c=a.c[e],s(c.id,c,a,b,d,e,g);n.DOMNodeCompleted(b)}return b}function r(e,a){var b=e,c;if(e.base){if(typeof e.base=="string")e.base=[e.base];if(e.base.length>0){b={};for(c=0;c<e.base.length;c++){var d=n.nodeLookup[e.base[c]];d&&f.extend(!0,b,d)}f.extend(!0,b,e)}}b.base=null;for(c=0;b.c&&c<b.c.length;c++)b.c[c]=r(b.c[c],a);return b}function t(e,
a){if(e)if(z(e,a),!e.id||e.id==="")alert("elements without ids are not yet supported");else{n.nodeLookup[e.id]=e;for(var b=0;e.children&&b<e.children.length;b++)t(e.children[b])}}function o(e,a){if(!e)return a;if(typeof a=="string"){var b=a.search(/\$\{/);if(b>=0){var c=a.search(/\}/);if(c>b)return b=a.slice(b+2,c),e[b]}}return a}function y(e,a){var b=e.obj.graphics,c=e.params;b.clear();var d="rgba(0,0,0,0)";e.def.fill&&typeof e.def.fill=="object"&&(d=e.def.fill[0]);b.beginFill(d).drawRect(0,0,o(c,
e.def.rect[2]),o(c,e.def.rect[3]));for(var f in e.children)e.children.hasOwnProperty(f)&&y(a.children[f])}var z,A,B;z=function(e,a){if(e.type)e.t=e.type;if(e.t)e.t=e.t.toLowerCase();e.type=e.t;e.children?e.c=e.children:e.children=e.c;e.rect?e.r=e.rect:e.rect=e.r;if(!e.rect)e.rect=[];for(;e.rect.length<4;)e.rect[e.rect.length]=0;e.borderRadius?e.br=e.borderRadius:e.borderRadius=e.br;e.shape?e.sh=e.shape:e.shape=e.sh;e.transform?e.tf=e.transform:e.transform=e.tf;if(e.tf){for(;e.tf.length<5;)e.tf[e.tf.length]=
0;for(;e.transform.length<8;)e.tf[e.tf.length]=1}e.opacity?e.o=e.opacity:e.opacity=e.o;if(e.stroke)e.s=e.stroke;e.stroke=e.s;if(e.fill)e.f=e.fill;if(e.f&&a){var b=a[e.f];if(b)e.f=b}e.fill=e.f};return{stageLookup:{},nodeLookup:{},nodeSymbolInstanceLookup:{},DOMNodeSeek:function(){},DOMNodeReset:function(){},DOMNodeStarted:function(){},DOMNodeCompleted:function(){},renderDOM:function(e,a,b,c,d,f){window.EdgeScreenProfile={name:"detected",dim:[screen.width,screen.height]};n.nodeLookup={};for(c=0;c<e.length;c++)t(e[c],
b);for(c=0;c<e.length;c++)e[c]&&(e[c]=r(e[c],b));n.nodeSymbolInstanceLookup={};if(d)for(c=0;c<d.length;c++)n.nodeSymbolInstanceLookup[d[c].id]=d[c];for(c=0;c<e.length;c++)e[c]&&(d=e[c],(d=s(d.id,d,null,null,b,0,f))&&a.appendChild(d))},buildSceneGraphNode:s,drawSceneGraph:function(){for(var e in n.stageLookup)if(n.stageLookup.hasOwnProperty(e)){var a=n.stageLookup[e],b;for(b in a.children)a.children.hasOwnProperty(b)&&y(a.children[b],a);a.stage.update()}},createElement:l}}();h.DeclareMarkup=n}})(jQuery,
jQuery.Edge);

