{"version":3,"file":"js/467.28061ea4d0614a3a84fa.chunk.js","mappings":"mIACO,MAAMA,EAAc,KAYvB,SAASC,IACL,IAAI,UAAiB,CACGC,SAASC,iBAAiB,wBAClCC,SAASC,IACjB,GAAiC,MAA7BA,EAAGC,QAAQC,cAAuB,CAClC,MAAMC,EAAcN,SAASO,cAAc,MAC3CD,EAAYE,YAAcL,EAAGK,YAC7B,IAAK,IAAIC,EAAI,EAAGA,EAAIN,EAAGO,WAAWC,OAAQF,IAAK,CAC3C,MAAMG,EAAOT,EAAGO,WAAWD,GAC3BH,EAAYO,aAAaD,EAAKE,KAAMF,EAAKG,MAC7C,CACAZ,EAAGa,WAAWC,aAAaX,EAAaH,EAC5C,CACA,GAAiC,OAA7BA,EAAGC,QAAQC,cAAwB,CACnC,MAAMa,EAAclB,SAASO,cAAc,KAC3CW,EAAYV,YAAcL,EAAGK,YAC7B,IAAK,IAAIC,EAAI,EAAGA,EAAIN,EAAGO,WAAWC,OAAQF,IAAK,CAC3C,MAAMG,EAAOT,EAAGO,WAAWD,GAC3BS,EAAYL,aAAaD,EAAKE,KAAMF,EAAKG,MAC7C,CACAZ,EAAGa,WAAWC,aAAaC,EAAaf,EAC5C,IAER,CACJ,CACA,MAAMgB,EApCN,SAAkBC,EAAMC,GACpB,IAAIC,EACJ,OAAO,WACH,MAAMC,EAAUC,KACVC,EAAOC,UACbC,aAAaL,GACbA,EAAYM,YAAW,KACnBR,EAAKS,MAAMN,EAASE,EAAK,GAC1BJ,EACP,CACJ,CA0BgCS,CAAS/B,EAAkB,KAC3DA,IACAgC,OAAOC,iBAAiB,SAAUb,EAAwB,C","sources":["webpack:///./wwwroot/js/tagReplacer.ts"],"sourcesContent":["import { isSmallScreen } from './utils';\nexport const tagReplacer = () => {\n function debounce(func, delay) {\n let timeoutId;\n return function () {\n const context = this;\n const args = arguments;\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n func.apply(context, args);\n }, delay);\n };\n }\n function replaceHTagWithP() {\n if (isSmallScreen()) {\n const elementTags = document.querySelectorAll('.dynamic-element-tag');\n elementTags.forEach((el) => {\n if (el.tagName.toLowerCase() === 'p') {\n const hTagElement = document.createElement('h2');\n hTagElement.textContent = el.textContent;\n for (let i = 0; i < el.attributes.length; i++) {\n const attr = el.attributes[i];\n hTagElement.setAttribute(attr.name, attr.value);\n }\n el.parentNode.replaceChild(hTagElement, el);\n }\n if (el.tagName.toLowerCase() === 'h2') {\n const pTagElement = document.createElement('p');\n pTagElement.textContent = el.textContent;\n for (let i = 0; i < el.attributes.length; i++) {\n const attr = el.attributes[i];\n pTagElement.setAttribute(attr.name, attr.value);\n }\n el.parentNode.replaceChild(pTagElement, el);\n }\n });\n }\n }\n const debouncedReplaceH2WithP = debounce(replaceHTagWithP, 250);\n replaceHTagWithP();\n window.addEventListener('resize', debouncedReplaceH2WithP);\n};\n"],"names":["tagReplacer","replaceHTagWithP","document","querySelectorAll","forEach","el","tagName","toLowerCase","hTagElement","createElement","textContent","i","attributes","length","attr","setAttribute","name","value","parentNode","replaceChild","pTagElement","debouncedReplaceH2WithP","func","delay","timeoutId","context","this","args","arguments","clearTimeout","setTimeout","apply","debounce","window","addEventListener"],"sourceRoot":""}