text: angular.module("dvhbMetro",[]),function(t){"use strict";function e(){function e(e,n,o,i,a){function s(){l.resolve(),t.forEach(c,function(t,n){u[t]=u[t]||{},u[t].isDisabled=e.stations?!r(e.stations,t):!0})}function r(e,n){return t.isArray(e)?-1!=e.indexOf(n):t.isObject(e)?t.isDefined(e[n]):!1}var c,l=a.defer(),f=this,u={};e.metroInfo=null,c=o[0].querySelectorAll("[metro-station-name]"),c=[].map.call(c,function(t){return t.attributes["metro-station-name"].nodeValue}),s(),f.setMetroInfo=function(t){e.metroInfo=t},f.onSelectStation=function(n,i){var a=o[0].getBoundingClientRect();i={left:i.left-a.left,top:i.top-a.top},(e.metroInfo&&e.metroInfo.show||t.noop)(i),(e.onSelect||t.noop)(n,i)},f.findStation=function(e){var n=u[e];return t.isDefined(n)?n:{}},e.$watch("stations",s,!0)}function n(e,n,o){n.css("position","relative"),n.on("click",function(n){n.originalEvent.data&&n.originalEvent.data.fromStation||(e.metroInfo.hide||t.noop)()})}return e.$inject=["$scope","$http","$element","$attrs","$q"],{restrict:"AE",replace:!1,transclude:!0,controller:e,controllerAs:"metro",link:n,templateUrl:function(t,e){return e.mapUrl||"./metro.svg"},scope:{stations:"=?",onSelect:"=?"}}}t.module("dvhbMetro").directive("metro",e)}(angular),function(t){"use strict";function e(){function t(t,e,n,o){function i(){for(var t,n,o=e.find("circle"),i=o.length-1;i>=0;i--)if(o[i].classList.contains("metro-point")){t=o[i],n=t.getBoundingClientRect();break}return n?{left:n.left,top:n.top}:null}function a(e){t.data.isDisabled||(e.originalEvent.data={fromStation:!0},c.onSelectStation([r],i())),!t.data.isDisabled&&c.multiple&&(t.data.isActive=!t.data.isActive)}function s(){r=n.metroStationName,e.bind("click",a);var o=c.findStation(r);o&&(t.data=o,l&&l.registerStation(r,o),t.$watch("data.isDisabled",function(t){var n=e[0],o=/disabled/.test(n.className.baseVal);!o&&t&&(n.className.baseVal=n.className.baseVal+" disabled"),o&&!t&&(n.className.baseVal=n.className.baseVal.split(" ").filter(function(t){return"disabled"!=t}).join(" "))}))}var r,c=o[1],l=o[0];s()}return{require:["?^metroStationGroup","^metro"],restrict:"A",link:t,scope:{}}}t.module("dvhbMetro").directive("metroStationName",e)}(angular),function(t){"use strict";function e(){function e(e,n,o,i){function a(e){return t.extend(e,f)}function s(t){var o=t.left,i=t.top;e.offset&&e.offset.left&&(o+=e.offset.left||0),e.offset&&e.offset.top&&(i+=e.offset.top||0),n.css("left",o+"px"),n.css("top",i+"px"),n.css("display","block")}function r(){n.css("display","none")}function c(){return"block"==n.css("display")}function l(){n.css("position","absolute"),r(),u.setMetroInfo(a({})),e.control&&a(e.control)}var f,u=i[0];f={show:s,hide:r,isOpen:c},l()}return{require:["^metro"],restrict:"A",link:e,scope:{control:"=?",offset:"=?"}}}t.module("dvhbMetro").directive("metroInfo",e)}(angular),function(t){"use strict";function e(){function e(t,e){t.stations={},t.main="",this.registerStation=function(e,n){t.stations[e]=n,t.main=e}}function n(e,n,o,i){function a(){var n=!0;return t.forEach(e.stations,function(t,e){t.isDisabled===!1&&(n=!1)}),n}e.$watch(a,function(t){var e=n[0],o=/disabled/.test(e.className.baseVal);!o&&t&&(e.className.baseVal=e.className.baseVal+" disabled"),o&&!t&&(e.className.baseVal=e.className.baseVal.split(" ").filter(function(t){return"disabled"!=t}).join(" "))}),n.find("text").bind("click",function(t){var n=[];if(!a()){for(var o in e.stations)o.isDisabled||n.push(o);t.originalEvent.data={fromStation:!0};var s=t.target.getBoundingClientRect();i.onSelectStation(n,s)}})}return e.$inject=["$scope","$element"],{restrict:"A",link:n,require:"^metro",controller:e,replace:!1,scope:{}}}t.module("dvhbMetro").directive("metroStationGroup",e)}(angular);