{"version":3,"file":"index.mjs","sources":[""],"sourcesContent":["import type { FC, ReactElement } from \"react\";\r\nimport type { IComponentBaseProps } from \"#package/types\";\r\nimport type { IHTMLComment } from \"./config/types\";\r\nimport { getSanitizedHTML } from \"../../utils/getSanitizedHTML\";\r\n\r\n\r\n/**\r\n * Комментарий, выводимый в HTML-разметку\r\n * @returns {ReactElement}\r\n */\r\nconst HTMLComment: FC<IHTMLComment & IComponentBaseProps> = ({\r\n  extraAttrs = {},\r\n  text = \"\",\r\n}): ReactElement => {\r\n\r\n  const comment = `<!-- ${text} -->`;\r\n\r\n  const callback = (template: HTMLTemplateElement) => {\r\n    if (template) {\r\n      template.setAttribute(\"data-comment\", text);\r\n      template.innerHTML = \"\";\r\n    }\r\n  };\r\n\r\n  return (\r\n    <template data-comment={\"\"} ref={callback} dangerouslySetInnerHTML={{ __html: getSanitizedHTML(comment) }} {...extraAttrs} />\r\n  );\r\n\r\n};\r\n\r\nexport type { IHTMLComment };\r\nexport { HTMLComment };\r\n"],"names":["HTMLComment","extraAttrs","text","comment","callback","template","setAttribute","innerHTML","_jsx","ref","dangerouslySetInnerHTML","__html","getSanitizedHTML"],"mappings":"kGAUA,MAAMA,YAAsD,EAC1DC,sBAAa,CAAA,EACbC,UAAO,OAGP,MAAMC,QAAU,WAAQD,cAExB,MAAME,SAAYC,WAChB,GAAIA,SAAU,CACZA,SAASC,aAAa,eAAgBJ,MACtCG,SAASE,UAAY,EACvB;AAGF,OACEC,IAAA,WAAA,CAAU,eAAc,GAAIC,IAAKL,SAAUM,wBAAyB,CAAEC,OAAQC,iBAAiBT,aAAgBF"}