�PNG  IHDR��;���IDATx��ܻn�0���K�� �)(�pA��� ���7�LeG{�� �§㻢|��ذaÆ 6lذaÆ 6lذaÆ 6lom��$^�y���ذag�5bÆ 6lذaÆ 6lذa{���� 6lذaÆ �`����}H�Fkm�,�m����Ӫ���ô�ô!� �x�|'ܢ˟;�E:���9�&ᶒ�}�{�v]�n&�6� �h��_��t�ڠ͵-ҫ���Z;��Z$�.�P���k�ž)�!��o���>}l�eQfJ�T��u і���چ��\��X=8��Rن4`Vw�l�>����n�G�^��i�s��"ms�$�u��i��?w�bs[m�6�K4���O���.�4��%����/����b�C%��t ��M�ז� �-l�G6�mrz2���s�%�9��s@���-�k�9�=���)������k�B5����\��+͂�Zsٲ ��Rn��~G���R���C����� �wIcI��n7jJ���hۛNCS|���j0��8y�iHKֶۛ�k�Ɉ+;Sz������L/��F�*\��Ԕ�#"5��m�2��[S��������=�g��n�a�P�e�ғ�L�� lذaÆ 6l�^k��̱aÆ 6lذaÆ 6lذa;���� �_��ذaÆ 6lذaÆ 6lذaÆ ���R���IEND�B` 'use strict'; const { inheritableAttrs, elemsGroups } = require('./_collections'); exports.type = 'perItemReverse'; exports.active = true; exports.description = 'collapses useless groups'; function hasAnimatedAttr(item, name) { if (item.type === 'element') { return ( (elemsGroups.animation.includes(item.name) && item.attributes.attributeName === name) || (item.children.length !== 0 && item.children.some((child) => hasAnimatedAttr(child, name))) ); } return false; } /* * Collapse useless groups. * * @example * * * * * * ⬇ * * * * * * ⬇ * * * @param {Object} item current iteration item * @return {Boolean} if false, item will be filtered out * * @author Kir Belevich */ exports.fn = function (item) { // non-empty elements if ( item.type === 'element' && item.name !== 'switch' && item.children.length !== 0 ) { item.children.forEach(function (g, i) { // non-empty groups if (g.type === 'element' && g.name === 'g' && g.children.length !== 0) { // move group attibutes to the single child element if (Object.keys(g.attributes).length !== 0 && g.children.length === 1) { var inner = g.children[0]; if ( inner.type === 'element' && inner.attributes.id == null && g.attributes.filter == null && (g.attributes.class == null || inner.attributes.class == null) && ((g.attributes['clip-path'] == null && g.attributes.mask == null) || (inner.type === 'element' && inner.name === 'g' && g.attributes.transform == null && inner.attributes.transform == null)) ) { for (const [name, value] of Object.entries(g.attributes)) { if (g.children.some((item) => hasAnimatedAttr(item, name))) return; if (inner.attributes[name] == null) { inner.attributes[name] = value; } else if (name == 'transform') { inner.attributes[name] = value + ' ' + inner.attributes[name]; } else if (inner.attributes[name] === 'inherit') { inner.attributes[name] = value; } else if ( inheritableAttrs.includes(name) === false && inner.attributes[name] !== value ) { return; } delete g.attributes[name]; } } } // collapse groups without attributes if ( Object.keys(g.attributes).length === 0 && !g.children.some((item) => item.isElem(elemsGroups.animation)) ) { item.spliceContent(i, 1, g.children); } } }); } };