1const maybeUploadFileToImageURL=(value)=>{if(typeof value!=="object"){return value} 2if(value.constructor.name!=="File"){return value} 3let isImage=value.type.startsWith("image");return{url:URL.createObjectURL(value),name:value.name,is_image:isImage,}};const allUploadFilesToImageURLs=(value)=>{if(!Array.isArray(value)){return maybeUploadFileToImageURL(value)} 4return value.map((v)=>maybeUploadFileToImageURL(v))};const getFields=(form)=>{let data=new FormData(form);let out={};for(let[k,v]of data.entries()){let matches=k.match(/^form_fields\[([^\]]+)\](.*)/);if(matches){let value;if(matches[2]==="[]"){value=data.getAll(k)}else{value=data.get(k)} 5value=allUploadFilesToImageURLs(value);let fieldName=matches[1];out[fieldName]=value}} 6return out};function renderLiveHTML(form,code){let formData=getFields(form);return Mustache.render(code,{form:formData})} 7window.renderLiveHTML=renderLiveHTML;function initializeLiveHtml(wrapper,widget){let div=wrapper.getElementsByTagName("div")[0];let form=widget.getElementsByTagName("form")[0];let code=div.dataset.code;let realTime=div.dataset.realTime==="yes";let onChange=()=>{div.innerHTML=renderLiveHTML(form,code)};onChange();form.addEventListener(realTime?"input":"change",onChange)} 8function initializeAllLiveHtmlFields($scope){$scope.find(".elementor-field-type-dce_live_html").each((_,w)=>initializeLiveHtml(w,$scope[0]))} 9jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/form.default",initializeAllLiveHtmlFields,)})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.