Liferay.Loader.define("layout-template-admin-web@2.0.75/js/propsTransformers/MasterLayoutDropdownPropsTransformer",["module","exports","require","frontend-js-web","../modal/openDeletePageTemplateModal"],(function(e,t,a){var r;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let{actions:a,portletNamespace:r}=t;return i(i({},function(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(t,["actions","portletNamespace"])),{},{actions:null==a?void 0:a.map((t=>{var a;return i(i({},t),{},{items:null===(a=t.items)||void 0===a?void 0:a.map((t=>i(i({},t),{},{onClick(a){var n;const o=null===(n=t.data)||void 0===n?void 0:n.action;o&&(a.preventDefault(),e[o](t.data,r))}})))})})),portletNamespace:r})};var n=a("frontend-js-web"),o=(r=a("../modal/openDeletePageTemplateModal"))&&r.__esModule?r:{default:r};function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){u(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function u(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e={copyMasterLayout({copyMasterLayoutURL:e}){s(e)},deleteMasterLayout({deleteMasterLayoutURL:e}){(0,o.default)({onDelete:()=>{s(e)},title:Liferay.Language.get("master")})},deleteMasterLayoutPreview({deleteMasterLayoutPreviewURL:e}){s(e)},discardDraft({discardDraftURL:e}){(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-discard-current-draft-and-apply-latest-published-changes"),onConfirm:t=>{t&&s(e)}})},markAsDefaultMasterLayout({markAsDefaultMasterLayoutURL:e,message:t}){""!==t?(0,n.openConfirmModal)({message:Liferay.Language.get(t),onConfirm:t=>{t&&s(e)}}):s(e)},permissionsMasterLayout({permissionsMasterLayoutURL:e}){(0,n.openModal)({title:Liferay.Language.get("permissions"),url:e})},renameMasterLayout({layoutPageTemplateEntryId:e,layoutPageTemplateEntryName:t,updateMasterLayoutURL:a},r){(0,n.openSimpleInputModal)({dialogTitle:Liferay.Language.get("rename-master-page"),formSubmitURL:a,idFieldName:"layoutPageTemplateEntryId",idFieldValue:e,mainFieldLabel:Liferay.Language.get("name"),mainFieldName:"name",mainFieldPlaceholder:Liferay.Language.get("name"),mainFieldValue:t,namespace:r})},updateMasterLayoutPreview({itemSelectorURL:e,layoutPageTemplateEntryId:t},a){(0,n.openSelectionModal)({onSelect:e=>{if(e){const r=JSON.parse(e.value);document.getElementById("".concat(a,"layoutPageTemplateEntryId")).value=t,document.getElementById("".concat(a,"fileEntryId")).value=r.fileEntryId,submitForm(document.getElementById("".concat(a,"masterLayoutPreviewFm")))}},selectEventName:Liferay.Util.ns(a,"changePreview"),title:Liferay.Language.get("master-page-thumbnail"),url:e})}};function s(e){submitForm(document.hrefFm,e)}}}));
//# sourceMappingURL=MasterLayoutDropdownPropsTransformer.js.map