"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SectionBlockEdit=void 0;const classnames_1=__importDefault(require("classnames")),element_1=require("@wordpress/element"),i18n_1=require("@wordpress/i18n"),block_templates_1=require("@woocommerce/block-templates"),components_1=require("@woocommerce/components"),block_editor_1=require("@wordpress/block-editor"),block_slot_fill_1=require("../../../components/block-slot-fill"),sanitize_html_1=require("../../../utils/sanitize-html");function SectionBlockEdit({attributes:e,clientId:t}){const{description:o,title:c,blockGap:l}=e,n=(0,block_templates_1.useWooBlockProps)(e),i=(0,block_editor_1.useInnerBlocksProps)({className:(0,classnames_1.default)("wp-block-woocommerce-product-section__content",`wp-block-woocommerce-product-section__content--block-gap-${l}`)},{templateLock:"all"}),r=c?"fieldset":"div",s="fieldset"===r?"legend":"div",m=`wp-block-woocommerce-product-section__heading-tooltip-${t}`;return(0,element_1.createElement)(r,{...n},c&&(0,element_1.createElement)(s,{className:"wp-block-woocommerce-product-section__heading"},(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-section__heading-title-wrapper"},(0,element_1.createElement)("h2",{className:"wp-block-woocommerce-product-section__heading-title"},c,o&&(0,element_1.createElement)(components_1.__experimentalTooltip,{className:m,text:(0,element_1.createElement)("p",{className:"wp-block-woocommerce-product-section__heading-description",dangerouslySetInnerHTML:(0,sanitize_html_1.sanitizeHTML)(o)}),position:"bottom center",helperText:(0,i18n_1.__)("View helper text","woocommerce")})),(0,element_1.createElement)(block_slot_fill_1.BlockSlot,{name:"section-actions",clientId:t})),(0,element_1.createElement)(block_slot_fill_1.BlockSlot,{name:"section-description",clientId:t})),(0,element_1.createElement)("div",{...i}))}exports.SectionBlockEdit=SectionBlockEdit;