File "view.min.js.map"
Full Path: /home/pumpbmko/public_html/wp-content/plugins/gutenberg/build/block-library/blocks/form/view.min.js.map
File size: 2.81 KB
MIME-type: application/json
Charset: utf-8
{"version":3,"file":"./build/block-library/blocks/form/view.min.js","mappings":"AAEAA,SAASC,iBAAkB,sBAAuBC,SAAS,SAAWC,GAErE,IAAOA,EAAKC,SAAYD,EAAKC,OAAOC,WAAY,WAC/C,OAGD,MAAMC,EAAyBC,IAC9B,MAAMC,EAAY,IAAIC,gBAAiBC,OAAOC,SAASC,QACvDJ,EAAUK,OAAQ,iBAAkBN,GACpCG,OAAOC,SAASC,OAASJ,EAAUM,UAAU,EAI9CX,EAAKY,iBAAkB,UAAUC,eAAiBC,GACjDA,EAAMC,iBAEN,MAAMC,EAAWC,OAAOC,YAAa,IAAIC,SAAUnB,GAAOoB,WAC1DJ,EAASK,WAAarB,EAAKC,OAC3Be,EAASM,YAAcC,oBAAoBC,MAC3CR,EAASf,OAASsB,oBAAoBtB,OACtCe,EAASS,iBAAmBlB,OAAOC,SAASkB,KAC5CV,EAASK,WAAarB,EAAKC,OAE3B,WACwB0B,MAAOJ,oBAAoBK,QAAS,CAC1DC,OAAQ,OACRC,QAAS,CACR,eAAgB,qCAEjBC,KAAM,IAAIzB,gBAAiBU,GAAWL,cAEzBqB,GACb7B,EAAsB,WAEtBA,EAAsB,QAExB,CAAE,MAAQ8B,GACT9B,EAAsB,QACvB,CACD,GACD","sources":["webpack://wp/./packages/block-library/build-module/form/@wordpress/block-library/src/form/view.js"],"sourcesContent":["// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable no-undef */\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form is not using the mailto: action.\n\tif ( ! form.action || ! form.action.startsWith( 'mailto:' ) ) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = wpBlockFormSettings.nonce;\n\t\tformData.action = wpBlockFormSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( wpBlockFormSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],"names":["document","querySelectorAll","forEach","form","action","startsWith","redirectNotification","status","urlParams","URLSearchParams","window","location","search","append","toString","addEventListener","async","event","preventDefault","formData","Object","fromEntries","FormData","entries","formAction","_ajax_nonce","wpBlockFormSettings","nonce","_wp_http_referer","href","fetch","ajaxUrl","method","headers","body","ok","error"],"sourceRoot":""}