Contact Form by WPForms – Drag & Drop Form Builder for WordPress - Version 1.7.4.2

Version Description

  • Changed: DOMPurify library updated to 2.3.8.
  • Fixed: WordPress 6.0 compatibility - WPForms block styling fixed inside the Full Site Editor.
  • Fixed: Lite Connect: submitted form entries counting improved.
Download this release

Release Info

Developer slaFFik
Plugin Icon 128x128 Contact Form by WPForms – Drag & Drop Form Builder for WordPress
Version 1.7.4.2
Comparing to
See all releases

Code changes from version 1.7.4.1 to 1.7.4.2

assets/js/purify.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).DOMPurify=t()}(this,(function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,i=Object.freeze,a=Object.seal,l=Object.create,c="undefined"!=typeof Reflect&&Reflect,s=c.apply,u=c.construct;s||(s=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),a||(a=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var m,f=A(Array.prototype.forEach),d=A(Array.prototype.pop),p=A(Array.prototype.push),h=A(String.prototype.toLowerCase),g=A(String.prototype.match),y=A(String.prototype.replace),v=A(String.prototype.indexOf),b=A(String.prototype.trim),T=A(RegExp.prototype.test),N=(m=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(m,t)});function A(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(e,t,r)}}function E(e,r){t&&t(e,null);for(var o=r.length;o--;){var i=r[o];if("string"==typeof i){var a=h(i);a!==i&&(n(r)||(r[o]=a),i=a)}e[i]=!0}return e}function x(t){var n=l(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function w(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var k=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),S=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),D=i(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),C=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=i(["#text"]),L=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),R=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),I=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),U=a(/<%[\s\S]*|[\s\S]*%>/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),P=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),j=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=a(/^html$/i),q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Y(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var K=function(){return"undefined"==typeof window?null:window},V=function(e,t){if("object"!==(void 0===e?"undefined":q(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K(),n=function(t){return e(t)};if(n.version="2.3.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,l=t.HTMLTemplateElement,c=t.Node,s=t.Element,u=t.NodeFilter,m=t.NamedNodeMap,A=void 0===m?t.NamedNodeMap||t.MozNamedAttrMap:m,$=t.HTMLFormElement,X=t.DOMParser,Z=t.trustedTypes,J=s.prototype,Q=w(J,"cloneNode"),ee=w(J,"nextSibling"),te=w(J,"childNodes"),ne=w(J,"parentNode");if("function"==typeof l){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=V(Z,r),ie=oe?oe.createHTML(""):"",ae=o,le=ae.implementation,ce=ae.createNodeIterator,se=ae.createDocumentFragment,ue=ae.getElementsByTagName,me=r.importNode,fe={};try{fe=x(o).documentMode?o.documentMode:{}}catch(e){}var de={};n.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==fe;var pe=H,he=U,ge=z,ye=B,ve=j,be=G,Te=P,Ne=null,Ae=E({},[].concat(Y(k),Y(S),Y(_),Y(O),Y(M))),Ee=null,xe=E({},[].concat(Y(L),Y(R),Y(I),Y(F))),we=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Se=null,_e=!0,De=!0,Oe=!1,Ce=!1,Me=!1,Le=!1,Re=!1,Ie=!1,Fe=!1,He=!1,Ue=!0,ze=!0,Be=!1,Pe={},je=null,Ge=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),We=null,qe=E({},["audio","video","img","source","image","track"]),Ye=null,Ke=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",$e="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml",Ze=Xe,Je=!1,Qe=void 0,et=["application/xhtml+xml","text/html"],tt="text/html",nt=void 0,rt=null,ot=o.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},at=function(e){rt&&rt===e||(e&&"object"===(void 0===e?"undefined":q(e))||(e={}),e=x(e),Ne="ALLOWED_TAGS"in e?E({},e.ALLOWED_TAGS):Ae,Ee="ALLOWED_ATTR"in e?E({},e.ALLOWED_ATTR):xe,Ye="ADD_URI_SAFE_ATTR"in e?E(x(Ke),e.ADD_URI_SAFE_ATTR):Ke,We="ADD_DATA_URI_TAGS"in e?E(x(qe),e.ADD_DATA_URI_TAGS):qe,je="FORBID_CONTENTS"in e?E({},e.FORBID_CONTENTS):Ge,ke="FORBID_TAGS"in e?E({},e.FORBID_TAGS):{},Se="FORBID_ATTR"in e?E({},e.FORBID_ATTR):{},Pe="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,De=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.SAFE_FOR_TEMPLATES||!1,Me=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,Te=e.ALLOWED_URI_REGEXP||Te,Ze=e.NAMESPACE||Xe,e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe=Qe=-1===et.indexOf(e.PARSER_MEDIA_TYPE)?tt:e.PARSER_MEDIA_TYPE,nt="application/xhtml+xml"===Qe?function(e){return e}:h,Ce&&(De=!1),Fe&&(Ie=!0),Pe&&(Ne=E({},[].concat(Y(M))),Ee=[],!0===Pe.html&&(E(Ne,k),E(Ee,L)),!0===Pe.svg&&(E(Ne,S),E(Ee,R),E(Ee,F)),!0===Pe.svgFilters&&(E(Ne,_),E(Ee,R),E(Ee,F)),!0===Pe.mathMl&&(E(Ne,O),E(Ee,I),E(Ee,F))),e.ADD_TAGS&&(Ne===Ae&&(Ne=x(Ne)),E(Ne,e.ADD_TAGS)),e.ADD_ATTR&&(Ee===xe&&(Ee=x(Ee)),E(Ee,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&E(Ye,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(je===Ge&&(je=x(je)),E(je,e.FORBID_CONTENTS)),ze&&(Ne["#text"]=!0),Me&&E(Ne,["html","head","body"]),Ne.table&&(E(Ne,["tbody"]),delete ke.tbody),i&&i(e),rt=e)},lt=E({},["mi","mo","mn","ms","mtext"]),ct=E({},["foreignobject","desc","title","annotation-xml"]),st=E({},S);E(st,_),E(st,D);var ut=E({},O);E(ut,C);var mt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Xe,tagName:"template"});var n=h(e.tagName),r=h(t.tagName);if(e.namespaceURI===$e)return t.namespaceURI===Xe?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(st[n]);if(e.namespaceURI===Ve)return t.namespaceURI===Xe?"math"===n:t.namespaceURI===$e?"math"===n&&ct[r]:Boolean(ut[n]);if(e.namespaceURI===Xe){if(t.namespaceURI===$e&&!ct[r])return!1;if(t.namespaceURI===Ve&&!lt[r])return!1;var o=E({},["title","style","font","a","script"]);return!ut[n]&&(o[n]||!st[n])}return!1},ft=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},dt=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ee[e])if(Ie||Fe)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},pt=function(e){var t=void 0,n=void 0;if(Re)e="<remove></remove>"+e;else{var r=g(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(Ze===Xe)try{t=(new X).parseFromString(i,Qe)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=Je?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),Ze===Xe?ue.call(t,Me?"html":"body")[0]:Me?t.documentElement:a},ht=function(e){return ce.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},gt=function(e){return e instanceof $&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof A)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},yt=function(e){return"object"===(void 0===c?"undefined":q(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":q(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},vt=function(e,t,r){de[e]&&f(de[e],(function(e){e.call(n,t,r,rt)}))},bt=function(e){var t=void 0;if(vt("beforeSanitizeElements",e,null),gt(e))return ft(e),!0;if(g(e.nodeName,/[\u0080-\uFFFF]/))return ft(e),!0;var r=nt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:Ne}),!yt(e.firstElementChild)&&(!yt(e.content)||!yt(e.content.firstElementChild))&&T(/<[/\w]/g,e.innerHTML)&&T(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===r&&T(/<template/i,e.innerHTML))return ft(e),!0;if(!Ne[r]||ke[r]){if(!ke[r]&&Nt(r)){if(we.tagNameCheck instanceof RegExp&&T(we.tagNameCheck,r))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(r))return!1}if(ze&&!je[r]){var o=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(Q(i[a],!0),ee(e))}return ft(e),!0}return e instanceof s&&!mt(e)?(ft(e),!0):"noscript"!==r&&"noembed"!==r||!T(/<\/no(script|embed)/i,e.innerHTML)?(Ce&&3===e.nodeType&&(t=e.textContent,t=y(t,pe," "),t=y(t,he," "),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(ft(e),!0)},Tt=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in o||n in ot))return!1;if(De&&!Se[t]&&T(ge,t));else if(_e&&T(ye,t));else if(!Ee[t]||Se[t]){if(!(Nt(e)&&(we.tagNameCheck instanceof RegExp&&T(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&T(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&T(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ye[t]);else if(T(Te,y(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!We[e]){if(Oe&&!T(ve,y(n,be,"")));else if(n)return!1}else;return!0},Nt=function(e){return e.indexOf("-")>0},At=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;vt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(i=a.length;i--;){var c=t=a[i],s=c.name,u=c.namespaceURI;if(r=b(t.value),o=nt(s),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(dt(s,e),l.keepAttr))if(T(/\/>/i,r))dt(s,e);else{Ce&&(r=y(r,pe," "),r=y(r,he," "));var m=nt(e.nodeName);if(Tt(m,o,r))try{u?e.setAttributeNS(u,s,r):e.setAttribute(s,r),d(n.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)}},Et=function e(t){var n=void 0,r=ht(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof a&&e(n.content),At(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var i=void 0,l=void 0,s=void 0,u=void 0,m=void 0;if((Je=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)){if("function"!=typeof e.toString)throw N("toString is not a function");if("string"!=typeof(e=e.toString()))throw N("dirty is not a string, aborting")}if(!n.isSupported){if("object"===q(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(yt(e))return t.toStaticHTML(e.outerHTML)}return e}if(Le||at(o),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){var f=nt(e.nodeName);if(!Ne[f]||ke[f])throw N("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)1===(l=(i=pt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!Ie&&!Ce&&!Me&&-1===e.indexOf("<"))return oe&&He?oe.createHTML(e):e;if(!(i=pt(e)))return Ie?null:He?ie:""}i&&Re&&ft(i.firstChild);for(var d=ht(Be?e:i);s=d.nextNode();)3===s.nodeType&&s===u||bt(s)||(s.content instanceof a&&Et(s.content),At(s),u=s);if(u=null,Be)return e;if(Ie){if(Fe)for(m=se.call(i.ownerDocument);i.firstChild;)m.appendChild(i.firstChild);else m=i;return Ee.shadowroot&&(m=me.call(r,m,!0)),m}var p=Me?i.outerHTML:i.innerHTML;return Me&&Ne["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&T(W,i.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+p),Ce&&(p=y(p,pe," "),p=y(p,he," ")),oe&&He?oe.createHTML(p):p},n.setConfig=function(e){at(e),Le=!0},n.clearConfig=function(){rt=null,Le=!1},n.isValidAttribute=function(e,t,n){rt||at({});var r=nt(e),o=nt(t);return Tt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(de[e]=de[e]||[],p(de[e],t))},n.removeHook=function(e){de[e]&&d(de[e])},n.removeHooks=function(e){de[e]&&(de[e]=[])},n.removeAllHooks=function(){de={}},n}()}));
1
+ /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,a){return(r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var a=new(Function.bind.apply(e,o));return r&&t(a,r.prototype),a}).apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var i=Object.hasOwnProperty,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,s=Object.getOwnPropertyDescriptor,m=Object.freeze,f=Object.seal,p=Object.create,d="undefined"!=typeof Reflect&&Reflect,h=d.apply,g=d.construct;h||(h=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),f||(f=function(e){return e}),g||(g=function(e,t){return r(e,o(t))});var y,b=_(Array.prototype.forEach),v=_(Array.prototype.pop),T=_(Array.prototype.push),N=_(String.prototype.toLowerCase),E=_(String.prototype.match),A=_(String.prototype.replace),w=_(String.prototype.indexOf),x=_(String.prototype.trim),k=_(RegExp.prototype.test),S=(y=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(y,t)});function _(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return h(e,t,r)}}function O(e,t){l&&l(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=N(r);o!==r&&(c(t)||(t[n]=o),r=o)}e[r]=!0}return e}function D(e){var t,n=p(null);for(t in e)h(i,e,[t])&&(n[t]=e[t]);return n}function C(e,t){for(;null!==e;){var n=s(e,t);if(n){if(n.get)return _(n.get);if("function"==typeof n.value)return _(n.value)}e=u(e)}return function(e){return console.warn("fallback value for",e),null}}var M=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),R=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),F=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=m(["#text"]),z=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),B=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),P=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G=f(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=f(/<%[\w\W]*|[\w\W]*%>/gm),q=f(/^data-[\-\w.\u00B7-\uFFFF]/),Y=f(/^aria-[\-\w]+$/),K=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=f(/^(?:\w+script|data):/i),$=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=f(/^html$/i),Z=function(){return"undefined"==typeof window?null:window},J=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z(),r=function(e){return t(e)};if(r.version="2.3.8",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var a=n.document,i=n.document,l=n.DocumentFragment,c=n.HTMLTemplateElement,u=n.Node,s=n.Element,f=n.NodeFilter,p=n.NamedNodeMap,d=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,h=n.HTMLFormElement,g=n.DOMParser,y=n.trustedTypes,_=s.prototype,Q=C(_,"cloneNode"),ee=C(_,"nextSibling"),te=C(_,"childNodes"),ne=C(_,"parentNode");if("function"==typeof c){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var oe=J(y,a),ae=oe?oe.createHTML(""):"",ie=i,le=ie.implementation,ce=ie.createNodeIterator,ue=ie.createDocumentFragment,se=ie.getElementsByTagName,me=a.importNode,fe={};try{fe=D(i).documentMode?i.documentMode:{}}catch(e){}var pe={};r.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==fe;var de,he,ge=G,ye=W,be=q,ve=Y,Te=V,Ne=$,Ee=K,Ae=null,we=O({},[].concat(o(M),o(R),o(L),o(F),o(U))),xe=null,ke=O({},[].concat(o(z),o(B),o(j),o(P))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Oe=null,De=!0,Ce=!0,Me=!1,Re=!1,Le=!1,Ie=!1,Fe=!1,He=!1,Ue=!1,ze=!1,Be=!0,je=!0,Pe=!1,Ge={},We=null,qe=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ye=null,Ke=O({},["audio","video","img","source","image","track"]),Ve=null,$e=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml",Qe=Je,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,ot=i.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},it=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=D(t),Ae="ALLOWED_TAGS"in t?O({},t.ALLOWED_TAGS):we,xe="ALLOWED_ATTR"in t?O({},t.ALLOWED_ATTR):ke,Ve="ADD_URI_SAFE_ATTR"in t?O(D($e),t.ADD_URI_SAFE_ATTR):$e,Ye="ADD_DATA_URI_TAGS"in t?O(D(Ke),t.ADD_DATA_URI_TAGS):Ke,We="FORBID_CONTENTS"in t?O({},t.FORBID_CONTENTS):qe,_e="FORBID_TAGS"in t?O({},t.FORBID_TAGS):{},Oe="FORBID_ATTR"in t?O({},t.FORBID_ATTR):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Ce=!1!==t.ALLOW_DATA_ATTR,Me=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=t.SAFE_FOR_TEMPLATES||!1,Le=t.WHOLE_DOCUMENT||!1,He=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,ze=t.RETURN_TRUSTED_TYPE||!1,Fe=t.FORCE_BODY||!1,Be=!1!==t.SANITIZE_DOM,je=!1!==t.KEEP_CONTENT,Pe=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,Qe=t.NAMESPACE||Je,t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de=de=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===de?function(e){return e}:N,Re&&(Ce=!1),Ue&&(He=!0),Ge&&(Ae=O({},o(U)),xe=[],!0===Ge.html&&(O(Ae,M),O(xe,z)),!0===Ge.svg&&(O(Ae,R),O(xe,B),O(xe,P)),!0===Ge.svgFilters&&(O(Ae,L),O(xe,B),O(xe,P)),!0===Ge.mathMl&&(O(Ae,F),O(xe,j),O(xe,P))),t.ADD_TAGS&&(Ae===we&&(Ae=D(Ae)),O(Ae,t.ADD_TAGS)),t.ADD_ATTR&&(xe===ke&&(xe=D(xe)),O(xe,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&O(Ve,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(We===qe&&(We=D(We)),O(We,t.FORBID_CONTENTS)),je&&(Ae["#text"]=!0),Le&&O(Ae,["html","head","body"]),Ae.table&&(O(Ae,["tbody"]),delete _e.tbody),m&&m(t),rt=t)},lt=O({},["mi","mo","mn","ms","mtext"]),ct=O({},["foreignobject","desc","title","annotation-xml"]),ut=O({},["title","style","font","a","script"]),st=O({},R);O(st,L),O(st,I);var mt=O({},F);O(mt,H);var ft=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});var n=N(e.tagName),r=N(t.tagName);return e.namespaceURI===Ze?t.namespaceURI===Je?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(st[n]):e.namespaceURI===Xe?t.namespaceURI===Je?"math"===n:t.namespaceURI===Ze?"math"===n&&ct[r]:Boolean(mt[n]):e.namespaceURI===Je&&(!(t.namespaceURI===Ze&&!ct[r])&&(!(t.namespaceURI===Xe&&!lt[r])&&(!mt[n]&&(ut[n]||!st[n]))))},pt=function(e){T(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},dt=function(e,t){try{T(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){T(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(He||Ue)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){var t,n;if(Fe)e="<remove></remove>"+e;else{var r=E(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(Qe===Je)try{t=(new g).parseFromString(o,de)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?"":o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Qe===Je?se.call(t,Le?"html":"body")[0]:Le?t.documentElement:a},gt=function(e){return ce.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},yt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},bt=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},vt=function(e,t,n){pe[e]&&b(pe[e],(function(e){e.call(r,t,n,rt)}))},Tt=function(e){var t;if(vt("beforeSanitizeElements",e,null),yt(e))return pt(e),!0;if(k(/[\u0080-\uFFFF]/,e.nodeName))return pt(e),!0;var n=he(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:n,allowedTags:Ae}),e.hasChildNodes()&&!bt(e.firstElementChild)&&(!bt(e.content)||!bt(e.content.firstElementChild))&&k(/<[/\w]/g,e.innerHTML)&&k(/<[/\w]/g,e.textContent))return pt(e),!0;if("select"===n&&k(/<template/i,e.innerHTML))return pt(e),!0;if(!Ae[n]||_e[n]){if(!_e[n]&&Et(n)){if(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))return!1}if(je&&!We[n]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(Q(a[i],!0),ee(e))}return pt(e),!0}return e instanceof s&&!ft(e)?(pt(e),!0):"noscript"!==n&&"noembed"!==n||!k(/<\/no(script|embed)/i,e.innerHTML)?(Re&&3===e.nodeType&&(t=e.textContent,t=A(t,ge," "),t=A(t,ye," "),e.textContent!==t&&(T(r.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(pt(e),!0)},Nt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in i||n in ot))return!1;if(Ce&&!Oe[t]&&k(be,t));else if(De&&k(ve,t));else if(!xe[t]||Oe[t]){if(!(Et(e)&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&k(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Ve[t]);else if(k(Ee,A(n,Ne,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(n,"data:")||!Ye[e]){if(Me&&!k(Te,A(n,Ne,"")));else if(n)return!1}else;return!0},Et=function(e){return e.indexOf("-")>0},At=function(e){var t,n,o,a;vt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(a=i.length;a--;){var c=t=i[a],u=c.name,s=c.namespaceURI;if(n="value"===u?t.value:x(t.value),o=he(u),l.attrName=o,l.attrValue=n,l.keepAttr=!0,l.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,l),n=l.attrValue,!l.forceKeepAttr&&(dt(u,e),l.keepAttr))if(k(/\/>/i,n))dt(u,e);else{Re&&(n=A(n,ge," "),n=A(n,ye," "));var m=he(e.nodeName);if(Nt(m,o,n))try{s?e.setAttributeNS(s,u,n):e.setAttribute(u,n),v(r.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)}},wt=function e(t){var n,r=gt(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),Tt(n)||(n.content instanceof l&&e(n.content),At(n));vt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t,o){var i,c,s,m,f;if((et=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!bt(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(bt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Ie||it(o),r.removed=[],"string"==typeof t&&(Pe=!1),Pe){if(t.nodeName){var p=he(t.nodeName);if(!Ae[p]||_e[p])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(c=(i=ht("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?i=c:i.appendChild(c);else{if(!He&&!Re&&!Le&&-1===t.indexOf("<"))return oe&&ze?oe.createHTML(t):t;if(!(i=ht(t)))return He?null:ze?ae:""}i&&Fe&&pt(i.firstChild);for(var d=gt(Pe?t:i);s=d.nextNode();)3===s.nodeType&&s===m||Tt(s)||(s.content instanceof l&&wt(s.content),At(s),m=s);if(m=null,Pe)return t;if(He){if(Ue)for(f=ue.call(i.ownerDocument);i.firstChild;)f.appendChild(i.firstChild);else f=i;return xe.shadowroot&&(f=me.call(a,f,!0)),f}var h=Le?i.outerHTML:i.innerHTML;return Le&&Ae["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&k(X,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),Re&&(h=A(h,ge," "),h=A(h,ye," ")),oe&&ze?oe.createHTML(h):h},r.setConfig=function(e){it(e),Ie=!0},r.clearConfig=function(){rt=null,Ie=!1},r.isValidAttribute=function(e,t,n){rt||it({});var r=he(e),o=he(t);return Nt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],T(pe[e],t))},r.removeHook=function(e){if(pe[e])return v(pe[e])},r.removeHooks=function(e){pe[e]&&(pe[e]=[])},r.removeAllHooks=function(){pe={}},r}()}));
assets/languages/wpforms-lite.pot CHANGED
@@ -1,13 +1,13 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WPForms Lite 1.7.4.1\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpforms-lite\n"
5
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
6
  "Language-Team: LANGUAGE <LL@li.org>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2022-05-05T12:49:49+03:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.6.0\n"
13
  "X-Domain: wpforms-lite\n"
@@ -24,7 +24,7 @@ msgstr ""
24
  #: src/Integrations/Divi/Divi.php:207
25
  #: src/Integrations/Divi/WPFormsSelector.php:35
26
  #: src/Integrations/Elementor/Widget.php:41
27
- #: src/Integrations/Gutenberg/FormSelector.php:91
28
  #: src/Lite/Admin/DashboardWidget.php:173
29
  #: templates/admin/dashboard/widget/settings.php:42
30
  msgid "WPForms"
@@ -182,7 +182,7 @@ msgstr ""
182
  #: includes/admin/admin.php:177
183
  #: includes/admin/builder/class-builder.php:540
184
  #: src/Admin/Education/Builder/Captcha.php:156
185
- #: src/Integrations/Gutenberg/FormSelector.php:104
186
  #: wpforms.php:152
187
  msgid "Heads up!"
188
  msgstr ""
@@ -4874,7 +4874,7 @@ msgstr ""
4874
  #: src/Integrations/Divi/WPFormsSelector.php:60
4875
  #: src/Integrations/Elementor/Widget.php:115
4876
  #: src/Integrations/Elementor/Widget.php:143
4877
- #: src/Integrations/Gutenberg/FormSelector.php:101
4878
  #: templates/emails/summary-body-plain.php:32
4879
  #: templates/emails/summary-body.php:59
4880
  msgid "Form"
@@ -6756,12 +6756,12 @@ msgid "Select form"
6756
  msgstr ""
6757
 
6758
  #: src/Integrations/Divi/WPFormsSelector.php:67
6759
- #: src/Integrations/Gutenberg/FormSelector.php:102
6760
  msgid "Show Title"
6761
  msgstr ""
6762
 
6763
  #: src/Integrations/Divi/WPFormsSelector.php:77
6764
- #: src/Integrations/Gutenberg/FormSelector.php:103
6765
  msgid "Show Description"
6766
  msgstr ""
6767
 
@@ -6797,39 +6797,39 @@ msgstr ""
6797
  msgid "Select a form"
6798
  msgstr ""
6799
 
6800
- #: src/Integrations/Gutenberg/FormSelector.php:92
6801
  msgid "Select and display one of your forms."
6802
  msgstr ""
6803
 
6804
- #: src/Integrations/Gutenberg/FormSelector.php:94
6805
  msgid "form"
6806
  msgstr ""
6807
 
6808
- #: src/Integrations/Gutenberg/FormSelector.php:95
6809
  msgid "contact"
6810
  msgstr ""
6811
 
6812
- #: src/Integrations/Gutenberg/FormSelector.php:96
6813
  msgid "survey"
6814
  msgstr ""
6815
 
6816
- #: src/Integrations/Gutenberg/FormSelector.php:99
6817
  msgid "Select a Form"
6818
  msgstr ""
6819
 
6820
- #: src/Integrations/Gutenberg/FormSelector.php:100
6821
  msgid "Form Settings"
6822
  msgstr ""
6823
 
6824
- #: src/Integrations/Gutenberg/FormSelector.php:105
6825
  msgid "Do not forget to test your form."
6826
  msgstr ""
6827
 
6828
- #: src/Integrations/Gutenberg/FormSelector.php:106
6829
  msgid "Check out our complete guide!"
6830
  msgstr ""
6831
 
6832
- #: src/Integrations/Gutenberg/FormSelector.php:253
6833
  msgid "The form cannot be displayed."
6834
  msgstr ""
6835
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WPForms Lite 1.7.4.2\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpforms-lite\n"
5
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
6
  "Language-Team: LANGUAGE <LL@li.org>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2022-05-19T14:30:17+03:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.6.0\n"
13
  "X-Domain: wpforms-lite\n"
24
  #: src/Integrations/Divi/Divi.php:207
25
  #: src/Integrations/Divi/WPFormsSelector.php:35
26
  #: src/Integrations/Elementor/Widget.php:41
27
+ #: src/Integrations/Gutenberg/FormSelector.php:136
28
  #: src/Lite/Admin/DashboardWidget.php:173
29
  #: templates/admin/dashboard/widget/settings.php:42
30
  msgid "WPForms"
182
  #: includes/admin/admin.php:177
183
  #: includes/admin/builder/class-builder.php:540
184
  #: src/Admin/Education/Builder/Captcha.php:156
185
+ #: src/Integrations/Gutenberg/FormSelector.php:149
186
  #: wpforms.php:152
187
  msgid "Heads up!"
188
  msgstr ""
4874
  #: src/Integrations/Divi/WPFormsSelector.php:60
4875
  #: src/Integrations/Elementor/Widget.php:115
4876
  #: src/Integrations/Elementor/Widget.php:143
4877
+ #: src/Integrations/Gutenberg/FormSelector.php:146
4878
  #: templates/emails/summary-body-plain.php:32
4879
  #: templates/emails/summary-body.php:59
4880
  msgid "Form"
6756
  msgstr ""
6757
 
6758
  #: src/Integrations/Divi/WPFormsSelector.php:67
6759
+ #: src/Integrations/Gutenberg/FormSelector.php:147
6760
  msgid "Show Title"
6761
  msgstr ""
6762
 
6763
  #: src/Integrations/Divi/WPFormsSelector.php:77
6764
+ #: src/Integrations/Gutenberg/FormSelector.php:148
6765
  msgid "Show Description"
6766
  msgstr ""
6767
 
6797
  msgid "Select a form"
6798
  msgstr ""
6799
 
6800
+ #: src/Integrations/Gutenberg/FormSelector.php:137
6801
  msgid "Select and display one of your forms."
6802
  msgstr ""
6803
 
6804
+ #: src/Integrations/Gutenberg/FormSelector.php:139
6805
  msgid "form"
6806
  msgstr ""
6807
 
6808
+ #: src/Integrations/Gutenberg/FormSelector.php:140
6809
  msgid "contact"
6810
  msgstr ""
6811
 
6812
+ #: src/Integrations/Gutenberg/FormSelector.php:141
6813
  msgid "survey"
6814
  msgstr ""
6815
 
6816
+ #: src/Integrations/Gutenberg/FormSelector.php:144
6817
  msgid "Select a Form"
6818
  msgstr ""
6819
 
6820
+ #: src/Integrations/Gutenberg/FormSelector.php:145
6821
  msgid "Form Settings"
6822
  msgstr ""
6823
 
6824
+ #: src/Integrations/Gutenberg/FormSelector.php:150
6825
  msgid "Do not forget to test your form."
6826
  msgstr ""
6827
 
6828
+ #: src/Integrations/Gutenberg/FormSelector.php:151
6829
  msgid "Check out our complete guide!"
6830
  msgstr ""
6831
 
6832
+ #: src/Integrations/Gutenberg/FormSelector.php:311
6833
  msgid "The form cannot be displayed."
6834
  msgstr ""
6835
 
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  == Changelog ==
2
 
 
 
 
 
 
3
  = 1.7.4.1 =
4
  - Fixed: LiteConnect auth key request didn't work with plain permalinks and with subdirectory install.
5
  - Fixed: Form Locations compatibility with the Full Site Editor template parts.
1
  == Changelog ==
2
 
3
+ = 1.7.4.2 =
4
+ - Changed: DOMPurify library updated to 2.3.8.
5
+ - Fixed: WordPress 6.0 compatibility - WPForms block styling fixed inside the Full Site Editor.
6
+ - Fixed: Lite Connect: submitted form entries counting improved.
7
+
8
  = 1.7.4.1 =
9
  - Fixed: LiteConnect auth key request didn't work with plain permalinks and with subdirectory install.
10
  - Fixed: Form Locations compatibility with the Full Site Editor template parts.
includes/admin/builder/class-builder.php CHANGED
@@ -441,7 +441,7 @@ class WPForms_Builder {
441
  'dom-purify',
442
  WPFORMS_PLUGIN_URL . 'assets/js/purify.min.js',
443
  [],
444
- '2.3.6'
445
  );
446
 
447
  if ( wp_is_mobile() ) {
441
  'dom-purify',
442
  WPFORMS_PLUGIN_URL . 'assets/js/purify.min.js',
443
  [],
444
+ '2.3.8'
445
  );
446
 
447
  if ( wp_is_mobile() ) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpforms, jaredatch, smub, slaFFik
3
  Tags: contact form, contact form plugin, forms, form builder, custom form, contact button, contact me, custom contact form, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form, feedback
4
  Requires at least: 5.2
5
  Tested up to: 6.0
6
- Stable tag: 1.7.4.1
7
  Requires PHP: 5.6
8
  License: GNU General Public License v2.0 or later
9
 
@@ -427,6 +427,11 @@ Syed Balkhi
427
 
428
  == Changelog ==
429
 
 
 
 
 
 
430
  = 1.7.4.1 =
431
  - Fixed: LiteConnect auth key request didn't work with plain permalinks and with subdirectory install.
432
  - Fixed: Form Locations compatibility with the Full Site Editor template parts.
3
  Tags: contact form, contact form plugin, forms, form builder, custom form, contact button, contact me, custom contact form, form manager, form, forms builder, forms creator, captcha, recaptcha, Akismet, email form, web form, feedback form, payment form, survey form, donation form, email submit form, message form, mailchimp, mailchimp form, aweber, aweber form, paypal, paypal form, stripe, stripe form, getresponse, getresponse form, email subscription, contact form widget, user registration form, wordpress registration, wordpress login form, feedback
4
  Requires at least: 5.2
5
  Tested up to: 6.0
6
+ Stable tag: 1.7.4.2
7
  Requires PHP: 5.6
8
  License: GNU General Public License v2.0 or later
9
 
427
 
428
  == Changelog ==
429
 
430
+ = 1.7.4.2 =
431
+ - Changed: DOMPurify library updated to 2.3.8.
432
+ - Fixed: WordPress 6.0 compatibility - WPForms block styling fixed inside the Full Site Editor.
433
+ - Fixed: Lite Connect: submitted form entries counting improved.
434
+
435
  = 1.7.4.1 =
436
  - Fixed: LiteConnect auth key request didn't work with plain permalinks and with subdirectory install.
437
  - Fixed: Form Locations compatibility with the Full Site Editor template parts.
src/Integrations/Gutenberg/FormSelector.php CHANGED
@@ -69,10 +69,19 @@ class FormSelector implements IntegrationInterface {
69
  ],
70
  ];
71
 
 
 
72
  register_block_type(
73
  'wpforms/form-selector',
74
  [
75
- 'attributes' => \apply_filters( 'wpforms_gutenberg_form_selector_attributes', $attributes ),
 
 
 
 
 
 
 
76
  'style' => $block_style,
77
  'editor_style' => 'wpforms-integrations',
78
  'render_callback' => [ $this, 'get_form_html' ],
@@ -81,43 +90,25 @@ class FormSelector implements IntegrationInterface {
81
  }
82
 
83
  /**
84
- * Load WPForms Gutenberg block scripts.
85
  *
86
- * @since 1.4.8
87
  */
88
- public function enqueue_block_editor_assets() {
89
 
90
- $i18n = [
91
- 'title' => \esc_html__( 'WPForms', 'wpforms-lite' ),
92
- 'description' => \esc_html__( 'Select and display one of your forms.', 'wpforms-lite' ),
93
- 'form_keywords' => [
94
- \esc_html__( 'form', 'wpforms-lite' ),
95
- \esc_html__( 'contact', 'wpforms-lite' ),
96
- \esc_html__( 'survey', 'wpforms-lite' ),
97
- 'the dude',
98
- ],
99
- 'form_select' => \esc_html__( 'Select a Form', 'wpforms-lite' ),
100
- 'form_settings' => \esc_html__( 'Form Settings', 'wpforms-lite' ),
101
- 'form_selected' => \esc_html__( 'Form', 'wpforms-lite' ),
102
- 'show_title' => \esc_html__( 'Show Title', 'wpforms-lite' ),
103
- 'show_description' => \esc_html__( 'Show Description', 'wpforms-lite' ),
104
- 'panel_notice_head' => \esc_html__( 'Heads up!', 'wpforms-lite' ),
105
- 'panel_notice_text' => \esc_html__( 'Do not forget to test your form.', 'wpforms-lite' ),
106
- 'panel_notice_link' => \esc_html__( 'Check out our complete guide!', 'wpforms-lite' ),
107
- ];
108
 
109
- if ( version_compare( $GLOBALS['wp_version'], '5.1.1', '<=' ) ) {
110
- array_pop( $i18n['form_keywords'] );
111
- }
112
-
113
- $min = wpforms_get_min_suffix();
 
 
114
 
115
- wp_enqueue_style(
116
- 'wpforms-integrations',
117
- WPFORMS_PLUGIN_URL . "assets/css/admin-integrations{$min}.css",
118
- [],
119
- WPFORMS_VERSION
120
- );
121
 
122
  $disable_css_setting = (int) wpforms_setting( 'disable-css', '1' );
123
 
@@ -128,10 +119,43 @@ class FormSelector implements IntegrationInterface {
128
  wp_register_style(
129
  'wpforms-gutenberg-form-selector',
130
  WPFORMS_PLUGIN_URL . "assets/css/wpforms-{$css_file}{$min}.css",
131
- [ 'wp-edit-blocks', 'wpforms-integrations' ],
132
  WPFORMS_VERSION
133
  );
134
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  wp_enqueue_script(
137
  'wpforms-gutenberg-form-selector',
@@ -145,7 +169,7 @@ class FormSelector implements IntegrationInterface {
145
  $forms = wpforms()->form->get( '', [ 'order' => 'DESC' ] );
146
  $forms = ! empty( $forms ) ? $forms : [];
147
  $forms = array_map(
148
- function( $form ) {
149
 
150
  $form->post_title = htmlspecialchars_decode( $form->post_title, ENT_QUOTES );
151
 
@@ -160,7 +184,7 @@ class FormSelector implements IntegrationInterface {
160
  [
161
  'logo_url' => WPFORMS_PLUGIN_URL . 'assets/images/sullie-alt.png',
162
  'block_preview_url' => WPFORMS_PLUGIN_URL . 'assets/images/integrations/gutenberg/block-preview.png',
163
- 'wpnonce' => \wp_create_nonce( 'wpforms-gutenberg-form-selector' ),
164
  'forms' => $forms,
165
  'i18n' => $i18n,
166
  ]
@@ -176,21 +200,21 @@ class FormSelector implements IntegrationInterface {
176
  *
177
  * @return string
178
  */
179
- public function get_form_html( $attr ) {
180
 
181
- $id = ! empty( $attr['formId'] ) ? \absint( $attr['formId'] ) : 0;
182
 
183
  if ( empty( $id ) ) {
184
  return '';
185
  }
186
 
187
- $title = ! empty( $attr['displayTitle'] ) ? true : false;
188
- $desc = ! empty( $attr['displayDesc'] ) ? true : false;
189
 
190
  // Disable form fields if called from the Gutenberg editor.
191
  if ( $this->is_gb_editor() ) {
192
 
193
- \add_filter(
194
  'wpforms_frontend_container_class',
195
  function ( $classes ) {
196
  $classes[] = 'wpforms-gutenberg-form-selector';
@@ -199,14 +223,14 @@ class FormSelector implements IntegrationInterface {
199
  return $classes;
200
  }
201
  );
202
- \add_action(
203
  'wpforms_frontend_output',
204
  function () {
205
  echo '<fieldset disabled>';
206
  },
207
  3
208
  );
209
- \add_action(
210
  'wpforms_frontend_output',
211
  function () {
212
  echo '</fieldset>';
@@ -216,7 +240,7 @@ class FormSelector implements IntegrationInterface {
216
  }
217
 
218
  if ( ! empty( $attr['className'] ) ) {
219
- \add_filter(
220
  'wpforms_frontend_container_class',
221
  function ( $classes ) use ( $attr ) {
222
  $cls = array_map( 'esc_attr', explode( ' ', $attr['className'] ) );
@@ -226,34 +250,78 @@ class FormSelector implements IntegrationInterface {
226
  );
227
  }
228
 
229
- \ob_start();
230
-
231
- \do_action( 'wpforms_gutenberg_block_before' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  if ( $this->is_gb_editor() ) {
234
  wpforms_display(
235
  $id,
236
- apply_filters( 'wpforms_gutenberg_block_form_title', $title, $id ),
237
- apply_filters( 'wpforms_gutenberg_block_form_desc', $desc, $id )
238
  );
239
  } else {
240
  printf(
241
  '[wpforms id="%s" title="%d" description="%d"]',
242
- absint( $id ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
243
- apply_filters( 'wpforms_gutenberg_block_form_title', $title, $id ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
244
- apply_filters( 'wpforms_gutenberg_block_form_desc', $desc, $id ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
245
  );
246
  }
247
 
248
- \do_action( 'wpforms_gutenberg_block_after' );
 
 
 
 
 
249
 
250
- $content = \ob_get_clean();
251
 
252
  if ( empty( $content ) ) {
253
- $content = '<div class="components-placeholder"><div class="components-placeholder__label"></div><div class="components-placeholder__fieldset">' . \esc_html__( 'The form cannot be displayed.', 'wpforms-lite' ) . '</div></div>';
 
 
 
254
  }
255
 
256
- return \apply_filters( 'wpforms_gutenberg_block_form_content', $content, $id );
 
 
 
 
 
 
 
 
 
257
  }
258
 
259
  /**
@@ -266,6 +334,7 @@ class FormSelector implements IntegrationInterface {
266
  public function is_gb_editor() {
267
 
268
  // TODO: Find a better way to check if is GB editor API call.
269
- return \defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context']; // phpcs:ignore
 
270
  }
271
  }
69
  ],
70
  ];
71
 
72
+ $this->register_styles();
73
+
74
  register_block_type(
75
  'wpforms/form-selector',
76
  [
77
+ /**
78
+ * Modify wpforms block attributes.
79
+ *
80
+ * @since 1.5.8.2
81
+ *
82
+ * @param array $attributes Attributes.
83
+ */
84
+ 'attributes' => apply_filters( 'wpforms_gutenberg_form_selector_attributes', $attributes ), // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
85
  'style' => $block_style,
86
  'editor_style' => 'wpforms-integrations',
87
  'render_callback' => [ $this, 'get_form_html' ],
90
  }
91
 
92
  /**
93
+ * Register WPForms Gutenberg block styles.
94
  *
95
+ * @since 1.7.4.2
96
  */
97
+ protected function register_styles() {
98
 
99
+ $min = wpforms_get_min_suffix();
100
+ $deps = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
+ if ( is_admin() ) {
103
+ wp_register_style(
104
+ 'wpforms-integrations',
105
+ WPFORMS_PLUGIN_URL . "assets/css/admin-integrations{$min}.css",
106
+ [],
107
+ WPFORMS_VERSION
108
+ );
109
 
110
+ $deps = [ 'wp-edit-blocks', 'wpforms-integrations' ];
111
+ }
 
 
 
 
112
 
113
  $disable_css_setting = (int) wpforms_setting( 'disable-css', '1' );
114
 
119
  wp_register_style(
120
  'wpforms-gutenberg-form-selector',
121
  WPFORMS_PLUGIN_URL . "assets/css/wpforms-{$css_file}{$min}.css",
122
+ $deps,
123
  WPFORMS_VERSION
124
  );
125
  }
126
+ }
127
+
128
+ /**
129
+ * Load WPForms Gutenberg block scripts.
130
+ *
131
+ * @since 1.4.8
132
+ */
133
+ public function enqueue_block_editor_assets() {
134
+
135
+ $i18n = [
136
+ 'title' => esc_html__( 'WPForms', 'wpforms-lite' ),
137
+ 'description' => esc_html__( 'Select and display one of your forms.', 'wpforms-lite' ),
138
+ 'form_keywords' => [
139
+ esc_html__( 'form', 'wpforms-lite' ),
140
+ esc_html__( 'contact', 'wpforms-lite' ),
141
+ esc_html__( 'survey', 'wpforms-lite' ),
142
+ 'the dude',
143
+ ],
144
+ 'form_select' => esc_html__( 'Select a Form', 'wpforms-lite' ),
145
+ 'form_settings' => esc_html__( 'Form Settings', 'wpforms-lite' ),
146
+ 'form_selected' => esc_html__( 'Form', 'wpforms-lite' ),
147
+ 'show_title' => esc_html__( 'Show Title', 'wpforms-lite' ),
148
+ 'show_description' => esc_html__( 'Show Description', 'wpforms-lite' ),
149
+ 'panel_notice_head' => esc_html__( 'Heads up!', 'wpforms-lite' ),
150
+ 'panel_notice_text' => esc_html__( 'Do not forget to test your form.', 'wpforms-lite' ),
151
+ 'panel_notice_link' => esc_html__( 'Check out our complete guide!', 'wpforms-lite' ),
152
+ ];
153
+
154
+ if ( version_compare( $GLOBALS['wp_version'], '5.1.1', '<=' ) ) {
155
+ array_pop( $i18n['form_keywords'] );
156
+ }
157
+
158
+ wp_enqueue_style( 'wpforms-integrations' );
159
 
160
  wp_enqueue_script(
161
  'wpforms-gutenberg-form-selector',
169
  $forms = wpforms()->form->get( '', [ 'order' => 'DESC' ] );
170
  $forms = ! empty( $forms ) ? $forms : [];
171
  $forms = array_map(
172
+ static function( $form ) {
173
 
174
  $form->post_title = htmlspecialchars_decode( $form->post_title, ENT_QUOTES );
175
 
184
  [
185
  'logo_url' => WPFORMS_PLUGIN_URL . 'assets/images/sullie-alt.png',
186
  'block_preview_url' => WPFORMS_PLUGIN_URL . 'assets/images/integrations/gutenberg/block-preview.png',
187
+ 'wpnonce' => wp_create_nonce( 'wpforms-gutenberg-form-selector' ),
188
  'forms' => $forms,
189
  'i18n' => $i18n,
190
  ]
200
  *
201
  * @return string
202
  */
203
+ public function get_form_html( $attr ) { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks
204
 
205
+ $id = ! empty( $attr['formId'] ) ? absint( $attr['formId'] ) : 0;
206
 
207
  if ( empty( $id ) ) {
208
  return '';
209
  }
210
 
211
+ $title = ! empty( $attr['displayTitle'] );
212
+ $desc = ! empty( $attr['displayDesc'] );
213
 
214
  // Disable form fields if called from the Gutenberg editor.
215
  if ( $this->is_gb_editor() ) {
216
 
217
+ add_filter(
218
  'wpforms_frontend_container_class',
219
  function ( $classes ) {
220
  $classes[] = 'wpforms-gutenberg-form-selector';
223
  return $classes;
224
  }
225
  );
226
+ add_action(
227
  'wpforms_frontend_output',
228
  function () {
229
  echo '<fieldset disabled>';
230
  },
231
  3
232
  );
233
+ add_action(
234
  'wpforms_frontend_output',
235
  function () {
236
  echo '</fieldset>';
240
  }
241
 
242
  if ( ! empty( $attr['className'] ) ) {
243
+ add_filter(
244
  'wpforms_frontend_container_class',
245
  function ( $classes ) use ( $attr ) {
246
  $cls = array_map( 'esc_attr', explode( ' ', $attr['className'] ) );
250
  );
251
  }
252
 
253
+ ob_start();
254
+
255
+ // phpcs:disable WPForms.PHP.ValidateHooks.InvalidHookName
256
+
257
+ /**
258
+ * Fires before Gutenberg block output.
259
+ *
260
+ * @since 1.5.8.2
261
+ */
262
+ do_action( 'wpforms_gutenberg_block_before' );
263
+
264
+ /**
265
+ * Filter block title display flag.
266
+ *
267
+ * @since 1.5.8.2
268
+ *
269
+ * @param bool $title Title display flag.
270
+ * @param int $id Form id.
271
+ */
272
+ $title = apply_filters( 'wpforms_gutenberg_block_form_title', $title, $id );
273
+
274
+ /**
275
+ * Filter block description display flag.
276
+ *
277
+ * @since 1.5.8.2
278
+ *
279
+ * @param bool $desc Description display flag.
280
+ * @param int $id Form id.
281
+ */
282
+ $desc = apply_filters( 'wpforms_gutenberg_block_form_desc', $desc, $id );
283
 
284
  if ( $this->is_gb_editor() ) {
285
  wpforms_display(
286
  $id,
287
+ $title,
288
+ $desc
289
  );
290
  } else {
291
  printf(
292
  '[wpforms id="%s" title="%d" description="%d"]',
293
+ absint( $id ),
294
+ (bool) $title,
295
+ (bool) $desc
296
  );
297
  }
298
 
299
+ /**
300
+ * Fires after Gutenberg block output.
301
+ *
302
+ * @since 1.5.8.2
303
+ */
304
+ do_action( 'wpforms_gutenberg_block_after' );
305
 
306
+ $content = ob_get_clean();
307
 
308
  if ( empty( $content ) ) {
309
+ $content = '<div class="components-placeholder"><div class="components-placeholder__label"></div>' .
310
+ '<div class="components-placeholder__fieldset">' .
311
+ esc_html__( 'The form cannot be displayed.', 'wpforms-lite' ) .
312
+ '</div></div>';
313
  }
314
 
315
+ /**
316
+ * Filter Gutenberg block content.
317
+ *
318
+ * @since 1.5.8.2
319
+ *
320
+ * @param string $content Block content.
321
+ * @param int $id Form id.
322
+ */
323
+ return apply_filters( 'wpforms_gutenberg_block_form_content', $content, $id );
324
+ // phpcs:enable WPForms.PHP.ValidateHooks.InvalidHookName
325
  }
326
 
327
  /**
334
  public function is_gb_editor() {
335
 
336
  // TODO: Find a better way to check if is GB editor API call.
337
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
338
+ return defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && $_REQUEST['context'] === 'edit';
339
  }
340
  }
src/Integrations/LiteConnect/Integration.php CHANGED
@@ -214,14 +214,18 @@ class Integration extends API {
214
  $count = self::get_entries_count();
215
 
216
  // Reduces the entries that were already imported previously from the count.
217
- $import = wpforms_setting( 'import', false, self::get_option_name() );
 
218
 
219
  if ( isset( $import['previous_import_count'] ) ) {
220
  $prev_count = (int) $import['previous_import_count'];
221
- $count = $count < $prev_count ? 0 : $count - $prev_count;
222
  }
223
 
224
- return $count;
 
 
 
 
225
  }
226
 
227
  /**
@@ -242,6 +246,9 @@ class Integration extends API {
242
  if ( $status === 'done' ) {
243
  $previous_imported_entries = Transient::get( 'lite_connect_imported_entries' );
244
  $settings['import']['previous_import_count'] = is_array( $previous_imported_entries ) ? count( $previous_imported_entries ) : 0;
 
 
 
245
  }
246
 
247
  self::maybe_set_entries_count();
@@ -296,7 +303,9 @@ class Integration extends API {
296
  return;
297
  }
298
 
299
- $previous_import_count = isset( $settings['import']['previous_import_count'] ) ? (int) $settings['import']['previous_import_count'] : 0;
 
 
300
 
301
  // When the entries counter was manually deleted from options OR it was modified by another process,
302
  // we are setting the counter to the value of the previous imported entries.
214
  $count = self::get_entries_count();
215
 
216
  // Reduces the entries that were already imported previously from the count.
217
+ $import = wpforms_setting( 'import', false, self::get_option_name() );
218
+ $prev_count = 0;
219
 
220
  if ( isset( $import['previous_import_count'] ) ) {
221
  $prev_count = (int) $import['previous_import_count'];
 
222
  }
223
 
224
+ if ( isset( $import['previous_failed_count'] ) ) {
225
+ $prev_count += (int) $import['previous_failed_count'];
226
+ }
227
+
228
+ return $count < $prev_count ? 0 : $count - $prev_count;
229
  }
230
 
231
  /**
246
  if ( $status === 'done' ) {
247
  $previous_imported_entries = Transient::get( 'lite_connect_imported_entries' );
248
  $settings['import']['previous_import_count'] = is_array( $previous_imported_entries ) ? count( $previous_imported_entries ) : 0;
249
+
250
+ $previous_failed_entries = Transient::get( 'lite_connect_failed_entries' );
251
+ $settings['import']['previous_failed_count'] = is_array( $previous_failed_entries ) ? count( $previous_failed_entries ) : 0;
252
  }
253
 
254
  self::maybe_set_entries_count();
303
  return;
304
  }
305
 
306
+ $previous_import_count = isset( $settings['import']['previous_import_count'] ) ? (int) $settings['import']['previous_import_count'] : 0;
307
+ $previous_failed_count = isset( $settings['import']['previous_failed_count'] ) ? (int) $settings['import']['previous_failed_count'] : 0;
308
+ $previous_import_count += $previous_failed_count;
309
 
310
  // When the entries counter was manually deleted from options OR it was modified by another process,
311
  // we are setting the counter to the value of the previous imported entries.
wpforms.php CHANGED
@@ -7,7 +7,7 @@
7
  * Requires PHP: 5.6
8
  * Author: WPForms
9
  * Author URI: https://wpforms.com
10
- * Version: 1.7.4.1
11
  * Text Domain: wpforms-lite
12
  * Domain Path: assets/languages
13
  *
@@ -36,7 +36,7 @@ if ( ! defined( 'WPFORMS_VERSION' ) ) {
36
  *
37
  * @since 1.0.0
38
  */
39
- define( 'WPFORMS_VERSION', '1.7.4.1' );
40
  }
41
 
42
  // Plugin Folder Path.
7
  * Requires PHP: 5.6
8
  * Author: WPForms
9
  * Author URI: https://wpforms.com
10
+ * Version: 1.7.4.2
11
  * Text Domain: wpforms-lite
12
  * Domain Path: assets/languages
13
  *
36
  *
37
  * @since 1.0.0
38
  */
39
+ define( 'WPFORMS_VERSION', '1.7.4.2' );
40
  }
41
 
42
  // Plugin Folder Path.