1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.SVGPanZoom=e()}(this,function(){"use strict";var o=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},p=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e,n=o.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&o.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||o.call(t,e)},v=function(t,e){n&&"__proto__"===e.name?n(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},m=function(t,e){if("__proto__"===e){if(!o.call(t,e))return;if(i)return i(t,e).value}return t[e]},d=function t(){var e,n,i,o,r,a,s=arguments[0],u=1,c=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[1]||{},u=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});u<c;++u)if(null!=(e=arguments[u]))for(n in e)i=m(s,n),s!==(o=m(e,n))&&(h&&o&&(p(o)||(r=l(o)))?(r?(r=!1,a=i&&l(i)?i:[]):a=i&&p(i)?i:{},v(s,{name:n,newValue:t(h,a,o)})):void 0!==o&&v(s,{name:n,newValue:o}));return s};var a="undefined"!=typeof window?window:global,c=a.requestAnimationFrame,g=a.cancelAnimationFrame;if(!c||!g){var s=0;c=function(t,e){var n=(new Date).getTime(),i=Math.max(0,16-(n-s)),o=a.setTimeout(function(){t(n+i)},i);return s=n+i,o},g=function(t){clearTimeout(t)}}var y=function t(n,i,o,e,r){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var s=0,u=0;this.getCurrentState=function(){var e={};return Object.keys(n).forEach(function(t){e[t]=n[t]+u/o*(i[t]-n[t])}),e},this.animate=function(t){s||(s=t),o<(u=t-s)?r():(e(a.getCurrentState()),a.id=c(a.animate))},this.id=c(this.animate.bind(this))},w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t=function(){function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();var x={initialViewBox:null,animationTime:200,limits:null,eventMagnet:null,zoom:{factor:.25,minZoom:.1,maxZoom:5,events:{mouseWheel:!0,doubleClick:!0,pinch:!0},callback:function(t){}},pan:{factor:100,events:{drag:!0,dragMouseButton:1,dragCursor:"move"},callback:function(t){}}},b={x:0,y:0,width:1e3,height:1e3},M=function(t,e){var n=t.createSVGPoint();return n.x=parseInt(e.x,10),n.y=parseInt(e.y,10),n.matrixTransform(t.getScreenCTM().inverse())},E=function(t,e){return/touch/i.test((e=e.originalEvent||e).type)&&(null!==e.touches&&e.touches.length?e=e.touches[0]:null!==e.changedTouches&&e.changedTouches.length&&(e=e.changedTouches[0])),M(t,{x:e.clientX,y:e.clientY})},V=function(t,e){t.setAttribute("viewBox",[e.x,e.y,e.width,e.height].join(" "))},B=function(t){var e=(t.originalEvent||t).touches;return Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2))},L=function(t){return 2===(t.originalEvent||t).touches.length};return function(){function f(s,t){var h=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),!(s instanceof SVGElement))throw Error("Invalid Parameters. Firt parameter to SVGPanZoom should be an svg element");(this.svg=s).setAttribute("preserveAspectRatio","xMidYMid meet");var l=d({},s.viewBox.baseVal);0===l.x&&0===l.y&&0===l.width&&0===l.height&&(l=b);var e=void 0;Object.defineProperty(this,"options",{get:function(){return e},set:function(t){if(e)throw Error("Options cannot be overriden");e=t}});var n=this,i=void 0,o=void 0,r=void 0,a=void 0;this.options={get initialViewBox(){return i},set initialViewBox(t){if(null!==t)if("string"==typeof t)e=t.replace(/\s+/g," ").split(" "),l={x:parseFloat(e[0]),y:parseFloat(e[1]),width:parseFloat(e[2]),height:parseFloat(e[3])};else{if("object"!==(void 0===t?"undefined":w(t)))throw Error("initialViewBox is of invalid type");l=d({},b,t)}var e;i=d({},l)},get animationTime(){return o},set animationTime(t){o=t||0},get eventMagnet(){return r},set eventMagnet(t){n.destroy(),r=t||s,n._setupEvents()},get limits(){return a},set limits(t){a={};var e=((t||(0===t?0:15))+"").trim().split(" "),n=+(e[1]||e[0]).replace(/%/g,"")/100,i=l.height*n;a.minX=l.x-i,a.maxX=l.x+i;var o=+e[0].replace(/%/g,"")/100,r=l.width*o;a.minY=l.y-r,a.maxY=l.y+r}};var u,c,p=(u=function(t){return V(s,t)},c=void 0,function(t,e,n,i){c&&g(c.id),c=new y(t,e,n,u||Function.prototype,function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];(i||Function.prototype).apply(c=null,e)})});this.getViewBox=function(){return d({},l)},this.setViewBox=function(t,e,n,i,o,r){"function"==typeof o&&(r=o,o=null),o||0===o||(o=h.options.animationTime);var a=h.getViewBox();return h.validateLimits(l={x:t||0===t?t:l.x,y:e||0===e?e:l.y,width:n||0===n?n:l.width,height:i||0===i?i:l.height}),0<o?p(a,l,o,r):(V(s,l),(r||Function.prototype)()),h};var v=function(t,e,n){return this.options.pan&&(e||0===e||(e=this.options.pan.factor))?t(e,n):this};this.panLeft=v.bind(this,function(t,e){return h.pan(l.x-t,null,e)}),this.panRight=v.bind(this,function(t,e){return h.pan(l.x+t,null,e)}),this.panUp=v.bind(this,function(t,e){return h.pan(null,l.y-t,e)}),this.panDown=v.bind(this,function(t,e){return h.pan(null,l.y+t,e)}),this.pan=function(t,e,n){return h.setViewBox(t,e,null,null,n,function(){h.options.pan.callback(h.getViewBox())})};var m=function(t,e,n,i){return this.options.zoom&&(n||0===n||(n=this.options.zoom.factor))?t(e,n,i):this};
1this.zoomIn=m.bind(this,function(t,e,n){return h.zoomOut(t,-e,n)}),this.zoomOut=m.bind(this,function(t,e,n){var i=void 0,o=void 0;e<0?(o=l.width/(1-e),i=l.height/(1-e)):(o=l.width*(1+e),i=l.height*(1+e));var r=h.options.initialViewBox.width/h.options.zoom.maxZoom,a=h.options.initialViewBox.width/h.options.zoom.minZoom;o<r?(i*=r/o,o=r):a<o&&(i*=a/o,o=a);var s=h.options.initialViewBox.height/h.options.zoom.maxZoom,u=h.options.initialViewBox.height/h.options.zoom.minZoom;i<s?(o*=s/i,i=s):u<i&&(o*=u/i,i=u);var c=void 0;return h.setViewBox((c=t?{x:t.x+o/l.width*(l.x-t.x),y:t.y+i/l.height*(l.y-t.y)}:{x:l.x+(l.width-o)/2,y:l.y+(l.height-i)/2}).x,c.y,o,i,n,function(){h.options.zoom.callback(h.options.initialViewBox.width/o,h.getViewBox())})}),this.destroy=Function.prototype,d(this.options,d(!0,{},x,t)),this.reset(0)}return t(f,[{key:"validateLimits",value:function(t){var e=this.options.limits,n=this.options.initialViewBox;t.x=n.width<t.width?Math.min(Math.max(t.x,e.minX+(n.width-t.width)),e.maxX):Math.min(Math.max(t.x,e.minX),e.maxX+(n.width-t.width)),t.y=n.height<t.height?Math.min(Math.max(t.y,e.minY+(n.height-t.height)),e.maxY):Math.min(Math.max(t.y,e.minY),e.maxY+(n.height-t.height))}},{key:"reset",value:function(t,e){return this.clone(this.options.initialViewBox,t,e)}},{key:"clone",value:function(t,e,n){return this.setViewBox(t.x,t.y,t.width,t.height,e,n)}},{key:"getCenter",value:function(){var t=this.getViewBox();return{x:t.x+t.width/2,y:t.y+t.height/2}}},{key:"setCenter",value:function(t,e,n,i){var o=this.getViewBox();return this.setViewBox(t-o.width/2,e-o.height/2,o.width,o.height,n,i)}},{key:"_setupEvents",value:function(){var e=this,l=this.svg,n={mousewheel:function(t){t.preventDefault(),t.stopPropagation();var e=parseInt(-((t=t||t.originalEvent).detail||t.deltaX||t.deltaY||t.deltaZ)||t.wheelDelta);if(e&&this.options.zoom&&this.options.zoom.events.mouseWheel){var n=E(l,t);0<e?this.zoomIn(n,null,0):this.zoomOut(n,null,0)}},dblclick:function(t){this.options.zoom&&this.options.zoom.events.doubleClick&&this.zoomIn(E(l,t))}},p=!1,v=!1,m=!1,f=0;n.click=function(t){m&&(m=!1,t.preventDefault())},n.pinchAndDrag=function(u){var c=this;if(!(!this.options.pan.events.drag||"mousedown"===u.type&&u.which!==this.options.pan.events.dragMouseButton||p||v)){m=!1;var n=window.document.body,h=d({},this.getViewBox()),i=this.options.eventMagnet.style.cursor;null!==this.options.pan.events.dragCursor&&(this.options.eventMagnet.style.cursor=this.options.pan.events.dragCursor),"touchstart"===u.type&&L(u)?(v=!0,f=B(u)):p=!0;var o=function(t){var e,n,i=/touch/i.test(u.type)&&L(t);if(!v||i)if(t.preventDefault(),!v&&i&&(p=!(v=!0),f=B(t)),25<Math.sqrt(Math.pow(u.pageX-t.pageX,2)+Math.pow(u.pageY-t.pageY,2))&&(m=!0),p){var o=E(l,u),r=E(l,t);c.pan(h.x+(o.x-r.x),h.y+(o.y-r.y),0)}else if(v){var a=B(t);if(a===f)return;var s=M(l,{x:((n=((e=t).originalEvent||e).touches)[0].clientX+n[1].clientX)/2,y:(n[0].clientY+n[1].clientY)/2});c.zoomOut(s,a<f?(f-a)/a:(f-a)/f,0),f=a}},t=function t(e){"mouseout"===e.type&&e.target!==e.currentTarget||"mouseup"===e.type&&e.which!==c.options.pan.events.dragMouseButton||(n.removeEventListener("mousemove",o,{passive:!1,capture:!0}),n.removeEventListener("touchmove",o,{passive:!1,capture:!0}),n.removeEventListener("mouseup",t,{passive:!1,capture:!0}),n.removeEventListener("touchend",t,{passive:!1,capture:!0}),n.removeEventListener("touchcancel",t,{passive:!1,capture:!0}),n.removeEventListener("mouseout",t,{passive:!1,capture:!0}),null!==c.options.pan.events.dragCursor&&(c.options.eventMagnet.style.cursor=i),v=p=!1,f=0)};n.addEventListener("mousemove",o,{passive:!1,capture:!0}),n.addEventListener("touchmove",o,{passive:!1,capture:!0}),n.addEventListener("mouseup",t,{passive:!1,capture:!0}),n.addEventListener("touchend",t,{passive:!1,capture:!0}),n.addEventListener("touchcancel",t,{passive:!1,capture:!0}),n.addEventListener("mouseout",t,{passive:!1,capture:!0})}},Object.keys(n).forEach(function(t){n[t]=n[t].bind(e)}),this.options.eventMagnet.addEventListener("DOMMouseScroll",n.mousewheel),this.options.eventMagnet.addEventListener("wheel",n.mousewheel),this.options.eventMagnet.addEventListener("dblclick",n.dblclick),this.options.eventMagnet.addEventListener("click",n.click,{capture:!0}),this.options.eventMagnet.addEventListener("mousedown",n.pinchAndDrag,{passive:!1,capture:!0}),this.options.eventMagnet.addEventListener("touchstart",n.pinchAndDrag,{passive:!1,capture:!0}),this.destroy=function(){this.options.eventMagnet.removeEventListener("DOMMouseScroll",n.mousewheel),this.options.eventMagnet.removeEventListener("wheel",n.mousewheel),this.options.eventMagnet.removeEventListener("dblclick",n.dblclick),this.options.eventMagnet.removeEventListener("click",n.click,{capture:!0}),this.options.eventMagnet.removeEventListener("mousedown",n.pinchAndDrag,{passive:!1,capture:!0}),this.options.eventMagnet.removeEventListener("touchstart",n.pinchAndDrag,{passive:!1,capture:!0})}}}]),f}()});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.