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,IACP,IAMAF,EAAE+U,GAAG3T,IAAM,SAAS4T,GACpB,IAAIC,EAAY/S,MAAME,UAAU8S,MAAMC,KAAK1K,UAAW,GACtD,MAAsB,iBAAXuK,GAAkC,OAAXA,EAC3BhV,EAAEoB,IAAI,IAAM4T,EAAU,OAAOrN,MAAM3H,EAAEoB,IAAK,CAAClB,KAAK,IAAIkV,OAAOH,IAE3D/U,KAAKkK,MAAK,WACK,iBAAX4K,EACXhV,EAAEoB,IAAI,IAAM4T,EAAU,OAAOrN,MAAM3H,EAAEoB,IAAK,CAAClB,MAAMkV,OAAOH,IAGxDjV,EAAEoB,IAAI0E,WAAW5F,KAAM8U,GAAW,CAAC,EAEnC,GACA,EAMAhV,EAAEoB,IAAM,IAAInB,CACZ,CAhxCC,CAgxCEoV","sources":["jquery.svg.js"],"sourcesContent":["\r\n/* http://keith-wood.name/svg.html\r\nSVG for jQuery v1.4.5.\r\nWritten by Keith Wood (kbwood{at}iinet.com.au) August 2007.\r\nDual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and\r\nMIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.\r\nPlease attribute the author if you use it. */\r\n(function($) { // Hide scope, no $ conflict\r\n/* SVG manager.\r\nUse the singleton instance of this class, $.svg,\r\nto interact with the SVG functionality. */\r\nfunction SVGManager() {\r\nthis._settings = []; // Settings to be remembered per SVG object\r\nthis._extensions = []; // List of SVG extensions added to SVGWrapper\r\n// for each entry [0] is extension name, [1] is extension class (function)\r\n// the function takes one parameter - the SVGWrapper instance\r\nthis.regional = []; // Localisations, indexed by language, '' for default (English)\r\nthis.regional[''] = {errorLoadingText: 'Error loading',\r\nnotSupportedText: 'This browser does not support SVG'};\r\nthis.local = this.regional['']; // Current localisation\r\nthis._uuid = new Date().getTime();\r\nthis._renesis = detectActiveX('RenesisX.RenesisCtrl');\r\n}\r\n/* Determine whether a given ActiveX control is available.\r\n@param classId (string) the ID for the ActiveX control\r\n@return (boolean) true if found, false if not */\r\nfunction detectActiveX(classId) {\r\ntry {\r\nreturn !!(window.ActiveXObject && new ActiveXObject(classId));\r\n}\r\ncatch (e) {\r\nreturn false;\r\n}\r\n}\r\nvar PROP_NAME = 'svgwrapper';\r\n$.extend(SVGManager.prototype, {\r\n/* Class name added to elements to indicate already configured with SVG. */\r\nmarkerClassName: 'hasSVG',\r\n/* SVG namespace. */\r\nsvgNS: 'http://www.w3.org/2000/svg',\r\n/* XLink namespace. */\r\nxlinkNS: 'http://www.w3.org/1999/xlink',\r\n/* SVG wrapper class. */\r\n_wrapperClass: SVGWrapper,\r\n/* Camel-case versions of attribute names containing dashes or are reserved words. */\r\n_attrNames: {class_: 'class', in_: 'in',\r\nalignmentBaseline: 'alignment-baseline', baselineShift: 'baseline-shift',\r\nclipPath: 'clip-path', clipRule: 'clip-rule',\r\ncolorInterpolation: 'color-interpolation',\r\ncolorInterpolationFilters: 'color-interpolation-filters',\r\ncolorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline',\r\nenableBackground: 'enable-background', fillOpacity: 'fill-opacity',\r\nfillRule: 'fill-rule', floodColor: 'flood-color',\r\nfloodOpacity: 'flood-opacity', fontFamily: 'font-family',\r\nfontSize: 'font-size', fontSizeAdjust: 'font-size-adjust',\r\nfontStretch: 'font-stretch', fontStyle: 'font-style',\r\nfontVariant: 'font-variant', fontWeight: 'font-weight',\r\nglyphOrientationHorizontal: 'glyph-orientation-horizontal',\r\nglyphOrientationVertical: 'glyph-orientation-vertical',\r\nhorizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x',\r\nimageRendering: 'image-rendering', letterSpacing: 'letter-spacing',\r\nlightingColor: 'lighting-color', markerEnd: 'marker-end',\r\nmarkerMid: 'marker-mid', markerStart: 'marker-start',\r\nstopColor: 'stop-color', stopOpacity: 'stop-opacity',\r\nstrikethroughPosition: 'strikethrough-position',\r\nstrikethroughThickness: 'strikethrough-thickness',\r\nstrokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset',\r\nstrokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin',\r\nstrokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity',\r\nstrokeWidth: 'stroke-width', textAnchor: 'text-anchor',\r\ntextDecoration: 'text-decoration', textRendering: 'text-rendering',\r\nunderlinePosition: 'underline-position', underlineThickness: 'underline-thickness',\r\nvertAdvY: 'vert-adv-y', vertOriginY: 'vert-origin-y',\r\nwordSpacing: 'word-spacing', writingMode: 'writing-mode'},\r\n/* Add the SVG object to its container. */\r\n_attachSVG: function(container, settings) {\r\nvar svg = (container.namespaceURI == this.svgNS ? container : null);\r\nvar container = (svg ? null : container);\r\nif ($(container || svg).hasClass(this.markerClassName)) {\r\nreturn;\r\n}\r\nif (typeof settings == 'string') {\r\nsettings = {loadURL: settings};\r\n}\r\nelse if (typeof settings == 'function') {\r\nsettings = {onLoad: settings};\r\n}\r\n$(container || svg).addClass(this.markerClassName);\r\ntry {\r\nif (!svg) {\r\nsvg = document.createElementNS(this.svgNS, 'svg');\r\nsvg.setAttribute('version', '1.1');\r\nif (container.clientWidth > 0) {\r\nsvg.setAttribute('width', container.clientWidth);\r\n}\r\nif (container.clientHeight > 0) {\r\nsvg.setAttribute('height', container.clientHeight);\r\n}\r\ncontainer.appendChild(svg);\r\n}\r\nthis._afterLoad(container, svg, settings || {});\r\n}\r\ncatch (e) {\r\nif ($.browser.msie) {\r\nif (!container.id) {\r\ncontainer.id = 'svg' + (this._uuid++);\r\n}\r\nthis._settings[container.id] = settings;\r\ncontainer.innerHTML = '';\r\n}\r\nelse {\r\ncontainer.innerHTML = '

' +\r\nthis.local.notSupportedText + '

';\r\n}\r\n}\r\n},\r\n/* SVG callback after loading - register SVG root. */\r\n_registerSVG: function() {\r\nfor (var i = 0; i < document.embeds.length; i++) { // Check all\r\nvar container = document.embeds[i].parentNode;\r\nif (!$(container).hasClass($.svg.markerClassName) || // Not SVG\r\n$.data(container, PROP_NAME)) { // Already done\r\ncontinue;\r\n}\r\nvar svg = null;\r\ntry {\r\nsvg = document.embeds[i].getSVGDocument();\r\n}\r\ncatch(e) {\r\nsetTimeout($.svg._registerSVG, 250); // Renesis takes longer to load\r\nreturn;\r\n}\r\nsvg = (svg ? svg.documentElement : null);\r\nif (svg) {\r\n$.svg._afterLoad(container, svg);\r\n}\r\n}\r\n},\r\n/* Post-processing once loaded. */\r\n_afterLoad: function(container, svg, settings) {\r\nvar settings = settings || this._settings[container.id];\r\nthis._settings[container ? container.id : ''] = null;\r\nvar wrapper = new this._wrapperClass(svg, container);\r\n$.data(container || svg, PROP_NAME, wrapper);\r\ntry {\r\nif (settings.loadURL) { // Load URL\r\nwrapper.load(settings.loadURL, settings);\r\n}\r\nif (settings.settings) { // Additional settings\r\nwrapper.configure(settings.settings);\r\n}\r\nif (settings.onLoad && !settings.loadURL) { // Onload callback\r\nsettings.onLoad.apply(container || svg, [wrapper]);\r\n}\r\n}\r\ncatch (e) {\r\nalert(e);\r\n}\r\n},\r\n/* Return the SVG wrapper created for a given container.\r\n@param container (string) selector for the container or\r\n(element) the container for the SVG object or\r\njQuery collection - first entry is the container\r\n@return (SVGWrapper) the corresponding SVG wrapper element, or null if not attached */\r\n_getSVG: function(container) {\r\ncontainer = (typeof container == 'string' ? $(container)[0] :\r\n(container.jquery ? container[0] : container));\r\nreturn $.data(container, PROP_NAME);\r\n},\r\n/* Remove the SVG functionality from a div.\r\n@param container (element) the container for the SVG object */\r\n_destroySVG: function(container) {\r\nvar $container = $(container);\r\nif (!$container.hasClass(this.markerClassName)) {\r\nreturn;\r\n}\r\n$container.removeClass(this.markerClassName);\r\nif (container.namespaceURI != this.svgNS) {\r\n$container.empty();\r\n}\r\n$.removeData(container, PROP_NAME);\r\n},\r\n/* Extend the SVGWrapper object with an embedded class.\r\nThe constructor function must take a single parameter that is\r\na reference to the owning SVG root object. This allows the\r\nextension to access the basic SVG functionality.\r\n@param name (string) the name of the SVGWrapper attribute to access the new class\r\n@param extClass (function) the extension class constructor */\r\naddExtension: function(name, extClass) {\r\nthis._extensions.push([name, extClass]);\r\n},\r\n/* Does this node belong to SVG?\r\n@param node (element) the node to be tested\r\n@return (boolean) true if an SVG node, false if not */\r\nisSVGElem: function(node) {\r\nreturn (node.nodeType == 1 && node.namespaceURI == $.svg.svgNS);\r\n}\r\n});\r\n/* The main SVG interface, which encapsulates the SVG element.\r\nObtain a reference from $().svg('get') */\r\nfunction SVGWrapper(svg, container) {\r\nthis._svg = svg; // The SVG root node\r\nthis._container = container; // The containing div\r\nfor (var i = 0; i < $.svg._extensions.length; i++) {\r\nvar extension = $.svg._extensions[i];\r\nthis[extension[0]] = new extension[1](this);\r\n}\r\n}\r\n$.extend(SVGWrapper.prototype, {\r\n/* Retrieve the width of the SVG object. */\r\n_width: function() {\r\nreturn (this._container ? this._container.clientWidth : this._svg.width);\r\n},\r\n/* Retrieve the height of the SVG object. */\r\n_height: function() {\r\nreturn (this._container ? this._container.clientHeight : this._svg.height);\r\n},\r\n/* Retrieve the root SVG element.\r\n@return the top-level SVG element */\r\nroot: function() {\r\nreturn this._svg;\r\n},\r\n/* Configure a SVG node.\r\n@param node (element, optional) the node to configure\r\n@param settings (object) additional settings for the root\r\n@param clear (boolean) true to remove existing attributes first,\r\nfalse to add to what is already there (optional)\r\n@return (SVGWrapper) this root */\r\nconfigure: function(node, settings, clear) {\r\nif (!node.nodeName) {\r\nclear = settings;\r\nsettings = node;\r\nnode = this._svg;\r\n}\r\nif (clear) {\r\nfor (var i = node.attributes.length - 1; i >= 0; i--) {\r\nvar attr = node.attributes.item(i);\r\nif (!(attr.nodeName == 'onload' || attr.nodeName == 'version' ||\r\nattr.nodeName.substring(0, 5) == 'xmlns')) {\r\nnode.attributes.removeNamedItem(attr.nodeName);\r\n}\r\n}\r\n}\r\nfor (var attrName in settings) {\r\nnode.setAttribute($.svg._attrNames[attrName] || attrName, settings[attrName]);\r\n}\r\nreturn this;\r\n},\r\n/* Locate a specific element in the SVG document.\r\n@param id (string) the element's identifier\r\n@return (element) the element reference, or null if not found */\r\ngetElementById: function(id) {\r\nreturn this._svg.ownerDocument.getElementById(id);\r\n},\r\n/* Change the attributes for a SVG node.\r\n@param element (SVG element) the node to change\r\n@param settings (object) the new settings\r\n@return (SVGWrapper) this root */\r\nchange: function(element, settings) {\r\nif (element) {\r\nfor (var name in settings) {\r\nif (settings[name] == null) {\r\nelement.removeAttribute($.svg._attrNames[name] || name);\r\n}\r\nelse {\r\nelement.setAttribute($.svg._attrNames[name] || name, settings[name]);\r\n}\r\n}\r\n}\r\nreturn this;\r\n},\r\n/* Check for parent being absent and adjust arguments accordingly. */\r\n_args: function(values, names, optSettings) {\r\nnames.splice(0, 0, 'parent');\r\nnames.splice(names.length, 0, 'settings');\r\nvar args = {};\r\nvar offset = 0;\r\nif (values[0] != null && values[0].jquery) {\r\nvalues[0] = values[0][0];\r\n}\r\nif (values[0] != null && !(typeof values[0] == 'object' && values[0].nodeName)) {\r\nargs['parent'] = null;\r\noffset = 1;\r\n}\r\nfor (var i = 0; i < values.length; i++) {\r\nargs[names[i + offset]] = values[i];\r\n}\r\nif (optSettings) {\r\n$.each(optSettings, function(i, value) {\r\nif (typeof args[value] == 'object') {\r\nargs.settings = args[value];\r\nargs[value] = null;\r\n}\r\n});\r\n}\r\nreturn args;\r\n},\r\n/* Add a title.\r\n@param parent (element or jQuery) the parent node for the new title (optional)\r\n@param text (string) the text of the title\r\n@param settings (object) additional settings for the title (optional)\r\n@return (element) the new title node */\r\ntitle: function(parent, text, settings) {\r\nvar args = this._args(arguments, ['text']);\r\nvar node = this._makeNode(args.parent, 'title', args.settings || {});\r\nnode.appendChild(this._svg.ownerDocument.createTextNode(args.text));\r\nreturn node;\r\n},\r\n/* Add a description.\r\n@param parent (element or jQuery) the parent node for the new description (optional)\r\n@param text (string) the text of the description\r\n@param settings (object) additional settings for the description (optional)\r\n@return (element) the new description node */\r\ndescribe: function(parent, text, settings) {\r\nvar args = this._args(arguments, ['text']);\r\nvar node = this._makeNode(args.parent, 'desc', args.settings || {});\r\nnode.appendChild(this._svg.ownerDocument.createTextNode(args.text));\r\nreturn node;\r\n},\r\n/* Add a definitions node.\r\n@param parent (element or jQuery) the parent node for the new definitions (optional)\r\n@param id (string) the ID of this definitions (optional)\r\n@param settings (object) additional settings for the definitions (optional)\r\n@return (element) the new definitions node */\r\ndefs: function(parent, id, settings) {\r\nvar args = this._args(arguments, ['id'], ['id']);\r\nreturn this._makeNode(args.parent, 'defs', $.extend(\r\n(args.id ? {id: args.id} : {}), args.settings || {}));\r\n},\r\n/* Add a symbol definition.\r\n@param parent (element or jQuery) the parent node for the new symbol (optional)\r\n@param id (string) the ID of this symbol\r\n@param x1 (number) the left coordinate for this symbol\r\n@param y1 (number) the top coordinate for this symbol\r\n@param width (number) the width of this symbol\r\n@param height (number) the height of this symbol\r\n@param settings (object) additional settings for the symbol (optional)\r\n@return (element) the new symbol node */\r\nsymbol: function(parent, id, x1, y1, width, height, settings) {\r\nvar args = this._args(arguments, ['id', 'x1', 'y1', 'width', 'height']);\r\nreturn this._makeNode(args.parent, 'symbol', $.extend({id: args.id,\r\nviewBox: args.x1 + ' ' + args.y1 + ' ' + args.width + ' ' + args.height},\r\nargs.settings || {}));\r\n},\r\n/* Add a marker definition.\r\n@param parent (element or jQuery) the parent node for the new marker (optional)\r\n@param id (string) the ID of this marker\r\n@param refX (number) the x-coordinate for the reference point\r\n@param refY (number) the y-coordinate for the reference point\r\n@param mWidth (number) the marker viewport width\r\n@param mHeight (number) the marker viewport height\r\n@param orient (string or int) 'auto' or angle (degrees) (optional)\r\n@param settings (object) additional settings for the marker (optional)\r\n@return (element) the new marker node */\r\nmarker: function(parent, id, refX, refY, mWidth, mHeight, orient, settings) {\r\nvar args = this._args(arguments, ['id', 'refX', 'refY',\r\n'mWidth', 'mHeight', 'orient'], ['orient']);\r\nreturn this._makeNode(args.parent, 'marker', $.extend(\r\n{id: args.id, refX: args.refX, refY: args.refY, markerWidth: args.mWidth,\r\nmarkerHeight: args.mHeight, orient: args.orient || 'auto'}, args.settings || {}));\r\n},\r\n/* Add a style node.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param styles (string) the CSS styles\r\n@param settings (object) additional settings for the node (optional)\r\n@return (element) the new style node */\r\nstyle: function(parent, styles, settings) {\r\nvar args = this._args(arguments, ['styles']);\r\nvar node = this._makeNode(args.parent, 'style', $.extend(\r\n{type: 'text/css'}, args.settings || {}));\r\nnode.appendChild(this._svg.ownerDocument.createTextNode(args.styles));\r\nif ($.browser.opera) {\r\n$('head').append('');\r\n}\r\nreturn node;\r\n},\r\n/* Add a script node.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param script (string) the JavaScript code\r\n@param type (string) the MIME type for the code (optional, default 'text/javascript')\r\n@param settings (object) additional settings for the node (optional)\r\n@return (element) the new script node */\r\nscript: function(parent, script, type, settings) {\r\nvar args = this._args(arguments, ['script', 'type'], ['type']);\r\nvar node = this._makeNode(args.parent, 'script', $.extend(\r\n{type: args.type || 'text/javascript'}, args.settings || {}));\r\nnode.appendChild(this._svg.ownerDocument.createTextNode(args.script));\r\nif (!$.browser.mozilla) {\r\n$.globalEval(args.script);\r\n}\r\nreturn node;\r\n},\r\n/* Add a linear gradient definition.\r\nSpecify all of x1, y1, x2, y2 or none of them.\r\n@param parent (element or jQuery) the parent node for the new gradient (optional)\r\n@param id (string) the ID for this gradient\r\n@param stops (string[][]) the gradient stops, each entry is\r\n[0] is offset (0.0-1.0 or 0%-100%), [1] is colour,\r\n[2] is opacity (optional)\r\n@param x1 (number) the x-coordinate of the gradient start (optional)\r\n@param y1 (number) the y-coordinate of the gradient start (optional)\r\n@param x2 (number) the x-coordinate of the gradient end (optional)\r\n@param y2 (number) the y-coordinate of the gradient end (optional)\r\n@param settings (object) additional settings for the gradient (optional)\r\n@return (element) the new gradient node */\r\nlinearGradient: function(parent, id, stops, x1, y1, x2, y2, settings) {\r\nvar args = this._args(arguments,\r\n['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']);\r\nvar sets = $.extend({id: args.id},\r\n(args.x1 != null ? {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2} : {}));\r\nreturn this._gradient(args.parent, 'linearGradient',\r\n$.extend(sets, args.settings || {}), args.stops);\r\n},\r\n/* Add a radial gradient definition.\r\nSpecify all of cx, cy, r, fx, fy or none of them.\r\n@param parent (element or jQuery) the parent node for the new gradient (optional)\r\n@param id (string) the ID for this gradient\r\n@param stops (string[][]) the gradient stops, each entry\r\n[0] is offset, [1] is colour, [2] is opacity (optional)\r\n@param cx (number) the x-coordinate of the largest circle centre (optional)\r\n@param cy (number) the y-coordinate of the largest circle centre (optional)\r\n@param r (number) the radius of the largest circle (optional)\r\n@param fx (number) the x-coordinate of the gradient focus (optional)\r\n@param fy (number) the y-coordinate of the gradient focus (optional)\r\n@param settings (object) additional settings for the gradient (optional)\r\n@return (element) the new gradient node */\r\nradialGradient: function(parent, id, stops, cx, cy, r, fx, fy, settings) {\r\nvar args = this._args(arguments,\r\n['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']);\r\nvar sets = $.extend({id: args.id}, (args.cx != null ?\r\n{cx: args.cx, cy: args.cy, r: args.r, fx: args.fx, fy: args.fy} : {}));\r\nreturn this._gradient(args.parent, 'radialGradient',\r\n$.extend(sets, args.settings || {}), args.stops);\r\n},\r\n/* Add a gradient node. */\r\n_gradient: function(parent, name, settings, stops) {\r\nvar node = this._makeNode(parent, name, settings);\r\nfor (var i = 0; i < stops.length; i++) {\r\nvar stop = stops[i];\r\nthis._makeNode(node, 'stop', $.extend(\r\n{offset: stop[0], stopColor: stop[1]},\r\n(stop[2] != null ? {stopOpacity: stop[2]} : {})));\r\n}\r\nreturn node;\r\n},\r\n/* Add a pattern definition.\r\nSpecify all of vx, vy, xwidth, vheight or none of them.\r\n@param parent (element or jQuery) the parent node for the new pattern (optional)\r\n@param id (string) the ID for this pattern\r\n@param x (number) the x-coordinate for the left edge of the pattern\r\n@param y (number) the y-coordinate for the top edge of the pattern\r\n@param width (number) the width of the pattern\r\n@param height (number) the height of the pattern\r\n@param vx (number) the minimum x-coordinate for view box (optional)\r\n@param vy (number) the minimum y-coordinate for the view box (optional)\r\n@param vwidth (number) the width of the view box (optional)\r\n@param vheight (number) the height of the view box (optional)\r\n@param settings (object) additional settings for the pattern (optional)\r\n@return (element) the new pattern node */\r\npattern: function(parent, id, x, y, width, height, vx, vy, vwidth, vheight, settings) {\r\nvar args = this._args(arguments, ['id', 'x', 'y', 'width', 'height',\r\n'vx', 'vy', 'vwidth', 'vheight'], ['vx']);\r\nvar sets = $.extend({id: args.id, x: args.x, y: args.y,\r\nwidth: args.width, height: args.height}, (args.vx != null ?\r\n{viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {}));\r\nreturn this._makeNode(args.parent, 'pattern', $.extend(sets, args.settings || {}));\r\n},\r\n/* Add a clip path definition.\r\n@param parent (element) the parent node for the new element (optional)\r\n@param id (string) the ID for this path\r\n@param units (string) either 'userSpaceOnUse' (default) or 'objectBoundingBox' (optional)\r\n@return (element) the new clipPath node */\r\nclipPath: function(parent, id, units, settings) {\r\nvar args = this._args(arguments, ['id', 'units']);\r\nargs.units = args.units || 'userSpaceOnUse';\r\nreturn this._makeNode(args.parent, 'clipPath', $.extend(\r\n{id: args.id, clipPathUnits: args.units}, args.settings || {}));\r\n},\r\n/* Add a mask definition.\r\n@param parent (element or jQuery) the parent node for the new mask (optional)\r\n@param id (string) the ID for this mask\r\n@param x (number) the x-coordinate for the left edge of the mask\r\n@param y (number) the y-coordinate for the top edge of the mask\r\n@param width (number) the width of the mask\r\n@param height (number) the height of the mask\r\n@param settings (object) additional settings for the mask (optional)\r\n@return (element) the new mask node */\r\nmask: function(parent, id, x, y, width, height, settings) {\r\nvar args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']);\r\nreturn this._makeNode(args.parent, 'mask', $.extend(\r\n{id: args.id, x: args.x, y: args.y, width: args.width, height: args.height},\r\nargs.settings || {}));\r\n},\r\n/* Create a new path object.\r\n@return (SVGPath) a new path object */\r\ncreatePath: function() {\r\nreturn new SVGPath();\r\n},\r\n/* Create a new text object.\r\n@return (SVGText) a new text object */\r\ncreateText: function() {\r\nreturn new SVGText();\r\n},\r\n/* Add an embedded SVG element.\r\nSpecify all of vx, vy, vwidth, vheight or none of them.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param x (number) the x-coordinate for the left edge of the node\r\n@param y (number) the y-coordinate for the top edge of the node\r\n@param width (number) the width of the node\r\n@param height (number) the height of the node\r\n@param vx (number) the minimum x-coordinate for view box (optional)\r\n@param vy (number) the minimum y-coordinate for the view box (optional)\r\n@param vwidth (number) the width of the view box (optional)\r\n@param vheight (number) the height of the view box (optional)\r\n@param settings (object) additional settings for the node (optional)\r\n@return (element) the new node */\r\nsvg: function(parent, x, y, width, height, vx, vy, vwidth, vheight, settings) {\r\nvar args = this._args(arguments, ['x', 'y', 'width', 'height',\r\n'vx', 'vy', 'vwidth', 'vheight'], ['vx']);\r\nvar sets = $.extend({x: args.x, y: args.y, width: args.width, height: args.height},\r\n(args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' +\r\nargs.vwidth + ' ' + args.vheight} : {}));\r\nreturn this._makeNode(args.parent, 'svg', $.extend(sets, args.settings || {}));\r\n},\r\n/* Create a group.\r\n@param parent (element or jQuery) the parent node for the new group (optional)\r\n@param id (string) the ID of this group (optional)\r\n@param settings (object) additional settings for the group (optional)\r\n@return (element) the new group node */\r\ngroup: function(parent, id, settings) {\r\nvar args = this._args(arguments, ['id'], ['id']);\r\nreturn this._makeNode(args.parent, 'g', $.extend({id: args.id}, args.settings || {}));\r\n},\r\n/* Add a usage reference.\r\nSpecify all of x, y, width, height or none of them.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param x (number) the x-coordinate for the left edge of the node (optional)\r\n@param y (number) the y-coordinate for the top edge of the node (optional)\r\n@param width (number) the width of the node (optional)\r\n@param height (number) the height of the node (optional)\r\n@param ref (string) the ID of the definition node\r\n@param settings (object) additional settings for the node (optional)\r\n@return (element) the new node */\r\nuse: function(parent, x, y, width, height, ref, settings) {\r\nvar args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);\r\nif (typeof args.x == 'string') {\r\nargs.ref = args.x;\r\nargs.settings = args.y;\r\nargs.x = args.y = args.width = args.height = null;\r\n}\r\nvar node = this._makeNode(args.parent, 'use', $.extend(\r\n{x: args.x, y: args.y, width: args.width, height: args.height},\r\nargs.settings || {}));\r\nnode.setAttributeNS($.svg.xlinkNS, 'href', args.ref);\r\nreturn node;\r\n},\r\n/* Add a link, which applies to all child elements.\r\n@param parent (element or jQuery) the parent node for the new link (optional)\r\n@param ref (string) the target URL\r\n@param settings (object) additional settings for the link (optional)\r\n@return (element) the new link node */\r\nlink: function(parent, ref, settings) {\r\nvar args = this._args(arguments, ['ref']);\r\nvar node = this._makeNode(args.parent, 'a', args.settings);\r\nnode.setAttributeNS($.svg.xlinkNS, 'href', args.ref);\r\nreturn node;\r\n},\r\n/* Add an image.\r\n@param parent (element or jQuery) the parent node for the new image (optional)\r\n@param x (number) the x-coordinate for the left edge of the image\r\n@param y (number) the y-coordinate for the top edge of the image\r\n@param width (number) the width of the image\r\n@param height (number) the height of the image\r\n@param ref (string) the path to the image\r\n@param settings (object) additional settings for the image (optional)\r\n@return (element) the new image node */\r\nimage: function(parent, x, y, width, height, ref, settings) {\r\nvar args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);\r\nvar node = this._makeNode(args.parent, 'image', $.extend(\r\n{x: args.x, y: args.y, width: args.width, height: args.height},\r\nargs.settings || {}));\r\nnode.setAttributeNS($.svg.xlinkNS, 'href', args.ref);\r\nreturn node;\r\n},\r\n/* Draw a path.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param path (string or SVGPath) the path to draw\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\npath: function(parent, path, settings) {\r\nvar args = this._args(arguments, ['path']);\r\nreturn this._makeNode(args.parent, 'path', $.extend(\r\n{d: (args.path.path ? args.path.path() : args.path)}, args.settings || {}));\r\n},\r\n/* Draw a rectangle.\r\nSpecify both of rx and ry or neither.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param x (number) the x-coordinate for the left edge of the rectangle\r\n@param y (number) the y-coordinate for the top edge of the rectangle\r\n@param width (number) the width of the rectangle\r\n@param height (number) the height of the rectangle\r\n@param rx (number) the x-radius of the ellipse for the rounded corners (optional)\r\n@param ry (number) the y-radius of the ellipse for the rounded corners (optional)\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\nrect: function(parent, x, y, width, height, rx, ry, settings) {\r\nvar args = this._args(arguments, ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']);\r\nreturn this._makeNode(args.parent, 'rect', $.extend(\r\n{x: args.x, y: args.y, width: args.width, height: args.height},\r\n(args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {}));\r\n},\r\n/* Draw a circle.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param cx (number) the x-coordinate for the centre of the circle\r\n@param cy (number) the y-coordinate for the centre of the circle\r\n@param r (number) the radius of the circle\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\ncircle: function(parent, cx, cy, r, settings) {\r\nvar args = this._args(arguments, ['cx', 'cy', 'r']);\r\nreturn this._makeNode(args.parent, 'circle', $.extend(\r\n{cx: args.cx, cy: args.cy, r: args.r}, args.settings || {}));\r\n},\r\n/* Draw an ellipse.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param cx (number) the x-coordinate for the centre of the ellipse\r\n@param cy (number) the y-coordinate for the centre of the ellipse\r\n@param rx (number) the x-radius of the ellipse\r\n@param ry (number) the y-radius of the ellipse\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\nellipse: function(parent, cx, cy, rx, ry, settings) {\r\nvar args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']);\r\nreturn this._makeNode(args.parent, 'ellipse', $.extend(\r\n{cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings || {}));\r\n},\r\n/* Draw a line.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param x1 (number) the x-coordinate for the start of the line\r\n@param y1 (number) the y-coordinate for the start of the line\r\n@param x2 (number) the x-coordinate for the end of the line\r\n@param y2 (number) the y-coordinate for the end of the line\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\nline: function(parent, x1, y1, x2, y2, settings) {\r\nvar args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']);\r\nreturn this._makeNode(args.parent, 'line', $.extend(\r\n{x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings || {}));\r\n},\r\n/* Draw a polygonal line.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param points (number[][]) the x-/y-coordinates for the points on the line\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\npolyline: function(parent, points, settings) {\r\nvar args = this._args(arguments, ['points']);\r\nreturn this._poly(args.parent, 'polyline', args.points, args.settings);\r\n},\r\n/* Draw a polygonal shape.\r\n@param parent (element or jQuery) the parent node for the new shape (optional)\r\n@param points (number[][]) the x-/y-coordinates for the points on the shape\r\n@param settings (object) additional settings for the shape (optional)\r\n@return (element) the new shape node */\r\npolygon: function(parent, points, settings) {\r\nvar args = this._args(arguments, ['points']);\r\nreturn this._poly(args.parent, 'polygon', args.points, args.settings);\r\n},\r\n/* Draw a polygonal line or shape. */\r\n_poly: function(parent, name, points, settings) {\r\nvar ps = '';\r\nfor (var i = 0; i < points.length; i++) {\r\nps += points[i].join() + ' ';\r\n}\r\nreturn this._makeNode(parent, name, $.extend(\r\n{points: $.trim(ps)}, settings || {}));\r\n},\r\n/* Draw text.\r\nSpecify both of x and y or neither of them.\r\n@param parent (element or jQuery) the parent node for the text (optional)\r\n@param x (number or number[]) the x-coordinate(s) for the text (optional)\r\n@param y (number or number[]) the y-coordinate(s) for the text (optional)\r\n@param value (string) the text content or\r\n(SVGText) text with spans and references\r\n@param settings (object) additional settings for the text (optional)\r\n@return (element) the new text node */\r\ntext: function(parent, x, y, value, settings) {\r\nvar args = this._args(arguments, ['x', 'y', 'value']);\r\nif (typeof args.x == 'string' && arguments.length < 4) {\r\nargs.value = args.x;\r\nargs.settings = args.y;\r\nargs.x = args.y = null;\r\n}\r\nreturn this._text(args.parent, 'text', args.value, $.extend(\r\n{x: (args.x && isArray(args.x) ? args.x.join(' ') : args.x),\r\ny: (args.y && isArray(args.y) ? args.y.join(' ') : args.y)},\r\nargs.settings || {}));\r\n},\r\n/* Draw text along a path.\r\n@param parent (element or jQuery) the parent node for the text (optional)\r\n@param path (string) the ID of the path\r\n@param value (string) the text content or\r\n(SVGText) text with spans and references\r\n@param settings (object) additional settings for the text (optional)\r\n@return (element) the new text node */\r\ntextpath: function(parent, path, value, settings) {\r\nvar args = this._args(arguments, ['path', 'value']);\r\nvar node = this._text(args.parent, 'textPath', args.value, args.settings || {});\r\nnode.setAttributeNS($.svg.xlinkNS, 'href', args.path);\r\nreturn node;\r\n},\r\n/* Draw text. */\r\n_text: function(parent, name, value, settings) {\r\nvar node = this._makeNode(parent, name, settings);\r\nif (typeof value == 'string') {\r\nnode.appendChild(node.ownerDocument.createTextNode(value));\r\n}\r\nelse {\r\nfor (var i = 0; i < value._parts.length; i++) {\r\nvar part = value._parts[i];\r\nif (part[0] == 'tspan') {\r\nvar child = this._makeNode(node, part[0], part[2]);\r\nchild.appendChild(node.ownerDocument.createTextNode(part[1]));\r\nnode.appendChild(child);\r\n}\r\nelse if (part[0] == 'tref') {\r\nvar child = this._makeNode(node, part[0], part[2]);\r\nchild.setAttributeNS($.svg.xlinkNS, 'href', part[1]);\r\nnode.appendChild(child);\r\n}\r\nelse if (part[0] == 'textpath') {\r\nvar set = $.extend({}, part[2]);\r\nset.href = null;\r\nvar child = this._makeNode(node, part[0], set);\r\nchild.setAttributeNS($.svg.xlinkNS, 'href', part[2].href);\r\nchild.appendChild(node.ownerDocument.createTextNode(part[1]));\r\nnode.appendChild(child);\r\n}\r\nelse { // straight text\r\nnode.appendChild(node.ownerDocument.createTextNode(part[1]));\r\n}\r\n}\r\n}\r\nreturn node;\r\n},\r\n/* Add a custom SVG element.\r\n@param parent (element or jQuery) the parent node for the new element (optional)\r\n@param name (string) the name of the element\r\n@param settings (object) additional settings for the element (optional)\r\n@return (element) the new custom node */\r\nother: function(parent, name, settings) {\r\nvar args = this._args(arguments, ['name']);\r\nreturn this._makeNode(args.parent, args.name, args.settings || {});\r\n},\r\n/* Create a shape node with the given settings. */\r\n_makeNode: function(parent, name, settings) {\r\nparent = parent || this._svg;\r\nvar node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name);\r\nfor (var name in settings) {\r\nvar value = settings[name];\r\nif (value != null && value != null &&\r\n(typeof value != 'string' || value != '')) {\r\nnode.setAttribute($.svg._attrNames[name] || name, value);\r\n}\r\n}\r\nparent.appendChild(node);\r\nreturn node;\r\n},\r\n/* Add an existing SVG node to the diagram.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param node (element) the new node to add or\r\n(string) the jQuery selector for the node or\r\n(jQuery collection) set of nodes to add\r\n@return (SVGWrapper) this wrapper */\r\nadd: function(parent, node) {\r\nvar args = this._args((arguments.length == 1 ? [null, parent] : arguments), ['node']);\r\nvar svg = this;\r\nargs.parent = args.parent || this._svg;\r\nargs.node = (args.node.jquery ? args.node : $(args.node));\r\ntry {\r\nif ($.svg._renesis) {\r\nthrow 'Force traversal';\r\n}\r\nargs.parent.appendChild(args.node.cloneNode(true));\r\n}\r\ncatch (e) {\r\nargs.node.each(function() {\r\nvar child = svg._cloneAsSVG(this);\r\nif (child) {\r\nargs.parent.appendChild(child);\r\n}\r\n});\r\n}\r\nreturn this;\r\n},\r\n/* Clone an existing SVG node and add it to the diagram.\r\n@param parent (element or jQuery) the parent node for the new node (optional)\r\n@param node (element) the new node to add or\r\n(string) the jQuery selector for the node or\r\n(jQuery collection) set of nodes to add\r\n@return (element[]) collection of new nodes */\r\nclone: function(parent, node) {\r\nvar svg = this;\r\nvar args = this._args((arguments.length == 1 ? [null, parent] : arguments), ['node']);\r\nargs.parent = args.parent || this._svg;\r\nargs.node = (args.node.jquery ? args.node : $(args.node));\r\nvar newNodes = [];\r\nargs.node.each(function() {\r\nvar child = svg._cloneAsSVG(this);\r\nif (child) {\r\nchild.id = '';\r\nargs.parent.appendChild(child);\r\nnewNodes.push(child);\r\n}\r\n});\r\nreturn newNodes;\r\n},\r\n/* SVG nodes must belong to the SVG namespace, so clone and ensure this is so.\r\n@param node (element) the SVG node to clone\r\n@return (element) the cloned node */\r\n_cloneAsSVG: function(node) {\r\nvar newNode = null;\r\nif (node.nodeType == 1) { // element\r\nnewNode = this._svg.ownerDocument.createElementNS(\r\n$.svg.svgNS, this._checkName(node.nodeName));\r\nfor (var i = 0; i < node.attributes.length; i++) {\r\nvar attr = node.attributes.item(i);\r\nif (attr.nodeName != 'xmlns' && attr.nodeValue) {\r\nif (attr.prefix == 'xlink') {\r\nnewNode.setAttributeNS($.svg.xlinkNS,\r\nattr.localName || attr.baseName, attr.nodeValue);\r\n}\r\nelse {\r\nnewNode.setAttribute(this._checkName(attr.nodeName), attr.nodeValue);\r\n}\r\n}\r\n}\r\nfor (var i = 0; i < node.childNodes.length; i++) {\r\nvar child = this._cloneAsSVG(node.childNodes[i]);\r\nif (child) {\r\nnewNode.appendChild(child);\r\n}\r\n}\r\n}\r\nelse if (node.nodeType == 3) { // text\r\nif ($.trim(node.nodeValue)) {\r\nnewNode = this._svg.ownerDocument.createTextNode(node.nodeValue);\r\n}\r\n}\r\nelse if (node.nodeType == 4) { // CDATA\r\nif ($.trim(node.nodeValue)) {\r\ntry {\r\nnewNode = this._svg.ownerDocument.createCDATASection(node.nodeValue);\r\n}\r\ncatch (e) {\r\nnewNode = this._svg.ownerDocument.createTextNode(\r\nnode.nodeValue.replace(/&/g, '&').\r\nreplace(//g, '>'));\r\n}\r\n}\r\n}\r\nreturn newNode;\r\n},\r\n/* Node names must be lower case and without SVG namespace prefix. */\r\n_checkName: function(name) {\r\nname = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z' ?\r\nname.toLowerCase() : name);\r\nreturn (name.substring(0, 4) == 'svg:' ? name.substring(4) : name);\r\n},\r\n/* Load an external SVG document.\r\n@param url (string) the location of the SVG document or\r\nthe actual SVG content\r\n@param settings (boolean) see addTo below or\r\n(function) see onLoad below or\r\n(object) additional settings for the load with attributes below:\r\naddTo (boolean) true to add to what's already there,\r\nor false to clear the canvas first\r\nchangeSize (boolean) true to allow the canvas size to change,\r\nor false to retain the original\r\nonLoad (function) callback after the document has loaded,\r\n'this' is the container, receives SVG object and\r\noptional error message as a parameter\r\nparent (string or element or jQuery) the parent to load\r\ninto, defaults to top-level svg element\r\n@return (SVGWrapper) this root */\r\nload: function(url, settings) {\r\nsettings = (typeof settings == 'boolean' ? {addTo: settings} :\r\n(typeof settings == 'function' ? {onLoad: settings} :\r\n(typeof settings == 'string' ? {parent: settings} :\r\n(typeof settings == 'object' && settings.nodeName ? {parent: settings} :\r\n(typeof settings == 'object' && settings.jquery ? {parent: settings} :\r\nsettings || {})))));\r\nif (!settings.parent && !settings.addTo) {\r\nthis.clear(false);\r\n}\r\nvar size = [this._svg.getAttribute('width'), this._svg.getAttribute('height')];\r\nvar wrapper = this;\r\n// Report a problem with the load\r\nvar reportError = function(message) {\r\nmessage = $.svg.local.errorLoadingText + ': ' + message;\r\nif (settings.onLoad) {\r\nsettings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper, message]);\r\n}\r\nelse {\r\nwrapper.text(null, 10, 20, message);\r\n}\r\n};\r\n// Create a DOM from SVG content\r\nvar loadXML4IE = function(data) {\r\nvar xml = new ActiveXObject('Microsoft.XMLDOM');\r\nxml.validateOnParse = false;\r\nxml.resolveExternals = false;\r\nxml.async = false;\r\nxml.loadXML(data);\r\nif (xml.parseError.errorCode != 0) {\r\nreportError(xml.parseError.reason);\r\nreturn null;\r\n}\r\nreturn xml;\r\n};\r\n// Load the SVG DOM\r\nvar loadSVG = function(data) {\r\nif (!data) {\r\nreturn;\r\n}\r\nif (data.documentElement.nodeName != 'svg') {\r\nvar errors = data.getElementsByTagName('parsererror');\r\nvar messages = (errors.length ? errors[0].getElementsByTagName('div') : []); // Safari\r\nreportError(!errors.length ? '???' :\r\n(messages.length ? messages[0] : errors[0]).firstChild.nodeValue);\r\nreturn;\r\n}\r\nvar parent = (settings.parent ? $(settings.parent)[0] : wrapper._svg);\r\nvar attrs = {};\r\nfor (var i = 0; i < data.documentElement.attributes.length; i++) {\r\nvar attr = data.documentElement.attributes.item(i);\r\nif (!(attr.nodeName == 'version' || attr.nodeName.substring(0, 5) == 'xmlns')) {\r\nattrs[attr.nodeName] = attr.nodeValue;\r\n}\r\n}\r\nwrapper.configure(parent, attrs, !settings.parent);\r\nvar nodes = data.documentElement.childNodes;\r\nfor (var i = 0; i < nodes.length; i++) {\r\ntry {\r\nif ($.svg._renesis) {\r\nthrow 'Force traversal';\r\n}\r\nparent.appendChild(wrapper._svg.ownerDocument.importNode(nodes[i], true));\r\nif (nodes[i].nodeName == 'script') {\r\n$.globalEval(nodes[i].textContent);\r\n}\r\n}\r\ncatch (e) {\r\nwrapper.add(parent, nodes[i]);\r\n}\r\n}\r\nif (!settings.changeSize) {\r\nwrapper.configure(parent, {width: size[0], height: size[1]});\r\n}\r\nif (settings.onLoad) {\r\nsettings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper]);\r\n}\r\n};\r\nif (url.match('';\r\n}\r\nelse { // Element\r\nsvgDoc = '<' + node.nodeName;\r\nif (node.attributes) {\r\nfor (var i = 0; i < node.attributes.length; i++) {\r\nvar attr = node.attributes.item(i);\r\nif (!($.trim(attr.nodeValue) == '' || attr.nodeValue.match(/^\\[object/) ||\r\nattr.nodeValue.match(/^function/))) {\r\nsvgDoc += ' ' + (attr.namespaceURI == $.svg.xlinkNS ? 'xlink:' : '') +\r\nattr.nodeName + '=\"' + attr.nodeValue + '\"';\r\n}\r\n}\r\n}\r\nif (node.firstChild) {\r\nsvgDoc += '>';\r\nvar child = node.firstChild;\r\nwhile (child) {\r\nsvgDoc += this._toSVG(child);\r\nchild = child.nextSibling;\r\n}\r\nsvgDoc += '';\r\n}\r\nelse {\r\nsvgDoc += '/>';\r\n}\r\n}\r\nreturn svgDoc;\r\n}\r\n});\r\n/* Helper to generate an SVG path.\r\nObtain an instance from the SVGWrapper object.\r\nString calls together to generate the path and use its value:\r\nvar path = root.createPath();\r\nroot.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'});\r\nor\r\nroot.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */\r\nfunction SVGPath() {\r\nthis._path = '';\r\n}\r\n$.extend(SVGPath.prototype, {\r\n/* Prepare to create a new path.\r\n@return (SVGPath) this path */\r\nreset: function() {\r\nthis._path = '';\r\nreturn this;\r\n},\r\n/* Move the pointer to a position.\r\n@param x (number) x-coordinate to move to or\r\n(number[][]) x-/y-coordinates to move to\r\n@param y (number) y-coordinate to move to (omitted if x is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nmove: function(x, y, relative) {\r\nrelative = (isArray(x) ? y : relative);\r\nreturn this._coords((relative ? 'm' : 'M'), x, y);\r\n},\r\n/* Draw a line to a position.\r\n@param x (number) x-coordinate to move to or\r\n(number[][]) x-/y-coordinates to move to\r\n@param y (number) y-coordinate to move to (omitted if x is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nline: function(x, y, relative) {\r\nrelative = (isArray(x) ? y : relative);\r\nreturn this._coords((relative ? 'l' : 'L'), x, y);\r\n},\r\n/* Draw a horizontal line to a position.\r\n@param x (number) x-coordinate to draw to or\r\n(number[]) x-coordinates to draw to\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nhoriz: function(x, relative) {\r\nthis._path += (relative ? 'h' : 'H') + (isArray(x) ? x.join(' ') : x);\r\nreturn this;\r\n},\r\n/* Draw a vertical line to a position.\r\n@param y (number) y-coordinate to draw to or\r\n(number[]) y-coordinates to draw to\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nvert: function(y, relative) {\r\nthis._path += (relative ? 'v' : 'V') + (isArray(y) ? y.join(' ') : y);\r\nreturn this;\r\n},\r\n/* Draw a cubic Bézier curve.\r\n@param x1 (number) x-coordinate of beginning control point or\r\n(number[][]) x-/y-coordinates of control and end points to draw to\r\n@param y1 (number) y-coordinate of beginning control point (omitted if x1 is array)\r\n@param x2 (number) x-coordinate of ending control point (omitted if x1 is array)\r\n@param y2 (number) y-coordinate of ending control point (omitted if x1 is array)\r\n@param x (number) x-coordinate of curve end (omitted if x1 is array)\r\n@param y (number) y-coordinate of curve end (omitted if x1 is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\ncurveC: function(x1, y1, x2, y2, x, y, relative) {\r\nrelative = (isArray(x1) ? y1 : relative);\r\nreturn this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y);\r\n},\r\n/* Continue a cubic Bézier curve.\r\nStarting control point is the reflection of the previous end control point.\r\n@param x2 (number) x-coordinate of ending control point or\r\n(number[][]) x-/y-coordinates of control and end points to draw to\r\n@param y2 (number) y-coordinate of ending control point (omitted if x2 is array)\r\n@param x (number) x-coordinate of curve end (omitted if x2 is array)\r\n@param y (number) y-coordinate of curve end (omitted if x2 is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nsmoothC: function(x2, y2, x, y, relative) {\r\nrelative = (isArray(x2) ? y2 : relative);\r\nreturn this._coords((relative ? 's' : 'S'), x2, y2, x, y);\r\n},\r\n/* Draw a quadratic Bézier curve.\r\n@param x1 (number) x-coordinate of control point or\r\n(number[][]) x-/y-coordinates of control and end points to draw to\r\n@param y1 (number) y-coordinate of control point (omitted if x1 is array)\r\n@param x (number) x-coordinate of curve end (omitted if x1 is array)\r\n@param y (number) y-coordinate of curve end (omitted if x1 is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\ncurveQ: function(x1, y1, x, y, relative) {\r\nrelative = (isArray(x1) ? y1 : relative);\r\nreturn this._coords((relative ? 'q' : 'Q'), x1, y1, x, y);\r\n},\r\n/* Continue a quadratic Bézier curve.\r\nControl point is the reflection of the previous control point.\r\n@param x (number) x-coordinate of curve end or\r\n(number[][]) x-/y-coordinates of points to draw to\r\n@param y (number) y-coordinate of curve end (omitted if x is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\nsmoothQ: function(x, y, relative) {\r\nrelative = (isArray(x) ? y : relative);\r\nreturn this._coords((relative ? 't' : 'T'), x, y);\r\n},\r\n/* Generate a path command with (a list of) coordinates. */\r\n_coords: function(cmd, x1, y1, x2, y2, x3, y3) {\r\nif (isArray(x1)) {\r\nfor (var i = 0; i < x1.length; i++) {\r\nvar cs = x1[i];\r\nthis._path += (i == 0 ? cmd : ' ') + cs[0] + ',' + cs[1] +\r\n(cs.length < 4 ? '' : ' ' + cs[2] + ',' + cs[3] +\r\n(cs.length < 6 ? '': ' ' + cs[4] + ',' + cs[5]));\r\n}\r\n}\r\nelse {\r\nthis._path += cmd + x1 + ',' + y1 +\r\n(x2 == null ? '' : ' ' + x2 + ',' + y2 +\r\n(x3 == null ? '' : ' ' + x3 + ',' + y3));\r\n}\r\nreturn this;\r\n},\r\n/* Draw an arc to a position.\r\n@param rx (number) x-radius of arc or\r\n(number/boolean[][]) x-/y-coordinates and flags for points to draw to\r\n@param ry (number) y-radius of arc (omitted if rx is array)\r\n@param xRotate (number) x-axis rotation (degrees, clockwise) (omitted if rx is array)\r\n@param large (boolean) true to draw the large part of the arc,\r\nfalse to draw the small part (omitted if rx is array)\r\n@param clockwise (boolean) true to draw the clockwise arc,\r\nfalse to draw the anti-clockwise arc (omitted if rx is array)\r\n@param x (number) x-coordinate of arc end (omitted if rx is array)\r\n@param y (number) y-coordinate of arc end (omitted if rx is array)\r\n@param relative (boolean) true for coordinates relative to the current point,\r\nfalse for coordinates being absolute\r\n@return (SVGPath) this path */\r\narc: function(rx, ry, xRotate, large, clockwise, x, y, relative) {\r\nrelative = (isArray(rx) ? ry : relative);\r\nthis._path += (relative ? 'a' : 'A');\r\nif (isArray(rx)) {\r\nfor (var i = 0; i < rx.length; i++) {\r\nvar cs = rx[i];\r\nthis._path += (i == 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' +\r\ncs[2] + ' ' + (cs[3] ? '1' : '0') + ',' +\r\n(cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6];\r\n}\r\n}\r\nelse {\r\nthis._path += rx + ',' + ry + ' ' + xRotate + ' ' +\r\n(large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ',' + y;\r\n}\r\nreturn this;\r\n},\r\n/* Close the current path.\r\n@return (SVGPath) this path */\r\nclose: function() {\r\nthis._path += 'z';\r\nreturn this;\r\n},\r\n/* Return the string rendering of the specified path.\r\n@return (string) stringified path */\r\npath: function() {\r\nreturn this._path;\r\n}\r\n});\r\nSVGPath.prototype.moveTo = SVGPath.prototype.move;\r\nSVGPath.prototype.lineTo = SVGPath.prototype.line;\r\nSVGPath.prototype.horizTo = SVGPath.prototype.horiz;\r\nSVGPath.prototype.vertTo = SVGPath.prototype.vert;\r\nSVGPath.prototype.curveCTo = SVGPath.prototype.curveC;\r\nSVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC;\r\nSVGPath.prototype.curveQTo = SVGPath.prototype.curveQ;\r\nSVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ;\r\nSVGPath.prototype.arcTo = SVGPath.prototype.arc;\r\n/* Helper to generate an SVG text object.\r\nObtain an instance from the SVGWrapper object.\r\nString calls together to generate the text and use its value:\r\nvar text = root.createText();\r\nroot.text(null, x, y, text.string('This is ').\r\nspan('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */\r\nfunction SVGText() {\r\nthis._parts = []; // The components of the text object\r\n}\r\n$.extend(SVGText.prototype, {\r\n/* Prepare to create a new text object.\r\n@return (SVGText) this text */\r\nreset: function() {\r\nthis._parts = [];\r\nreturn this;\r\n},\r\n/* Add a straight string value.\r\n@param value (string) the actual text\r\n@return (SVGText) this text object */\r\nstring: function(value) {\r\nthis._parts[this._parts.length] = ['text', value];\r\nreturn this;\r\n},\r\n/* Add a separate text span that has its own settings.\r\n@param value (string) the actual text\r\n@param settings (object) the settings for this text\r\n@return (SVGText) this text object */\r\nspan: function(value, settings) {\r\nthis._parts[this._parts.length] = ['tspan', value, settings];\r\nreturn this;\r\n},\r\n/* Add a reference to a previously defined text string.\r\n@param id (string) the ID of the actual text\r\n@param settings (object) the settings for this text\r\n@return (SVGText) this text object */\r\nref: function(id, settings) {\r\nthis._parts[this._parts.length] = ['tref', id, settings];\r\nreturn this;\r\n},\r\n/* Add text drawn along a path.\r\n@param id (string) the ID of the path\r\n@param value (string) the actual text\r\n@param settings (object) the settings for this text\r\n@return (SVGText) this text object */\r\npath: function(id, value, settings) {\r\nthis._parts[this._parts.length] = ['textpath', value,\r\n$.extend({href: id}, settings || {})];\r\nreturn this;\r\n}\r\n});\r\n/* Attach the SVG functionality to a jQuery selection.\r\n@param command (string) the command to run (optional, default 'attach')\r\n@param options (object) the new settings to use for these SVG instances\r\n@return jQuery (object) for chaining further calls */\r\n$.fn.svg = function(options) {\r\nvar otherArgs = Array.prototype.slice.call(arguments, 1);\r\nif (typeof options == 'string' && options == 'get') {\r\nreturn $.svg['_' + options + 'SVG'].apply($.svg, [this[0]].concat(otherArgs));\r\n}\r\nreturn this.each(function() {\r\nif (typeof options == 'string') {\r\n$.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs));\r\n}\r\nelse {\r\n$.svg._attachSVG(this, options || {});\r\n}\r\n});\r\n};\r\n/* Determine whether an object is an array. */\r\nfunction isArray(a) {\r\nreturn (a && a.constructor == Array);\r\n}\r\n// Singleton primary SVG interface\r\n$.svg = new SVGManager();\r\n})(jQuery);\r\n"],"names":["$","SVGManager","this","_settings","_extensions","regional","errorLoadingText","notSupportedText","local","_uuid","Date","getTime","_renesis","classId","window","ActiveXObject","e","detectActiveX","PROP_NAME","SVGWrapper","svg","container","_svg","_container","i","length","extension","SVGPath","_path","SVGText","_parts","isArray","a","constructor","Array","extend","prototype","markerClassName","svgNS","xlinkNS","_wrapperClass","_attrNames","class_","in_","alignmentBaseline","baselineShift","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDashArray","strokeDashOffset","strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","vertAdvY","vertOriginY","wordSpacing","writingMode","_attachSVG","settings","namespaceURI","hasClass","loadURL","onLoad","addClass","document","createElementNS","setAttribute","clientWidth","clientHeight","appendChild","_afterLoad","browser","msie","id","innerHTML","initPath","_registerSVG","embeds","parentNode","data","getSVGDocument","setTimeout","documentElement","wrapper","load","configure","apply","alert","_getSVG","jquery","_destroySVG","$container","removeClass","empty","removeData","addExtension","name","extClass","push","isSVGElem","node","nodeType","_width","width","_height","height","root","clear","nodeName","attributes","attr","item","substring","removeNamedItem","attrName","getElementById","ownerDocument","change","element","removeAttribute","_args","values","names","optSettings","splice","args","offset","each","value","title","parent","text","arguments","_makeNode","createTextNode","describe","defs","symbol","x1","y1","viewBox","marker","refX","refY","mWidth","mHeight","orient","markerWidth","markerHeight","style","styles","type","opera","append","script","mozilla","globalEval","linearGradient","stops","x2","y2","sets","_gradient","radialGradient","cx","cy","r","fx","fy","stop","pattern","x","y","vx","vy","vwidth","vheight","units","clipPathUnits","mask","createPath","createText","group","use","ref","setAttributeNS","link","image","path","d","rect","rx","ry","circle","ellipse","line","polyline","points","_poly","polygon","ps","join","trim","_text","textpath","part","child","set","href","other","add","cloneNode","_cloneAsSVG","clone","newNodes","newNode","_checkName","nodeValue","prefix","localName","baseName","childNodes","createCDATASection","replace","toLowerCase","url","addTo","size","getAttribute","reportError","message","loadXML4IE","xml","validateOnParse","resolveExternals","async","loadXML","parseError","errorCode","reason","loadSVG","attrs","nodes","importNode","textContent","changeSize","errors","getElementsByTagName","messages","firstChild","match","DOMParser","parseFromString","ajax","dataType","success","error","http","exc","remove","removeChild","attrsToo","toSVG","XMLSerializer","_toSVG","serializeToString","svgDoc","nextSibling","reset","move","relative","_coords","horiz","vert","curveC","smoothC","curveQ","smoothQ","cmd","x3","y3","cs","arc","xRotate","large","clockwise","close","moveTo","lineTo","horizTo","vertTo","curveCTo","smoothCTo","curveQTo","smoothQTo","arcTo","string","span","fn","options","otherArgs","slice","call","concat","jQuery"],"version":3,"file":"index.4ea5409e.js.map"}