text: /*!
   AngularJS pan/zoom v1.0.3
   License: MIT
   Github: https://github.com/mvindahl/angular-pan-zoom
  */
  angular.module("panzoom",["monospaced.mousewheel"]).directive("panzoom",["$document","PanZoomService",function(o,e){var n={};return{restrict:"E",transclude:!0,scope:{config:"=",model:"="},controller:["$scope","$element",function(i,a){function t(){h.isRegistered||(h.isRegistered=!0,jQuery.fx.timer(h))}var l=a,m=a.find(".pan-zoom-contents"),c=function(o){return Math.pow(i.config.scalePerZoomLevel,o-i.config.neutralZoomLevel)},r=function(o){return Math.log(o)/Math.log(i.config.scalePerZoomLevel)+i.config.neutralZoomLevel};i.config.zoomLevels=i.config.zoomLevels||5,i.config.neutralZoomLevel=i.config.neutralZoomLevel||2,i.config.friction=i.config.friction||10,i.config.haltSpeed=i.config.haltSpeed||100,i.config.scalePerZoomLevel=i.config.scalePerZoomLevel||2,i.config.zoomStepDuration=i.config.zoomStepDuration||.2,i.config.zoomStepDuration=i.config.zoomStepDuration||.2,i.config.modelChangedCallback=i.config.modelChangedCallback||function(){},i.config.zoomToFitZoomLevelFactor=i.config.zoomToFitZoomLevelFactor||.95,i.config.zoomButtonIncrement=i.config.zoomButtonIncrement||1,i.config.initialZoomLevel=i.config.initialZoomLevel||i.config.neutralZoomLevel,i.config.initialPanX=i.config.initialPanX||0,i.config.initialPanY=i.config.initialPanY||0,i.config.zoomOnDoubleClick=void 0!==i.config.zoomOnDoubleClick?i.config.zoomOnDoubleClick:!0,i.config.zoomOnMouseWheel=void 0!==i.config.zoomOnMouseWheel?i.config.zoomOnMouseWheel:!0,i.config.panOnClickDrag=void 0!==i.config.panOnClickDrag?i.config.panOnClickDrag:!0,i.config.invertMouseWheel=i.config.invertMouseWheel||!1;var s=function(o){var e=a.width(),n=a.height(),t=o.width,l=o.height,m=Math.min(e/t,n/l),s=r(m),f=s*i.config.zoomToFitZoomLevelFactor,g=c(f);return{zoomLevel:f,pan:{x:-o.x*g+(e-t*g)/2,y:-o.y*g+(n-l*g)/2}}};i.base=i.config.initialZoomToFit?s(i.config.initialZoomToFit):{zoomLevel:i.config.initialZoomLevel,pan:{x:i.config.initialPanX,y:i.config.initialPanY}},i.model.zoomLevel=i.base.zoomLevel,i.model.pan={x:i.base.pan.x,y:i.base.pan.y},i.previousPosition=void 0,i.dragging=!1,i.panVelocity=void 0,i.zoomAnimation=void 0;var f=function(){if(i.zoomAnimation){i.model.zoomLevel=i.base.zoomLevel+i.zoomAnimation.deltaZoomLevel*i.zoomAnimation.progress;var o=i.zoomAnimation.translationFromZoom(i.model.zoomLevel);i.model.pan.x=i.base.pan.x+o.x,i.model.pan.y=i.base.pan.y+o.y}else i.model.zoomLevel=i.base.zoomLevel,i.model.pan.x=i.base.pan.x,i.model.pan.y=i.base.pan.y;var e="scale("+c(i.model.zoomLevel)+")";m.css("transform-origin","0 0"),m.css("ms-transform-origin","0 0"),m.css("webkit-transform-origin","0 0"),m.css("transform",e),m.css("ms-transform",e),m.css("webkit-transform",e),m.css("left",i.model.pan.x),m.css("top",i.model.pan.y)},g=function(){var o={x:l.width()/2,y:l.height()/2};return o},u=function(o,e,n){i.zoomAnimation&&(i.base.zoomLevel=i.model.zoomLevel,i.base.pan.x=i.model.pan.x,i.base.pan.y=i.model.pan.y,i.zoomAnimation=void 0),o=Math.max(0,o),o=Math.min(i.config.zoomLevels-1,o);var a=o-i.base.zoomLevel;if(a){n=n||i.config.zoomStepDuration;var l=e||g(),m=c(i.base.zoomLevel),r={x:i.base.pan.x,y:i.base.pan.y},s=function(o){var e=c(o),n={x:l.x-e/m*(l.x-r.x),y:l.y-e/m*(l.y-r.y)};return{x:n.x-r.x,y:n.y-r.y}};i.zoomAnimation={deltaZoomLevel:a,translationFromZoom:s,duration:n,progress:0},t()}},v=function(o){u(i.base.zoomLevel+i.config.zoomButtonIncrement,o)},p=function(o){u(i.base.zoomLevel-i.config.zoomButtonIncrement,o)},d=function(o){var e=o,n=c(i.base.zoomLevel),a=i.base.pan;return{x:e.x*n+a.x,y:e.y*n+a.y}},y=function(o){var e=o,n=c(i.base.zoomLevel),a=i.base.pan;return{x:1/n*(e.x-a.x),y:1/n*(e.y-a.y)}},z=function(o){i.base=s(o),f()},x=function(o){return Math.sqrt(o.x*o.x+o.y*o.y)},b=!1,L=function(){var o=null;return function(){var e=jQuery.now(),n=o?(e-o)/1e3:0;if(o=e,i.zoomAnimation&&(i.zoomAnimation.progress+=n/i.zoomAnimation.duration,i.zoomAnimation.progress>=1&&(i.zoomAnimation.progress=1,f(),i.base.zoomLevel=i.model.zoomLevel,i.base.pan.x=i.model.pan.x,i.base.pan.y=i.model.pan.y,i.zoomAnimation=void 0,i.config.modelChangedCallback(i.model))),i.panVelocity)for(;n>0;){var a=Math.min(.02,n);n-=a,i.base.pan.x+=i.panVelocity.x*a,i.panVelocity.x*=1-i.config.friction*a,i.base.pan.y+=i.panVelocity.y*a,i.panVelocity.y*=1-i.config.friction*a;var t=x(i.panVelocity);if(t<i.config.haltSpeed){i.panVelocity=void 0,i.config.modelChangedCallback(i.model);break}}f();var l=void 0===i.panVelocity&&void 0===i.zoomAnimation;return l?(h.isRegistered=!1,o=null,!1):!b}};f();var h=new L;h.isRegistered=!1,i.$on("$destroy",function(){e.unregisterAPI(i.elementId),b=!0}),i.onDblClick=function(o){if(i.config.zoomOnDoubleClick){var e={x:o.pageX-l.offset().left,y:o.pageY-l.offset().top};v(e)}};var M,Z;i.onMousedown=function(e){i.config.panOnClickDrag&&(Z={x:e.pageX,y:e.pageY},M=jQuery.now(),i.dragging=!0,o.on("mousemove",i.onMousemove),o.on("mouseup",i.onMouseup))};var k=function(o){o.x=o.x||0,o.y=o.y||0,i.base.pan.x+=o.x,i.base.pan.y+=o.y,f()};i.onMousemove=function(o){var e=jQuery.now(),n=(e-M)/1e3;M=e;var a={x:o.pageX-Z.x,y:o.pageY-Z.y};k(a),i.panVelocity={x:a.x/n,y:a.y/n},Z={x:o.pageX,y:o.pageY}},i.onMouseup=function(){var e=jQuery.now(),n=(e-M)/1e3;if(i.panVelocity){var a=Math.max(0,Math.pow(n+1,-4)-.2);i.panVelocity.x*=a,i.panVelocity.y*=a}i.dragging=!1,t(),o.off("mousemove",i.onMousemove),o.off("mouseup",i.onMouseup)},i.onMouseleave=function(){i.onMouseup()},i.onMouseWheel=function(o,e,n,a){if(i.config.zoomOnMouseWheel){if(o.preventDefault(),i.zoomAnimation)return;var t=a/Math.abs(a);i.config.invertMouseWheel&&(t=-t);var m={x:o.pageX-l.offset().left,y:o.pageY-l.offset().top};0>t?v(m):p(m)}},n={model:i.model,config:i.config,changeZoomLevel:u,zoomIn:v,zoomOut:p,zoomToFit:z,getViewPosition:d,getModelPosition:y}}],link:function(o,i,a){o.elementId=a.id,o.elementId&&e.registerAPI(o.elementId,n)},template:'<div class="pan-zoom-frame" ng-dblclick="onDblClick($event)" ng-mousedown="onMousedown($event)" msd-wheel="onMouseWheel($event, $delta, $deltaX, $deltaY)" style="position:relative;overflow:hidden;cursor:move"><div class="pan-zoom-contents" style="position:absolute;left:0px;top:0px" ng-transclude></div></div>',replace:!0}}]);
  angular.module("panzoomwidget",[]).directive("panzoomwidget",["$document","PanZoomService",function(o,e){var n;return{restrict:"E",transclude:!0,compile:function(){return{pre:function(){},post:function(t,i,m){if(n=m.panzoomId,!n)throw"Error in setup. You must define attribute panzoom-id on the <panzoomwidget> element in order to link it to the id of the <panzoom> element. Ref: ";e.getAPI(n).then(function(e){t.model=e.model,t.config=e.config;var n=i.find(".zoom-slider-widget"),m=!1,u=function(o){return(t.config.zoomLevels-o-1)*t.widgetConfig.zoomLevelHeight},l=function(o){return t.config.zoomLevels-1-o/t.widgetConfig.zoomLevelHeight},g=function(o){var e=o.pageY-i.find(".zoom-slider").offset().top-t.widgetConfig.zoomLevelHeight/2;return l(e)};t.getZoomLevels=function(){for(var o=[],e=t.config.zoomLevels-1;e>=0;e--)o.push(e);return o},t.widgetConfig={zoomLevelHeight:10},t.zoomIn=function(){e.zoomIn()},t.zoomOut=function(){e.zoomOut()},t.onClick=function(o){var n=g(o);e.changeZoomLevel(n)},t.onMousedown=function(){m=!0,o.on("mousemove",t.onMousemove),o.on("mouseup",t.onMouseup)},t.onMousemove=function(o){o.preventDefault();var n=g(o);e.changeZoomLevel(n)},t.onMouseup=function(){m=!1,o.off("mousemove",t.onMousemove),o.off("mouseup",t.onMouseup)},t.onMouseleave=function(){m=!1},setInterval(function(){n.css("top",u(t.model.zoomLevel)+"px")},25)})}}},template:'<div class="panzoomwidget"><div ng-click="zoomIn()" ng-mouseenter="zoomToLevelIfDragging(config.zoomLevels - 1)" class="zoom-button zoom-button-in">+</div><div class="zoom-slider" ng-mousedown="onMousedown()" ng-click="onClick($event)"><div class="zoom-slider-widget" ng-style="{\'height\': widgetConfig.zoomLevelHeight - 2 +\'px\'}"></div><div ng-repeat="zoomLevel in getZoomLevels()"  class="zoom-level zoom-level-{{zoomLevel}}" ng-style="{\'height\': widgetConfig.zoomLevelHeight +\'px\'}"></div></div><div ng-click="zoomOut()" ng-mouseenter="zoomToLevelIfDragging(0)" class="zoom-button zoom-button-out">-</div><div ng-transclude></div></div>',replace:!0}}]);
  angular.module("panzoom").factory("PanZoomService",["$q",function(e){var r={},o=function(o,t){r[o]||(r[o]=e.defer());var n=r[o];if(n.hasBeenResolved)throw"Internal error: attempt to register a panzoom API but key was already used. Did you declare two <panzoom> directives with the same id?";n.resolve(t),n.hasBeenResolved=!0},t=function(e){delete r[e]},n=function(o){return r[o]||(r[o]=e.defer()),r[o].promise};return{registerAPI:o,unregisterAPI:t,getAPI:n}}]);
  