"use strict";(self.webpackChunkgravityforms=self.webpackChunkgravityforms||[]).push([[832],{1714:function(t,e,o){o.r(e);var n=o(8140),r=o(527),i=o(3656),c=o(7143),a=o(6087),l=o(3963),s=o.n(l),u=o(1533);function d(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function f(t){for(var e=1;e-1)||"function"==typeof navigator.clipboard.readText||(_(p.paste_not_available,p.your_browser_no_permission_to_paste),!1)};e.default=function(){return React.createElement(a.Fragment,null,React.createElement(i.PluginBlockSettingsMenuItem,{allowedBlocks:["gravityforms/form"],icon:"",label:p.copy_form_styles,onClick:function(){return m()}}),React.createElement(i.PluginBlockSettingsMenuItem,{allowedBlocks:["gravityforms/form"],icon:"",label:p.paste_form_styles,onClick:function(){return g()}}))}},1026:function(t,e,o){o.d(e,{default:function(){return y}});var n=o(5798),r=o(2279),i=o(1533),c=o.n(i),a=window.wp||{},l=(null===c()||void 0===c()?void 0:c().block_editor["gravityforms/form"])||{},s=l.i18n,u={ready:!1},d={insertButton:null},f=function(t){return a.data.select("core/blocks").getBlockTypes().filter(function(e){return!t||"gravityforms/form"!==e.name}).map(function(t){return t.name})},p=function(){a.data.dispatch("core/edit-post").showBlockTypes(f(!1))},m=function(){var t;window.wp.data.dispatch("core/edit-post").setIsInserterOpened(!0),t=f(!0),a.data.dispatch("core/edit-post").hideBlockTypes(t),a.data.dispatch("core/edit-post").showBlockTypes(["gravityforms/form"]);var e=setInterval(function(){var t,o,r;d.insertButton=document.querySelector(".editor-block-list-item-gravityforms-form"),d.insertButton&&(u.ready=!0,o=document.createElement("div"),r=d.insertButton.getBoundingClientRect(),o.innerHTML='\n\t
\n\t\t'.concat(s.insert_gform_block_title,"\n\t\t").concat((0,n.sprintf)(s.insert_gform_block_content,''),''.concat(s.external_link_opens_in_new_tab,' ')),"\n\t
\n\t"),o.classList.add("gform-block__tooltip"),(0,n.isRtl)()?o.style="left: ".concat(r.right-(275+d.insertButton.clientWidth),"px; top: ").concat(r.top+d.insertButton.clientHeight/2,"px;"):o.style="left: ".concat(r.right+20,"px; top: ").concat(r.top+d.insertButton.clientHeight/2,"px;"),d.insertButton.addEventListener("mouseenter",function(){o&&(o.style.opacity="0",setTimeout(function(){o.style.zIndex="-1"},200))}),d.insertButton.parentNode.appendChild(o),t=a.data.subscribe(function(){a.data.select("core/block-editor").getBlocks().filter(function(t){return"gravityforms/form"===t.name&&void 0===t.originalContent}).length&&setTimeout(function(){localStorage.removeItem("gfAddBlock"),t(),p()},100)})),u.ready&&clearInterval(e)},500)},g=function(){localStorage.getItem("gfAddBlock")&&(m(),window.addEventListener("beforeunload",p),(0,n.consoleInfo)("Gravity Forms Admin: Initialized block editor insert form scripts."))},b=function(t){for(var e in t)-1!==e.indexOf("gform_")&&delete t[e];return t},y=function(){if(g(),void 0!==o(4309)){var t=o(1714);(0,r.registerPlugin)("gravityforms",{render:t.default}),window.acf&&window.acf.addFilter("prepare_for_ajax",b),(0,n.consoleInfo)("Gravity Forms Admin: Initialized all block editor scripts.")}}}}]);