shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$svg$parseSVGDefinitions = function(global, require, module, exports) {
  var Color = require("module$node_modules$pixi_DOT_js$lib$color$Color"), warn = require("module$node_modules$pixi_DOT_js$lib$utils$logging$warn"), FillGradient = require("module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$fill$FillGradient"), parseSVGFloatAttribute = require("module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$svg$parseSVGFloatAttribute");
  "use strict";
  exports.parseSVGDefinitions = function(svg, session) {
    svg = svg.querySelectorAll("defs");
    for (let i = 0; i < svg.length; i++) {
      const definition = svg[i];
      for (let j = 0; j < definition.children.length; j++) {
        var child = definition.children[j];
        switch(child.nodeName.toLowerCase()) {
          case "lineargradient":
            var JSCompiler_temp_const = session.defs, JSCompiler_temp_const$jscomp$0 = child.id, x0 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "x1", 0), y0 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "y1", 0), x1 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "x2", 1), y1 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "y2", 0);
            const gradientUnit = child.getAttribute("gradientUnits") || "objectBoundingBox";
            x0 = new FillGradient.FillGradient(x0, y0, x1, y1, "objectBoundingBox" === gradientUnit ? "local" : "global");
            for (y0 = 0; y0 < child.children.length; y0++) {
              y1 = child.children[y0], x1 = parseSVGFloatAttribute.parseSVGFloatAttribute(y1, "offset", 0), y1 = Color.Color.shared.setValue(y1.getAttribute("stop-color")).toNumber(), x0.addColorStop(x1, y1);
            }
            JSCompiler_temp_const[JSCompiler_temp_const$jscomp$0] = x0;
            break;
          case "radialgradient":
            JSCompiler_temp_const = session.defs, child = child.id, warn.warn("[SVG Parser] Radial gradients are not yet supported"), JSCompiler_temp_const$jscomp$0 = new FillGradient.FillGradient(0, 0, 1, 0), JSCompiler_temp_const[child] = JSCompiler_temp_const$jscomp$0;
        }
      }
    }
  };
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$svg$parseSVGDefinitions.js.map
