Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/components/PublishButton",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../config/index","../utils/useCheckFormsValidity","./FormValidationModal"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function PublishButton({canPublish:e,formRef:t,label:r,onPublish:u}){const c=(0,o.default)(),[f,d]=(0,a.useState)(!1),p=i.config.singleSegmentsExperienceMode&&i.config.saveVariantSegmentsExperienceURL?i.config.saveVariantSegmentsExperienceURL:i.config.publishURL;return a.default.createElement(a.default.Fragment,null,a.default.createElement("form",{action:p,method:"POST",ref:t},a.default.createElement("input",{name:"".concat(i.config.portletNamespace,"redirect"),type:"hidden",value:i.config.redirectURL}),a.default.createElement(n.default,{"aria-label":r,disabled:i.config.pending||!e,displayType:"primary",onClick:()=>{c().then((e=>{e?u():d(!0)}))},size:"sm"},r)),f&&a.default.createElement(l.FormValidationModal,{onCloseModal:()=>d(!1),onPublish:u}))};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=r("../config/index"),o=_interopRequireDefault(r("../utils/useCheckFormsValidity")),l=r("./FormValidationModal");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=PublishButton.js.map