text: !function(a){"use strict";a.module("humanUI",["humanUI.config","humanUI.utilities","humanUI.parse","humanUI.background","humanUI.load","humanUI.camera","humanUI.timeline","humanUI.crossSection","humanUI.annotations","humanUI.hotspots","humanUI.actions","humanUI.dissect","humanUI.modes","humanUI.info","humanUI.media","humanUI.scene","humanUI.bookmark","humanUI.fullscreen","humanUI.snapshot","humanUI.rpc","humanUI.templates"]).constant("MIN_HUMAN_VERSION","10.6.0").run(["$rootScope","Human","RpcDefinitions","ConfigCreator",function(b,c,d,e){c.properties.subscribe({propId:"locale",callback:function(a){b.$broadcast("human.locale",a)}});var f=["modules.activate.finish","modules.deactivate.finish","timeline.timeFrame.updated","timeline.chapters.activated","bookmarks.restored","annotations.shown","dissect.toggled","isolate.toggled","xray.toggled"];a.forEach(f,function(a){c.events.on(a,function(){b.$applyAsync()})}),e.init(),d.init()}]).factory("currentModule",["$window","Human",function(a,b){var c={id:null,data:null};return b.events.on("modules.create.start",function(b){c.id!==b.moduleId&&(c.id=b.moduleId,c.data=a.JSON.parse(a.JSON.stringify(b.moduleData)))}),c}]).factory("Human",["$window","MIN_HUMAN_VERSION",function(b,c){var d,e,f,g=[];a.forEach([Human.VERSION,c],function(a){a.replace(/^(\d+)\.(\d+)\.(\d+)-?(\w+)?$/,function(a,b,c,d,e){g.push({major:b,minor:c,patch:d,client:e||null})})});var h=["Human",Human.VERSION,"is not reliably supported! Use",c,"or higher."].join(" "),i=function(a){0!==a.length&&(f=a.shift(),d=Number(g[0][f]),e=Number(g[1][f]),e>d?b.console.warn(h):d===e&&i(a))};return 2===g.length?i(["major","minor","patch"]):b.console.warn(h),Human}]),a.module("humanUI.utilities",[]).factory("isBaseAnatomy",function(){return function(b){var c=a.isObject(b)?b.moduleId:b;return c?Human.modules.isBaseModule(c):!1}}).factory("touchTarget",["$document",function(a){return function(b,c){b.addEventListener("touchmove",function(b){var d=b.changedTouches[0],e=a[0].elementFromPoint(d.pageX,d.pageY);c(e)})}}]).factory("destroyInterval",["$interval",function(b){return function(c){a.isDefined(c)&&(b.cancel(c),c=void 0)}}]).factory("checkModule",function(){return function(b){try{a.module(b)}catch(c){return!1}return!0}}).factory("doTween",["$window",function(b){return function(c,d,e,f,g){a.isArray(c)||(c=[c]),a.isArray(d)||(d=[d]);var h,i=[],j=[];for(h=0;h<c.length;h++)j.push(c[h]),i.push((d[h]-c[h])/e);var k,l,m=0,n=function(a){for(l||(l=a),k=a-l,m+=k,l=a,h=0;h<i.length;h++)j[h]+=k*i[h];e>m?(f(j),b.requestAnimationFrame(n)):(f(d),g(),b.cancelAnimationFrame(o))},o=b.requestAnimationFrame(n)}}]).factory("ElementDisplay",["OutsideListen",function(a){return{create:function(b){if(b.trigger&&b.target){var c,d=b.action||"toggle",e=d[0].toUpperCase()+d.slice(1),f=b.eventName||"element"+e,g="show"===d?"removeClass":"hide"===d?"addClass":"toggleClass";b.globalClose&&(c=a.create(b.target),c.excludedEls=[b.trigger[0],b.target[0]]);var h=function(a){b.target[a]("ng-hide");var d=!b.target.hasClass("ng-hide");c&&(d?c.add(h.bind(null,"addClass")):c.remove()),b.trigger.triggerHandler(f,d),b.target.triggerHandler(f,d)};b.trigger.on("click",h.bind(null,g))}}}}]).factory("OutsideListen",["$document",function(b){var c=function(c,d){d=d||{},this.element=c,this.excludedEls=[this.element[0]],a.isArray(d.exclude)&&a.forEach(d.exclude,function(a){var c=b[0].querySelectorAll(a);c=Array.prototype.slice.call(c),this.excludedEls=this.excludedEls.concat(c)},this)};return c.prototype._checkContainment=function(a){for(var b=0;b<this.excludedEls.length;b++)if(this.excludedEls[b].contains(a))return!0;return!1},c.prototype.add=function(a){var c=function(b){this._checkContainment(b.target)||(a(),this.remove())};this.checkOutside=c.bind(this),b[0].addEventListener("touchstart",this.checkOutside,!0),b[0].addEventListener("mousedown",this.checkOutside,!0)},c.prototype.remove=function(){b[0].removeEventListener("touchstart",this.checkOutside,!0),b[0].removeEventListener("mousedown",this.checkOutside,!0),this.checkOutside=null},{create:function(a,b){return new c(a,b)}}}]).filter("translate",function(){return function(a,b,c){var d=a[b];return c&&a.translations&&a.translations[c]&&(d=a.translations[c][b]||d),d}}).filter("excludeBaseAnatomy",["isBaseAnatomy",function(a){return function(b){return a(b)?null:b}}]).filter("escapeHtml",function(){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=[];a.forEach(b,function(a,b){c.push(b)});var d=new RegExp("(?:"+c.join("|")+")","g"),e=function(a){return b[a]};return function(a){return a.replace(d,e)}}).filter("dashNormalize",function(){return function(a){return/^[a-z]+([_[A-Z])[a-z]+/.test(a)?a.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([a-zA-Z])_/g,"$1-").toLowerCase():a}}).filter("camelCaseNormalize",function(){return function(b){return a.isString(b)&&(b=b.replace(/[-_]([a-z])/g,function(a){return a[1].toUpperCase()})),b}}).filter("formatPosition",function(){return function(a,b){var c,d="array"===b?[]:{},e=["x","y","z"];switch(b){case"array":if(a.hasOwnProperty("length"))d=a;else for(c=0;c<e.length;c++)a.hasOwnProperty(e[c])&&d.push(a[e[c]]);break;case"object":if(a.hasOwnProperty("length"))for(c=0;c<a.length;c++)d[e[c]]=a[c];else d=a;break;default:d=a}return d}}).directive("toggleButton",function(){return{restrict:"A",scope:{config:"=toggleButton"},link:function(b,c,d){"on"===d.toggleDefault&&(b.config.model=!0);var e,f=function(d){if(b.config.model=a.isDefined(d)?!!d:!b.config.model,b.config.model!==e){var f=b.config.model?"on":"off";a.isFunction(b.config[f])&&b.config[f](),c[b.config.model?"addClass":"removeClass"]("on"),e=b.config.model}};c.on("click",function(){f(),b.$digest()}),b.$watch("config.model",function(b){a.isDefined(b)&&f(b)})}}}),a.module("humanUI.utilities").factory("HumanCollection",["$interpolate",function(b){var c,d,e,f=function(a,b){b=b||{},this.element=a,this.lis={},this.collapseTemplate=b.collapseTemplate||"<span collapse></span>",this.element.data("humanCollection",this)},g=f;return g.create=function(a){return new g(a)},g.compare=function(a,b,c){var d,e,f,g=[],h=[],i={},j={};if(b){for(d=0;d<a.length;d++)i[a[d][c]]=a[d];for(d=0;d<b.length;d++)j[b[d][c]]=b[d];for(e in i)i.hasOwnProperty(e)&&!j.hasOwnProperty(e)&&g.push(i[e]);for(e in j)j.hasOwnProperty(e)&&!i.hasOwnProperty(e)&&h.push(j[e]);f={toAdd:g,toRemove:h}}else f={toAdd:a,toRemove:h};return f},g.sort=function(a){return function(b,c){var d=b[a].toLowerCase(),e=c[a].toLowerCase();return e>d?-1:d>e?1:0}},g.prototype.buildClasses=function(a,b,c){var f;d=[],e=c?c(a):{},b&&(e["tree-leaf"]=!0);for(f in e)e.hasOwnProperty(f)&&e[f]&&d.push(f);return d.join(" ")},g.prototype._buildObjectGroups=function(b){var c,d,e,f,h,i={},j="abcdefghijklmnopqrstuvwxyz".split("");a.forEach(j,function(a){i[a]=[]});for(h in b)if(b.hasOwnProperty(h)){if(f=b[h],c=!1,f.displayName)for(d=0;!c&&d<f.displayName.length;)e=f.displayName[d].toLowerCase(),c=j.indexOf(e)>=0,d++;if(!c)continue;i[e].push(f)}var k=g.sort("displayName");for(h in i)i.hasOwnProperty(h)&&i[h].sort(k);return i},g.prototype.buildDOMString=function(a,d,e){var f,g,h,i,j,k,l,m=this._buildObjectGroups(d),n="<ul>";f=e.itemId?' id="{{'+e.itemId+' | escapeHtml }}"':"";var o="<li"+f+' class="{{ classes }}">';for(i in m)if(m.hasOwnProperty(i)){for(l=m[i],l.length>0&&(f='id="letter-group-'+i+'"',j='<h1 class="letter-header">',j+=i.toUpperCase()+"</h1>",n+="<li "+f+' class="letter-group">'+j+"<ul>"),k=0;k<l.length;k++){if(c=l[k],!c.objectId||!c.displayName)return;g=e.itemClasses,c.classes=this.buildClasses(c,!1,g),h=o+a,h=b(h)(c),delete c.classes,n+=h+"</li>"}l.length>0&&(n+="</ul></li>")}return n+="</ul>"},g.prototype._buildTreeDOMString=function(a,d,e,f){var g,h,i,j,k,l=f?"<ul>":"";i=e.itemId?' id="{{'+e.itemId+' | escapeHtml }}"':"";var m="<li"+i+' class="{{ classes }}">';for(k=0;k<d.length;k++){if(c=d[k],!c.objectId||!c.displayName)return;g=e.isLeaf?e.isLeaf(c):!1,j=e.itemClasses,c.classes=this.buildClasses(c,g,j),h=m+(g?"":this.collapseTemplate)+a,h=b(h)(c),delete c.classes,g||(h+=this._buildTreeDOMString(a,c.objects,e,!0)),l+="</li>"+h}return l+=f?"</ul>":""},g.prototype.buildTreeDOMString=function(a,b,c,d){return this._buildTreeDOMString(a,b,c,d)},g.prototype.buildLis=function(a){if(a&&a.length)for(var b=0;b<a.length;b++)this.lis[a[b].id]=a[b];this.element.triggerHandler("humanCollection.built")},g.prototype.emptyLis=function(){for(var a in this.lis)this.lis.hasOwnProperty(a)&&delete this.lis[a];this.element.triggerHandler("humanCollection.emptied")},g.prototype.getLi=function(b){return this.lis[b]?a.element(this.lis[b]):void 0},g.prototype.removeLi=function(a){this.lis[a]&&(this.lis[a].remove(),delete this.lis[a])},g}]).factory("TreeCollapse",["$timeout",function(b){var c={animate:!0};return{show:function(d,e){if(!d.data("transitioning")){var f=d.parent();e=a.extend({},c,e);var g=e.animate;f.removeClass("collapsed").addClass("opening"),g&&d.addClass("transitioning"),d.css("height",0),d.data("transitioning",!0),f.data("collapsed",!1);var h=function(){g&&d.removeClass("transitioning"),f.addClass("open").removeClass("opening"),d.css("height","auto"),d.data("transitioning",!1)};g?b(h,350):b(h),d.css("height",d[0].scrollHeight+"px")}},hide:function(d,e){var f;if(!d.data("transitioning")){var g=d.parent();e=a.extend({},c,e);var h=e.animate;f=d.css("height",d[0].offsetHeight+"px")[0].offsetHeight,h&&d.addClass("transitioning"),g.removeClass("open").addClass("collapsing"),d.data("transitioning",!0);var i=function(){d.data("transitioning",!1),h&&d.removeClass("transitioning"),g.addClass("collapsed").removeClass("collapsing"),g.data("collapsed",!0)};d.css("height",0),h?b(i,350):b(i)}},toggle:function(a){this[a.parent().data("collapsed")?"show":"hide"](a)},getTarget:function(b){if(b)for(var c=b.children(),d=0;d<c.length;d++)if("ul"===c[d].tagName.toLowerCase())return a.element(c[d])},globalBind:function(b){var c=this;b.off("click.collapseToggle"),b.on("click.collapseToggle",function(b){if(b.target.hasAttribute("collapse")){b.stopPropagation();var d=a.element(b.target),e=d.parent();c.toggle(c.getTarget(e))}})},init:function(a){a.find("li").addClass("collapsed").data("collapsed",!0),a.children().find("ul").css("height","0px")}}}]).directive("collapse",["TreeCollapse",function(a){return{restrict:"A",link:function(b,c){c.off("click.collapseToggle"),c.on("click.collapseToggle",function(b){b.stopPropagation();var d=c.parent();a.toggle(a.getTarget(d))})}}}]).directive("humanList",["HumanCollection",function(a){return{restrict:"E",scope:{listData:"=",listConfig:"="},compile:function(b){var c=b[0].innerHTML;b.addClass("human-collection").empty();var d=function(b,d){var e=a.create(d),f=function(a){var f=b.listConfig||{},g=e.buildDOMString(c,a,f);d.empty().append(g),f.letterHeaders&&d.addClass("letter-headers"),e.emptyLis(),e.buildLis(d.find("li"))};b.$watch("listData",function(a){a&&f(a)})};return d}}}]).directive("humanTree",["$compile","HumanCollection","TreeCollapse",function(b,c,d){return{restrict:"E",scope:{treeData:"=",treeConfig:"="},compile:function(e){var f=e[0].innerHTML;e.addClass("human-collection").empty();var g=function(e,g){var h=c.create(g),i=function(i,j){var k,l=e.treeConfig||{};if(l.compare&&l.itemId){for(var m,n,o,p=c.compare(i,j,l.itemId),q=0;q<p.toRemove.length;q++)h.removeLi(p.toRemove[q][l.itemId]);m=g[0].firstChild,n=m&&"ul"===m.tagName.toLowerCase(),o=n?a.element(m):g,k=h.buildTreeDOMString(f,p.toAdd,l,!n),o.append(k)}else k=h.buildTreeDOMString(f,i,l,!0),g.empty().append(k);l.compile===!1?d.globalBind(g):b(g.contents())(e),d.init(g),h.emptyLis(),h.buildLis(g.find("li"))};e.$watch("treeData",function(a,b){a&&i(a,b)})};return g}}}]),a.module("humanUI.utilities").factory("Draggable",["$window","$document",function(b,c){var d,e,f,g="touchstart mousedown",h="touchmove mousemove",i="touchend touchcancel mouseup",j=[],k=function(d,e){var f={element:null,axis:!1,elementBounds:!1};if(a.isString(d.element)){var g=d.element.split(".");f.element="parent"===g[0]?e.parent()[0]:"window"===g[0]?b:c[0].querySelector(g[0]),("width"===g[1]||"height"===g[1])&&(f.elementBounds=g[1])}else"boolean"==typeof d.element&&(d.element||(f.element=!1));return("x"===d.axis||"y"===d.axis)&&(f.axis=d.axis),f},l=function(b){this.element=b.element,this.handle=b.handle||b.element,this.x=this.y=0,this.constraints=k(b.constraints||{},this.element),this.callbacks={onStart:b.onStart||a.noop,onMove:b.onMove||a.noop,onEnd:b.onEnd||a.noop},a.forEach(g.split(" "),function(a){this.handle.on(a+".draggable",this.onStart.bind(this))},this)};return l.prototype.setElCoords=function(){if(this.width=this.element[0].offsetWidth,this.height=this.element[0].offsetHeight,d=b.parseInt(this.element.css("margin-left")),e=b.parseInt(this.element.css("margin-top")),this.x=this.element[0].offsetLeft-d,this.y=this.element[0].offsetTop-e,this.constraints.element){var a={};this.constraints.element===b?(a.left=0,a.top=0,a.right=b.innerWidth,a.bottom=b.innerHeight):a=this.constraints.element.getBoundingClientRect();var c=this.element[0].offsetParent.getBoundingClientRect();this.xMin=a.left-c.left,this.xMax=c.width+(a.right-c.right),this.yMin=a.top-c.top,this.yMax=c.height+(a.bottom-c.bottom)}else this.xMin=this.yMin=-(1/0),this.xMax=this.yMax=1/0},l.prototype.setEventCoords=function(a){a=a.originalEvent||a,a=a.changedTouches?a.changedTouches[0]:a,this.deltaX=a.clientX-this.eventX||0,this.deltaY=a.clientY-this.eventY||0,this.eventX=a.clientX,this.eventY=a.clientY},l.prototype.constrainX=function(a){return this.constraints.element&&(a<this.xMin&&(a=this.xMin),f="width"===this.constraints.elementBounds?0:this.width,a+f>this.xMax&&(a=this.xMax-f)),"y"===this.constraints.axis&&(a=this.x),a},l.prototype.constrainY=function(a){return this.constraints.element&&(a<this.yMin&&(a=this.yMin),f="height"===this.constraints.elementBounds?0:this.height,a+f>this.yMax&&(a=this.yMax-f)),"x"===this.constraints.axis&&(a=this.y),a},l.prototype.onStart=function(b){b.stopPropagation(),b.preventDefault(),this.setElCoords(),this.setEventCoords(b),a.forEach(h.split(" "),function(a){c.on(a+".draggable",this.onMove.bind(this))},this),a.forEach(i.split(" "),function(a){c.on(a+".draggable",this.onEnd.bind(this))},this),this.callbacks.onStart(this.x,this.y)},l.prototype.move=function(a,b){(a!==this.x||b!==this.y)&&(this.x=a,this.y=b,this.element.css({left:this.x+"px",top:this.y+"px"}))},l.prototype.onMove=function(a){a.stopPropagation(),a.preventDefault(),this.setEventCoords(a),this.move(this.constrainX(this.x+this.deltaX),this.constrainY(this.y+this.deltaY)),this.callbacks.onMove(this.x,this.y)},l.prototype.onEnd=function(){a.forEach(h.split(" "),function(a){c.off(a+".draggable")},this),a.forEach(i.split(" "),function(a){c.off(a+".draggable")},this),this.callbacks.onEnd()},{create:function(a){var b=new l(a);return j.push(b),b}}}]).directive("draggable",["Draggable",function(b){return{restrict:"A",link:function(c,d,e){var f,g,h=d.find("drag-handle");f=a.isDefined(e.constrainElement)?"false"===e.constrainElement?!1:e.constrainElement:"window",("x"===e.constrainAxis||"y"===e.constrainAxis)&&(g=e.constrainAxis),b.create({element:d,handle:h.length?h:d,constraints:{element:f,axis:g}})}}}]),a.module("humanUI.utilities").factory("HumanKeySelect",["$window",function(b){var c=function(a){return"ArrowUp"===a.key||38===a.keyCode||38===a.which},d=function(a){return"ArrowDown"===a.key||40===a.keyCode||40===a.which},e=function(a){return"Enter"===a.key||13===a.keyCode||13===a.which},f=function(a){return a.clientHeight>0&&a.clientWidth>0},g=function(a){for(var c=a.getBoundingClientRect().height,d=b.getComputedStyle(a),e=["marginTop","marginBottom"],f=0;f<e.length;f++)d[e[f]]&&/px$/.test(d[e[f]])&&(c+=b.parseInt(d[e[f]]));return c},h=function(b,c,d){this.$selectedItem=null,this.enabled=!1,this.$element=b,this.items=this.setItems(c),this.config=a.extend({cycle:!0,selectedClass:"user-selected",onSelected:a.noop},d),this.bindHandlers()};return h.create=function(a,b,c){return new h(a,b,c)},h.prototype._findScrollParent=function(){for(var a=this.items[0],b=null;!b&&a&&a!==this.$element[0];)a=a.parentNode,a&&a.scrollHeight>a.clientHeight&&(b=a);return b},h.prototype._selectItem=function(b){var c=this.config.selectedClass;return this._clearSelectedItem(),b&&(this.$selectedItem=a.element(b),this.$selectedItem.addClass(c)),this.$selectedItem},h.prototype._clearSelectedItem=function(){var a=this.config.selectedClass;this.$selectedItem&&(this.$selectedItem.removeClass(a),this.$selectedItem=null)},h.prototype._isFirstVisibleItem=function(a){for(var b=this.items.indexOf(a),c=b-1;c>=0;c--)if(f(this.items[c]))return!1;return!0},h.prototype._isLastVisibleItem=function(a){for(var b=this.items.indexOf(a),c=b+1;c<this.items.length;c++)if(f(this.items[c]))return!1;return!0},h.prototype._selectNextItem=function(a){var b;for(b=a+1;b<this.items.length;b++)if(f(this.items[b]))return this._selectItem(this.items[b]);if(this.config.cycle)for(b=0;a>b;b++)if(f(this.items[b]))return this._selectItem(this.items[b])},h.prototype._selectPreviousItem=function(a){var b;for(b=a-1;b>=0;b--)if(f(this.items[b]))return this._selectItem(this.items[b]);if(this.config.cycle)for(b=this.items.length-1;b>a;b--)if(f(this.items[b]))return this._selectItem(this.items[b])},h.prototype._handleScroll=function(b,c){var d,e,f,h,i=this.$selectedItem[0],j=g(i),k=2;if(d=i.offsetTop-j*k,e=this._scrollParent.scrollTop,f=i.offsetTop+j*(k+1),h=this._scrollParent.scrollTop+this._scrollParent.clientHeight,this._scrollParent.scrollHeight>this._scrollParent.clientHeight&&(1===b&&f>h||-1===b&&e>d)){a.element(this._scrollParent).one("scroll",c);var l=this._scrollParent.scrollTop,m=j*k*b;if(this._scrollParent.scrollTop=l+m,l===this._scrollParent.scrollTop){var n=this.config.cycle;n&&1===b&&this._isLastVisibleItem(i)?this._scrollParent.scrollTop=0:n&&-1===b&&this._isFirstVisibleItem(i)?this._scrollParent.scrollTop=this._scrollParent.scrollHeight:(a.element(this._scrollParent).off("scroll",c),c())}}else c()},h.prototype.selectItem=function(a){if(a=a||{},a.hasOwnProperty("index")&&this._selectNextItem(a.index-1),a.hasOwnProperty("dir")){if(!this.$selectedItem)return;var b=a.dir,c=this.items.indexOf(this.$selectedItem[0]),d=this[1===b?"_selectNextItem":"_selectPreviousItem"];d=d.bind(this,c),this._scrollParent||(this._scrollParent=this._findScrollParent()),this._scrollParent?this._handleScroll(b,d):d()}},h.prototype.setItems=function(b){this.items=b||[],a.isArray(this.items)||(this.items=Array.prototype.slice.call(this.items))},h.prototype.bindHandlers=function(){var a=this;a.$element.on("focus",function(){a.enabled=!0}),a.$element.on("blur",function(){a.enabled=!1,a._clearSelectedItem()}),a.$element[0].addEventListener("click",function(b){a.enabled&&a.items.length&&a.items.indexOf(b.target)>=0&&a._selectItem(b.target)},!0),b.addEventListener("keydown",function(b){a.enabled&&a.items.length&&(b.stopImmediatePropagation(),c(b)||d(b)?a.selectItem(a.$selectedItem?{dir:d(b)?1:-1}:{index:0}):e(b)&&a.$selectedItem&&a.config.onSelected(a.$selectedItem))},!0)},h}]),a.module("humanUI.utilities").constant("SLIDER_TEMPLATE",['<div class="track">','<div class="progress"></div>','<div class="handle">','<div class="progress-label" style="display:none"></div>',"</div>","</div>"].join("")).factory("HumanSlider",["SLIDER_TEMPLATE","Draggable",function(b,c){var d,e,f=[],g=function(d){this.value=d.value||0,this.axis=d.axis||"x",this.callbacks={onMove:d.onMove||a.noop},this.label=d.label,d.element.innerHTML=b,d.element.setAttribute("axis",this.axis);var e=d.element.children[0];this.elements={container:d.element,track:e,progress:e.children[0],handle:e.children[1],label:e.children[1].children[0]},this.draggable=c.create({element:a.element(this.elements.handle),constraints:{axis:this.axis,element:"x"===this.axis?"parent.width":"parent.height"},onMove:this.onMove.bind(this)});var f=this;this.elements.track.addEventListener("mousedown",function(a){var b=a.target.getBoundingClientRect(),c=a.clientX-b.left,d=a.clientY-b.top;f.onMove(c,d)}),a.isFunction(this.label)&&(this.elements.handle.addEventListener("mouseover",function(){f.elements.label.style.display="block"}),this.elements.handle.addEventListener("mouseleave",function(){f.elements.label.style.display="none"}))};g.prototype.toOffset=function(a){return d="x"===this.axis?h:i,e="x"===this.axis?"offsetWidth":"offsetHeight",a*this.elements.track[e]},g.prototype.fromOffset=function(a,b){return d="x"===this.axis?a:b,e="x"===this.axis?"offsetWidth":"offsetHeight",d/this.elements.track[e]};var h,i,j,k;return g.prototype.move=function(b){this.value=b,j=this.toOffset(this.value),"x"===this.axis?(h=j,i=this.draggable.y,k="width"):(h=this.draggable.x,i=j,k="height"),h===h&&i===i&&(this.draggable.move(h,i),this.elements.progress.style[k]=j+"px",a.isFunction(this.label)&&(this.elements.label.textContent=this.label()))},g.prototype.onMove=function(a,b){this.move(this.fromOffset(a,b)),this.callbacks.onMove(this.value)},{create:function(a){var b=new g(a);return f.push(b),b}}}]),a.module("humanUI.hotspots",[]).directive("humanHotspots",["$window","$compile","HumanActions","HotspotData","Hotspot","HotspotInfo",function(b,c,d,e,f,g){return{restrict:"E",scope:!0,link:function(c,d){f.parentElement=d[0];var h=function(b){a.forEach(b,function(a){var b=f.create(a);b.template&&b.render()})},i=function(a){a=a.toString();var b=e.byChapter;b.hasOwnProperty(a)&&h(b[a])},j=function(b){a.forEach(b,function(a){f.destroy(a)})},k=function(){j(f.hotspots.slice(0)),l=!0},l=!0;Human.events.on("timeline.chapters.activated",function(a){l&&(h(e.global),l=!1);var c=f.hotspots.filter(function(a){return!e.global[a.id]});j(c),i(a.newChapterIndex),b.innerWidth<g.breakPoint?g.hideLabels(f.hotspots):g.showLabels(f.hotspots)}),Human.events.on("modules.deactivate.finish",k),Human.events.on("modules.destroy.finish",k);var m=!1,n=function(){g.testBreakpoint(f.hotspots),m=!1};b.addEventListener("resize",function(){m||(m=!0,b.requestAnimationFrame(n))})}}}]),a.module("humanUI.hotspots").factory("HotspotData",["$timeout","Human","currentModule",function(b,c,d){var e={all:{},global:{},byChapter:{},byName:{}},f=Object.keys(e),g=1;e.getCurrentId=function(){return g},e.add=function(b,c){a.isDefined(b.id)&&(b.name=b.id,delete b.id),b.id=g,this.all[b.id.toString()]=b,a.isDefined(c)&&(b.chapterScope=c),a.isDefined(b.chapterScope)?(c=b.chapterScope.toString(),this.byChapter[c]||(this.byChapter[c]=[]),this.byChapter[c].push(b)):this.global[b.id.toString()]=b,a.isDefined(b.name)&&(this.byName[b.name]=b),g++},e.update=function(b,c){var d=this.all[b.toString()];if(c.hasOwnProperty("chapterScope")){var e=d.chapterScope,f=c.chapterScope;if(d.hasOwnProperty("chapterScope")){var g=this.byChapter[e].indexOf(d);this.byChapter[e].splice(g,1)}else delete this.global[d.id];a.isDefined(f)?(this.byChapter[f]||(this.byChapter[f]=[]),this.byChapter[f].push(d)):(delete c.chapterScope,delete d.chapterScope,this.global[d.id]=d)}if(c.hasOwnProperty("name")){var h=d.name,i=c.name;d.hasOwnProperty("name")&&delete this.byName[h],a.isDefined(i)?this.byName[i]=d:(delete c.name,delete d.name)}a.extend(d,c)},e.remove=function(b){delete this.all[b],this.global[b]&&delete this.global[b];var c,d,e;for(c in this.byChapter)if(this.byChapter.hasOwnProperty(c)){var f=this.byChapter[c];for(d=0;d<f.length;d++)if(b===f[d].id){e=d;break}if(a.isDefined(e)){f.splice(e,1);break}}for(c in this.byName)if(this.byName.hasOwnProperty(c)&&b===this.byName[c].id){delete this.byName[c];break}},e.removeAll=function(){for(var a,b,c=0;c<f.length;c++){b=this[f[c]];for(a in b)b.hasOwnProperty(a)&&(b[a]=void 0,delete b[a])}};var h=function(){var b=d.data;b.hotspots&&b.hotspots.length&&a.forEach(b.hotspots,function(a){e.add(a)}),b.chapters&&b.chapters.length&&a.forEach(b.chapters,function(b,c){b.hotspots&&b.hotspots.length&&a.forEach(b.hotspots,function(a){e.add(a,c)})})};return c.events.on("modules.activate.start",function(a){c.modules.activeModules[a.moduleId]||(e.removeAll(),h())}),e}]),a.module("humanUI.hotspots").factory("HotspotInfo",["$window","Info",function(a,b){var c={},d={},e={breakPoint:400,current:null,setCurrent:function(c){this.current=c,a.innerWidth<e.breakPoint&&(this.current?this.setInfoPanel(this.current):b.update()),this.current&&this.current.setDepth(-1)},setInfoPanel:function(a){(a.title||a.description)&&(b.setTitle(a.title||""),b.setDescription(a.description||""))},getLabel:function(a){return a.element?a.element.getElementsByClassName("label-outer")[0]:void 0},isHideable:function(a){return a.element&&a.hasClass("label")&&a.hasClass("circle")&&!a.hasClass("show-hover")},showLabel:function(a){var b=this.getLabel(a);b&&(b.style.display="block")},hideLabel:function(a){var b=this.getLabel(a);b&&(b.style.display="none")},showLabels:function(a){for(var b=0;b<a.length;b++){var d=a[b];c.hasOwnProperty(d.id)&&(d.removeClass("show-hover"),this.showLabel(d),delete c[d.id])}},hideLabels:function(a){for(var b=0;b<a.length;b++){var d=a[b];this.isHideable(d)&&(d.addClass("show-hover"),this.hideLabel(d),c[d.id]=!0)}},testBreakpoint:function(c){a.innerWidth<e.breakPoint&&!f?(f=!0,this.hideLabels(c),this.current&&this.setInfoPanel(this.current)):a.innerWidth>=e.breakPoint&&f&&(f=!1,this.showLabels(c),b.update())},testLabel:function(b){if(b.element&&b.canvasPos){var c,e=this.getLabel(b),f=e.getBoundingClientRect();if(b.hasClass("left"))Math.ceil(f.left)<0&&!d.hasOwnProperty(b.id)?(c=Math.floor(b.canvasPos[0])-Math.ceil(f.left),b.addClass("flipped"),d[b.id]=c):d.hasOwnProperty(b.id)&&Math.floor(b.canvasPos[0])>d[b.id]&&(b.removeClass("flipped"),delete d[b.id]);else{var g=a.innerWidth-Math.floor(b.canvasPos[0]);Math.floor(f.right)>a.innerWidth&&!d.hasOwnProperty(b.id)?(c=g+(Math.floor(f.right)-a.innerWidth),b.addClass("flipped"),d[b.id]=c):d.hasOwnProperty(b.id)&&g>d[b.id]&&(b.removeClass("flipped"),delete d[b.id])}}}},f=a.innerWidth<e.breakPoint;return e}]),a.module("humanUI.hotspots").constant("HOTSPOT_TEMPLATES",{circle:['<div class="outer">','<div class="inner">{{ symbol }}</div>',"</div>"].join(""),label:['<div class="label-outer">','<h1 class="title">{{ title }}</h1>','<p class="description">{{ description }}</p>',"</div>"].join("")}).constant("HOTSPOT_CLASSES",{circle:"circle",plus:"plus",minus:"minus",label:"label",left:"left",singleLine:"single-line",pulse:"pulse",pulseHover:"pulse-hover",showHover:"show-hover",transitionShow:"transition-show",transitionHide:"transition-hide"}).factory("HOTSPOT_TYPES",["HOTSPOT_TEMPLATES","HOTSPOT_CLASSES",function(a,b){return{circle:{template:a.circle,classes:[b.circle],variations:[b.pulse,b.pulseHover,b.transitionShow,b.transitionHide]},circlePlus:{template:a.circle,classes:[b.circle,b.plus],variations:[b.pulse,b.pulseHover,b.transitionShow,b.transitionHide]},circleMinus:{template:a.circle,classes:[b.circle,b.minus],variations:[b.pulse,b.pulseHover,b.transitionShow,b.transitionHide]},label:{template:a.label,classes:[b.label],variations:[b.left,b.singleLine,b.transitionShow,b.transitionHide]},circleLabel:{template:a.circle+a.label,classes:[b.circle,b.label],variations:[b.plus,b.minus,b.pulse,b.pulseHover,b.showHover,b.left,b.singleLine,b.transitionShow,b.transitionHide]}}}]),a.module("humanUI.hotspots").factory("Hotspot",["$window","$filter","$interpolate","HOTSPOT_TYPES","HOTSPOT_CLASSES","HotspotData","HotspotInfo","Human","HumanParser","HumanActions","currentModule","doTween",function(b,c,d,e,f,g,h,i,j,k,l,m){var n,o,p,q,r,s,t=1,u=80,v=100,w=500,x=[],y=[],z=[],A=b.document.getElementById(i.canvasId||i.CANVAS_ID),B=function(c){var d=a.copy(c);for(var e in d)d.hasOwnProperty(e)&&(this[e]=d[e]);if(a.isDefined(this.shown)||(this.shown=!0),!this.pos&&this.objectId){var f=i.scene.objects[this.objectId];f&&(this.pos=i.scene.objects[this.objectId].getCenter())}a.isArray(this.dir)&&b.vec3.normalize(this.dir,this.dir),this._buildType(),this.createElement(),this.bindEngineHandlers(),this._displayUpdate={id:this.id},this._positionUpdate={id:this.id},this._userUpdate={id:this.id},this.setObjectShown(),this.setCanvasPos()};B.TAG_NAME="human-hotspot",B.parentElement=null,B.hotspots=[],B.hotspotDepths=[],B.create=function(a){var b=new B(a);return B.hotspots.push(b),B.hotspotDepths.push(b),b},B.get=function(a){for(var b=0;b<B.hotspots.length;b++)if(B.hotspots[b].id===a)return B.hotspots[b];return null},B.destroy=function(a){var b=B.hotspots.indexOf(a);B.hotspots.splice(b,1),b=B.hotspotDepths.indexOf(a),B.hotspotDepths.splice(b,1),a.unRender(),a.unbindEngineHandlers(),a=void 0},B.prototype._buildType=function(){var a=c("camelCaseNormalize")(this.type);if(a&&e[a]){var b=e[a],d=b.classes.slice();if(this.className)for(var f=this.className.split(" "),g=0;g<f.length;g++)-1===d.indexOf(f[g])&&d.push(f[g]);this.title&&d.push("has-title"),this.description&&d.push("has-description"),this.className=d.join(" "),this.template=b.template}},B.prototype._setCanvasDims=function(){p=A.getBoundingClientRect(),this._canvasWidth=p.width,this._canvasHeight=p.height};var C,D,E;B.prototype._getViewAngle=function(){return this.dir?(C=i.view.camera.eye,z[0]=C.x,z[1]=C.y,z[2]=C.z,b.vec3.subtract(z,z,this.pos),b.vec3.normalize(z,z),D=b.Math.min(b.vec3.dot(z,this.dir),1),E=b.Math.acos(D)*(180/b.Math.PI)):0},B.prototype._getViewPos=function(){return n=i.renderer.getViewMat(),x=b.vec3?b.vec3.transformMat4(x,this.pos,n):i.math.transformPoint3(n,this.pos),x[3]=1,x},B.prototype._getCanvasPos=function(a){return o=i.renderer.getProjMat(),y=b.vec4?b.vec4.transformMat4(y,a,o):i.math.transformPoint4(o,a),q=y[0],r=y[1],s=y[3],this._setCanvasDims(),[(1+q/s)*this._canvasWidth/2,(1-r/s)*this._canvasHeight/2]},B.prototype.getContext=function(){var b=g.byName,c={self:g.all[this.id]||{}};return a.extend({},b,c)},B.prototype.doActions=function(){this.actions&&k.parse(this.actions,this.getContext(),a.noop)},B.prototype.createElement=function(){var e=b.document.createElement(B.TAG_NAME);if(this.name&&e.setAttribute("name",this.name),this.className&&(e.className=this.className),this.template&&(e.innerHTML=d(this.template)(this)),this.actionsSrc){var f=l.data;this.actions=j.parse(this.actionsSrc)(f)}if(this.actions){var g=k.JOIN_CHARACTER,h="";a.isArray(this.actions)?h=this.actions.join(g):a.isObject(this.actions)&&(h=this.actions.actions.join(g)),e.setAttribute("actions",h)}if(this.pos&&e.setAttribute("pos",this.pos.join(",")),this.objectId&&e.setAttribute("object-id",this.objectId),a.isObject(this.data)){var i,m;a.forEach(this.data,function(b,d){i=c("dashNormalize")(d),m=a.isObject(b)?a.toJson(b):b,e.setAttribute("data-"+i,m)})}return a.element(e).data("hotspot",this),this.element=e,e},B.prototype.hasClass=function(a){return a=" "+a+" ",(" "+this.className+" ").indexOf(a)>-1},B.prototype.addClass=function(a){this.hasClass(a)||(this.className+=" "+a,this.element&&(this.element.className+=" "+a))},B.prototype.removeClass=function(a){a=" "+a+" ";var b=" "+this.className+" ";this.className=b.replace(a," ").trim(),this.element&&(b=" "+this.element.className+" ",this.element.className=b.replace(a," ").trim())},B.prototype.render=function(){this._rendered||(B.parentElement.appendChild(this.element),this.setCanvasPos(),this.unbindDOMHandlers(),this.bindDOMHandlers(),this._rendered=!0)},B.prototype.unRender=function(){this._rendered&&(this.unbindDOMHandlers(),B.parentElement.removeChild(this.element),this._rendered=!1)},B.prototype.setDepth=function(a){this.element&&(-1===a&&(a=B.hotspotDepths.length),this.element.style["z-index"]=a)};var F,G,H,I;B.prototype._getOpacity=function(){return this.dir&&this._viewAngle>=u?(G=this._viewAngle-u,H=v-u,I=G/H*t,F=b.Math.max(1-I,0)):F=t,F},B.prototype._setOpacity=function(){this.dir&&(this.element.style.opacity=this._getOpacity())},B.prototype._setTranslation=function(){this.element.style.transform="translate("+this.canvasPos[0]+"px,"+this.canvasPos[1]+"px)"};var J,K,L,M,N=function(a){this.element.style.opacity=a[0]},O=function(){this.element.style.display="none",this._notifyDisplayUpdated()};B.prototype._transitionDisplay=function(a){
  J=this._getOpacity(),K=w*J,L=N.bind(this),a?(this.element.style.opacity=0,this.element.style.display="block",M=this._notifyDisplayUpdated.bind(this),m(0,J,K,L,M)):(M=O.bind(this),m(J,0,K,L,M))},B.prototype._notifyDisplayUpdated=function(){this._displayUpdate.inView=this.inView,this._displayUpdate.shown=this.shown,a.isDefined(this.objectShown)&&(this._displayUpdate.objectShown=this.objectShown),this.hasClass("label")&&h.testLabel(this),i.events.fire("hotspots.displayUpdated",this._displayUpdate)};var P,Q,R,S,T;B.prototype.setDisplay=function(b){P=this.objectShown||!a.isDefined(this.objectShown),Q=!!(this.shown&&this.inView&&P),this.element&&(T=!1,b&&(S=Q?f.transitionShow:f.transitionHide,T=this.hasClass(S)),T?this._transitionDisplay(Q):(this.element.style.display=Q?"block":"none",this._notifyDisplayUpdated()))};var U=!1,V=function(a,b){return a._depth-b._depth},W=function(){B.hotspotDepths.sort(V);for(var a=0;a<B.hotspotDepths.length;a++)B.hotspotDepths[a]!==h.current&&B.hotspotDepths[a].setDepth(a);h.current&&h.current.setDepth(-1),U=!1};B.prototype._getInView=function(a){return this._viewAngle<v&&this.canvasPos[0]>0&&this.canvasPos[0]<this._canvasWidth&&this.canvasPos[1]>0&&this.canvasPos[1]<this._canvasHeight&&a[2]<=0},B.prototype.setCanvasPos=function(){this.pos&&(x=this._getViewPos(),this._depth=x[2],this.canvasPos=this._getCanvasPos(x),this._viewAngle=this._getViewAngle(),R=this._getInView(x),R!==this.inView&&(this.inView=R,this.setDisplay()),this.element&&(this._setOpacity(),this._setTranslation(),this.hasClass("label")&&h.testLabel(this)),U||(U=!0,b.setTimeout(W,0)),this._positionUpdate.canvasPos=this.canvasPos,i.events.fire("hotspots.positionUpdated",this._positionUpdate))},B.prototype.setObjectShown=function(){var b=i.scene.objects[this.objectId];if(this.objectId&&b){var c=arguments[0];if(a.isObject(c)&&c.enabledObjectsUpdate){var d=c.enabledObjectsUpdate;if(!d.hasOwnProperty(this.objectId))return;P=d[this.objectId]}else P=b.shown;b.isRenderable()||(P=!1),P!==this.objectShown&&(this.objectShown=P,this.setDisplay())}},B.prototype.setShown=function(a){a!==this.shown&&(this.shown=a,this.setDisplay(!0),this.hasClass("canonical")&&h.setCurrent(this.shown?this:null),!this.shown&&this.hasClass("show-hover")&&h.hideLabel(this))},B.prototype._onObjectRenderable=function(a){this.objectId&&this.objectId===a.objectId&&(this.setCanvasPos(),this.setObjectShown())},B.prototype.bindEngineHandlers=function(){this._boundSetPos=this.setCanvasPos.bind(this),i.events.on("camera.updated",this._boundSetPos),i.events.on("canvas.resized",this._boundSetPos),this._boundSetObjectShown=this.setObjectShown.bind(this),i.events.on("scene.objectsShown",this._boundSetObjectShown),this._boundOnObjectRenderable=this._onObjectRenderable.bind(this),i.events.on("scene.objectRenderable",this._boundOnObjectRenderable)},B.prototype.unbindEngineHandlers=function(){a.isFunction(this._boundSetPos)&&(i.events.off("camera.updated",this._boundSetPos),i.events.off("canvas.resized",this._boundSetPos),this._boundSetPos=void 0),a.isFunction(this._boundSetObjectShown)&&(i.events.off("scene.objectsShown",this._boundSetObjectShown),this._boundSetObjectShown=void 0),a.isFunction(this._boundOnObjectRenderable)&&(i.events.off("scene.objectRenderable",this._boundOnObjectRenderable),this._boundOnObjectRenderable=void 0)},B.prototype._onClick=function(){this.doActions(),i.events.fire("hotspots.picked",this._userUpdate)};var X=b.document.getElementById(i.containerId||i.CONTAINER_ID),Y=function(){h.current&&b.innerWidth>=h.breakPoint&&h.hideLabel(h.current),h.setCurrent(null),X.removeEventListener("touchstart",Y)};return B.prototype._onTouch=function(a){a.preventDefault(),this.hasClass("show-hover")&&(X.removeEventListener("touchstart",Y),b.innerWidth>=h.breakPoint&&(h.current&&h.hideLabel(h.current),h.showLabel(this),h.testLabel(this)),h.setCurrent(this),X.addEventListener("touchstart",Y)),this._onClick()},B.prototype._onEnter=function(){this!==h.current&&this.hasClass("show-hover")&&(h.showLabel(this),h.testLabel(this)),i.events.fire("hotspots.entered",this._userUpdate)},B.prototype._onLeave=function(){this!==h.current&&this.hasClass("show-hover")&&h.hideLabel(this),i.events.fire("hotspots.left",this._userUpdate)},B.prototype.bindDOMHandlers=function(){this._boundOnClick=this._onClick.bind(this),this.element.addEventListener("click",this._boundOnClick),this._boundOnTouch=this._onTouch.bind(this),this.element.addEventListener("touchstart",this._boundOnTouch),this._boundOnEnter=this._onEnter.bind(this),this.element.addEventListener("mouseenter",this._boundOnEnter),this._boundOnLeave=this._onLeave.bind(this),this.element.addEventListener("mouseleave",this._boundOnLeave)},B.prototype.unbindDOMHandlers=function(){a.isFunction(this._boundOnClick)&&(this.element.removeEventListener("click",this._boundOnClick),this._boundOnClick=void 0),a.isFunction(this._boundOnTouch)&&(this.element.removeEventListener("touchstart",this._boundOnTouch),this._boundOnTouch=void 0),a.isFunction(this._boundOnEnter)&&(this.element.removeEventListener("mouseenter",this._boundOnEnter),this._boundOnEnter=void 0),a.isFunction(this._boundOnLeave)&&(this.element.removeEventListener("mouseleave",this._boundOnLeave),this._boundOnLeave=void 0)},B}]),a.module("humanUI.actions",[]).factory("HumanAction",["$window","Human","currentModule",function(b,c,d){var e={},f={},g={currentTime:function(){return c.timeline.time},currentOpacity:function(){var a=b.document.getElementById(c.containerId||c.CONTAINER_ID),d=b.parseFloat(a.style.opacity);return d===d?d:1}},h=function(){var a;for(a in f)f.hasOwnProperty(a)&&delete f[a];for(a in d.data)d.data.hasOwnProperty(a)&&(f[a]=d.data[a]);for(a in g)g.hasOwnProperty(a)&&(f[a]=g[a])};c.events.on("modules.activate.start",function(a){c.modules.activeModules[a.moduleId]||h()}),c.events.on("timeline.chapters.activated",function(a){f.currentChapter=f.chapters?f.chapters[a.newChapterIndex]:null});var i={baseContext:f,define:function(b,c,d,g){var h={fn:c||a.noop,context:d||f,metaData:g||{}};a.isArray(b)||(b=[b]);for(var i=0;i<b.length;i++)e[b[i]]=h},getNames:function(){return Object.keys(e)},getFunction:function(a){var b=e[a];return b?b.fn:void 0},getContext:function(a){var b=e[a];return b?b.context:void 0},getMetaData:function(a){var b=e[a];return b?b.metaData:void 0}};return i}]).factory("HumanActions",["$window","$timeout","Human","HumanAction","HumanParser",function(b,c,d,e,f){var g=/Async$/,h={asyncActions:!1},i={start:[],finish:[]},j={},k={},l=0,m=function(a){j[a]=!0},n=function(a){delete j[a]},o=function(b,d,i){var k;if(j.hasOwnProperty(this.id)||(k=p.bind(null,i,this.id,this.parentId,-1)),0===b.length&&(n(this.id),k=p.bind(null,i,this.id,this.parentId,0)),k)return void(h.asyncActions?c(k,0):k());var l=b.shift().split(":"),m=l.shift(),q=l,r=o.bind(this,b,d,i);h.asyncActions&&(r=c.bind(null,r,0));var s=!1;g.test(m)&&(m=m.replace(g,""),s=!0);var t=e.getFunction(m);if(t){for(var u=e.getContext(m),v=a.extend({},u,d),w=0;w<q.length;w++)q[w]=f.parse(q[w])(v);var x=s?a.noop:r,y={id:this.id,instruction:m,callback:x};t.apply(y,q),s&&r()}else r()},p=function(a,b,c,d){for(var e={id:b,parentId:c,code:d},f=0;f<i.finish.length;f++)i.finish[f](e);a(e)},q=function(b){b=Array.prototype.slice.call(b);var c,d=b.shift(),e={},f=a.noop;return a.isNumber(b[b.length-1])&&(c=b.pop()),2===b.length?(e=b[0],f=b[1]):1===b.length&&(a.isFunction(b[0])?f=b[0]:e=b[0]),[d,e,f,c]},r={JOIN_CHARACTER:"|",config:h,callbacks:i,currentMetaData:k,registerMetaData:function(a){var b;for(b in k)k.hasOwnProperty(b)&&delete k[b];for(b in a)a.hasOwnProperty(b)&&(k[b]=a[b])},parse:function(){var b=q(arguments),d=b[0],e=b[1],f=b[2],g=b[3],j={};a.isString(d)?d=d.split(this.JOIN_CHARACTER):a.isArray(d)?d=d.slice(0):a.isObject(d)&&d.actions&&(a.extend(j,d),delete j.actions,d=d.actions.slice(0)),this.registerMetaData(j),l++,m(l);var k=function(){for(var a={id:l,parentId:g},b=0;b<i.start.length;b++)i.start[b](a);o.call(a,d,e,f)};h.asyncActions?c(k,0):k()},stop:function(a){if(a)n(a);else for(a in j)j.hasOwnProperty(a)&&n(a)}};return b.document.addEventListener("click",function(a){var b=a.target.getAttribute("actions-src");if(b){var c=f.parse(b)(e.baseContext);r.parse(c)}}),r}]),a.module("humanUI.actions").run(["$window","Human","HumanBackground","HumanAction","HumanActions","Hotspot","HotspotData","Media","Info","doTween",function(b,c,d,e,f,g,h,i,j,k){var l,m=e.baseContext,n=function(a){var b=m.chapters.indexOf(a),d=c.timeline.activeRoot._chapters[b];return d},o=function(a,b){var d=c.view.annotations.annotations,e=m.chapters[a].annotations.indexOf(b),f=new RegExp(a+"\\."+e+"$");for(var g in d)if(d.hasOwnProperty(g)&&f.test(g))return d[g]},p=function(d,e,f){var h=b.document.getElementById(c.containerId||c.CONTAINER_ID);a.isFunction(d)&&(d=d()),a.isFunction(e)&&(e=e());var i=function(a){h.style.opacity=a[0],g.parentElement.style.opacity=a[0]};k(d,e,1e3*f,i,this.callback)};l={arity:3},e.define(["tweenOpacity"],p,m,l);var q=function(a,b,c){var e=[function(a){d.setColors(a)},function(a){d.setColorStops(a)}],f=e[r.indexOf(this.instruction)];k(a,b,1e3*c,f,this.callback)},r=["tweenBackgroundColors","tweenBackgroundColorStops"];l={arity:3},e.define(r,q,m,l);var s=function(a){var c,d,e=1e3*a,f=this.callback,g=function(a){c||(c=a),d=a-c,b.Math.round(d)<e?b.requestAnimationFrame(g):f()};b.requestAnimationFrame(g)};l={arity:1},e.define(["wait"],s,m,l);var t=function(b){var d="showObjects"===this.instruction,e={};a.isArray(b)||(b=[b]);for(var f=0;f<b.length;f++)e[b[f]]=d;c.scene.setEnabledObjects({objects:e}),this.callback()};l={arity:1},e.define(["hideObjects","showObjects"],t,m,l);var u=function(b,d){a.isDefined(d)&&(b.animationDuration=d),c.view.camera.fly[this.instruction](b,this.callback)};l={arity:[1,2]},e.define(["flyTo","jumpTo"],u,m,l);var v=function(b,d){var e=this.instruction.replace(/Object$/,""),f={objectId:b};a.isDefined(d)&&(f.animationDuration=d),c.view.camera.fly[e](f,this.callback)};l={arity:[1,2]},e.define(["flyToObject","jumpToObject"],v,m,l);var w=function(){var b=Array.prototype.slice.call(arguments),d=b[0],e=b[1],f={};f.loop="loop"===this.instruction;var g=!a.isDefined(d)&&!a.isDefined(e),h=a.isDefined(d)&&!a.isDefined(e),i=a.isDefined(d)&&a.isDefined(e);g?f.startTime=c.timeline.time:h?a.isFunction(d)?f.startTime=d():a.isNumber(d)?f.startTime=d:a.isObject(d)&&(f.startChapterId=n(d).id,f.numChapters=1):i&&(a.isFunction(d)?f.startTime=d():a.isNumber(d)?f.startTime=d:a.isObject(d)&&(f.startChapterId=n(d).id),a.isFunction(e)?f.finishTime=e():a.isNumber(e)?f.finishTime=e:a.isObject(e)&&(f.finishChapterId=n(e).id),(a.isNumber(d)||a.isNumber(e))&&(f.align=!1)),f.loop||c.events.once("timeline.stopped",this.callback.bind(this)),c.timeline.play(f),f.loop&&this.callback()};l={arity:[0,2]},e.define(["play","loop"],w,m,l);var x=function(b){var d={};a.isNumber(b)?d.time=b:a.isObject(b)&&(d.chapterId=n(b).id),c.timeline.scrub(d),this.callback()};l={arity:1},e.define(["scrub"],x,m,l);var y=function(){c.timeline.stop(),this.callback()};l={arity:0},e.define(["stop"],y,m,l);var z=function(){var a,b=Array.prototype.slice.call(arguments);if(0===b.length)for(var d in c.view.annotations.annotations)c.view.annotations.annotations.hasOwnProperty(d)&&(a=c.view.annotations.annotations[d],a.setShown("showAnnotations"===this.instruction));else for(var e=c.timeline.activeRoot._nowBranch,f=c.timeline.activeRoot._chapters.indexOf(e),g=0;g<b.length;g++)a=o(f,b[g]),a&&a.setShown("showAnnotations"===this.instruction);this.callback()};l={arity:[1,1/0]},e.define(["hideAnnotations","showAnnotations"],z,m,l);var A=function(){var a,b,c,d,e=Array.prototype.slice.call(arguments);if(0===e.length)for(a=0;a<g.hotspots.length;a++)b=g.hotspots[a],"resetHotspots"===this.instruction?(c=h.all[b.id],d=c.hasOwnProperty("shown")?c.shown:!0,b.setShown(d)):b.setShown("showHotspots"===this.instruction);else for(a=0;a<e.length;a++)b=g.get(e[a].id),b&&("resetHotspots"===this.instruction?(c=h.all[b.id],d=c.hasOwnProperty("shown")?c.shown:!0,b.setShown(d)):b.setShown("showHotspots"===this.instruction));this.callback()};l={arity:[1,1/0]},e.define(["hideHotspots","showHotspots","resetHotspots"],A,m,l);var B=function(a){f.parse(a,{},this.callback,this.id)};l={arity:1},e.define(["doActions"],B,m,l);var C=function(a){var b=this.callback,c=function(){i.audioEl.removeEventListener("ended",c),b()};i.audioEl.addEventListener("ended",c),i.audioEl.src=a};l={arity:1},e.define(["playAudio"],C,m,l);var D=function(){i.audioEl.readyState>0&&i.audioEl.pause(),this.callback()};l={arity:0},e.define(["pauseAudio"],D,m,l);var E=function(a){j.setTitle(a),this.callback()};l={arity:1},e.define(["setInfoTitle"],E,m,l);var F=function(a){j.setDescription(a),this.callback()};l={arity:1},e.define(["setInfoDescription"],F,m,l)}]),a.module("humanUI.actions").factory("HumanActionsTour",["$window","HumanActions","HumanParser","currentModule",function(b,c,d,e){var f,g,h={config:{automateWait:0},data:{tourData:{},firstBranchIndex:null,lastBranchIndex:null},state:{actions:[],index:null,isBeginning:!1,isEnd:!1,title:null,lock:!1,branchIndex:null},callbacks:{actions:[],index:[],title:[],lock:[],automate:[]}},i=h.state,j=!1,k=function(a){i.actions=a,h.callbacks.actions.forEach(function(a){a(i.actions)})},l=function(a){i.index=a,i.index<0&&(i.index=0),i.index>=i.actions.length&&(i.index=i.actions.length-1),o(),p(),h.callbacks.index.forEach(function(a){a(i)})},m=function(a){i.title=a.title?a.title:a.titleSrc?d.parse(a.titleSrc)(e.data):null,h.callbacks.title.forEach(function(a){a(i)})},n=function(a){i.lock=a,h.callbacks.lock.forEach(function(a){a(i)})},o=function(){return i.isBeginning=i.index<=0&&i.branchIndex===h.data.firstBranchIndex,i.isBeginning},p=function(){return i.isEnd=i.index>=i.actions.length-1&&i.branchIndex===h.data.lastBranchIndex,i.isEnd};return h.setAutomate=function(a){j=!!a,j?h.next():(b.clearTimeout(f),f=void 0),h.callbacks.automate.forEach(function(a){a(j)})},h.getAutomate=function(){return j},c.callbacks.start.push(function(d){var e=c.currentMetaData;a.isNumber(e.__index)&&(l(e.__index),m(e),n(!!e.lock),g=d.id,a.isDefined(f)&&(b.clearTimeout(f),f=void 0))}),c.callbacks.finish.push(function(a){if(n(!1),a.id===g&&0===a.code&&j){var c=h.next.bind(h),d=h.config.automateWait;f=b.setTimeout(c,d)}}),h.next=function(b){if(b=b||a.noop,!i.isEnd){var d=i.actions[i.index+1];d&&(c.stop(),c.parse(d,b))}},h.prev=function(b){if(b=b||a.noop,!i.isBeginning){var d=i.actions[i.index-1];d&&(c.stop(),c.parse(d,b))}},Human.events.on("modules.activate.start",function(){for(var b=e.data,c=0;c<b.chapters.length;c++){var f=b.chapters[c],g={};if(f.ui&&f.ui.actionsTour){var i=f.ui.actionsTour.dataSrc;g.actions=d.parse(i)(e.data),g.initParse=f.ui.actionsTour.initParse||!1,g.initIndex=f.ui.actionsTour.initIndex||0}if(g.actions&&g.actions.length){a.isNumber(h.data.firstBranchIndex)||(h.data.firstBranchIndex=c),h.data.lastBranchIndex=c;for(var j=0;j<g.actions.length;j++)g.actions[j].__index=j;h.data.tourData[c.toString()]=g}}}),Human.events.on("timeline.chapters.activated",function(a){var b=a.newChapterIndex;i.branchIndex=b;var d=h.data.tourData[b.toString()];d?(k(d.actions),d.initParse?c.parse(i.actions[d.initIndex]):l(d.initIndex)):k([])}),h}]).directive("humanActionsTour",["HumanActionsTour",function(a){return{restrict:"E",scope:!0,link:function(b){a.callbacks.actions.push(function(a){b.show=a&&a.length>0,b.$applyAsync()})}}}]).directive("actionsTourReset",["Human","HumanActionsTour",function(a,b){return{restrict:"A",scope:!0,link:function(c,d){b.callbacks.index.push(function(a){d[a.isEnd?"addClass":"removeClass"]("is-end")}),d.on("click",function(){var c=b.data.firstBranchIndex,d=a.timeline.activeRoot._chapters[c].id;a.timeline.scrub({chapterId:d})})}}}]).directive("actionsTourAutomate",["HumanActionsTour",function(a){return{restrict:"A",scope:!0,link:function(b,c){a.callbacks.automate.push(function(a){c[a?"addClass":"removeClass"]("automating")}),a.callbacks.index.push(function(a){c[a.isEnd?"addClass":"removeClass"]("is-end")}),c.on("click",function(){var b=a.getAutomate();a.setAutomate(!b)})}}}]).directive("actionsTourPrev",["HumanActionsTour",function(a){return{restrict:"A",scope:!0,link:function(b,c){var d=function(a){var b=a.lock||a.isBeginning?"addClass":"removeClass";c[b]("disabled")};a.callbacks.index.push(d),a.callbacks.lock.push(d),c.on("click",function(){a.prev()})}}}]).directive("actionsTourNext",["HumanActionsTour",function(a){return{restrict:"A",scope:!0,link:function(b,c){var d=function(a){var b=a.lock||a.isEnd?"addClass":"removeClass";c[b]("disabled")};a.callbacks.index.push(d),a.callbacks.lock.push(d),c.on("click",function(){a.next()})}}}]).directive("actionsTourTitle",["HumanActionsTour",function(a){return{restrict:"A",scope:!0,link:function(b,c){a.callbacks.title.push(function(a){c[0].innerHTML=a.title||"",c[a.title?"addClass":"removeClass"]("has-title")})}}}]),a.module("humanUI.annotations",[]).directive("humanAnnotations",["Human",function(a){return{restrict:"E",scope:!0,templateUrl:"templates/annotations/panel.html",link:function(b){b.info="Toggle Annotations",b.config={model:a.view.annotations.shown,on:function(){a.view.annotations.setShown(!0)},off:function(){a.view.annotations.setShown(!1)}},a.events.on("annotations.shown",function(){b.config.model=a.view.annotations.shown}),a.events.on("timeline.chapters.activated",function(){b.config.model=a.view.annotations.shown}),b.$watch("uiComponents.config.annotations",function(a){b.show=!!a})}}}]),a.module("humanUI.background",[]).factory("HumanBackground",["$window",function(a){return a.HumanBackground||a.console.warn("HumanBackground not found."),a.HumanBackground||{}}]),a.module("humanUI.bookmark",[]).constant("THUMBNAIL_URL","thumbnails/bookmarks?eid").filter("BookmarkTour",["THUMBNAIL_URL",function(b){return function(c){var d=c.tour;return delete c.tour,d.unshift(c),a.forEach(d,function(a){a.tourMember=!0,a.thumbnailSrc=[b,a.eid].join("=")}),d}}]).constant("BOOKMARK_TOUR_BASE_STATE",{isTour:!1,isTourMember:!1,restoring:!1,captures:[],curCapture:null,curCaptureIndex:null}).provider("BookmarkTour",["BOOKMARK_TOUR_BASE_STATE",function(b){var c={compare:!1},d=a.extend({},b),e={newModules:null,oldModules:null},f=function(f,g,h,i,j){var k,l,m,n={},o=function(b){a.forEach(b,function(a){j.modules.isBaseModule(a)&&(l=a.split("/"),m=l[l.length-1].replace(/\.json$/,""),n[m]||j.assets.server.cacheStateIndex(m))})},p=function(b){k=[],a.forEach(b,function(b){o(b.modules.activeModules),k.push(a.copy(b.modules.activeModules))})},q=function(a){d.curCapture=d.captures[a]||null,d.curCaptureIndex=d.curCapture?a:null},r=function(){var b=Object.keys(j.modules.activeModules);a.forEach(b,function(a){j.modules.deactivate(a,{},function(){if(!j.modules.isBaseModule(a)){var b=j.modules.modules[a].rootObjects,c=["tweens","reflections","audio","videos","lights","skyBoxes","geometries","materials","transforms","morph"];j.modules.unload(a,b,c,function(){j.modules.destroy(a)})}})})},s=function(){a.equals(e.oldModules,e.newModules)||j.modules.deactivateModules()},t=function(a){e.oldModules=e.newModules,e.newModules=k[a],c.compare?s():r()};return d.reset=function(){a.extend(d,b)},d.restore=function(b,c){var e=d.captures[b];e&&(d.restoring=!0,q(b),h(function(){t(b),j.bookmarks.restore(e,function(){a.isFunction(c)&&c()})}))},d.onRestored=function(){d.isTour||d.isTourMember||(d.captures=[])},j.events.on("bookmarks.restored",function(b){d.restoring=!1,d.isTour=!(!b.tour||!b.tour.length),d.isTourMember=!!b.tourMember,d.isTour&&(d.captures=g("BookmarkTour")(b),p(d.captures),q(0));var c=a.isArray(d.captures)&&!!d.captures.length;d.bookmarkTour=(d.isTour||d.isTourMember)&&c,d.onRestored(b),f.$broadcast("bookmarkTour.state",d)}),{state:d}};return f.$inject=["$rootScope","$filter","$timeout","$q","Human"],{$get:f,config:function(b){a.extend(c,b)},extend:function(b){a.extend(d,b)}}}]).directive("updateScroll",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e,f,g,h,i=d.updateScroll,j=function(b){a(function(){e=c[0].offsetWidth,f=c[0].scrollWidth,f>e&&(g=f/c.children().length,h=f-e,c[0].scrollLeft=g*(b+1)-h)})};b.$watch(i,j)}}}]).directive("prevNextBookmark",["Human","BookmarkTour",function(a,b){return{restrict:"A",link:function(a,c,d){var e,f="next"===d.prevNextBookmark?1:-1;a.state=b.state,c.on("click",function(){e||b.state.restore(a.state.curCaptureIndex+f)});var g={expressions:["state.curCaptureIndex","state.captures.length"],callback:function(a){e=!!(1===f&&a[0]===a[1]-1||-1===f&&0===a[0]),c[e?"addClass":"removeClass"]("disabled")}};a.$watchGroup(g.expressions,g.callback)}}}]).directive("humanBookmarkTour",["$timeout","$document","Human","BookmarkTour",function(a,b,c,d){return{restrict:"E",templateUrl:"templates/bookmark/tour.html",scope:!0,link:function(a){a.show=!1;var b,c,e=function(){a.show=b&&c};a.restore=function(a){d.state.restore(a)},a.reset=function(){d.state.reset()},a.$on("bookmarkTour.state",function(a,b){c=b.bookmarkTour,e()}),a.$watch("uiComponents.config.bookmarkTour",function(a){b=!!a,e()})}}}]),a.module("humanUI.camera",[]).factory("HumanCamera",["$window","Human",function(a,b){var c,d=new Float64Array(3),e=new Float64Array(3),f=new Float64Array(3),g=function(a,b){b[0]=a.x,b[1]=a.y,b[2]=a.z},h=null,i=null,j=!1;b.events.on("bookmarks.restored",function(a){a.camera&&(i=a.camera),j=!0});var k=function(){j&&(i=null,j=!1)};return b.events.on("modules.deactivate.finish",k),b.events.on("modules.destroy.finish",k),{getCenterCamera:function(){return h||i},setCenterCamera:function(a){h=a},getPanRate:function(){return g(b.view.camera.getEye(),d),g(b.view.camera.getLook(),e),a.vec3?(a.vec3.sub(f,d,e),c=a.vec3.length(f)):(b.math.subVec3(d,e,f),c=b.math.lenVec3(f)),.12*c}}}]).directive("centerCamera",["Human","HumanCamera",function(a,b){return{restrict:"A",link:function(c,d){d.on("click",function(){var c=b.getCenterCamera();c?a.view.camera.fly.flyTo(c):a.init.resetCamera()})}}}]).directive("humanCameraCenter",function(){return{restrict:"E",scope:!0,templateUrl:"templates/camera/center.html",link:function(a){a.$watch("uiComponents.config.center",function(b){a.show=!!b})}}}).directive("panCamera",["$interval","Human","HumanCamera","touchTarget","destroyInterval",function(b,c,d,e,f){var g={interval:10},h="touchstart mousedown",i="touchend touchcancel mouseleave mouseup";return{restrict:"A",link:function(j,k,l){var m,n,o,p,q,r=l.panCamera||"up",s=function(){p=g.interval/1e3*d.getPanRate(),q=b(function(){switch(m=0,n=0,o=0,r){case"up":n=-p;break;case"down":n=p;break;case"left":m=-p;break;case"right":m=p}c.view.camera.pan({x:m,y:n,z:o})},g.interval)};e(k[0],function(a){k[0]!==a&&f(q)}),a.forEach(h.split(" "),function(a){k.on(a,function(a){a.preventDefault(),s()})}),a.forEach(i.split(" "),function(a){k.on(a,function(){f(q)})})}}}]).directive("humanCameraPan",function(){var a={up:"W",down:"S",left:"D",right:"A"};return{restrict:"E",scope:!0,templateUrl:"templates/camera/pan.html",link:function(b){b.keys=a,b.$watch("uiComponents.config.pan",function(a){b.show=!!a})}}}).directive("zoomCamera",["Human","touchTarget",function(b,c){var d,e="touchstart mousedown",f="touchend touchcancel mouseleave mouseup",g=.3,h=.001,i=0,j=!1;return b.events.on("tick",function(){return 0!==i?(j&&(i=g*d),i*=b.input.cameraFriction||.85,Math.abs(i)<h?void(i=0):void b.view.camera.zoom(i)):void 0}),{restrict:"A",link:function(b,h,k){var l="out"===k.zoomCamera?1:-1;c(h[0],function(a){h[0]!==a&&(j=!1)}),a.forEach(e.split(" "),function(a){h.on(a,function(a){a.preventDefault(),d=l,i=g*d,j=!0})}),a.forEach(f.split(" "),function(a){h.on(a,function(){j=!1})})}}}]).directive("humanCameraZoomIn",function(){return{restrict:"E",scope:!0,templateUrl:"templates/camera/zoom-in.html",link:function(a){a.$watch("uiComponents.config.zoomIn",function(b){a.show=!!b})}}}).directive("humanCameraZoomOut",function(){return{restrict:"E",scope:!0,templateUrl:"templates/camera/zoom-out.html",link:function(a){a.$watch("uiComponents.config.zoomOut",function(b){a.show=!!b})}}}).directive("humanCameraZoom",function(){return{restrict:"E",scope:!0,templateUrl:"templates/camera/zoom.html",link:function(a){var b=["uiComponents.config.zoomOut","uiComponents.config.zoomIn"];a.$watchGroup(b,function(b){a.show=!!b[0]&&!!b[1]})}}}).directive("setCameraMode",["Human",function(a){return{restrict:"A",link:function(b,c){var d={};c.on("click",function(){"pan"===a.properties.properties["input.mouseOrbitPan"]?(d["input.mouseOrbitPan"]="orbit",d["input.touchOrbitPan"]="orbit"):(d["input.mouseOrbitPan"]="pan",d["input.touchOrbitPan"]="pan"),a.properties.set(d)})}}}]).directive("humanCameraMode",["Human",function(a){return{restrict:"E",scope:!0,templateUrl:"templates/camera/mode.html",link:function(b,c){var d=function(a){c.attr("mode",b.mode=a)},e=a.properties.subscribe({propId:"input.mouseOrbitPan",callback:d});a.properties.resubscribe(e,"input.mouseOrbitPan"),e=a.properties.subscribe({propId:"input.touchOrbitPan",callback:d}),a.properties.resubscribe(e,"input.touchOrbitPan"),b.$watch("uiComponents.config.cameraMode",function(a){b.show=!!a})}}}]),a.module("humanUI.config",[]).constant("BASE_CONFIG",{bookmarkTour:!1,annotations:!1,audio:!1,info:!1,loadProgress:!0,fullscreen:!0,pan:!0,zoomIn:!0,zoomOut:!0,center:!0,cameraMode:!0,objectTree:!1,objectSlider:!1,playPause:!1,scrubber:!1,tour:!1,crossSection:!1,dissect:!1,isolate:!1,xray:!1,actionsTour:!1}).constant("CONFIG_GROUPS",{nav:["pan","zoomIn","zoomOut","center","cameraMode"],zoom:["zoomIn","zoomOut"],scene:["objectTree","objectSlider"],tools:["crossSection","dissect","isolate","xray"],modes:["isolate","xray"]}).constant("CONFIG_ALIASES",{loader:"loadProgress",panel:"info",tree:"objectTree",fs:"fullscreen",slider:"objectSlider"}).constant("EXPANDABLE_UI_COMPONENTS",{components:{scrubber:{chapters:!1,tour:!1},tour:{chapters:!1},playPause:{tour:!1},objectSlider:{objects:!1}},notes:{"scrubber.chapters":"Display chapters for scrubber","scrubber.tour":"Play one chapter at a time","tour.chapters":"Display chapters for tours","playPause.tour":"Play one chapter at a time","objectSlider.objects":"Display objects for objectSlider"}}).filter("convertDotKeys",function(){return function(b){for(var c in b)if(b.hasOwnProperty(c)&&/\./.test(c)){var d=c.split(".");a.isObject(b[d[0]])||(b[d[0]]={}),b[d[0]][d[1]]=b[c],delete b[c]}return b}}).filter("convertTags",function(){return function(b,c){return a.isArray(c)&&c.length>0&&(c.has=function(a){return this.indexOf(a)>-1},c.has("scrubber")||c.has("scrubber-chapters")?(b.scrubber=!0,c.has("scrubber-chapters")&&(b.scrubber={chapters:!0},c.has("tour")&&(b.scrubber.tour=!0))):(c.has("play-controls")&&(b.playPause=!0),c.has("tour")&&(b.tour=!0)),delete c.has),b}}).filter("extendConfig",["BASE_CONFIG","CONFIG_ALIASES","CONFIG_GROUPS",function(b,c,d){return function(e,f){return f.hasOwnProperty("all")?a.forEach(b,function(a,b){e[b]=f.all}):(a.forEach(d,function(b,c){f.hasOwnProperty(c)&&a.forEach(b,function(a){e[a]=f[c]})}),a.extend(e,f),a.forEach(d,function(a,b){e.hasOwnProperty(b)&&delete e[b]}),a.forEach(c,function(a,b){e.hasOwnProperty(b)&&(e[a]=e[b],delete e[b])})),e}}]).filter("convertUiParams",["CONFIG_ALIASES","convertDotKeysFilter",function(b,c){var d=/^ui-/,e=function(a){return"true"===a?!0:"false"===a||""===a?!1:a};return function(f){var g={};return a.forEach(f,function(a,c){(d.test(c)||b.hasOwnProperty(c))&&(c=c.replace(d,"").replace(/-([a-z])/g,function(a){return a[1].toUpperCase()}),g[c]=e(a))}),c(g),g}}]).provider("ConfigCreator",function(){var b=function(b,c,d,e,f,g){var h=d("extendConfig"),i=d("convertTags"),j=d("convertUiParams"),k=d("convertDotKeys"),l=function(){var a={},c=b.location.search.slice(1);c=c.replace(/&amp;/g,"&");for(var d,e=c.split("&"),f=0;f<e.length;f++)d=e[f].split("="),a[d[0]]=d[1];return a};return{config:{},urlConfig:j(l()),bookmarkConfig:{},contentConfig:{},applicationConfig:{},init:function(){var a=this;c.uiComponents={config:this.config},f.events.on("timeline.chapters.activated",function(b){var c=b.newChapterIndex;a._buildContentConfig(g.data,c),a._extend(),a._apply()});var b=!1;c.$on("bookmarkTour.state",function(c,d){d.bookmarkTour!==b&&(b=d.bookmarkTour,a.bookmarkConfig.bookmarkTour=d.bookmarkTour,a._extend(),a._apply())})},_buildContentConfig:function(b,c){var d=i({},b.tags);h(d,b.ui||{}),a.isNumber(c)&&b.chapters&&h(d,b.chapters[c].ui||{}),d.hasOwnProperty("data")&&delete d.data,this.contentConfig=d},_buildApplicationConfig:function(a){a=k(a||{}),h(this.applicationConfig,a)},_extend:function(){for(var b=a.extend({},e),c=[this.contentConfig,this.bookmarkConfig],d=0;d<c.length;d++)h(b,c[d]);return h(b,this.urlConfig),h(b,this.applicationConfig),this.config=b,this.config},_apply:function(){c.uiComponents.config=this.config,c.$applyAsync()}}};return b.$inject=["$window","$rootScope","$filter","BASE_CONFIG","Human","currentModule"],{$get:b}}),a.module("humanUI.crossSection",[]).factory("Clip",["Human",function(b){return{MAP:[{view:"Anterior",clip:b.view.clip.FRONT},{view:"Posterior",clip:b.view.clip.BACK},{view:"Left",clip:b.view.clip.LEFT},{view:"Right",clip:b.view.clip.RIGHT},{view:"Superior",clip:b.view.clip.TOP},{view:"Inferior",clip:b.view.clip.BOTTOM}],state:{current:null},show:function(a){b.view.clip.setClip({state:"clipping"}),b.view.clip.selectClip(a),b.view.clip.setClip({state:"visible"})},reset:function(){a.forEach(b.view.clip.clips,function(a){a.progress=0}),b.view.clip.reset(),this.state.current=this.MAP[0],this.show(this.state.current.clip)}}}]).directive("humanCameraClip",["$window","Human",function(a,b){var c,d=a.vec3&&a.vec3.create||b.math.vec3,e=d(),f=d(),g=d(),h=b.view.camera,i=h.near,j=function(){return e[0]=h.eye.x,e[1]=h.eye.y,e[2]=h.eye.z,f[0]=h.look.x,f[1]=h.look.y,f[2]=h.look.z,a.vec3?(a.vec3.sub(g,e,f),c=a.vec3.length(g)):(b.math.subVec3(e,f,g),c=b.math.lenVec3(g)),a.Math.abs(c)},k=function(){b.properties.set({"camera.optics.near":.75*j()})};return{restrict:"E",scope:!0,templateUrl:"templates/cross-section/camera-clip.html",link:function(a){a.config={on:function(){b.events.on("camera.updated",k),k()},off:function(){b.events.off("camera.updated",k),b.properties.set({"camera.optics.near":i})}}}}}]).directive("cycleSectionPlane",["Clip",function(a){return{restrict:"A",link:function(b,c){c.on("click",function(){var c=a.state.current?a.MAP.indexOf(a.state.current):0;c=c===a.MAP.length-1?0:c+1,a.state.current=a.MAP[c],a.show(a.state.current.clip),b.$digest()})}}}]).directive("resetSectionPlane",["Clip",function(a){return{restrict:"A",link:function(b,c){c.on("click",function(){a.reset(),b.$digest()})}}}]).directive("humanCrossSectionSlider",["Human","HumanSlider",function(a,b){return{restrict:"E",scope:!0,templateUrl:"templates/cross-section/slider.html",link:function(c,d){var e=b.create({element:d.find("human-slider")[0],onMove:function(b){a.view.clip.setClip({state:"visible",progress:b}),0===b&&a.view.clip.selectedClip._setProgress(0)}});a.events.on("clip.updated",function(a){e.move(a.progress||0)})}}}]).directive("humanCrossSection",["$parse","$timeout","Clip",function(b,c,d){return{restrict:"E",scope:!0,templateUrl:"templates/cross-section/controls.html",link:function(e,f,g){var h=function(a){c(function(){Human.view.clip.setClip({clipId:d.state.current.clipId,state:a?"visible":"clipping"})})};d.state.current=d.MAP[0],e.state=d.state,e.tooltipText={select:"Select Plane",reset:"Reset"},g.tooltipText&&a.extend(e.tooltipText,b(g.tooltipText)({})),f.on("crossSectionToggle",function(a,b){h(b)})}}}]).directive("humanCrossSectionToggle",["$document","Clip","ElementDisplay",function(b,c,d){return{restrict:"E",scope:!0,templateUrl:"templates/cross-section/toggle.html",link:function(c,e,f){var g;g=f.hasOwnProperty("target")?a.element(b[0].querySelector(f.target)):e.next(),d.create({trigger:e,target:g,eventName:"crossSectionToggle",globalClose:f.hasOwnProperty("globalClose")}),c.info="Cross Section",c.config={},c.$watch("uiComponents.config.crossSection",function(a){c.show=!!a})}}}]),a.module("humanUI.dissect",[]).directive("undoDissect",["Human",function(a){
  return{restrict:"A",scope:!0,link:function(b,c){var d=!0;c.addClass("disabled"),c.on("click",function(){d||a.view.dissect.undo()}),a.events.on("dissect.toggled",function(a){d=!a.enabled,c[d?"addClass":"removeClass"]("disabled")})}}}]).directive("humanDissectUndo",function(){return{restrict:"E",scope:!0,templateUrl:"templates/dissect/undo.html",link:function(a){a.info="Undo Dissect [Ctrl + Z]",a.$watch("uiComponents.config.dissect",function(b){a.show=!!b})}}}).directive("humanDissect",["Human",function(a){return{restrict:"E",scope:!0,templateUrl:"templates/dissect/dissect.html",link:function(b){var c=function(b){a.rpc.call(null,"dissect.setEnabled",{enable:b})};b.info="Dissect [Ctrl + X]",b.config={model:a.view.dissect.enabled,on:c.bind(null,!0),off:c.bind(null,!1)},a.events.on("dissect.toggled",function(){b.config.model=a.view.dissect.enabled}),b.$watch("uiComponents.config.dissect",function(a){b.show=!!a})}}}]),a.module("humanUI.fullscreen",[]).factory("Fullscreen",["$document","$rootScope",function(b,c){var d,e=b[0],f=e.documentElement,g={request:[f.requestFullscreen,f.webkitRequestFullscreen,f.mozRequestFullScreen,f.msRequestFullscreen],exit:[e.exitFullscreen,e.webkitExitFullscreen,e.mozCancelFullScreen,e.msExitFullscreen]};return{VENDOR_PREFIXES:["","webkit","moz","ms"],setMethods:function(){var b,c={};for(var d in g)if(g.hasOwnProperty(d)){b=g[d];for(var h=0;h<b.length;h++)if(a.isFunction(b[h])){c[d]=b[h];break}if(!c[d])return!1}return this.request=c.request.bind(f),this.exit=c.exit.bind(e),!0},isActive:function(){return d=e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement||void 0,!!d},bindHandlers:function(){var d,f=this;b.on("keypress",function(a){var b=a.target.nodeName.toLowerCase();"input"!==b&&"textarea"!==b&&70===a.which&&a.shiftKey&&f.toggle()}),a.forEach(this.VENDOR_PREFIXES,function(a){var b=a+"fullscreenchange";e.addEventListener(b,function(){d=f.isActive(),c.$broadcast("fullscreen.change",{active:d,fromUI:f._fromUI}),f._fromUI=!1},!1)})},_fromUI:!1,toggle:function(){this._fromUI=!0,this[this.isActive()?"exit":"request"]()}}}]).directive("humanFullscreen",["$window","Fullscreen",function(a,b){var c=a===a.top;return{restrict:"E",scope:!0,templateUrl:"templates/fullscreen/panel.html",link:function(a){a.config={on:b.toggle.bind(b),off:b.toggle.bind(b)},a.$on("fullscreen.change",function(b,c){a.config.model=c.active,a.mode=c.active?"fullscreen":"normalscreen",a.$digest()}),a.$watch("uiComponents.config.fullscreen",function(b){a.show=c&&!!b})}}}]).directive("windowLink",["$window",function(a){return{restrict:"A",link:function(b,c){c.attr("href",a.location.href)}}}]).directive("humanWindowLink",["$window",function(a){var b=a===a.top;return{restrict:"E",scope:!0,templateUrl:"templates/fullscreen/window-link.html",link:function(a){a.$watch("uiComponents.config.fullscreen",function(c){a.show=!b&&!!c})}}}]).run(["Fullscreen",function(a){var b=a.setMethods();b&&a.bindHandlers()}]),a.module("humanUI.info",[]).run(["Info",function(a){a._instantiated=!0}]).provider("Info",function(){var b={baseAnatomy:!1,modifyLinks:!0,props:["title","displayName","description"],precedence:["bookmark","chapter","module"]},c={info:{bookmark:null,chapter:null,module:null},bookmarkRestoring:!1,current:null,precedence:a.copy(b.precedence),title:"",description:""},d={title:[],description:[]},e=function(e,f){var g=function(a){a=a||"",b.modifyLinks&&(a=e("modifyLinks")(a)),c.title=a,d.title.forEach(function(a){a(c.title)})},h=function(a){a=a||"",b.modifyLinks&&(a=e("modifyLinks")(a)),c.description=a,d.description.forEach(function(a){a(c.description)})},i=function(){for(var d,e=0;e<b.precedence.length;e++)if(d=c.info[b.precedence[e]],a.isObject(d)&&(d.title||d.description))return c.current=b.precedence[e],g(d.title),void h(d.description);c.current=null,g(""),h("")},j=function(d){b.precedence=a.copy(d),c.precedence=d,i()},k=function(a,d){if(!c.info.hasOwnProperty(a)||!d)return null;"chapter"===a&&d.info&&(d=d.info);for(var e={},f=0;f<b.props.length;f++){var g=b.props[f];if(d.hasOwnProperty(g)){var h=d[g];"displayName"===g&&(g="title"),e[g]=h}}c.info[a]=e,i()},l=function(){for(var a in c.info)c.info.hasOwnProperty(a)&&(c.info[a]=null);g(""),h("")};return f.events.on("bookmarks.restoring",function(){c.bookmarkRestoring=!0}),f.events.on("bookmarks.restored",function(a){c.bookmarkRestoring=!1,k("bookmark",a)}),f.events.on("timeline.chapters.activated",function(a){k("chapter",f.timeline.activeRoot._chapters[a.newChapterIndex])}),f.events.on("modules.activate.finish",function(a){var c=f.modules.activeModules[a.moduleId];b.baseAnatomy||(c=e("excludeBaseAnatomy")(c)),k("module",c)}),f.events.on("modules.deactivate.finish",l),{state:c,callbacks:d,setPrecedence:j,setTitle:g,setDescription:h,update:i}};return e.$inject=["$filter","Human"],{$get:e,config:function(c){a.extend(b,c)}}}).filter("modifyLinks",["$document",function(b){var c=b[0];return function(b){var d=c.createElement("div");d.innerHTML=b;var e=d.querySelectorAll("a");return a.forEach(e,function(a){/^(http)|(\/\/)/.test(a.href)&&a.setAttribute("target","_blank")}),d.innerHTML}}]).directive("humanInfo",["$window","$filter","$sce","Info",function(b,c,d,e){return{restrict:"A",scope:!0,link:function(c,f){var g=function(){var b=e.state.title,f=e.state.description;if(!b&&!f||e.state.bookmarkRestoring)c.info=null;else{var g={title:b,description:f};g.description&&(g.description=a.isString(g.description)?d.trustAsHtml(g.description):""),c.info=g}c.$applyAsync()},h=0,i=0,j=function(){var a=f[0].getBoundingClientRect();h=a.left+a.width,i=a.top+a.height},k=function(){i>b.innerHeight?f.addClass("overflow-height"):f.removeClass("overflow-height"),h>b.innerWidth?f.addClass("overflow-width"):f.removeClass("overflow-width")};c.info=null,c.show=!1,e.callbacks.title.push(g),e.callbacks.description.push(g),c.$watch("info",function(d,e){c.show=!!d,a.equals(d,e)||b.setTimeout(function(){j(),k()})}),b.addEventListener("resize",k)}}}]),a.module("humanUI.load",[]).directive("loadProgress",["Human",function(a){return{restrict:"A",link:function(b,c,d){var e,f="bar"===d.loadProgress,g=function(a){f?c[0].style.width=a:c[0].textContent=a};a.events.on("assets.load.start",function(){g("0%")}),a.events.on("assets.load.progress",function(a){e=a.receivedAssets/a.requestedAssets,g(Math.floor(100*e)+"%")}),a.events.on("assets.load.finish",function(){g("100%")})}}}]).directive("loadStatus",["Human",function(a){return{restrict:"A",link:function(b,c){c[0].textContent="Loading...",a.events.on("modules.activate.start",function(b){var d=a.modules.modules[b.moduleId];c[0].textContent="Loading "+d.displayName+"..."}),a.events.on("assets.load.finish",function(){c[0].textContent=""})}}}]),a.module("humanUI.media",[]).constant("AUDIO_TYPES",{ogg:'audio/ogg;codecs="vorbis"',mp3:"audio/mpeg;"}).constant("AUDIO_PATH","/content/states/{{ fullUrl }}").factory("Media",["$document","$interpolate","AUDIO_TYPES","AUDIO_PATH",function(a,b,c,d){var e={},f={},g=a[0].createElement("audio");return g.setAttribute("autoplay",""),a[0].body.appendChild(g),{audioEl:g,supportTest:function(b){if(e.hasOwnProperty(b))return e[b];if(!b&&e.hasOwnProperty("audio"))return e.audio;var d=a[0].createElement("audio"),f=!!d.canPlayType;return b?(f=f&&!!d.canPlayType(c[b]||b),e[b]=f):e.audio=f,f},getSupportedSrc:function(a){if(f[a.clipId])return f[a.clipId];var c=b(d)({fullUrl:a.fullUrl}),e=c.match(/\.(\w+)$/);e=e&&e[1];for(var g=[e].concat(a.alternatives||[]),h=0;h<g.length;h++)if(this.supportTest(g[h]))return f[a.clipId]=c.replace(/\.\w+$/,"."+g[h]),f[a.clipId];return!1}}}]).directive("toggleMuteAudio",["Media",function(a){return{restrict:"A",scope:!0,link:function(b,c){var d=a.audioEl;c.on("click",function(){d.muted=!d.muted}),d.addEventListener("volumechange",function(){c[d.muted?"addClass":"removeClass"]("muted"),b.muted=d.muted,b.$digest()})}}}]).directive("muteReplayAudio",function(){return{restrict:"A",scope:!0,link:function(b,c){c.on("click",function(){b[b.states.ended?"replay":"toggleMute"](),b.$digest()}),b.$watch("states",function(b){a.forEach(["ended","muted"],function(a){c[b[a]?"addClass":"removeClass"](a)})},!0)}}}).directive("humanAudio",["$q","Human","Media",function(a,b,c){return{restrict:"E",scope:!0,templateUrl:"templates/media/audio.html",link:function(a){var d=c.audioEl,e=!1,f=!1,g=function(){a.show=e&&f};a.states={ended:!1,muted:!1},a.replay=function(){d.currentTime=0,d.play(),a.states.ended=!1},a.toggleMute=function(){d.muted=!d.muted,a.states.muted=d.muted},d.addEventListener("ended",function(){a.states.ended=!0,a.$digest()}),d.addEventListener("playing",function(){a.states.ended=!1,a.$digest()}),b.events.on("audio.suggestedClipInfo",function(b){d.src=c.getSupportedSrc(b),f=!!d.src,g(),a.$digest()}),a.$watch("uiComponents.config.audio",function(a){e=!!a,g()})}}}]),a.module("humanUI.modes",[]).run(["$window",function(a){Human.events.on("isolate.noSelection",function(){a.alert("Please select an object before entering Isolate mode.")})}]).directive("humanXray",["Human",function(a){return{restrict:"E",scope:!0,templateUrl:"templates/modes/xray.html",link:function(b){b.info="X-Ray Mode [T]",b.config={model:a.view.xray.enabled,on:a.view.setModeEnabled.bind(a.view,"xray"),off:a.view.setModeEnabled.bind(a.view,"highlight")},a.events.on("xray.toggled",function(){b.config.model=a.view.xray.enabled}),b.$watch("uiComponents.config.xray",function(a){b.show=!!a})}}}]).directive("humanIsolate",["Human",function(a){return{restrict:"E",scope:!0,templateUrl:"templates/modes/isolate.html",link:function(b){b.info="Isolate Mode [I]",b.config={model:a.view.isolate.enabled,on:a.view.setModeEnabled.bind(a.view,"isolate"),off:a.view.setModeEnabled.bind(a.view,"highlight")},a.events.on("isolate.toggled",function(){b.config.model=a.view.isolate.enabled}),b.$watch("uiComponents.config.isolate",function(a){b.show=!!a})}}}]),a.module("humanUI.parse",[]).factory("HumanParser",function(){function b(a){var b=c[a];if(b)return b;var d=a.split("."),e="";d.forEach(function(a){e+="if(s == null) return undefined;\ns=s."+a+";\n"}),e+="return s;";var f=new Function("s",e);return f.toString=function(){return e},b=f,c[a]=b,b}var c={},d={},e=function(a){this.lexer=a};e.prototype={parse:function(b){this.text=b,this.tokens=this.lexer.lex(b);var c=a.noop;if(this.tokens.length>0&&(c=this.primary()),0!==this.tokens.length)throw new Error("Unexpected token");return c},primary:function(){var a;if(this.peek().identifier)a=this.identifier();else{if(!this.peek().constant)throw new Error("Not a valid expression");a=this.constant()}for(var b;b=this.expect("[",".");)"["===b.text?a=this.objectIndex(a):"."===b.text&&(a=this.fieldAccess(a));return a},fieldAccess:function(a){var b=this.identifier();return function(c){var d=a(c);return null==d?void 0:b(d)}},objectIndex:function(a){var b=this.primary();return this.consume("]"),function(c){var d=a(c),e=b(c);return d?d[e]:void 0}},identifier:function(){for(var a=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier;)a+=this.consume().text+this.consume().text;return b(a)},constant:function(){function a(){return b}var b=this.consume().value;return a.constant=!0,a.literal=!0,a},consume:function(a){if(0===this.tokens.length)throw new Error("Unexpected end of expression");var b=this.expect(a);if(!b)throw new Error("Unexpected token");return b},expect:function(a,b,c,d){var e=this.peek(a,b,c,d);return e?(this.tokens.shift(),e):!1},peek:function(a,b,c,d){return this.peekAhead(0,a,b,c,d)},peekAhead:function(a,b,c,d,e){if(this.tokens.length>a){var f=this.tokens[a],g=f.text;if(g===b||g===c||g===d||g===e||!b&&!c&&!d&&!e)return f}return!1}};var f=function(){};return f.prototype={lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index<this.text.length;){var b=this.text.charAt(this.index);this.isNumber(b)||"."===b&&this.isNumber(this.peek())?this.readNumber():this.isValidIdentifierStart(this.peekMultichar())?this.readIdentifier():this.is(b,"[].")?(this.tokens.push({index:this.index,text:b}),this.index++):this.index++}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){var b=a||1;return this.index+b<this.text.length?this.text.charAt(this.index+b):!1},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var c=a.charCodeAt(0),d=b.charCodeAt(0);return c>=55296&&56319>=c&&d>=56320&&57343>=d?a+b:a},isNumber:function(a){return a>="0"&&"9">=a&&"string"==typeof a},isValidIdentifierStart:function(a){return a>="a"&&"z">=a||a>="A"&&"Z">=a||"_"===a||"$"===a},isValidIdentifierContinue:function(a){return this.isValidIdentifierStart(a)||this.isNumber(a)},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index).toLowerCase();if("."!==c&&!this.isNumber(c))break;a+=c,this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdentifier:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isValidIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})}},{Lexer:f,parse:function(a){var b,c=a=a.trim();if(b=d[c],!b){var g=new f,h=new e(g);b=h.parse(a),d[c]=b}return b}}}),a.module("humanUI.rpc",[]).factory("RpcDefinitions",["$document","$filter","ConfigCreator","Human","HumanSnapshot","HumanBackground","HotspotData","Hotspot","HOTSPOT_TYPES",function(b,c,d,e,f,g,h,i,j){return{init:function(){var k=b[0].querySelector("[rpc-styles]");e.rpc.define("injectStyles",function(a){k&&(k.styleSheet?k.styleSheet.cssText=a:k.appendChild(b[0].createTextNode(a)),e.view.annotations.updateDimensions(),e.view.annotations.layouts.redrawLayout())},{hidden:!0});var l=["bookmarkTour","loadProgress"];e.rpc.define("ui.getDisplay",function(){var b={};a.forEach(d.config,function(a,c){-1===l.indexOf(c)&&(b[c]=a)}),this.setResult(b)}),e.rpc.define("ui.setDisplay",function(a){d._buildApplicationConfig(a),d._extend(),d._apply()});var m=function(a){var b=this;f.get(a,function(a){b.setResult(a.src)})};e.rpc.define("snapshot.get",m,{hidden:!0}),e.rpc.define("scene.snapshot",m,{hidden:!0}),e.rpc.define("ui.snapshot",m),e.rpc.define("ui.getBackground",function(){var a=g.getBackgroundData(),b={colors:[a.colors[0][255],a.colors[1][255]],colorStops:[a.colors[0].stop,a.colors[1].stop],gradientType:a.gradientType};this.setResult(b)}),e.rpc.define("ui.setBackground",function(a){a.hasOwnProperty("colors")&&g.setColors(a.colors),a.hasOwnProperty("colorStops")&&g.setColorStops(a.colorStops),a.hasOwnProperty("gradientType")&&g.setGradientType(a.gradientType)}),e.rpc.define("ui.getWorldPosition",function(a){var b=a.x,c=a.y,d=e.renderer.pick(b,c,!0);if(d){var f=Array.prototype.slice.call(d.worldPos);d=n(f,"object")}else d=null;this.setResult(d)});var n=c("formatPosition"),o={position:function(a,b){a.pos=n(b,"array")},direction:function(a,b){a.dir=n(b,"array")},chapterScope:function(a,b){a.chapterScope=b},shown:function(a,b){a.shown=b},type:function(a,b){a.type=b},title:function(a,b){a.title=b},objectId:function(a,b){a.objectId=b},data:function(a,b){a.data=b}},p={id:function(a,b){a.id=b},pos:function(a,b){a.position=n(b,"object")},dir:function(a,b){a.direction=n(b,"object")},canvasPos:function(a,b){a.canvasPosition=n(b,"object")},chapterScope:function(a,b){a.chapterScope=b},shown:function(a,b){a.shown=b},type:function(a,b){a.type=b},title:function(a,b){a.title=b},objectId:function(a,b){a.objectId=b},data:function(a,b){a.data=b}},q=function(a,b){var c={};for(var d in b)b.hasOwnProperty(d)&&a.hasOwnProperty(d)&&b[d](c,a[d]);return c};e.rpc.define("hotspots.create",function(b){b=q(b,o),h.add(b);var c=h.getCurrentId()-1,d=e.timeline.activeRoot._chapters,f=e.timeline.activeRoot._nowBranch,g=d.indexOf(f);if(!a.isDefined(b.chapterScope)||b.chapterScope===g){var j=i.create(h.all[c]);j.template&&j.render()}this.setResult(c)}),e.rpc.define("hotspots.info",function(b){a.isObject(b)&&(b=void 0);var c=null;if(b)c=q(i.get(b),p);else{c=[];for(var d=0;d<i.hotspots.length;d++)c.push(q(i.hotspots[d],p))}this.setResult(c)}),e.rpc.define("hotspots.update",function(a){var b=a.id,c=h.all[b];if(c){a=q(a,o),h.update(b,a);var d=i.get(b);d&&(i.destroy(d),d=i.create(c),d.template&&d.render())}}),e.rpc.define("hotspots.destroy",function(a){var b=i.get(a);b&&i.destroy(b),h.remove(a)});var r=function(a,b){if(a)i.get(a).setShown(b);else for(var c=0;c<i.hotspots.length;c++)i.hotspots[c].setShown(b)};e.rpc.define("hotspots.show",function(b){a.isObject(b)&&(b=void 0),r(b,!0)}),e.rpc.define("hotspots.hide",function(b){a.isObject(b)&&(b=void 0),r(b,!1)}),e.rpc.define("hotspots.types",function(){var a=Object.keys(j).map(function(a){return c("dashNormalize")(a)});this.setResult(a)});var s={};e.rpc.defineEvent("hotspots.positionUpdated",{events:["hotspots.positionUpdated"],map:function(a){return p.id(s,a.id),p.canvasPos(s,a.canvasPos),s}}),e.rpc.defineEvent("hotspots.displayUpdated"),e.rpc.defineEvent("hotspots.picked"),e.rpc.defineEvent("hotspots.entered"),e.rpc.defineEvent("hotspots.left")}}}]),a.module("humanUI.scene",[]).provider("ObjectOpacities",function(){var b,c,d,e,f,g,h,i,j,k=[],l=0,m={},n={initIndex:0,minOpacity:0,layerHandlers:{}},o=function(b){a.extend(n,b)},p=function(p,q){var r=function(a){for(var b=[],c=0;c<a.length;c++)b.push({name:a[c],objectIds:[a[c]]});return b},s=function(a){for(var b=[],c={},d=0;d<a.length;d++)"selector"===a[d].definition?(c={name:a[d].name,objectIds:p.scene.select(a[d].selector)},b.push(c)):b.push(a[d]);return b},t=function(a){for(var b=[],c=0;c<a.length;c++){var d=p.scene.objects[a[c]];if(d){var e=d.getLeafObjects();b=b.concat(e)}}return b},u=function(a,b){b=b*(1-n.minOpacity)+n.minOpacity,a.setOpacity(b)};return{data:{layers:[],threshold:1,minOpacity:n.minOpacity,initIndex:n.initIndex},newObjectsEvent:"objectSlider.layers",newPositionEvent:"objectSlider.position",config:function(b){o(b),a.extend(this.data,b)},init:function(j,o,u){this.resetScene(),j||(j=q.getFromRoots().map(function(a){return a.objectId})),j=s(j),a.isNumber(o)&&(n.initIndex=this.data.initIndex=o),a.isNumber(u)&&(n.minOpacity=u),this.data.layers=a.isString(j[0])?r(j):j,l=this.data.threshold=1/j.length,m={},e=n.initIndex,f=0,h=b=c=d=g=void 0;var v=this.data.layers[e];k=v?t(v.objectIds):[],this.data.layers.forEach(function(a){var b=t(a.objectIds);for(g=0;g<b.length;g++)m[b[g].objectId]={opacity:b[g].opacity};for(g=0;g<a.objectIds.length;g++){var c=a.objectIds[g],d=p.scene.enabledObjects.hasOwnProperty(c);m[c]?m[c].enabled=d:m[c]={enabled:d}}}),this.set(n.initIndex*l),i.triggerHandler(this.newObjectsEvent)},resetScene:function(){var a,b,c={};for(var d in m)m.hasOwnProperty(d)&&(a=m[d],b=p.scene.objects[d],a.hasOwnProperty("enabled")&&(c[d]=a.enabled),a.hasOwnProperty("opacity")&&b.setOpacity(a.opacity));p.scene.setEnabledObjects({objects:c})},set:function(a){if(e=Math.floor(a/l),e!==e&&(e=n.initIndex),b=e!==f,c=this.data.layers[e],b){var m,o,q=Math.abs(e-f),r=(e-f)/q,s=[],v=-1===r?1:0;for(g=f;g!==e;){if(m=this.data.layers[g])for(j=n.layerHandlers[m.name]||u,s=t(m.objectIds),o=0;o<s.length;o++)j(s[o],v);g+=r}if(0===n.minOpacity){var w={};for(g=0;g<this.data.layers.length;g++)if(m=this.data.layers[g],!n.layerHandlers[m.name])for(o=0;o<m.objectIds.length;o++)w[m.objectIds[o]]=g>=e;p.scene.setEnabledObjects({objects:w})}k=c?t(c.objectIds):[]}if(k.length)for(j=n.layerHandlers[c.name]||u,d=(a-l*e)/l,o=0;o<k.length;o++)j(k[o],1-d);f=e,h=a,i.triggerHandler(this.newPositionEvent,h)},getIndex:function(){return e},getPosition:function(){return h},setElement:function(a){i=a}}};return p.$inject=["Human","SceneObjects"],{$get:p,config:o}}).directive("humanObjectSlider",["$window","Human","HumanSlider","ObjectOpacities","HumanParser","currentModule",function(b,c,d,e,f,g){return{restrict:"E",templateUrl:"templates/scene/object-slider.html",scope:!0,link:function(c,h,i){var j=h.find("object-slider-layers")[0],k=i.axis||"y",l=function(){for(var a=e.data.threshold,b="x"===k?"left":"top",c=0;c<j.children.length;c++){var d=j.children[c];d.style[b]=c*a*100+"%"}},m=function(b){for(var c="x"===k?"left":"top",d=0;d<j.children.length;d++){var e=a.element(j.children[d]),f=parseInt(e[0].style[c])/100,g=b>=f?"addClass":"removeClass";e[g]("on")}},n=d.create({axis:k,element:h.find("human-slider")[0],onMove:function(a){e.set(a),m(a)}});c.setOpacity=function(a){var b=e.data.threshold,c=a*b;e.set(c),n.move(c),m(c)},e.setElement(h),h.on(e.newPositionEvent,function(a,b){n.move(b),m(b)}),h.on(e.newObjectsEvent,function(){c.layers=e.data.layers;var a=e.data.threshold,d=e.data.initIndex,f=d*a;n.move(f),b.setTimeout(function(){l(),m(f)},0)}),c.$watch("uiComponents.config.objectSlider",function(b){var d=a.isObject(b)&&b.objects;h[d?"addClass":"removeClass"]("layers");var i=a.isObject(b)&&b.data,j=null;i&&(j=b.data,a.isString(j)&&(j=j.split(",")));var k=a.isObject(b)&&b.dataSrc;k&&(j=f.parse(b.dataSrc)(g.data)),c.show=!!b,b&&e.init(j)},!0)}}}]).factory("GraphState",["Human",function(a){function b(b){return Object.keys(a.scene.objects).forEach(function(a){b[a]=!1}),b}function c(b){var c=a.scene.objects[b].parent;return c?c.objects.map(function(a){return a.objectId}):[]}function d(b,c,e){var f=a.scene.objects[c].parent;f&&!b[f.objectId]&&(e[f.objectId]=!0,b[f.objectId]=!0,d(b,f.objectId,e))}function e(b,d,f){var g=a.scene.objects[d].parent,h=c(d).filter(function(a){return b[a]});g&&0===h.length&&b[g.objectId]&&(f[g.objectId]=!1,b[g.objectId]=!1,e(b,g.objectId,f))}function f(a,b){var c,f={};if("shown"===a)c=k;else if("selected"===a)c=l;else{if("pickThrough"!==a)return;c=m,a="pickable"}var g;for(g in b)b.hasOwnProperty(g)&&(b[g]?(f[g]=!0,c[g]=!0,d(c,g,f)):(f[g]=!1,c[g]=!1,e(c,g,f)));return f}function g(c){var f;if("shown"===c)f=k;else if("selected"===c)f=l;else{if("pickThrough"!==c)return;f=m,c="pickable"}f=b(f);var g,h,i=[];return a.scene.rootObjects.forEach(function(b){for(i=a.scene.getLeaves(b.objectId),g=0;g<i.length;g++)h=a.scene.objects[i[g]],h[c]&&d(f,i[g],{})}),f=b(f),a.scene.rootObjects.forEach(function(b){for(i=a.scene.getLeaves(b.objectId),g=0;g<i.length;g++)h=a.scene.objects[i[g]],h[c]?(f[h.objectId]=!0,d(f,i[g],{})):(f[h.objectId]=!1,e(f,i[g],{}))}),f}function h(a){return k[a]}function i(a){return l[a]}function j(a){return m[a]}var k={},l={},m={};return{updateGraphState:f,buildGraphState:g,isShown:h,isSelected:i,isPickThrough:j}}]).factory("ObjectRendered",["$timeout","Human",function(a,b){var c=function(a,b){this.collection=a,this.element=b,this.flagged={},this.liQueue=[],this.assetCount=0,this.maxQueueLength=1,this.boundLoadProgress=this.onAssetLoadProgress.bind(this),this.boundObjectRenderable=this.onObjectRenderable.bind(this),this.boundAssetAttachFinish=this.onAssetAttachFinish.bind(this),this.addHandlers(),this.element.data("objectRendered",this)};return c.create=function(a){var b=a.data("humanCollection");if(b){var d=a.data("objectRendered");return d||new c(b,a)}},c.prototype.setMaxQueueLength=function(){this.maxQueueLength=Math.floor(this.assetCount/100),this.maxQueueLength<1&&(this.maxQueueLength=1),this.maxQueueLength>20&&(this.maxQueueLength=20)},c.prototype.paintAndReset=function(){for(var a=0;a<this.liQueue.length;a++)this.liQueue[a].addClass("anatomy-rendered");this.liQueue.length=0},c.prototype._updateRendered=function(a,c){var d=b.scene.objects[a];if(d&&d.isRenderable())for(;d&&!this.flagged[d.objectId];){var e=this.collection.getLi(d.objectId);e&&(c?(this.liQueue.push(e),this.liQueue.length===this.maxQueueLength&&this.paintAndReset()):e.addClass("anatomy-rendered"),this.flagged[d.objectId]=!0),d=d.parent}},c.prototype.updateRendered=function(){for(var a in this.collection.lis)this.collection.lis.hasOwnProperty(a)&&this._updateRendered(a,!1);this.flagged={}},c.prototype.addHandlers=function(){b.events.off("assets.load.progress",this.boundLoadProgress),b.events.on("assets.load.progress",this.boundLoadProgress),b.events.off("scene.objectRenderable",this.boundObjectRenderable),b.events.on("scene.objectRenderable",this.boundObjectRenderable),b.events.off("graph.assetAttach.finish",this.boundAssetAttachFinish),b.events.on("graph.assetAttach.finish",this.boundAssetAttachFinish)},c.prototype.removeHandlers=function(){b.events.off("assets.load.progress",this.boundLoadProgress),b.events.off("scene.objectRenderable",this.boundObjectRenderable),b.events.off("graph.assetAttach.finish",this.boundAssetAttachFinish)},c.prototype.onAssetLoadProgress=function(a){0===this.assetCount&&(this.assetCount=a.requestedAssets,this.setMaxQueueLength())},c.prototype.onObjectRenderable=function(b){var c=this;a(function(){c._updateRendered(b.objectId,!0)})},c.prototype.onAssetAttachFinish=function(){var b=this;a(function(){b.paintAndReset(),b.flagged={},b.assetCount=0})},c}]).factory("ObjectEnabled",["$timeout","Human","GraphState",function(b,c,d){var e=function(a,b){this.collection=a,this.element=b,this.shownState=d.buildGraphState("shown");var e=this.onObjectShow.bind(this),f=this.onObjectsShown.bind(this);this.element.off("click.objectShow",e),this.element.on("click.objectShow",e),c.events.off("scene.objectsShown",f),c.events.on("scene.objectsShown",f),this.element.data("objectEnabled",this)};return e.create=function(a){var b=a.data("humanCollection");if(b){var c=a.data("objectEnabled");return c||new e(b,a)}},e.toggleEnabledAnatomy=function(a,b){var d={};if(d[b]=a,c.scene.setEnabledObjects({objects:d}),a){var e=c.scene.objects[b].getLeafObjects(),f=[];e.forEach(function(a){a.isRenderable()||f.push(a)}),f.length&&c.scene.graph.attachAssetSetsToSubtree(f)}},e.prototype.update=function(a,b){var c=this.collection.getLi(b);c&&c[a?"addClass":"removeClass"]("anatomy-enabled")},e.prototype.onObjectShow=function(a,b){var c=b&&b.target||a.target;if(c.hasAttribute("object-enabled")){a.stopPropagation();var d=c.getAttribute("object-enabled"),f=this.collection.getLi(d);f.toggleClass("anatomy-enabled");var g=f.hasClass("anatomy-enabled");e.toggleEnabledAnatomy(g,d)}},e.prototype.onObjectsShown=function(c){var e=this,f=d.updateGraphState("shown",c.enabledObjectsUpdate);b(function(){a.forEach(f,e.update,e)})},e}]).provider("ObjectSelected",function(){var b={selectOpen:!0,deselectClose:!0},c=function(c,d,e,f){var g=function(c,f){this.collection=c,this.element=f,this.config=a.copy(b),this.selectedState=e.buildGraphState("selected"),this.throttle=!1;var g=this.onObjectSelect.bind(this),h=this.onObjectsSelected.bind(this);this.element.off("click.objectSelect",g),this.element.on("click.objectSelect",g),d.events.off("scene.objectsSelected",h),d.events.on("scene.objectsSelected",h),this.element.data("objectSelected",this)};return g.create=function(a){var b=a.data("humanCollection");if(b){var c=a.data("objectSelected");return c||new g(b,a)}},g.prototype.selectAnatomy=function(a){var b=this,c=d.view.pick.getMultiPickEnabled();d.scene.setSelectedObjects({objectId:a,select:!0,replace:!c}),c?b.throttle=!1:d.view.camera.fly.flyTo({boundary:d.scene.getBoundary({objects:d.scene.selectedObjects})},function(){b.throttle=!1})},g.prototype.onObjectSelect=function(a,b){var c=b&&b.target||a.target;if(c.hasAttribute("object-selected")){a.stopPropagation();var d=c.getAttribute("object-selected"),e=this.collection.getLi(d);this.throttle=!0,this.selectAnatomy(d);var g=f.getTarget(e);g&&f.show(g)}},g.prototype.update=function(a,b){var c=this.collection.getLi(b),d=f.getTarget(c);c&&(c[a?"addClass":"removeClass"]("anatomy-selected"),d&&(this.config.selectOpen&&a&&!this.throttle&&f.show(d,{animate:!1}),this.config.deselectClose&&!a&&f.hide(d,{animate:!1})))},g.prototype.onObjectsSelected=function(b){var d=this,f=e.updateGraphState("selected",b.selectedObjectsUpdate);c(function(){a.forEach(f,d.update,d)})},g};return c.$inject=["$timeout","Human","GraphState","TreeCollapse"],{$get:c,config:function(c){a.extend(b,c)}}}).factory("SceneObjects",["Human","ObjectEnabled","ObjectSelected","ObjectRendered",function(b,c,d,e){var f=function(a){return/export_ID$/.test(a)};return{getFromRoots:function(){var c=[];return a.forEach(b.scene.rootObjects,function(b){a.forEach(b.objects,function(a){f(a.objectId)?c=c.concat(a.objects):c.push(a)})}),c},getFromList:function(){var c={};return a.forEach(b.scene.objects,function(a,b){a.parent&&!f(b)&&(c[b]=a)}),c},init:function(a){e.create(a),c.create(a),d.create(a)}}}]).directive("humanObjectTree",["$timeout","Human","SceneObjects","HumanKeySelect","GraphState",function(b,c,d,e,f){return{restrict:"E",templateUrl:"templates/scene/object-tree.html",scope:!0,transclude:!0,link:function(g,h,i){var j=h.find("human-tree"),k=function(a){g.show=l()&&a},l=function(){var b=g.rootObjects;return a.isArray(b)&&b.length>0};g.objectTreeConfig={compile:!1,compare:!0,itemId:"objectId",itemClasses:function(a){return{"anatomy-enabled":f.isShown(a.objectId),"anatomy-selected":f.isSelected(a.objectId)}},isLeaf:function(a){return a.isLeaf()}},g.rootObjects=c.scene.rootObjects,g.$watchCollection("rootObjects",function(){var c;l()&&b(function(){g.sceneObjects=d.getFromRoots(),d.init(j)}),c=a.isObject(g.uiComponents.config)?!!g.uiComponents.config.objectTree:!1,k(c)});var m=e.create(h,null,{cycle:!i.hasOwnProperty("noCycle"),onSelected:function(a){j.triggerHandler("click.objectSelect",{target:a[0]})}});g.$on("humanObjectTree.selectItem",function(a,b){m.selectItem(b)}),j.on("humanCollection.built",function(){m.setItems(j.find("a"))}),g.$watch("uiComponents.config.objectTree",function(a){k(!!a)})}}}]).directive("humanObjectListSearch",["$document","$timeout","SceneObjects",function(b,c,d){return{restrict:"E",scope:!0,templateUrl:"templates/scene/object-list-search.html",link:function(e,f,g){var h,i,j={};h=g.hasOwnProperty("target")?a.element(b[0].querySelector(g.target)):f.next();var k=function(){var b=h.find("human-list"),c=b.data("humanCollection");a.forEach(e.sceneObjects,function(a,b){a.displayName&&(i=a.displayName.toLowerCase(),j[i]||(j[i]=[]),j[i].push(c.getLi(b)[0]))})},l="Search Current 3D Model";g.searchPlaceholder?g.$observe("searchPlaceholder",function(a){e.searchPlaceholder=a}):e.searchPlaceholder=l,e.clearSearch=function(){var a=f.find("input");a.val(""),a.triggerHandler("change")},e.searchList=function(){var a,b,c,d,f,g=function(a,b){for(d=0;d<a.length;d++)a[d].style.display=b},i=e.searchText.toLowerCase(),k=0;a=new RegExp("^"+i+"|\\s"+i);for(f in j)j.hasOwnProperty(f)&&(c=a.test(f),b=c?"inherit":"none",g(j[f],b),c&&k++);e.noResults=0===k,e.searching=e.searchText.length>0,h.triggerHandler("objectListSearching",e.searching)},e._sceneObjects=Human.scene.objects,e.$watchCollection("_sceneObjects",function(a){Object.keys(a).length>0&&h[0]&&c(function(){e.sceneObjects=d.getFromList(),c(function(){k()})})})}}}]).directive("humanObjectList",["$timeout","$window","HumanKeySelect","SceneObjects","GraphState",function(a,b,c,d,e){return{restrict:"E",templateUrl:"templates/scene/object-list.html",scope:!0,transclude:!0,link:function(b,f,g){var h,i=f.find("human-list"),j=i[0],k=!1,l=function(){for(var a=0;a<n.length;a++)n[a].element.style.display="inherit";h.style["margin-top"]="0px",h.style["margin-bottom"]="0px"},m=function(a){b.searching&&a||(a?(o(),p(),i.off("scroll",p),i.on("scroll",p)):(l(),i.off("scroll",p)),k=a)},n=[],o=function(){var a=i.find("li.letter-group");l(),n=[];for(var b=0;b<a.length;b++)n.push({element:a[b],top:a[b].offsetTop,bottom:a[b].offsetTop+a[b].offsetHeight})},p=function(){if(h&&0!==n.length){var a,b,c=0,d=n.length;for(a=0;a<n.length;a++)b=n[a],b.bottom<j.scrollTop?c=a+1:b.top>j.scrollTop+j.clientHeight&&d===n.length&&(d=a);for(a=0;c>a;a++)n[a].element.style.display="none";for(a=c;d>a;a++)n[a].element.style.display="inherit";var e=0;for(a=d;a<n.length;a++)e+=n[a].bottom-n[a].top,n[a].element.style.display="none";h.style["margin-top"]=n[c].top+"px",h.style["margin-bottom"]=e+"px"}};b.objectListConfig={itemId:"objectId",itemClasses:function(a){return{"anatomy-rendered":a.isRenderable(),"anatomy-enabled":e.isShown(a.objectId),"anatomy-selected":e.isSelected(a.objectId)
  }},letterHeaders:!0},b._sceneObjects=Human.scene.objects,b.$watchCollection("_sceneObjects",function(c){Object.keys(c).length>0&&a(function(){b.sceneObjects=d.getFromList(),d.init(i),a(function(){h=i.children()[0]})})}),f.on("objectListSearching",function(a,c){b.searching=c,f[c?"addClass":"removeClass"]("searching"),m(!c),j.scrollTop=0}),b.$on("objectListRanges.setCropping",function(a,b){m(b)}),b.$on("objectListRanges.setRanges",o),b.$on("objectListRanges.crop",p),Human.events.on("graph.assetAttach.finish",function(){m(!0)});var q=c.create(f,null,{cycle:!g.hasOwnProperty("noCycle"),onSelected:function(a){i.triggerHandler("click.objectSelect",{target:a[0]})}});b.$on("humanObjectList.selectItem",function(a,b){q.selectItem(b)}),i.on("humanCollection.built",function(){q.setItems(i.find("a"))})}}}]),a.module("humanUI.snapshot",[]).provider("HumanSnapshot",function(){var b={copyrightImagePath:null,copyrightText:{font:"12px Arial",fillStyle:"#666666",textAlign:"center"}},c=function(c){c.copyrightImagePath&&(b.copyrightImagePath=c.copyrightImagePath),a.isObject(c.copyrightText)&&a.extend(b.copyrightText,c.copyrightText)},d=function(d,e,f,g,h){var i,j=!1,k=function(){i=new d.Image,i.onload=function(){j=!0},i.src=b.copyrightImagePath},l=function(c,d,e){var f,g;a.forEach(b.copyrightText,function(a,b){c[b]=a});var h=[(new Date).getFullYear(),String.fromCharCode(169)].join(" "),k=c.measureText(h);f=d/2-k.width/2,g=e-10,c.fillText(h,f,g),j&&(f=d/2-i.width/2,g=e-20-i.height,c.drawImage(i,f,g))},m=function(a,b,c,d){var e,f=function(a,c){for(var d=0;d<b.colors.length;d++){var e=b.colors[d][255];e="rgb("+e[0]+", "+e[1]+", "+e[2]+")",a.addColorStop(c[d],e)}};if("radial"===b.gradientType){var g=c/2,h=d/2,i=Math.max(g,h),j=[g,h,i,g,h,0];e=a.createRadialGradient.apply(a,j),f(e,[1,0])}else e=a.createLinearGradient(0,0,0,d),f(e,[0,1]);a.fillStyle=e,a.fillRect(0,0,c,d)},n=function(a,b){a=a||{};var c=h.renderer.canvas.canvas;c[0]&&(c=c[0]);var f=c.getBoundingClientRect(),g=f.width,i=f.height,j=a.width||g,k=a.height||i;j>=k?k=d.Math.floor(i/g*j):k>j&&(j=d.Math.floor(g/i*k));var n=!1;h.timeline.playing&&(n=!0,h.timeline.pause()),h.renderer.forceRenderFrame();var o=e[0].createElement("canvas"),p=o.getContext("2d");o.width=j,o.height=k;var q,r;"HumanBackground"in d&&(q=d.HumanBackground.getBackgroundData(),r=[p,q,j,k],m.apply(null,r)),r=[c,0,0,j,k],p.drawImage.apply(p,r);var s=a.copyright===!1?!1:!0;s&&l(p,j,k);var t=h.view.annotations.layouts,u=t.getLayout(t.activeLayout);if(u&&u.snapshot){var v;v=q?q.averageGray[1]>.5?"white":"black":"white",u.snapshot(o,p,v)}h.renderer.forceRenderFrame(),n&&h.timeline.unpause();var w=new d.Image;w.width=j,w.height=k,w.onload=b.bind(null,w),w.src=o.toDataURL("image/jpeg")};return b.copyrightImagePath&&k(),{get:function(b,c){n(b,function(e){b.openInTab&&d.open(e.src,"_blank"),a.isFunction(c)&&c(e)})},loadCopyrightImage:k,config:c}};return d.$inject=["$window","$document","$q","$timeout","Human"],{$get:d,config:c}}),a.module("humanUI.timeline",[]).factory("HumanTimeline",["Human",function(b){var c=function(){var c=b.timeline.activeRoot;if(c)for(var d,e,f,g,h=0;h<c._chapters.length;h++){if(d=c._chapters[h].maps,!Object.keys(d).length)return!1;for(g in d)if(d.hasOwnProperty(g)&&(e=d[g].data.timeline,f=a.isObject(e)?e.id:e,"dummy"!==f))return!0}return!1};return{isPlayable:function(a){if(c())return!0;var d=b.timeline.activeRoot;if(!d)return!1;var e=Object.keys(d._chapters).length>1,f=a&&a.lastTime>a.firstTime;return e&&f},playChapter:function(a){b.timeline.play({startChapterId:a.id,loop:!!a.animation.loop,numChapters:1})},handleChapter:function(a){var c=b.timeline.activeRoot;if(c){var d=c._chapters.indexOf(c._nowBranch),e=c._chapters.indexOf(a),f=e-d;1===Math.abs(f)?b.timeline[1===f?"next":"prev"]():a.animation.loop?this.playChapter(a):b.timeline.scrub({chapterId:a.id})}}}}]).directive("playPauseTimeline",["Human",function(b){return{restrict:"A",scope:{config:"="},link:function(c,d){var e,f,g,h=function(){e={startTime:b.timeline.time},g=!!b.timeline.activeRoot._nowBranch.animation.loop,(f||g)&&(e.loop=!0);var d=a.isObject(c.config)&&c.config.tour;(d||g)&&(e.numChapters=1),b.timeline.play(e)};d.on("click",function(){b.timeline.playing?b.timeline.stop():h()}),b.events.on("timeline.played",function(){d.addClass("playing")}),b.events.on("timeline.stopped",function(){d.removeClass("playing")}),b.events.on("timeline.scrubbed",function(){d.removeClass("playing")}),b.events.on("modules.activate.start",function(a){var c=b.modules.modules[a.moduleId];c&&(f=!(!c.animation||!c.animation.loop))})}}}]).directive("humanPlayPause",["HumanTimeline",function(b){return{restrict:"E",scope:!0,templateUrl:"templates/timeline/play-pause.html",link:function(c){var d,e,f=function(){c.show=!!d&&!!e};Human.events.on("modules.activate.finish",function(){var a=Human.timeline.getTimeFrame();e=b.isPlayable(a),f()}),Human.events.on("modules.deactivate.finish",function(){c.show=!1}),c.$watch("uiComponents.config.playPause",function(b){var e=c.uiComponents.config;d=!e.scrubber&&!e.tour&&!!b,f(),a.isObject(b)&&(c.config=b)},!0)}}}]).directive("humanChapters",["$window","$sce","$timeout","Human","HumanTimeline","checkModule","translateFilter",function(b,c,d,e,f,g,h){var i=a.element(b);return{restrict:"E",scope:{config:"=?"},templateUrl:"templates/timeline/chapters.html",link:function(b,j,k){var l,m,n,o=k.chaptersMode||"scrubber",p=function(){n=j[0].scrollWidth>j[0].clientWidth,j[n?"addClass":"removeClass"]("overflow")},q=function(){var a=j[0].children[b.curIndex];if("tour"===o&&a){var c=j[0].scrollWidth/b.chapters.length,d=b.curIndex*c;j[0].scrollLeft>d&&(j[0].scrollLeft=d);var e=j[0].scrollLeft+j[0].clientWidth,f=d+c;f>e&&(j[0].scrollLeft=f-j[0].clientWidth)}},r=function(a){if(!b.titles.hasOwnProperty(a.id)){var d=h(a.info,"displayName",m);b.titles[a.id]=c.trustAsHtml(d)}return b.titles[a.id]};b.titles={},b.chapters=[],b.getOffset=function(a){if(e.timeline.activeRoot){var b=e.timeline.activeRoot._times[a];return"scrubber"===o?b/l.lastTime*100+"%":"auto"}};var s=function(){if(e.timeline.activeRoot){var c=e.timeline.activeRoot._chapters;c.length>1&&(l=e.timeline.getTimeFrame(),b.chapters=c,b.titleDisplay=a.isObject(b.config)&&b.config.titleDisplay?b.config.titleDisplay:r,d(p),b.showTitles=!g("ui.bootstrap"),b.toolTipPos="scrubber"===o?"left":"top")}};j.on("click",function(a){if(/chapter/.test(a.target.className)){var b=e.timeline.branchTimelines[a.target.id];"scrubber"===o?f.playChapter(b):f.handleChapter(b)}}),i.on("resize",function(){d(p)}),b.$on("human.locale",function(a,b){m=b}),e.events.on("timeline.chapters.updated",function(){d(s)}),e.events.on("timeline.timeFrame.updated",function(a){l=a}),e.events.on("timeline.chapters.activated",function(a){d(function(){b.curIndex=a.newChapterIndex,q()})})}}}]).directive("humanScrubber",["Human","HumanTimeline","HumanSlider",function(b,c,d){return{restrict:"E",scope:!0,templateUrl:"templates/timeline/scrubber.html",link:function(e,f){var g,h,i,j,k,l=!1,m=function(){e.show=!!j&&!!k},n=function(b){e.uiConfig=b;var c=a.isObject(e.uiConfig)&&e.uiConfig.chapters;f[c?"addClass":"removeClass"]("chapters")},o=function(a){var b=Math.floor(a/60).toString(),c=Math.floor(a%60).toString();return 1===b.length&&(b="0"+b),1===c.length&&(c="0"+c),b+":"+c},p=function(){return h=o(b.timeline.time),i=o(g.lastTime),h+" / "+i},q=function(a){var b=g.lastTime-g.firstTime;return g.firstTime+b*a},r=function(a){var b=g.lastTime-g.firstTime;return g.firstTime+a/b},s=d.create({element:f.find("human-slider")[0],label:p,onMove:function(a){b.timeline.scrub({time:q(a)})}}),t=function(a){g=a,s.move(r(b.timeline.time)),l||(l=!0,b.events.on("timeline.scrubbed",function(a){s.move(r(a.time))}),b.events.on("timeline.playing",function(a){s.move(r(a.time))}))};b.events.on("timeline.timeFrame.updated",function(a){k=c.isPlayable(a),k&&t(a),m()}),b.events.on("modules.activate.finish",function(){var a=e.uiComponents.config;a.scrubber&&a.tour&&(j=1===b.timeline.activeRoot._chapters.length,m())}),b.events.on("modules.deactivate.finish",function(){e.show=!1}),e.$watch("uiComponents.config.scrubber",function(a){(!a||a&&!e.uiComponents.config.tour)&&(j=!!a,m()),n(a)},!0)}}}]).directive("prevNextChapter",["Human","HumanTimeline",function(a,b){return{restrict:"A",link:function(c,d,e){var f=e.prevNextChapter||"next";f="next"===f?1:-1;var g,h,i,j=function(){i=1===f&&g===h.length-1||-1===f&&0===g,d[i?"addClass":"removeClass"]("disabled")};d.on("click",function(){if(!i){var c=a.timeline.activeRoot._chapters;b.handleChapter(c[g+f])}}),a.events.on("timeline.chapters.updated",function(a){h=a}),a.events.on("timeline.chapters.activated",function(a){g=a.newChapterIndex,j()})}}}]).directive("humanTour",["$q","$timeout","Human",function(b,c,d){return{restrict:"E",scope:!0,templateUrl:"templates/timeline/tour.html",link:function(b,c){var e,f,g=function(){b.show=!!e&&!!f},h=function(d){b.uiConfig=d;var e=a.isObject(b.uiConfig)&&b.uiConfig.chapters;c[e?"addClass":"removeClass"]("chapters")};d.events.on("timeline.timeFrame.updated",function(){if(d.timeline.activeRoot){var a=b.uiComponents.config;f=d.timeline.activeRoot._chapters.length>1,a.scrubber&&a.tour&&(e=f),g()}}),d.events.on("modules.activate.finish",function(){if(d.timeline.activeRoot){var a=b.uiComponents.config;f=d.timeline.activeRoot._chapters.length>1,a.scrubber&&a.tour&&(e=f),g()}}),d.events.on("modules.deactivate.finish",function(){b.show=!1}),b.$watch("uiComponents.config.tour",function(a){(!a||a&&!b.uiComponents.config.scrubber)&&(e=!!a,g()),h(a)},!0)}}}]),a.module("humanUI.templates",["templates/annotations/panel.html","templates/bookmark/tour.html","templates/camera/center.html","templates/camera/mode.html","templates/camera/pan.html","templates/camera/zoom-in.html","templates/camera/zoom-out.html","templates/camera/zoom.html","templates/cross-section/camera-clip.html","templates/cross-section/controls.html","templates/cross-section/slider.html","templates/cross-section/toggle.html","templates/dissect/dissect.html","templates/dissect/undo.html","templates/fullscreen/panel.html","templates/fullscreen/window-link.html","templates/info/panel.html","templates/media/audio.html","templates/modes/isolate.html","templates/modes/xray.html","templates/scene/object-list-search.html","templates/scene/object-list.html","templates/scene/object-slider.html","templates/scene/object-tree.html","templates/timeline/chapters.html","templates/timeline/play-pause.html","templates/timeline/scrubber.html","templates/timeline/tour.html"]),a.module("templates/annotations/panel.html",[]).run(["$templateCache",function(a){a.put("templates/annotations/panel.html",'<button class="tool annotations" toggle-button="config"></button>')}]),a.module("templates/bookmark/tour.html",[]).run(["$templateCache",function(a){a.put("templates/bookmark/tour.html",'<div>\n  <button prev-next-bookmark="prev"></button>\n\n  <div id=\'bookmark-tour-captures\' update-scroll="state.curCaptureIndex">\n    <div class="bookmark-tour-capture"\n      ng-repeat="capture in state.captures"\n      ng-class="{ on: $index === state.curCaptureIndex }"\n      ng-click="restore($index)">\n\n      <img ng-src="/{{ capture.thumbnailSrc }}">\n    </div>\n  </div>\n\n  <button prev-next-bookmark="next"></button>\n</div>')}]),a.module("templates/camera/center.html",[]).run(["$templateCache",function(a){a.put("templates/camera/center.html","<div center-camera></div>")}]),a.module("templates/camera/mode.html",[]).run(["$templateCache",function(a){a.put("templates/camera/mode.html","<div set-camera-mode></div>")}]),a.module("templates/camera/pan.html",[]).run(["$templateCache",function(a){a.put("templates/camera/pan.html",'<div pan-camera="up" title="Pan Up [{{ keys.up }}]"></div>\n<div pan-camera="right" title="Pan Right [{{ keys.right }}]"></div>\n<div pan-camera="down" title="Pan Down [{{ keys.down }}]"></div>\n<div pan-camera="left" title="Pan Left [{{ keys.left }}]"></div>\n\n<div center-camera title="Center"></div>')}]),a.module("templates/camera/zoom-in.html",[]).run(["$templateCache",function(a){a.put("templates/camera/zoom-in.html",'<div zoom-camera="in">+</div>')}]),a.module("templates/camera/zoom-out.html",[]).run(["$templateCache",function(a){a.put("templates/camera/zoom-out.html",'<div zoom-camera="out">-</div>')}]),a.module("templates/camera/zoom.html",[]).run(["$templateCache",function(a){a.put("templates/camera/zoom.html",'<div zoom-camera="out">-</div>\n<div zoom-camera="in">+</div>')}]),a.module("templates/cross-section/camera-clip.html",[]).run(["$templateCache",function(a){a.put("templates/cross-section/camera-clip.html",'<button class="tool camera-clip" toggle-button="config"></button>')}]),a.module("templates/cross-section/controls.html",[]).run(["$templateCache",function(a){a.put("templates/cross-section/controls.html",'<button\n  class="tool"\n  cycle-section-plane\n  uib-tooltip="{{ tooltipText.select }}"></button>\n\n<human-cross-section-slider></human-cross-section-slider>\n<span class="view">{{ state.current.view }}</span>\n\n<button\n  class="tool"\n  reset-section-plane\n  plane="curPlane"\n  uib-tooltip="{{ tooltipText.reset }}"></button>')}]),a.module("templates/cross-section/slider.html",[]).run(["$templateCache",function(a){a.put("templates/cross-section/slider.html","<human-slider></human-slider>")}]),a.module("templates/cross-section/toggle.html",[]).run(["$templateCache",function(a){a.put("templates/cross-section/toggle.html",'<button class="cross-section tool" toggle-button="config"></button>')}]),a.module("templates/dissect/dissect.html",[]).run(["$templateCache",function(a){a.put("templates/dissect/dissect.html",'<button class="tool dissect" toggle-button="config"></button>')}]),a.module("templates/dissect/undo.html",[]).run(["$templateCache",function(a){a.put("templates/dissect/undo.html",'<button class="tool dissect-undo" undo-dissect></button>')}]),a.module("templates/fullscreen/panel.html",[]).run(["$templateCache",function(a){a.put("templates/fullscreen/panel.html",'<div toggle-button="config"></div>')}]),a.module("templates/fullscreen/window-link.html",[]).run(["$templateCache",function(a){a.put("templates/fullscreen/window-link.html",'<a window-link target="_blank"></a>')}]),a.module("templates/info/panel.html",[]).run(["$templateCache",function(a){a.put("templates/info/panel.html",'<h1 class="title">{{ infoTitle }}</h1>\n<div class="description" ng-bind-html="infoDescription | parseActions"></div>\n<ng-transclude class="custom-content"></ng-transclude>')}]),a.module("templates/media/audio.html",[]).run(["$templateCache",function(a){a.put("templates/media/audio.html",'<button mute-replay-audio class="tool"></button>')}]),a.module("templates/modes/isolate.html",[]).run(["$templateCache",function(a){a.put("templates/modes/isolate.html",'<button class="tool isolate" toggle-button="config"></button>')}]),a.module("templates/modes/xray.html",[]).run(["$templateCache",function(a){a.put("templates/modes/xray.html",'<button class="tool xray" toggle-button="config"></button>')}]),a.module("templates/scene/object-list-search.html",[]).run(["$templateCache",function(a){a.put("templates/scene/object-list-search.html",'<input\n  type="text"\n  placeholder="{{ searchPlaceholder }}"\n  ng-change="searchList()"\n  ng-model="searchText">\n\n<button ng-show="searching" ng-click="clearSearch()">&times;</button>')}]),a.module("templates/scene/object-list.html",[]).run(["$templateCache",function(a){a.put("templates/scene/object-list.html",'<ng-transclude></ng-transclude>\n\n<span class="no-results" ng-show="searching && noResults">No Results</span>\n\n<human-list\n  list-data="sceneObjects"\n  list-config="objectListConfig">\n    <a\n      object-selected="{{ objectId | escapeHtml }}"\n      title="{{ displayName | escapeHtml }}"\n      class="collection-item">\n      <span\n        object-enabled="{{ objectId | escapeHtml }}"\n        class="anatomy-check-icon"></span>{{ displayName | escapeHtml }}\n    </a>\n</human-list>')}]),a.module("templates/scene/object-slider.html",[]).run(["$templateCache",function(a){a.put("templates/scene/object-slider.html",'<object-slider-layers>\n  <button\n    ng-repeat="layer in layers"\n    ng-click="setOpacity($index)"\n    class="object-slider-layer"></button>\n\n  <!-- One at the end to hide the entire scene -->\n  <button\n    class="object-slider-layer"\n    ng-click="setOpacity(layers.length)"></button>\n</object-slider-layers>\n\n<human-slider></human-slider>')}]),a.module("templates/scene/object-tree.html",[]).run(["$templateCache",function(a){a.put("templates/scene/object-tree.html",'<ng-transclude></ng-transclude>\n<human-tree\n  tree-data="sceneObjects"\n  tree-config="objectTreeConfig">\n    <a\n      object-selected="{{ objectId | escapeHtml }}"\n      title="{{ displayName | escapeHtml }}"\n      class="collection-item">\n      <span\n        object-enabled="{{ objectId | escapeHtml }}"\n        class="anatomy-check-icon"></span>{{ displayName | escapeHtml }}\n    </a>\n</human-tree>')}]),a.module("templates/timeline/chapters.html",[]).run(["$templateCache",function(a){a.put("templates/timeline/chapters.html",'<button\n  ng-repeat="chapter in chapters"\n  id="{{ chapter.id }}"\n  class="chapter"\n  ng-class="{ on: $index === curIndex }"\n  uib-tooltip-html="titleDisplay(chapter)"\n  tooltip-placement="{{ toolTipPos }}"\n  title="{{ (showTitles && titleDisplay(chapter)) || \'\' }}"\n  ng-style="{ left: getOffset($index) }">{{ $index + 1 }}</button>\n')}]),a.module("templates/timeline/play-pause.html",[]).run(["$templateCache",function(a){a.put("templates/timeline/play-pause.html",'<button play-pause-timeline config="config"></button>')}]),a.module("templates/timeline/scrubber.html",[]).run(["$templateCache",function(a){a.put("templates/timeline/scrubber.html",'<button play-pause-timeline config="uiConfig"></button>\n\n<human-chapters chapters-mode="scrubber" config="uiConfig"></human-chapters>\n<human-slider></human-slider>')}]),a.module("templates/timeline/tour.html",[]).run(["$templateCache",function(a){a.put("templates/timeline/tour.html",'<div><button prev-next-chapter="prev"></button><human-chapters chapters-mode="tour" config="uiConfig"></human-chapters><button prev-next-chapter="next"></button></div>')}])}(angular);