Sid Gifari File Manager
🏠 Root
/
home2
/
iuywvcmy
/
public_html
/
wp-content
/
plugins
/
elementor
/
assets
/
js
/
Editing: text-path.b5766aff4e92f7f6c661.bundle.min.js
/*! For license information please see text-path.b5766aff4e92f7f6c661.bundle.min.js.LICENSE.txt */ "use strict";(self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[]).push([[30],{241:(e,t,n)=>{var o=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(7672),r=o(n(4786));class TextPathHandler extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{pathContainer:".e-text-path",svg:".e-text-path > svg"}}}getDefaultElements(){const{selectors:e}=this.getSettings(),t=this.$element[0];return{widgetWrapper:t,pathContainer:t.querySelector(e.pathContainer),svg:t.querySelector(e.svg),textPath:t.querySelector(e.textPath)}}onInit(){this.elements=this.getDefaultElements(),this.fetchSVG().then(()=>{const e=r.default.sanitize(this.elements.widgetWrapper.dataset.id);this.pathId=`e-path-${e}`,this.textPathId=`e-text-path-${e}`,this.elements.svg&&this.initTextPath()})}fetchSVG(){const{url:e}=this.elements.pathContainer.dataset;return e&&e.endsWith(".svg")?fetch(e).then(e=>e.text()).then(e=>{this.elements.pathContainer.innerHTML=r.default.sanitize(e),this.elements=this.getDefaultElements()}):Promise.reject(e)}setOffset(e){this.elements.textPath&&(this.isRTL()&&(e=100-parseInt(e)),this.elements.textPath.setAttribute("startOffset",e+"%"))}onElementChange(e){const{start_point:t,text:n}=this.getElementSettings();switch(e){case"start_point":this.setOffset(t.size);break;case"text":this.setText(n);break;case"text_path_direction":this.setOffset(t.size),this.setText(n)}}attachIdToPath(){(this.elements.svg.querySelector("[data-path-anchor]")||this.elements.svg.querySelector("path")).id=this.pathId}initTextPath(){const{start_point:e}=this.getElementSettings(),t=(0,a.escapeHTML)(this.elements.pathContainer.dataset.text);this.attachIdToPath(),this.elements.svg.innerHTML+=`\n\t\t\t<text>\n\t\t\t\t<textPath id="${this.textPathId}" href="#${this.pathId}"></textPath>\n\t\t\t</text>\n\t\t`,this.elements.textPath=this.elements.svg.querySelector(`#${this.textPathId}`),this.setOffset(e.size),this.setText(t)}setText(e){const{is_external:t,nofollow:n}=this.getElementSettings().link,{linkUrl:o}=this.elements.pathContainer.dataset,i=t?"_blank":"",l=n?"nofollow":"";o&&(e=`<a href="${(0,a.escapeHTML)(o)}" rel="${l}" target="${i}">${(0,a.escapeHTML)(e)}</a>`,e=r.default.sanitize(e,{ADD_ATTR:["target"]})),this.elements.textPath.innerHTML=e;const s=this.elements.svg.querySelector(`#${this.textPathId}-clone`);if(s&&s.remove(),this.shouldReverseText()){const t=this.elements.textPath.cloneNode();t.id+="-clone",t.classList.add("elementor-hidden"),t.textContent=e,this.elements.textPath.parentNode.appendChild(t),this.reverseToRTL()}}isRTL(){const{text_path_direction:e}=this.getElementSettings();let t=elementorFrontend.config.is_rtl;return e&&(t="rtl"===e),t}shouldReverseText(){if(!this.isRTL())return!1;if(elementorFrontend.utils.environment.firefox)return!1;return!elementorFrontend.utils.environment.blink||!this.isFixedChromiumVersion()}isFixedChromiumVersion(){return parseInt(navigator.userAgent.match(/(?:Chrom(?:e|ium)|Edg)\/([0-9]+)\./)[1])>=96}reverseToRTL(){let e=this.elements.textPath;e=e.querySelector("a")||e;e.textContent=e.textContent.replace(/([\u0591-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC\s$&+,:;=?@#|'<>.^*()%!-]+)/gi,e=>e.split("").reverse().join("")),e.setAttribute("aria-hidden",!0)}}t.default=TextPathHandler},4786:e=>{const{entries:t,setPrototypeOf:n,isFrozen:o,getPrototypeOf:a,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:l,create:s}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;i||(i=function freeze(e){return e}),l||(l=function seal(e){return e}),c||(c=function apply(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.apply(t,o)}),u||(u=function construct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const d=unapply(Array.prototype.forEach),p=unapply(Array.prototype.lastIndexOf),m=unapply(Array.prototype.pop),f=unapply(Array.prototype.push),h=unapply(Array.prototype.splice),g=unapply(String.prototype.toLowerCase),T=unapply(String.prototype.toString),y=unapply(String.prototype.match),S=unapply(String.prototype.replace),_=unapply(String.prototype.indexOf),E=unapply(String.prototype.trim),A=unapply(Object.prototype.hasOwnProperty),b=unapply(RegExp.prototype.test),x=function unconstruct(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return u(e,n)}}(TypeError);function unapply(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return c(e,t,o)}}function addToSet(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;n&&n(e,null);let r=t.length;for(;r--;){let n=t[r];if("string"==typeof n){const e=a(n);e!==n&&(o(t)||(t[r]=e),n=e)}e[n]=!0}return e}function cleanArray(e){for(let t=0;t<e.length;t++){A(e,t)||(e[t]=null)}return e}function clone(e){const n=s(null);for(const[o,a]of t(e)){A(e,o)&&(Array.isArray(a)?n[o]=cleanArray(a):a&&"object"==typeof a&&a.constructor===Object?n[o]=clone(a):n[o]=a)}return n}function lookupGetter(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return unapply(n.get);if("function"==typeof n.value)return unapply(n.value)}e=a(e)}return function fallbackValue(){return null}}const N=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","search","section","select","shadow","slot","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"]),v=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),k=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),C=i(["animate","color-profile","cursor","discard","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"]),R=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","mprescripts"]),w=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=i(["#text"]),O=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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),L=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","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"]),M=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=l(/<%[\w\W]*|[\w\W]*%>/gm),H=l(/\$\{[\w\W]*/gm),F=l(/^data-[\-\w.\u00B7-\uFFFF]+$/),U=l(/^aria-[\-\w]+$/),G=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=l(/^(?:\w+script|data):/i),W=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j=l(/^html$/i),Y=l(/^[a-z][.\w]*(-[.\w]+)+$/i);var $=Object.freeze({__proto__:null,ARIA_ATTR:U,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:Y,DATA_ATTR:F,DOCTYPE_NAME:j,ERB_EXPR:z,IS_ALLOWED_URI:G,IS_SCRIPT_OR_DATA:B,MUSTACHE_EXPR:P,TMPLIT_EXPR:H});const q=1,V=3,X=7,K=8,Z=9,J=function getGlobal(){return"undefined"==typeof window?null:window};var Q=function createDOMPurify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J();const DOMPurify=e=>createDOMPurify(e);if(DOMPurify.version="3.3.0",DOMPurify.removed=[],!e||!e.document||e.document.nodeType!==Z||!e.Element)return DOMPurify.isSupported=!1,DOMPurify;let{document:n}=e;const o=n,a=o.currentScript,{DocumentFragment:r,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:P,NamedNodeMap:z=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:H,DOMParser:F,trustedTypes:U}=e,B=u.prototype,W=lookupGetter(B,"cloneNode"),Y=lookupGetter(B,"remove"),Q=lookupGetter(B,"nextSibling"),ee=lookupGetter(B,"childNodes"),te=lookupGetter(B,"parentNode");if("function"==typeof l){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ne,oe="";const{implementation:ae,createNodeIterator:re,createDocumentFragment:ie,getElementsByTagName:le}=n,{importNode:se}=o;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};DOMPurify.isSupported="function"==typeof t&&"function"==typeof te&&ae&&void 0!==ae.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:de,TMPLIT_EXPR:pe,DATA_ATTR:me,ARIA_ATTR:fe,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:Te}=$;let{IS_ALLOWED_URI:ye}=$,Se=null;const _e=addToSet({},[...N,...v,...k,...R,...D]);let Ee=null;const Ae=addToSet({},[...O,...L,...I,...M]);let be=Object.seal(s(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}})),xe=null,Ne=null;const ve=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ke=!0,Ce=!0,Re=!1,we=!0,De=!1,Oe=!0,Le=!1,Ie=!1,Me=!1,Pe=!1,ze=!1,He=!1,Fe=!0,Ue=!1,Ge=!0,Be=!1,We={},je=null;const Ye=addToSet({},["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"]);let $e=null;const qe=addToSet({},["audio","video","img","source","image","track"]);let Ve=null;const Xe=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml";let Qe=Je,et=!1,tt=null;const nt=addToSet({},[Ke,Ze,Je],T);let ot=addToSet({},["mi","mo","mn","ms","mtext"]),at=addToSet({},["annotation-xml"]);const rt=addToSet({},["title","style","font","a","script"]);let it=null;const lt=["application/xhtml+xml","text/html"];let st=null,ct=null;const ut=n.createElement("form"),dt=function isRegexOrFunction(e){return e instanceof RegExp||e instanceof Function},pt=function _parseConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=clone(e),it=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,st="application/xhtml+xml"===it?T:g,Se=A(e,"ALLOWED_TAGS")?addToSet({},e.ALLOWED_TAGS,st):_e,Ee=A(e,"ALLOWED_ATTR")?addToSet({},e.ALLOWED_ATTR,st):Ae,tt=A(e,"ALLOWED_NAMESPACES")?addToSet({},e.ALLOWED_NAMESPACES,T):nt,Ve=A(e,"ADD_URI_SAFE_ATTR")?addToSet(clone(Xe),e.ADD_URI_SAFE_ATTR,st):Xe,$e=A(e,"ADD_DATA_URI_TAGS")?addToSet(clone(qe),e.ADD_DATA_URI_TAGS,st):qe,je=A(e,"FORBID_CONTENTS")?addToSet({},e.FORBID_CONTENTS,st):Ye,xe=A(e,"FORBID_TAGS")?addToSet({},e.FORBID_TAGS,st):clone({}),Ne=A(e,"FORBID_ATTR")?addToSet({},e.FORBID_ATTR,st):clone({}),We=!!A(e,"USE_PROFILES")&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Re=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,De=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Le=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||G,Qe=e.NAMESPACE||Je,ot=e.MATHML_TEXT_INTEGRATION_POINTS||ot,at=e.HTML_INTEGRATION_POINTS||at,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(Ce=!1),ze&&(Pe=!0),We&&(Se=addToSet({},D),Ee=[],!0===We.html&&(addToSet(Se,N),addToSet(Ee,O)),!0===We.svg&&(addToSet(Se,v),addToSet(Ee,L),addToSet(Ee,M)),!0===We.svgFilters&&(addToSet(Se,k),addToSet(Ee,L),addToSet(Ee,M)),!0===We.mathMl&&(addToSet(Se,R),addToSet(Ee,I),addToSet(Ee,M))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?ve.tagCheck=e.ADD_TAGS:(Se===_e&&(Se=clone(Se)),addToSet(Se,e.ADD_TAGS,st))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?ve.attributeCheck=e.ADD_ATTR:(Ee===Ae&&(Ee=clone(Ee)),addToSet(Ee,e.ADD_ATTR,st))),e.ADD_URI_SAFE_ATTR&&addToSet(Ve,e.ADD_URI_SAFE_ATTR,st),e.FORBID_CONTENTS&&(je===Ye&&(je=clone(je)),addToSet(je,e.FORBID_CONTENTS,st)),Ge&&(Se["#text"]=!0),Le&&addToSet(Se,["html","head","body"]),Se.table&&(addToSet(Se,["tbody"]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,oe=ne.createHTML("")}else void 0===ne&&(ne=function _createTrustedTypesPolicy(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}}(U,a)),null!==ne&&"string"==typeof oe&&(oe=ne.createHTML(""));i&&i(e),ct=e}},mt=addToSet({},[...v,...k,...C]),ft=addToSet({},[...R,...w]),ht=function _forceRemove(e){f(DOMPurify.removed,{element:e});try{te(e).removeChild(e)}catch(t){Y(e)}},gt=function _removeAttribute(e,t){try{f(DOMPurify.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(DOMPurify.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Pe||ze)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Tt=function _initDocument(e){let t=null,o=null;if(Me)e="<remove></remove>"+e;else{const t=y(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===it&&Qe===Je&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const a=ne?ne.createHTML(e):e;if(Qe===Je)try{t=(new F).parseFromString(a,it)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?oe:a}catch(e){}}const r=t.body||t.documentElement;return e&&o&&r.insertBefore(n.createTextNode(o),r.childNodes[0]||null),Qe===Je?le.call(t,Le?"html":"body")[0]:Le?t.documentElement:r},yt=function _createNodeIterator(e){return re.call(e.ownerDocument||e,e,P.SHOW_ELEMENT|P.SHOW_COMMENT|P.SHOW_TEXT|P.SHOW_PROCESSING_INSTRUCTION|P.SHOW_CDATA_SECTION,null)},St=function _isClobbered(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},_t=function _isNode(e){return"function"==typeof c&&e instanceof c};function _executeHooks(e,t,n){d(e,e=>{e.call(DOMPurify,t,n,ct)})}const Et=function _sanitizeElements(e){let t=null;if(_executeHooks(ce.beforeSanitizeElements,e,null),St(e))return ht(e),!0;const n=st(e.nodeName);if(_executeHooks(ce.uponSanitizeElement,e,{tagName:n,allowedTags:Se}),Oe&&e.hasChildNodes()&&!_t(e.firstElementChild)&&b(/<[/\w!]/g,e.innerHTML)&&b(/<[/\w!]/g,e.textContent))return ht(e),!0;if(e.nodeType===X)return ht(e),!0;if(Oe&&e.nodeType===K&&b(/<[/\w]/g,e.data))return ht(e),!0;if(!(ve.tagCheck instanceof Function&&ve.tagCheck(n))&&(!Se[n]||xe[n])){if(!xe[n]&&bt(n)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(n))return!1}if(Ge&&!je[n]){const t=te(e)||e.parentNode,n=ee(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const a=W(n[o],!0);a.__removalCount=(e.__removalCount||0)+1,t.insertBefore(a,Q(e))}}}return ht(e),!0}return e instanceof u&&!function _checkValidNamespace(e){let t=te(e);t&&t.tagName||(t={namespaceURI:Qe,tagName:"template"});const n=g(e.tagName),o=g(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Ze?t.namespaceURI===Je?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===o||ot[o]):Boolean(mt[n]):e.namespaceURI===Ke?t.namespaceURI===Je?"math"===n:t.namespaceURI===Ze?"math"===n&&at[o]:Boolean(ft[n]):e.namespaceURI===Je?!(t.namespaceURI===Ze&&!at[o])&&!(t.namespaceURI===Ke&&!ot[o])&&!ft[n]&&(rt[n]||!mt[n]):!("application/xhtml+xml"!==it||!tt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(De&&e.nodeType===V&&(t=e.textContent,d([ue,de,pe],e=>{t=S(t,e," ")}),e.textContent!==t&&(f(DOMPurify.removed,{element:e.cloneNode()}),e.textContent=t)),_executeHooks(ce.afterSanitizeElements,e,null),!1):(ht(e),!0)},At=function _isValidAttribute(e,t,o){if(Fe&&("id"===t||"name"===t)&&(o in n||o in ut))return!1;if(Ce&&!Ne[t]&&b(me,t));else if(ke&&b(fe,t));else if(ve.attributeCheck instanceof Function&&ve.attributeCheck(t,e));else if(!Ee[t]||Ne[t]){if(!(bt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t,e))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,o)||be.tagNameCheck instanceof Function&&be.tagNameCheck(o))))return!1}else if(Ve[t]);else if(b(ye,S(o,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(o,"data:")||!$e[e]){if(Re&&!b(he,S(o,ge,"")));else if(o)return!1}else;return!0},bt=function _isBasicCustomElement(e){return"annotation-xml"!==e&&y(e,Te)},xt=function _sanitizeAttributes(e){_executeHooks(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||St(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee,forceKeepAttr:void 0};let o=t.length;for(;o--;){const a=t[o],{name:r,namespaceURI:i,value:l}=a,s=st(r),c=l;let u="value"===r?c:E(c);if(n.attrName=s,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,_executeHooks(ce.uponSanitizeAttribute,e,n),u=n.attrValue,!Ue||"id"!==s&&"name"!==s||(gt(r,e),u="user-content-"+u),Oe&&b(/((--!?|])>)|<\/(style|title|textarea)/i,u)){gt(r,e);continue}if("attributename"===s&&y(u,"href")){gt(r,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){gt(r,e);continue}if(!we&&b(/\/>/i,u)){gt(r,e);continue}De&&d([ue,de,pe],e=>{u=S(u,e," ")});const p=st(e.nodeName);if(At(p,s,u)){if(ne&&"object"==typeof U&&"function"==typeof U.getAttributeType)if(i);else switch(U.getAttributeType(p,s)){case"TrustedHTML":u=ne.createHTML(u);break;case"TrustedScriptURL":u=ne.createScriptURL(u)}if(u!==c)try{i?e.setAttributeNS(i,r,u):e.setAttribute(r,u),St(e)?ht(e):m(DOMPurify.removed)}catch(t){gt(r,e)}}else gt(r,e)}_executeHooks(ce.afterSanitizeAttributes,e,null)},Nt=function _sanitizeShadowDOM(e){let t=null;const n=yt(e);for(_executeHooks(ce.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)_executeHooks(ce.uponSanitizeShadowNode,t,null),Et(t),xt(t),t.content instanceof r&&_sanitizeShadowDOM(t.content);_executeHooks(ce.afterSanitizeShadowDOM,e,null)};return DOMPurify.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,i=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!_t(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!DOMPurify.isSupported)return e;if(Ie||pt(t),DOMPurify.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=st(e.nodeName);if(!Se[t]||xe[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)n=Tt("\x3c!----\x3e"),a=n.ownerDocument.importNode(e,!0),a.nodeType===q&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!Pe&&!De&&!Le&&-1===e.indexOf("<"))return ne&&He?ne.createHTML(e):e;if(n=Tt(e),!n)return Pe?null:He?oe:""}n&&Me&&ht(n.firstChild);const s=yt(Be?e:n);for(;i=s.nextNode();)Et(i),xt(i),i.content instanceof r&&Nt(i.content);if(Be)return e;if(Pe){if(ze)for(l=ie.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Ee.shadowroot||Ee.shadowrootmode)&&(l=se.call(o,l,!0)),l}let u=Le?n.outerHTML:n.innerHTML;return Le&&Se["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b(j,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),De&&d([ue,de,pe],e=>{u=S(u,e," ")}),ne&&He?ne.createHTML(u):u},DOMPurify.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ie=!0},DOMPurify.clearConfig=function(){ct=null,Ie=!1},DOMPurify.isValidAttribute=function(e,t,n){ct||pt({});const o=st(e),a=st(t);return At(o,a,n)},DOMPurify.addHook=function(e,t){"function"==typeof t&&f(ce[e],t)},DOMPurify.removeHook=function(e,t){if(void 0!==t){const n=p(ce[e],t);return-1===n?void 0:h(ce[e],n,1)[0]}return m(ce[e])},DOMPurify.removeHooks=function(e){ce[e]=[]},DOMPurify.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},DOMPurify}();e.exports=Q}}]);
Save
Cancel