PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
jetpack / jetpack_vendor / automattic / jetpack-forms / dist / blocks / ai-form-plugin.js

ai-form-plugin.js in Jetpack – WP Security, Backup, Speed, & Growth 16.3, at jetpack_vendor/automattic/jetpack-forms/dist/blocks/ai-form-plugin.js

1 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";(globalThis.webpackChunk_automattic_jetpack_forms_blocks||=[]).push([[420],{30329(t,e,r){var a=r(94715),o=r(47143),s=r(43656),c=r(52619),n=r(27723),i=r(692),u=r(11435),l=r(82441);const __=n.__;async function f(t,e){if("jetpack/contact-form"!==e)return;const r=(0,o.select)(s.store);if(r.getCurrentPostType()===u.$8)return;const c=(0,o.select)(a.store),n=c.getBlock(t);if(!n||!n.innerBlocks?.length)return;if(n.attributes?.ref)return;const f=r.getCurrentPostId()||0,k=r.getEditedPostAttribute("title")||__("Generated Form","jetpack-forms");try{const e=await(0,l.r)({attributes:n.attributes,innerBlocks:n.innerBlocks},k,Number(f)||0);if(!e)return;const r=c.getBlock(t);if(!r||r.attributes?.ref)return;(0,o.dispatch)(a.store).updateBlockAttributes(t,{ref:e})}catch(t){console.error("Failed to create synced form:",t),(0,o.dispatch)(i.store).createErrorNotice(__("Failed to save the Generated form. Your form is still available but not synced.","jetpack-forms"),{type:"snackbar"})}}(0,c.hasAction)("jetpack_ai_assistant_generation_complete","jetpack-forms/ai-integration")||(0,c.addAction)("jetpack_ai_assistant_generation_complete","jetpack-forms/ai-integration",f)}},t=>{t(30329)}]);