const s=r=>{const{id:o}=window.FAB_TEMPLATE,{rest_url:t,path:e}=window.FAB_PLUGIN;fetch(t+"fab/v1/add_new_fab",{method:"POST",body:JSON.stringify({id:o,wpformsid:r})}).then(n=>n.json()).then(n=>{const a=n.post_id,i=`${e.home_url}/wp-admin/post.php?post=${a}&action=edit`;window.location.href=i})},c=()=>{const{label:r}=window.FAB_TEMPLATE,o=jQuery("#wpforms-embed");if(o.length){const t=jQuery("<button>",{id:"wpforms-turn-into-popup",class:o.attr("class"),text:r.button,css:{"background-color":"#4f46e5",border:"none",color:"#fff"},html:'<i class="fa fa-circle" style="color: #fff;"></i> '+r.button});o.after(t)}jQuery("#wpforms-turn-into-popup").on("click",function(t){t.preventDefault();const n=new URLSearchParams(window.location.search).get("form_id");n&&s(n)})},f=()=>{const{label:r}=window.FAB_TEMPLATE;jQuery(".wpforms-table-container .row-actions").each(function(){const o=jQuery(this).closest("tr").find("a").attr("href"),e=new URLSearchParams(o).get("form_id"),n=jQuery('<span class="turn-into-popup"> | <a href="#" class="wpforms-turn-into-popup" data-form-id="'+e+'">'+r.button+"</a></span>");jQuery(this).append(n)}),jQuery(".wpforms-turn-into-popup").on("click",function(o){o.preventDefault();let t;jQuery(".wpforms-builder").length?t=jQuery("#wpforms-builder-form").data("id"):t=jQuery(this).data("form-id"),t&&s(t)})};jQuery(document).ready(function(){jQuery("#wpforms-builder-form").length&&c(),jQuery(".wpforms-table-container").length&&f()});
//# sourceMappingURL=wpforms-lite.min.D9kj0Pu9.js.map
