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,GAAG,GACjC,CAAC;QAED,IAAIC,KAAK,CAACN,MAAM,GAAG,CAAC,EAAE;UACrBM,KAAK,CAACL,OAAO,CAAC,UAACM,IAAI,EAAK;YACvB,IAAMK,KAAK,GAAGf,QAAQ,CAACgB,aAAa,CAAC,KAAK,CAAC;YAC3C,IAAMC,IAAI,GAAGjB,QAAQ,CAACkB,cAAc,CAACJ,OAAO,CAACK,SAAS,CAAC;YACvDJ,KAAK,CAACK,SAAS,CAACC,GAAG,CAAC,8BAA8B,CAAC;YAEnDN,KAAK,CAACO,WAAW,CAACL,IAAI,CAAC;YACvBP,IAAI,CAACa,YAAY,CAACR,KAAK,EAAEL,IAAI,CAACc,UAAU,CAAC;UAC1C,CAAC,CAAC;QACH;MACD,CAAC,CAAC;IACH;EACD,CAAC,CAAC;AACH,C","sources":["webpack://propel/./blocks/core-blocks/table/script.js"],"sourcesContent":["const tablesFlip = document.querySelectorAll('.wp-block-table.is-style-flip');\nconst tablesStack = document.querySelectorAll('.wp-block-table.is-style-stack');\n\nif (tablesFlip.length > 0) {\n\ttablesFlip.forEach((table) => {\n\t\tconst firstRowItems = table.querySelectorAll('tbody td');\n\n\t\tif (firstRowItems.length > 0) {\n\t\t\tfirstRowItems.forEach((firstRowItem, index) => {\n\t\t\t\tconst items = table.querySelectorAll(\n\t\t\t\t\t'th:nth-child(' +\n\t\t\t\t\t\t(index + 1) +\n\t\t\t\t\t\t'), td:nth-child(' +\n\t\t\t\t\t\t(index + 1) +\n\t\t\t\t\t\t')'\n\t\t\t\t);\n\n\t\t\t\tif (items.length > 0) {\n\t\t\t\t\titems.forEach((item) => {\n\t\t\t\t\t\titem.style.setProperty('--mobileRow', index + 1);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nif (tablesStack.length > 0) {\n\ttablesStack.forEach((table) => {\n\t\tconst headings = table.querySelectorAll('thead th');\n\n\t\tif (headings.length > 0) {\n\t\t\theadings.forEach((heading, index) => {\n\t\t\t\tconst items = table.querySelectorAll(\n\t\t\t\t\t'td:nth-child(' + (index + 1) + ')'\n\t\t\t\t);\n\n\t\t\t\tif (items.length > 0) {\n\t\t\t\t\titems.forEach((item) => {\n\t\t\t\t\t\tconst label = document.createElement('div');\n\t\t\t\t\t\tconst text = document.createTextNode(heading.innerText);\n\t\t\t\t\t\tlabel.classList.add('wp-block-table__mobile-label');\n\n\t\t\t\t\t\tlabel.appendChild(text);\n\t\t\t\t\t\titem.insertBefore(label, item.firstChild);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n"],"names":["tablesFlip","document","querySelectorAll","tablesStack","length","forEach","table","firstRowItems","firstRowItem","index","items","item","style","setProperty","headings","heading","label","createElement","text","createTextNode","innerText","classList","add","appendChild","insertBefore","firstChild"],"sourceRoot":""}