Back to Codebase

Vulnerability Analysis Report

Cassiopeia Framework Theme v4.0.0-alpha4

Scan ID: SCAN-CASSIOPEIA-bQ9bij • Hash: 49844ba1

Severity Score
Critical
Total Findings
100
Engine Version
ECOMGUARD-HYBRID-AST-1.5
Scan Duration
1.109s

Vulnerability Details

L610

Dynamic Code Execution in HtmlDocument.php

CWE-94
File Location: libraries/src/Document/HtmlDocument.php:610
Security Score:
97 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- return eval($str);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L71

Dynamic Code Execution in TestListenerTrait.php

CWE-94
File Location: libraries/vendor/symfony/polyfill-util/TestListenerTrait.php:71
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- eval(<<<EOPHP
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L48

Insecure DOM Manipulation (XSS) in incompatible.js

CWE-79
File Location: build/incompatible_page/incompatible.js:48
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- header.innerHTML = errorLocale[key].header;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L178

Insecure DOM Manipulation (XSS) in field-subform.js

CWE-79
File Location: build/media/webcomponents/js/field-subform/field-subform.js:178
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpEl.innerHTML = this.template;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L239

Insecure DOM Manipulation (XSS) in tab.js

CWE-79
File Location: build/media/webcomponents/js/tab/tab.js:239
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- aElement.innerHTML = tab.getAttribute('name');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L199

Insecure DOM Manipulation (XSS) in overrider.js

CWE-79
File Location: media/com_languages/js/overrider.js:199
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- key.innerHTML = item.constant;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L237

Insecure DOM Manipulation (XSS) in overrider.js

CWE-79
File Location: media/com_languages/js/overrider.js:237
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('jform_key').value = document.getElementById('override_key' + id).innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L63

Insecure DOM Manipulation (XSS) in admin-module-edit.js

CWE-79
File Location: media/com_modules/js/admin-module-edit.js:63
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpMenu.innerHTML = '<span class=\"badge badge-danger\">' + Joomla.JText._('JNO') + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L97

Insecure DOM Manipulation (XSS) in admin-module-edit.js

CWE-79
File Location: media/com_modules/js/admin-module-edit.js:97
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- jQuery('#access-' + options.itemId, parent.document).innerHTML = parent.viewLevels[updAccess];
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L289

Insecure DOM Manipulation (XSS) in chosen.js

CWE-79
File Location: media/legacy/js/chosen.js:289
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- option_el.innerHTML = option.search_text;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in client.es6.min.js

CWE-79
File Location: media/plg_installer_webinstaller/js/client.es6.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- if(!window.jQuery)throw new Error("WebInstaller plugin requires jQuery");if(!Joomla)throw new Error("Joomla API is not properly initialised");((e,t,i,l)=>{"use strict";const n={view:"dashboard",id:0,ordering:"",list:0,options:i.getOptions("plg_installer_webinstaller",{})};let s;class a{initialise(){if(n.loaded=1,t.getElementById("myTabContent")){const e=t.getElementById("web");t.getElementById("uploadform-web-cancel").addEventListener("click",()=>{t.getElementById("uploadform-web").classList.add("hidden"),n.list&&t.querySelector(".list-view")&&t.querySelector(".list-view").click()}),e.insertAdjacentHTML("afterbegin",'<div id="appsloading" class="ifw-loading-container"></div>'),e.style.position="absolute",l("#appsloading").on("ajaxStart",()=>{t.body.classList.add("ifw-busy"),t.getElementById("appsloading").classList.remove("hidden")}).on("ajaxStop",()=>{t.getElementById("appsloading").classList.add("hidden"),t.body.classList.remove("ifw-busy")})}this.loadweb(`${n.options.base_url}index.php?format=json&option=com_apps&view=dashboard`),this.clickforlinks()}loadweb(s){if(!s)return!1;const r=this,o=new RegExp(n.options.base_url),d=new RegExp("^index.php");if(!o.test(s)&&!d.test(s))return e.open(s,"_blank"),!1;let c=`${s}&product=${n.options.product}&release=${n.options.release}&dev_level=${n.options.dev_level}&list=${n.list?"list":"grid"}&lang=${n.options.language}`;if(""!==n.ordering&&t.getElementById("com-apps-ordering").value&&(n.ordering=t.getElementById("com-apps-ordering").value,c+=`&ordering=${n.ordering}`),t.getElementById("myTabContent")){const e=t.getElementById("appsloading");e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%";const i=t.getElementById("web");i.style.position="relative",i.appendChild(e),l("#appsloading").trigger("ajaxStart")}return l.ajax({url:c,dataType:"jsonp",cache:!0,jsonpCallback:"jedapps_jsonpcallback",timeout:2e4,success(e){t.getElementById("web-loader")&&t.getElementById("web-loader").classList.add("hidden"),t.getElementById("jed-container").innerHTML=e.data.html,t.getElementById("com-apps-searchbox").addEventListener("keypress",e=>{13===e.which&&r.initiateSearch()}),t.getElementById("search-extensions").addEventListener("click",()=>{r.initiateSearch()}),t.getElementById("search-reset").addEventListener("click",()=>{t.getElementById("com-apps-searchbox").value="",r.initiateSearch()});const i=t.getElementById("com-apps-ordering");i&&i.addEventListener("change",()=>{const e=i.selectedIndex;n.ordering=i.options[e].value,r.installfromwebajaxsubmit()}),""!==n.options.installfrom_url&&r.installfromweb(n.options.installfrom_url)},fail(){t.getElementById("web-loader")&&(t.getElementById("web-loader").classList.add("hidden"),t.getElementById("web-loader-error").classList.remove("hidden"))},complete(){const s=t.getElementById("joomlaapsinstallatinput");if(s&&(s.value=n.options.installat_url),r.clickforlinks(),a.clicker(),"extension"!==n.view&&[].slice.call(t.querySelectorAll("div.load-extension")).forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),r.processLinkClick(e.getAttribute("data-url"))}),e.setAttribute("href","#")}),"extension"===n.view){const l=t.getElementById("install-extension"),n=t.getElementById("install-extension-from-external");l&&l.addEventListener("click",()=>{r.installfromweb(l.getAttribute("data-downloadurl"),l.getAttribute("data-name"))}),n&&n.addEventListener("click",()=>{const l=n.getAttribute("data-downloadurl");!0===e.confirm(i.JText._("PLG_INSTALLER_WEBINSTALLER_REDIRECT_TO_EXTERNAL_SITE_TO_INSTALL").replace("[SITEURL]",l))&&(t.getElementById("adminForm").setAttribute("action",l),t.querySelector("input[name=task]").setAttribute("disabled",!0),t.querySelector("input[name=install_directory]").setAttribute("disabled",!0),t.querySelector("input[name=install_url]").setAttribute("disabled",!0),t.querySelector("input[name=installtype]").setAttribute("disabled",!0),t.querySelector("input[name=filter_search]").setAttribute("disabled",!0),t.getElementById("adminForm").submit())})}n.list&&t.querySelector(".list-view")&&t.querySelector(".list-view").click(),t.getElementById("myTabContent")&&l("#appsloading").trigger("ajaxStop")},error(e){const i=t.getElementById("web-loader-error"),l=t.getElementById("web-loader");e.responseText&&i&&(i.innerHTML=e.responseText),l&&(l.classList.add("hidden"),i.classList.remove("hidden"))}}),!0}clickforlinks(){const e=this;[].slice.call(t.querySelectorAll("a.transcode")).forEach(t=>{const i=t.getAttribute("href");t.addEventListener("click",t=>{t.preventDefault(),e.processLinkClick(i)}),t.setAttribute("href","#")})}initiateSearch(){n.view="dashboard",this.installfromwebajaxsubmit()}installfromwebajaxsubmit(){let e=`&view=${n.view}`;if(n.id&&(e+=`&id=${n.id}`),t.getElementById("com-apps-searchbox").value){e+=`&filter_search=${encodeURI(t.getElementById("com-apps-searchbox").value.toLowerCase().replace(/ +/g,"_").replace(/[^a-z0-9-_]/g,"").trim())}`}""!==n.ordering&&t.getElementById("com-apps-ordering").value&&(n.ordering=t.getElementById("com-apps-ordering").value),n.ordering&&(e+=`&ordering=${n.ordering}`),this.loadweb(`${n.options.base_url}index.php?format=json&option=com_apps${e}`)}processLinkClick(e){const t=new RegExp(n.options.base_url),i=new RegExp("^index.php");t.test(e)||i.test(e)?(n.view=e.replace(/^.+[&?]view=(\w+).*$/,"$1"),"dashboard"===n.view?n.id=0:"category"===n.view&&(n.id=e.replace(/^.+[&?]id=(\d+).*$/,"$1")),this.loadweb(n.options.base_url+e)):this.loadweb(e)}static clicker(){t.querySelector(".grid-view")&&t.querySelector(".grid-view").addEventListener("click",()=>{n.list=0,t.querySelector(".list-container").classList.add("hidden"),t.querySelector(".grid-container").classList.remove("hidden"),t.getElementById("btn-list-view").classList.remove("active"),t.getElementById("btn-grid-view").classList.remove("active")}),t.querySelector(".list-view")&&t.querySelector(".list-view").addEventListener("click",()=>{n.list=1,t.querySelector(".grid-container").classList.add("hidden"),t.querySelector(".list-container").classList.remove("hidden"),t.getElementById("btn-grid-view").classList.remove("active"),t.getElementById("btn-list-view").classList.add("active")})}static installfromweb(e,l){if(!e)return alert(i.JText._("PLG_INSTALLER_WEBINSTALLER_CANNOT_INSTALL_EXTENSION_IN_PLUGIN")),!1;const n=t.getElementById("install_url"),s=t.getElementById("uploadform-web-url");if(n.value=e,s.innerHTML=e,l){t.getElementById("uploadform-web-name").innerHTML=l,t.getElementById("uploadform-web-name-label").classList.remove("hidden")}else t.getElementById("uploadform-web-name-label").classList.add("hidden");return t.getElementById("uploadform-web").classList.remove("hidden"),!0}}l(e=>{const t=e("#myTabTabs").find('a[href="#web"]');n.options.installfromon&&t.click(),t.hasClass("active")&&(s||(s=new a).initialise()),t.closest("li").click(()=>{s||(s=new a).initialise()}),""!==n.options.installfrom_url&&t.closest("li").click(),t.on("shown.bs.tab",()=>{s||(s=new a).initialise()})})})(window,document,Joomla,window.jQuery);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in stats-message.es6.min.js

CWE-79
File Location: media/plg_system_stats/js/stats-message.es6.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- Joomla=window.Joomla||{},((e,t)=>{"use strict";const s=({plugin:n="sendStats"}={})=>{const a=`index.php?option=com_ajax&group=system&plugin=${n}&format=raw`,l=t.getElementById("system-message-container");e.request({url:a,headers:{"Content-Type":"application/json"},onSuccess:e=>{try{const n=JSON.parse(e);n&&n.html&&(l.innerHTML=n.html,l.querySelector(".js-pstats-alert").style.display="block",(e=>{const s=t.getElementById("system-message-container"),n=s.querySelector(".js-pstats-alert"),a=s.querySelector(".js-pstats-data-details");t.addEventListener("click",e=>{e.target.classList.contains("js-pstats-btn-details")&&(e.preventDefault(),a.classList.toggle("d-none"))}),t.addEventListener("click",t=>{t.target.classList.contains("js-pstats-btn-allow-always")&&(t.preventDefault(),n.close(),e({plugin:"sendAlways"}))}),t.addEventListener("click",t=>{t.target.classList.contains("js-pstats-btn-allow-once")&&(t.preventDefault(),n.close(),e({plugin:"sendOnce"}))}),t.addEventListener("click",t=>{t.target.classList.contains("js-pstats-btn-allow-never")&&(t.preventDefault(),n.close(),e({plugin:"sendNever"}))})})(s))}catch(e){throw new Error(e)}},onError:t=>{e.renderMessages({error:[t.response]})}})};t.addEventListener("DOMContentLoaded",()=>{s()})})(Joomla,document);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in cms.min.js

CWE-79
File Location: media/system/js/cms.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- Joomla=window.Joomla||{},function(e,a){"use strict";a.setcollapse=function(a,n,o){e.getElementById("collapse-"+n)||(e.getElementById("container-collapse").innerHTML='<div class="collapse fade" id="collapse-'+n+'"><iframe class="iframe" src="'+a+'" height="'+o+'" width="100%"></iframe></div>')},window.jQuery&&function(a){function n(e,n){for(var o,t,i,d,l=!0,r=e.data("showon")||[],s=0,f=r.length;s<f;s++)i=(t=r[s]||{}).field,d=a('[name="'+i+'"], [name="'+i+'[]"]'),t.valid=0,d.each(function(){var e=a(this);if(-1!==["checkbox","radio"].indexOf(e.attr("type"))){if(!e.prop("checked"))return;o=e.val()}else null==(o=e.val())&&"select"==e.prop("tagName").toLowerCase()&&(o=[]);for(var n in"object"!=typeof o&&(o=JSON.parse('["'+o+'"]')),o)o.propertyIsEnumerable(n)&&("="==r[s].sign&&-1!==r[s].values.indexOf(o[n])&&(r[s].valid=1),"!="==r[s].sign&&-1===r[s].values.indexOf(o[n])&&(r[s].valid=1))}),""===t.op?0===t.valid&&(l=!1):("AND"===t.op&&t.valid+r[s-1].valid<2&&(l=!1),"OR"===t.op&&t.valid+r[s-1].valid>0&&(l=!0));n?l?e.slideDown():e.slideUp():e.toggle(l)}function o(o){for(var t=a(o=o||e).find("[data-showon]"),i=0,d=t.length;i<d;i++)!function(){for(var e,o=a(t[i]),d=o.data("showon")||[],l=a(),r=0,s=d.length;r<s;r++)e=d[r].field,l=l.add(a('[name="'+e+'"], [name="'+e+'[]"]'));n(o),l.on("change",function(){n(o,!0)})}()}e.addEventListener("DOMContentLoaded",function(e){o(e.target)}),e.addEventListener("joomla:updated",function(e){var n=a(e.target);if(n.hasClass("subform-repeatable-group"))for(var t,i,d=n.find("[data-showon]"),l=n.data("baseName"),r=n.data("group"),s=new RegExp("\\["+l+"\\]\\["+l+"X\\]","g"),f="["+l+"]["+r+"]",c=0,p=d.length;c<p;c++)i=(t=a(d[c])).attr("data-showon").replace(s,f),t.attr("data-showon",i);o(e.target)})}(jQuery)}(document,Joomla);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L994

Insecure DOM Manipulation (XSS) in calendar.js

CWE-79
File Location: media/system/js/fields/calendar.js:994
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.title.getElementsByTagName('span')[0].innerHTML = this.params.debug ? year + ' ' + Date.convertNumbers(year.toString()) : Date.convertNumbers(year.toString());
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in calendar.min.js

CWE-79
File Location: media/system/js/fields/calendar.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(e,a){"use strict";Date.convertNumbers=function(e){e=e.toString();if("[object Array]"===Object.prototype.toString.call(JoomlaCalLocale.localLangNumbers))for(var a=0;a<JoomlaCalLocale.localLangNumbers.length;a++)e=e.replace(new RegExp(a,"g"),JoomlaCalLocale.localLangNumbers[a]);return e},Date.toEnglish=function(e){e=this.toString();for(var a=[0,1,2,3,4,5,6,7,8,9],t=0;t<10;t++)e=e.replace(new RegExp(a[t],"g"),t);return e};var t=function(e){if(!e)throw new Error("Calendar setup failed:\n No valid element found, Please check your code");if("function"!=typeof Date.parseFieldDate)throw new Error("Calendar setup failed:\n No valid date helper, Please check your code");if(e._joomlaCalendar)throw new Error("JoomlaCalendar instance already exists for the element");if(e._joomlaCalendar=this,this.writable=!0,this.hidden=!0,this.params={},this.element=e,this.inputField=e.getElementsByTagName("input")[0],this.button=e.getElementsByTagName("button")[0],!this.inputField)throw new Error("Calendar setup failed:\n No valid input found, Please check your code");this.params={debug:!1,clicked:!1,element:{style:{display:"none"}},writable:!0};var t=this,s=this.button,r={inputField:this.inputField,dateType:JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",direction:void 0!==a.dir?a.dir:a.getElementsByTagName("html")[0].getAttribute("dir"),firstDayOfWeek:s.getAttribute("data-firstday")?parseInt(s.getAttribute("data-firstday")):0,dateFormat:"%Y-%m-%d %H:%M:%S",weekend:JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6],minYear:JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900,maxYear:JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100,minYearTmp:s.getAttribute("data-min-year"),maxYearTmp:s.getAttribute("data-max-year"),weekendTmp:s.getAttribute("data-weekend"),time24:!0,showsOthers:1===parseInt(s.getAttribute("data-show-others")),showsTime:!0,weekNumbers:1===parseInt(s.getAttribute("data-week-numbers")),showsTodayBtn:!0,compressedHeader:1===parseInt(s.getAttribute("data-only-months-nav"))};for(var o in s.getAttribute("data-dayformat")&&(r.dateFormat=s.getAttribute("data-dayformat")?s.getAttribute("data-dayformat"):"%Y-%m-%d %H:%M:%S"),s.getAttribute("data-time-24")&&(r.time24=24===parseInt(s.getAttribute("data-time-24"))),s.getAttribute("data-show-time")&&(r.showsTime=1===parseInt(s.getAttribute("data-show-time"))),s.getAttribute("data-today-btn")&&(r.showsTodayBtn=1===parseInt(s.getAttribute("data-today-btn"))),r)this.params[o]=r[o];i(t.params.minYearTmp)&&(t.params.minYear=l(parseInt(t.params.minYearTmp),t.params.dateType)),i(t.params.maxYearTmp)&&(t.params.maxYear=l(parseInt(t.params.maxYearTmp),t.params.dateType)),"undefined"!==t.params.weekendTmp&&(t.params.weekend=t.params.weekendTmp.split(",").map(function(e){return parseInt(e,10)})),this._dayMouseDown=function(e){return t._handleDayMouseDown(e)},this._calKeyEvent=function(e){return t._handleCalKeyEvent(e)},this._documentClick=function(e){return t._handleDocumentClick(e)},this.checkInputs(),this.inputField.getAttribute("readonly")||(this._create(),this._bindEvents())};t.prototype.checkInputs=function(){var e=Date.parseFieldDate(this.inputField.getAttribute("data-alt-value"),this.params.dateFormat,"gregorian");""!==this.inputField.value?(this.date=e,this.inputField.value=e.print(this.params.dateFormat,this.params.dateType,!0)):this.date=new Date},t.prototype.recreate=function(){var e=this.element,a=e.querySelector(".js-calendar");a&&(e._joomlaCalendar=null,a.parentNode.removeChild(a),new t(e))},t.prototype.updateTime=function(e,a,t){var s=this.date,r=this.date.getLocalDate(this.params.dateType),i=this.date.getLocalMonth(this.params.dateType),l=this.date.getLocalFullYear(this.params.dateType),o=this.inputField.parentNode.parentNode.querySelectorAll(".time-ampm")[0];this.params.time24||(/pm/i.test(o.value)&&e<12?e=parseInt(e)+12:/am/i.test(o.value)&&12==e&&(e=0)),s.setHours(e),s.setMinutes(parseInt(a,10)),s.setSeconds(s.getSeconds()),s.setLocalFullYear(this.params.dateType,l),s.setLocalMonth(this.params.dateType,i),s.setLocalDate(this.params.dateType,r),this.dateClicked=!1,this.callHandler()},t.prototype.setDate=function(e){e.equalsTo(this.date)||(this.date=e,this.processCalendar(this.params.firstDayOfWeek,e))},t.prototype.moveCursorBy=function(e){var a=new Date(this.date);a.setDate(a.getDate()-e),this.setDate(a)},t.prototype.resetSelected=function(e){for(var a=e.options,t=a.length;t--;){var s=a[t];s.selected&&(s.selected=!1)}},t.prototype.callHandler=function(){this.inputField.setAttribute("data-alt-value",this.date.print(this.params.dateFormat,"gregorian",!1)),this.inputField.getAttribute("data-alt-value")&&"0000-00-00 00:00:00"!==this.inputField.getAttribute("data-alt-value")&&(this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,!0),"gregorian"!==this.params.dateType&&this.inputField.setAttribute("data-local-value",this.date.print(this.params.dateFormat,this.params.dateType,!0))),this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,!0),"function"==typeof this.inputField.onchange&&this.inputField.onchange(),this.dateClicked&&"function"==typeof this.params.onUpdate&&this.params.onUpdate(this),this.dateClicked?this.close():this.processCalendar()},t.prototype.close=function(){this.hide()},t.prototype.show=function(){if(-1!==navigator.appName.indexOf("Internet Explorer")&&(-1===navigator.appVersion.indexOf("MSIE 9")&&-1===navigator.appVersion.indexOf("MSIE 1")&&e.jQuery&&jQuery().chosen))for(var t=this.element.getElementsByTagName("select"),s=0;s<t.length;s++)jQuery(t[s]).chosen("destroy");this.checkInputs(),this.inputField.focus(),this.dropdownElement.style.display="block",this.hidden=!1,a.addEventListener("keydown",this._calKeyEvent,!0),a.addEventListener("keypress",this._calKeyEvent,!0),a.addEventListener("mousedown",this._documentClick,!0);var r=this.element.querySelector(".js-calendar");e.innerHeight+e.scrollY<r.getBoundingClientRect().bottom+20&&(r.style.marginTop=-(r.getBoundingClientRect().height+this.inputField.getBoundingClientRect().height)+"px"),this.processCalendar()},t.prototype.hide=function(){a.removeEventListener("keydown",this._calKeyEvent,!0),a.removeEventListener("keypress",this._calKeyEvent,!0),a.removeEventListener("mousedown",this._documentClick,!0),this.dropdownElement.style.display="none",this.hidden=!0},t.prototype._handleDocumentClick=function(e){var t=e.target;if(null!==t&&!t.classList.contains("time"))for(;null!==t&&t!==this.element;t=t.parentNode);if(null===t)return a.activeElement.blur(),this.hide(),s(e)},t.prototype._handleDayMouseDown=function(e){var a=e.currentTarget,t=e.target||e.srcElement;if(!t||!t.hasAttribute("data-action")){if("TD"!==a.nodeName){var r=a.getParent("TD");"TD"===r.nodeName?a=r:(a=a.getParent("TD")).classList.contains("js-calendar")&&(a=a.getElementsByTagName("table")[0])}else if(!t.classList.contains("js-btn")&&!a.classList.contains("day")&&!a.classList.contains("title"))return;if(!a||a.disabled)return!1;if(void 0===a.navtype||300!==a.navtype){50===a.navtype&&(a._current=a.innerHTML),t!==a&&t.parentNode!==a||this.cellClick(a,e);var i=null;void 0!==a.month&&(i=a),void 0!==a.parentNode.month&&(i=a.parentNode);var l=null;if(i)l=new Date(this.date),i.month!==l.getLocalMonth(this.params.dateType)&&(l.setLocalMonth(this.params.dateType,i.month),this.setDate(l),this.dateClicked=!1,this.callHandler());else{var o=null;void 0!==a.year&&(o=t),void 0!==a.parentNode.year&&(o=t.parentNode),o&&(l=new Date(this.date),o.year!==l.getLocalFullYear(this.params.dateType)&&(l.setFullYear(this.params.dateType,o.year),this.setDate(l),this.dateClicked=!1,this.callHandler()))}}return s(e)}},t.prototype.cellClick=function(e,a){var t=!1,s=!1,r=null;if(void 0===e.navtype){this.currentDateEl&&(e.classList.add("selected"),this.currentDateEl=e.caldate,(t=this.currentDateEl===e.caldate)||(this.currentDateEl=e.caldate)),this.date.setLocalDateOnly("gregorian",e.caldate);var i=!(this.dateClicked=!e.otherMonth);this.currentDateEl&&(s=!e.disabled),i&&this.processCalendar()}else{r=new Date(this.date),this.dateClicked=!1;var l=r.getOtherFullYear(this.params.dateType),o=r.getLocalMonth(this.params.dateType);switch(e.navtype){case 400:break;case-2:this.params.compressedHeader||l>this.params.minYear&&r.setOtherFullYear(this.params.dateType,l-1);break;case-1:var n=r.getLocalDate(this.params.dateType);if(o>0)n>(d=r.getLocalMonthDays(this.params.dateType,o-1))&&r.setLocalDate(this.params.dateType,d),r.setLocalMonth(this.params.dateType,o-1);else if(l-- >this.params.minYear){r.setOtherFullYear(this.params.dateType,l),n>(d=r.getLocalMonthDays(this.params.dateType,11))&&r.setLocalDate(this.params.dateType,d),r.setLocalMonth(this.params.dateType,11)}break;case 1:n=r.getLocalDate(this.params.dateType);if(o<11)n>(d=r.getLocalMonthDays(this.params.dateType,o+1))&&r.setLocalDate(this.params.dateType,d),r.setLocalMonth(this.params.dateType,o+1);else if(l<this.params.maxYear){var d;r.setOtherFullYear(this.params.dateType,l+1),n>(d=r.getLocalMonthDays(this.params.dateType,0))&&r.setLocalDate(this.params.dateType,d),r.setLocalMonth(this.params.dateType,0)}break;case 2:this.params.compressedHeader||l<this.params.maxYear&&r.setOtherFullYear(this.params.dateType,l+1)}r.equalsTo(this.date)?0===e.navtype&&(s=t=!0):(this.setDate(r),s=!0)}s&&(this.params.showsTime&&(this.dateClicked=!1),a&&this.callHandler()),e.classList.remove("hilite"),t&&!this.params.showsTime&&(this.dateClicked=!1,a&&this.close())},t.prototype._handleCalKeyEvent=function(e){var a=e.keyCode;if(e.target!==this.inputField||13!==a&&9!==a||this.close(),"rtl"===this.params.direction&&(37===a?a=39:39===a&&(a=37)),32===a&&e.shiftKey&&(e.preventDefault(),this.cellClick(this._nav_now,e),this.close()),27===a&&this.close(),38===a&&this.moveCursorBy(7),40===a&&this.moveCursorBy(-7),37===a&&this.moveCursorBy(1),39===a&&this.moveCursorBy(-1),e.target===this.inputField&&!(a>48||a<57||186===a||189===a||190===a||32===a))return s(e)},t.prototype._create=function(){var e=this,a=this.element,t=r("table"),s=r("div");this.table=t,t.className="table",t.cellSpacing=0,t.cellPadding=0,t.style.marginBottom=0,this.dropdownElement=s,a.appendChild(s),this.params.direction&&(s.style.direction=this.params.direction),s.className="js-calendar",s.style.position="absolute",s.style.boxShadow="0px 0px 70px 0px rgba(0,0,0,0.67)",s.style.minWidth=this.inputField.width,s.style.padding="0",s.style.display="none",s.style.left="auto",s.style.top="auto",s.style.zIndex=1060,s.style.borderRadius="20px",this.wrapper=r("div"),this.wrapper.className="calendar-container",s.appendChild(this.wrapper),this.wrapper.appendChild(t);var i=r("thead",t);i.className="calendar-header";var l=null,o=null,n=this,d=function(a,t,s,i,d,m,p){for(var c in i=i||"td",d=d||{},l=r(i,o),t&&(m=m?'class="'+m+'"':"",l.colSpan=t),d)l.style[c]=d[c];for(var c in p)l.setAttribute(c,p[c]);return 0!==s&&Math.abs(s)<=2&&(l.className+=" nav"),t&&l.addEventListener("mousedown",e._dayMouseDown,!0),l.calendar=n,l.navtype=s,0!==s&&Math.abs(s)<=2?l.innerHTML="<a "+m+" style='display:inline;padding:2px 6px;cursor:pointer;text-decoration:none;' unselectable='on'>"+a+"</a>":(l.innerHTML=t?"<div unselectable='on'"+m+">"+a+"</div>":a,!t&&m&&(l.className=m)),l};!1===this.params.compressedHeader&&((o=r("tr",i)).className="calendar-head-row",this._nav_py=d("&lsaquo;",1,-2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-prev-year"),this.title=d('<div style="text-align:center;font-size:18px"><span></span></div>',this.params.weekNumbers?6:5,300),this.title.className="title",this._nav_ny=d(" &rsaquo;",1,2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-next-year")),(o=r("tr",i)).className="calendar-head-row",this._nav_pm=d("&lsaquo;",1,-1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-prev-month"),this._nav_month=d('<div style="text-align:center;font-size:1.2em"><span></span></div>',this.params.weekNumbers?6:5,888,"td",{textAlign:"center"}),this._nav_month.className="title",this._nav_nm=d(" &rsaquo;",1,1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-next-month"),(o=r("tr",i)).className=e.params.weekNumbers?"daynames wk":"daynames",this.params.weekNumbers&&((l=r("td",o)).className="day-name wn",l.innerHTML=JoomlaCalLocale.wk);for(var m=7;m>0;--m)l=r("td",o),m||(l.calendar=e);this.firstdayname=this.params.weekNumbers?o.firstChild.nextSibling:o.firstChild;var p=this.params.firstDayOfWeek,c=(l=this.firstdayname,JoomlaCalLocale.weekend);for(m=0;m<7;++m){var h=(m+p)%7;l.classList.add("day-name"),this.params.weekNumbers&&l.classList.add("day-name-week"),m&&(l.calendar=e,l.fdow=h),-1!==c.indexOf(c)&&l.classList.add("weekend"),l.innerHTML=JoomlaCalLocale.shortDays[(m+p)%7],l=l.nextSibling}var u=r("tbody",t);for(this.tbody=u,m=6;m>0;--m){o=r("tr",u),this.params.weekNumbers&&(l=r("td",o));for(var y=7;y>0;--y)(l=r("td",o)).calendar=this,l.addEventListener("mousedown",this._dayMouseDown,!0)}if(this.params.showsTime){(o=r("tr",u)).className="time",(l=r("td",o)).className="time time-title",l.colSpan=1,l.style.verticalAlign="middle",l.innerHTML=" ";var v=r("td",o);v.className="time hours-select",v.colSpan=2;var g=r("td",o);g.className="time minutes-select",g.colSpan=2,function(){function a(a,t,s,i,l){var o,n=r("select",l);n.calendar=e,n.className=a,n.setAttribute("data-chosen",!0),n.style.width="100%",n.navtype=50,n._range=[];for(var d=s;d<=i;++d){var m,p="";d===t&&(p=!0),d<10&&i>=10?(o="0"+d,m=Date.convertNumbers("0")+Date.convertNumbers(d)):(o=""+d,m=""+Date.convertNumbers(d)),n.options.add(new Option(m,o,p,p))}return n}var t=e.date.getHours(),s=e.date.getMinutes(),i=!e.params.time24,n=e.date.getHours()>12;i&&n&&(t-=12);var d=a("time time-hours",t,i?1:0,i?12:23,v),m=a("time time-minutes",s,0,59,g);if((l=r("td",o)).className="time ampm-select",l.colSpan=e.params.weekNumbers?1:2,i){n=Date.parseFieldDate(e.inputField.getAttribute("data-alt-value"),e.params.dateFormat,"gregorian").getHours()>=12;var p=r("select",l);p.className="time-ampm",p.style.width="100%",p.options.add(new Option(JoomlaCalLocale.PM,"pm",!!n||"",!!n||"")),p.options.add(new Option(JoomlaCalLocale.AM,"am",!n||"",!n||"")),p.addEventListener("change",function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},!1)}else l.innerHTML="&#160;",l.colSpan=e.params.weekNumbers?3:2;d.addEventListener("change",function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},!1),m.addEventListener("change",function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},!1)}()}((o=r("div",this.wrapper)).className="buttons-wrapper btn-group",this._nav_save=d(JoomlaCalLocale.save,"",100,"button","","js-btn btn btn-clear",{type:"button","data-action":"clear"}),this.inputField.hasAttribute("required"))||o.querySelector('[data-action="clear"]').addEventListener("click",function(a){a.preventDefault();for(var t=e.table.querySelectorAll("td"),s=0;s<t.length;s++)if(t[s].classList.contains("selected")){t[s].classList.remove("selected");break}e.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00"),e.inputField.setAttribute("value",""),e.inputField.value=""});this.params.showsTodayBtn&&(this._nav_now=d(JoomlaCalLocale.today,"",0,"button","","js-btn btn btn-today",{type:"button","data-action":"today"}),this.wrapper.querySelector('[data-action="today"]').addEventListener("click",function(a){a.preventDefault(),e.date.setLocalDateOnly("gregorian",new Date),e.dateClicked=!0,e.callHandler(),e.close()}));this._nav_exit=d(JoomlaCalLocale.exit,"",999,"button","","js-btn btn btn-exit",{type:"button","data-action":"exit"}),this.wrapper.querySelector('[data-action="exit"]').addEventListener("click",function(a){a.preventDefault(),e.dateClicked||(e.inputField.value?("gregorian"!==e.params.dateType&&e.inputField.setAttribute("data-local-value",e.inputField.value),void 0===e.dateClicked?e.inputField.setAttribute("data-alt-value",Date.parseFieldDate(e.inputField.value,e.params.dateFormat,e.params.dateType).print(e.params.dateFormat,"gregorian",!1)):e.inputField.setAttribute("data-alt-value",e.date.print(e.params.dateFormat,"gregorian",!1))):e.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00"),e.date=Date.parseFieldDate(e.inputField.getAttribute("data-alt-value"),e.params.dateFormat,e.params.dateType)),e.close()}),this.processCalendar()},t.prototype.processCalendar=function(){this.table.style.visibility="hidden";var e=this.params.firstDayOfWeek,a=this.date,t=new Date,s=t.getLocalFullYear(this.params.dateType),r=t.getLocalMonth(this.params.dateType),i=t.getLocalDate(this.params.dateType),l=a.getOtherFullYear(this.params.dateType),o=a.getHours(),n=a.getMinutes(),d=(a.getSeconds(),!this.params.time24);l<this.params.minYear?(l=this.params.minYear,a.getOtherFullYear(this.params.dateType,l)):l>this.params.maxYear&&(l=this.params.maxYear,a.getOtherFullYear(this.params.dateType,l)),this.params.firstDayOfWeek=e,this.date=new Date(a);var m=a.getLocalMonth(this.params.dateType),p=a.getLocalDate(this.params.dateType);a.setLocalDate(this.params.dateType,1);var c=(a.getLocalDay(this.params.dateType)-this.params.firstDayOfWeek)%7;c<0&&(c+=7),a.setLocalDate(this.params.dateType,-c),a.setLocalDate(this.params.dateType,a.getLocalDate(this.params.dateType)+1);for(var h=this.tbody.firstChild,u=this.ar_days=new Array,y=JoomlaCalLocale.weekend,v=parseInt(a.getLocalWeekDays(this.params.dateType)),g=0;g<v;++g,h=h.nextSibling){var b=h.firstChild;this.params.weekNumbers&&(b.className="day wn",b.innerHTML=a.getLocalWeekNumber(this.params.dateType),b=b.nextSibling),h.className=this.params.weekNumbers?"daysrow wk":"daysrow";for(var L,f=!1,C=u[g]=[],w=v+1,T=0;T<w;++T,b=b.nextSibling,a.setLocalDate(this.params.dateType,L+1)){b.className="day",b.style.textAlign="center",L=a.getLocalDate(this.params.dateType);var N=a.getLocalDay(this.params.dateType);b.pos=g<<4|T,C[T]=b;var D=a.getLocalMonth(this.params.dateType)===m;if(D)b.otherMonth=!1,f=!0,b.style.cursor="pointer";else{if(!this.params.showsOthers){b.className+=" emptycell",b.innerHTML="&#160;",b.disabled=!0;continue}b.className+=" disabled othermonth ",b.otherMonth=!0}b.disabled=!1,b.innerHTML=this.params.debug?L:Date.convertNumbers(L),b.disabled||(b.caldate=new Date(a),D&&L===p&&(b.className+=" selected",this.currentDateEl=b),a.getLocalFullYear(this.params.dateType)===s&&a.getLocalMonth(this.params.dateType)===r&&L===i&&(b.className+=" today"),-1!==y.indexOf(N)&&(b.className+=" weekend"))}f||this.params.showsOthers?h.style.display="":(h.style.display="none",h.className="emptyrow")}if(this.params.showsTime){o>12&&d&&(o-=12),o=o<10?"0"+o:o,n=n<10?"0"+n:n;var F=this.table.querySelector(".time-hours"),k=this.table.querySelector(".time-minutes");if(this.resetSelected(F),this.params.time24?F.value=o:F.value="00"==o?"12":o,this.resetSelected(k),k.value=n,!this.params.time24){var J=new Date(this.inputField.getAttribute("data-alt-value")),A=this.table.querySelector(".time-ampm");J.getHours()>12&&(this.resetSelected(A),A.value="pm")}}if(this.params.compressedHeader){var M=Date.convertNumbers(l.toString());this._nav_month.getElementsByTagName("span")[0].innerHTML=this.params.monthBefore?M+" - "+JoomlaCalLocale.months[m]:JoomlaCalLocale.months[m]+" - "+M}else this._nav_month.getElementsByTagName("span")[0].innerHTML=this.params.debug?m+" "+JoomlaCalLocale.months[m]:JoomlaCalLocale.months[m],this.title.getElementsByTagName("span")[0].innerHTML=this.params.debug?l+" "+Date.convertNumbers(l.toString()):Date.convertNumbers(l.toString());this.table.style.visibility="visible"},t.prototype._bindEvents=function(){var e=this;this.inputField.addEventListener("blur",function(a){var s=t.getCalObject(this)._joomlaCalendar;if("block"!==s.dropdownElement.style.display){if(s){if(s.inputField.value)if(void 0===s.params.dateClicked)if(s.inputField.setAttribute("data-local-value",s.inputField.value),"gregorian"!==s.params.dateType){var r,i=Date.parseFieldDate(s.inputField.value,s.params.dateFormat,s.params.dateType);r=Date.localCalToGregorian(i.getFullYear(),i.getMonth(),i.getDate()),i.setFullYear(r[0]),i.setMonth(r[1]),i.setDate(r[2]),s.inputField.setAttribute("data-alt-value",i.print(s.params.dateFormat,"gregorian",!1))}else s.inputField.setAttribute("data-alt-value",Date.parseFieldDate(s.inputField.value,s.params.dateFormat,s.params.dateType).print(s.params.dateFormat,"gregorian",!1));else s.inputField.setAttribute("data-alt-value",s.date.print(s.params.dateFormat,"gregorian",!1));else s.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00");s.date=Date.parseFieldDate(s.inputField.getAttribute("data-alt-value"),s.params.dateFormat,s.params.dateType)}e.close()}else a.preventDefault()},!0),this.button.addEventListener("click",function(){e.show()},!1)};var s=function(a){return a||(a=e.event),a.preventDefault(),a.stopPropagation(),!1},r=function(e,t){var s;return s=a.createElement(e),void 0!==t&&t.appendChild(s),s},i=function(e){return!isNaN(e)&&(0|(a=parseFloat(e)))===a;var a},l=function(e,a){return(new Date).getLocalFullYear(a)+e};function o(e){for(var a=e.target.querySelectorAll(".field-calendar"),s=0,r=a.length;s<r;s++)t.init(a[s])}t.getCalObject=function(e){if(!e)return!1;for(;e.parentNode;)if((e=e.parentNode).classList.contains("field-calendar"))return e;return!1},t.prototype.setAltValue=function(){var e=this.inputField;e.getAttribute("disabled")||(e.value=e.getAttribute("data-alt-value")?e.getAttribute("data-alt-value"):"")},t.onSubmit=function(){if(Joomla=e.Joomla||{},!Joomla.calendarProcessed){Joomla.calendarProcessed=!0;for(var t=a.querySelectorAll(".field-calendar"),s=0;s<t.length;s++){var r=t[s]._joomlaCalendar;r&&r.setAltValue()}}},t.init=function(a,s){e.JoomlaCalLocale=e.JoomlaCalLocale?JoomlaCalLocale:{},JoomlaCalLocale.today=JoomlaCalLocale.today?JoomlaCalLocale.today:"today",JoomlaCalLocale.weekend=JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6],JoomlaCalLocale.localLangNumbers=JoomlaCalLocale.localLangNumbers?JoomlaCalLocale.localLangNumbers:[0,1,2,3,4,5,6,7,8,9],JoomlaCalLocale.wk=JoomlaCalLocale.wk?JoomlaCalLocale.wk:"wk",JoomlaCalLocale.AM=JoomlaCalLocale.AM?JoomlaCalLocale.AM:"AM",JoomlaCalLocale.PM=JoomlaCalLocale.PM?JoomlaCalLocale.PM:"PM",JoomlaCalLocale.am=JoomlaCalLocale.am?JoomlaCalLocale.am:"am",JoomlaCalLocale.pm=JoomlaCalLocale.pm?JoomlaCalLocale.pm:"pm",JoomlaCalLocale.dateType=JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",JoomlaCalLocale.time=JoomlaCalLocale.time?JoomlaCalLocale.time:"time",JoomlaCalLocale.days=JoomlaCalLocale.days?JoomlaCalLocale.days:'["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]',JoomlaCalLocale.shortDays=JoomlaCalLocale.shortDays?JoomlaCalLocale.shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],JoomlaCalLocale.months=JoomlaCalLocale.months?JoomlaCalLocale.months:["January","February","March","April","May","June","July","August","September","October","November","December"],JoomlaCalLocale.shortMonths=JoomlaCalLocale.shortMonths?JoomlaCalLocale.shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],JoomlaCalLocale.minYear=JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900,JoomlaCalLocale.maxYear=JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100,JoomlaCalLocale.exit=JoomlaCalLocale.exit?JoomlaCalLocale.exit:"Cancel",JoomlaCalLocale.clear=JoomlaCalLocale.clear?JoomlaCalLocale.clear:"Clear";var r=a._joomlaCalendar;r?r.recreate():new t(a),a&&a.getElementsByTagName("input")[0]&&a.getElementsByTagName("input")[0].form&&!a.getElementsByTagName("input")[0].disabled&&a.getElementsByTagName("input")[0].form.addEventListener("submit",t.onSubmit)},e.JoomlaCalendar=t,a.addEventListener("DOMContentLoaded",o),a.addEventListener("joomla:updated",o),e.Calendar={},Calendar.setup=function(e){if(e.inputField&&a.getElementById(e.inputField)){var s=a.getElementById(e.inputField),r=s.parentNode.querySelectorAll("button")[0];for(var i in e)if(e.hasOwnProperty(i))switch(i){case"ifFormat":r&&r.setAttribute("data-dayformat",e.ifFormat);break;case"firstDay":r&&r.setAttribute("data-firstday",parseInt(e.firstDay));break;case"weekNumbers":r&&r.setAttribute("data-week-numbers","true"===e.weekNumbers||!0===e.weekNumbers?"1":"0");break;case"showOthers":r&&r.setAttribute("data-show-others","true"===e.showOthers||!0===e.showOthers?"1":"0");break;case"showsTime":r&&r.setAttribute("data-show-time","true"===e.showsTime||!0===e.showsTime?"1":"0");break;case"timeFormat":r&&r.setAttribute("data-time-24",parseInt(e.timeFormat))}t.init(s.parentNode.parentNode)}return null}}(window,document);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-field-module-order-es5.min.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-module-order-es5.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){return function e(t,i,n){function r(l,a){if(!i[l]){if(!t[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[l]={exports:{}};t[l][0].call(d.exports,function(e){return r(t[l][1][e]||e)},d,d.exports,e,t,i,n)}return i[l].exports}for(var o="function"==typeof require&&require,l=0;l<n.length;l++)r(n[l]);return r}}()({1:[function(e,t,i){"use strict";var n="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},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();customElements.define("joomla-field-module-order",function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.linkedFieldSelector="",e.linkedFieldElement="",e.originalPosition="",e.writeDynaList.bind(e),e.getNewOrder.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,HTMLElement),r(t,[{key:"connectedCallback",value:function(){if(this.linkedFieldSelector=this.getAttribute("data-linked-field")||"jform_position",!this.linkedFieldSelector)throw new Error("No linked field defined!");if(this.linkedFieldElement=document.getElementById(this.linkedFieldSelector),!this.linkedFieldElement)throw new Error("No linked field defined!");var e=this;this.originalPosition=this.linkedFieldElement.value,this.getNewOrder(this.originalPosition),this.linkedFieldElement.addEventListener("change",function(){e.originalPosition=e.linkedFieldElement.value,e.getNewOrder(e.linkedFieldElement.value)})}},{key:"writeDynaList",value:function(e,t,i,n){var r=0,o=document.createElement("select");for(var l in this.hasOwnProperty("disabled")&&o.setAttribute("disabled",""),this.getAttribute("onchange")&&o.setAttribute("onchange",this.getAttribute("onchange")),this.getAttribute("size")&&o.setAttribute("size",this.getAttribute("size")),o.classList.add(e.itemClass),o.setAttribute("name",e.name),o.id=e.id,t)if(t.hasOwnProperty(l)){var a=document.createElement("option"),s=t[l];a.value=s[1],a.innerHTML=s[2],(i&&n===s[1]||!i&&0===r)&&a.setAttribute("selected","selected"),o.appendChild(a),r++}this.innerHTML="",this.appendChild(o)}},{key:"getNewOrder",value:function(e){var t=this.getAttribute("data-url"),i=this.getAttribute("data-client-id"),r=this.getAttribute("data-ordering"),o=this.getAttribute("data-name"),l=this.getAttribute("data-client-attr")?this.getAttribute("data-client-attr"):"custom-select",a=this.getAttribute("id")+"_1",s=[],u=this;Joomla.request({url:t+"client_id="+i+"&position="+e,method:"GET",perform:!0,headers:{"Content-Type":"application/x-www-form-urlencoded"},onSuccess:function(e,t){if(e&&(e=JSON.parse(e)).data.length>0){for(var i=0;i<e.data.length;++i)s[i]=e.data[i].split(",");u.writeDynaList({name:o,id:a,itemClass:l},s,u.originalPosition,r)}"object"==n(e.messages)&&null!==e.messages&&Joomla.renderMessages(e.messages)}})}}]),t}())},{}]},{},[1]);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L260

Insecure DOM Manipulation (XSS) in joomla-field-simple-color-es5.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-simple-color-es5.js:260
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.icon.innerHTML = '<span class="sr-only">' + this.textSelect + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in awesomplete.min.js

CWE-79
File Location: media/vendor/awesomplete/js/awesomplete.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){var t=function(e,i){var s=this;t.count=(t.count||0)+1,this.count=t.count,this.isOpened=!1,this.input=n(e),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=i=i||{},function(t,e,i){for(var n in e){var s=e[n],r=t.input.getAttribute("data-"+n.toLowerCase());"number"==typeof s?t[n]=parseInt(r):!1===s?t[n]=null!==r:s instanceof Function?t[n]=null:t[n]=r,t[n]||0===t[n]||(t[n]=n in i?i[n]:s)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:!1!==i.sort&&t.SORT_BYLENGTH,container:t.CONTAINER,item:t.ITEM,replace:t.REPLACE,tabSelect:!1},i),this.index=-1,this.container=this.container(e),this.ul=n.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container}),this.status=n.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:0!=this.minChars?"Type "+this.minChars+" or more characters for results.":"Begin typing for results."}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;s.opened&&(13===e&&s.selected?(t.preventDefault(),s.select()):9===e&&s.selected&&s.tabSelect?s.select():27===e?s.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),s[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),s.select(e,t.target))}}}},n.bind(this.input,this._events.input),n.bind(this.input.form,this._events.form),n.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||i.list||[],t.all.push(this)};function e(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}t.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=n(t))&&t.children){var e=[];i.apply(t.children).forEach(function(t){if(!t.disabled){var i=t.textContent.trim(),n=t.value||i,s=t.label||i;""!==n&&e.push({label:s,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),n.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),n.fire(this.input,"awesomplete-open")},destroy:function(){if(n.unbind(this.input,this._events.input),n.unbind(this.input.form,this._events.form),!this.options.container){var e=this.container.parentNode;e.insertBefore(this.input,this.container),e.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var i=t.all.indexOf(this);-1!==i&&t.all.splice(i,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent+", list item "+(t+1)+" of "+e.length,this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,n.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=n.siblingIndex(t):t=this.ul.children[this.index],t){var i=this.suggestions[this.index];n.fire(this.input,"awesomplete-select",{text:i,origin:e||t})&&(this.replace(i),this.close({reason:"select"}),n.fire(this.input,"awesomplete-selectcomplete",{text:i}))}},evaluate:function(){var t=this,i=this.input.value;i.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new e(t.data(n,i))}).filter(function(e){return t.filter(e,i)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(e,n){t.ul.appendChild(t.item(e,i,n))}),0===this.ul.children.length?(this.status.textContent="No results found",this.close({reason:"nomatches"})):(this.open(),this.status.textContent=this.ul.children.length+" results found")):(this.close({reason:"nomatches"}),this.status.textContent="No results found")}},t.all=[],t.FILTER_CONTAINS=function(t,e){return RegExp(n.regExpEscape(e.trim()),"i").test(t)},t.FILTER_STARTSWITH=function(t,e){return RegExp("^"+n.regExpEscape(e.trim()),"i").test(t)},t.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},t.CONTAINER=function(t){return n.create("div",{className:"awesomplete",around:t})},t.ITEM=function(t,e,i){var s=""===e.trim()?t:t.replace(RegExp(n.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return n.create("li",{innerHTML:s,"aria-selected":"false",id:"awesomplete_list_"+this.count+"_item_"+i})},t.REPLACE=function(t){this.input.value=t.value},t.DATA=function(t){return t},Object.defineProperty(e.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),e.prototype.toString=e.prototype.valueOf=function(){return""+this.label};var i=Array.prototype.slice;function n(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function s(t,e){return i.call((e||document).querySelectorAll(t))}function r(){s("input.awesomplete").forEach(function(e){new t(e)})}n.create=function(t,e){var i=document.createElement(t);for(var s in e){var r=e[s];if("inside"===s)n(r).appendChild(i);else if("around"===s){var o=n(r);o.parentNode.insertBefore(i,o),i.appendChild(o),null!=o.getAttribute("autofocus")&&o.focus()}else s in i?i[s]=r:i.setAttribute(s,r)}return i},n.bind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.addEventListener(e,n)})}},n.unbind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.removeEventListener(e,n)})}},n.fire=function(t,e,i){var n=document.createEvent("HTMLEvents");for(var s in n.initEvent(e,!0,!0),i)n[s]=i[s];return t.dispatchEvent(n)},n.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},n.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof self&&(self.Awesomplete=t),"undefined"!=typeof Document&&("loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r)),t.$=n,t.$$=s,"object"==typeof module&&module.exports&&(module.exports=t)}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in runmode.min.js

CWE-79
File Location: media/vendor/codemirror/addon/runmode/runmode.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),d=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9);if(r.appendChild){var i=o&&o.tabSize||e.defaults.tabSize,c=r,l=0;c.innerHTML="",r=function(e,t){if("\n"==e)return c.appendChild(document.createTextNode(d?"\r":e)),void(l=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),l+=e.length-r;break}l+=o-r,n+=e.slice(r,o);var a=i-l%i;l+=a;for(var u=0;u<a;++u)n+=" ";r=o+1}if(t){var f=c.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else c.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),f=o&&o.state||e.startState(a),s=0,p=u.length;s<p;++s){s&&r("\n");var m=new e.StringStream(u[s]);for(!m.string&&a.blankLine&&a.blankLine(f);!m.eol();){var v=a.token(m,f);r(m.current(),v,s,m.start,f),m.start=m.pos}}}});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L114

Insecure DOM Manipulation (XSS) in joomla-alert.js

CWE-79
File Location: media/vendor/joomla-custom-elements/js/joomla-alert.js:114
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- closeButton.innerHTML = this.getText('JOPEN', 'Open');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-panels-es5.min.js

CWE-79
File Location: media/vendor/joomla-custom-elements/js/joomla-panels-es5.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function t(e,i,r){function n(s,o){if(!i[s]){if(!e[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=i[s]={exports:{}};e[s][0].call(h.exports,function(t){var i=e[s][1][t];return n(i||t)},h,h.exports,t,e,i,r)}return i[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(t,e,i){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var a=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":r(e))&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.hasActive=!1,t.currentActive="",t.hasNested=!1,t.isNested=!1,t.tabs=[],t.tabsLinks=[],t.panels=[],t.tabLinkHash=[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":r(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,HTMLElement),n(e,[{key:"recall",get:function(){return this.getAttribute("recall")},set:function(t){return this.setAttribute("recall",t)}},{key:"view",get:function(){return this.getAttribute("view")},set:function(t){this.setAttribute("view",t)}},{key:"orientation",get:function(){return this.getAttribute("orientation")||"horizontal"},set:function(t){this.setAttribute("orientation",t)}},{key:"responsive",get:function(){return this.getAttribute("responsive")},set:function(t){this.setAttribute("responsive",t)}},{key:"collapseWidth",get:function(){return this.getAttribute("collapse-width")},set:function(t){this.setAttribute("collapse-width",t)}}],[{key:"observedAttributes",get:function(){return["recall","orientation","view","responsive","collapse-width"]}}]),n(e,[{key:"connectedCallback",value:function(){var t=this;if((!this.orientation||this.orientation&&-1===["horizontal","vertical"].indexOf(this.orientation))&&this.setAttribute("orientation","horizontal"),this.view=this.getAttribute("view")||"tabs",this.recall=this.recall||"false",this.responsive=this.getAttribute("responsive")||"false",this.collapseWidth=this.getAttribute("collapseWidth")||0,this.panels=[].slice.call(this.querySelectorAll("section")),!this.panels.length)throw new Error("`Joomla-panels` require one ore more panels!");if(this.findAncestorByTagNme(this,"joomla-tab")&&(this.isNested=!0),this.querySelector("joomla-tab")&&(this.hasNested=!0),this.recall){var e=sessionStorage.getItem(this.getStorageKey());e&&!/@\[/.test(e)&&this.tabLinkHash.push(e),this.setTabState()}"ul"!==this.firstElementChild.tagName&&this.createNavigation(),this.panels.forEach(function(e){e.setAttribute("role","tabpanel"),t.tabs.push("#tab-"+e.id),e.hasAttribute("active")&&(t.hasActive=!0,t.currentActive=e.id,t.querySelector("#tab-"+e.id).setAttribute("aria-selected","true"),t.querySelector("#tab-"+e.id).setAttribute("active",""),t.querySelector("#tab-"+e.id).setAttribute("tabindex","0"))}),this.hasActive||(this.tabsLinks[0].setAttribute("active",""),this.hasActive=!0,this.currentActive=this.panels[0].id,this.tabsLinks[0].setAttribute("aria-selected","true"),this.tabsLinks[0].setAttribute("tabindex","0"),this.tabsLinks[0].setAttribute("active",""),this.panels[0].setAttribute("active","")),window.location.href.match(/#tab-/),"accordion"===this.view&&this.toAccordion.bind(this)(),"true"===this.responsive&&(this.changeView.bind(this),window.addEventListener("resize",this.changeView.bind(this)))}},{key:"disconnectedCallback",value:function(){var t=this,e=this.querySelector("ul");[].slice.call(e.querySelectorAll("a")).forEach(function(e){e.removeEventListener("click",t.activateTabFromLink,!0)}),e.removeEventListener("keydown",t.keyBehaviour,!0)}},{key:"createNavigation",value:function(){var t=this,e=this,i="";"ul"!==this.firstElementChild.tagName.toLowerCase()&&(i=document.createElement("ul")),i.setAttribute("role","tablist"),this.panels.forEach(function(r){if(!r.id)throw new Error("`joomla-panels` All panels require an ID");if(r.parentNode===t){var n=r.getAttribute("active")||!1,a=document.createElement("li"),s=document.createElement("a");a.setAttribute("role","presentation"),s.setAttribute("role","tab"),s.setAttribute("aria-controls",r.id),s.setAttribute("aria-selected",n?"true":"false"),s.setAttribute("tabindex",n?"0":"-1"),s.setAttribute("href","#"+r.id),s.setAttribute("id","tab-"+r.id),s.innerHTML=r.getAttribute("name"),n&&s.setAttribute("active",""),s.addEventListener("click",e.activateTabFromLink.bind(e)),t.tabsLinks.push(s),a.append(s),i.append(a),r.setAttribute("aria-labelledby","tab-"+r.id),n||r.setAttribute("aria-hidden","true")}}),this.insertAdjacentElement("afterbegin",i),this.querySelector("ul").addEventListener("keydown",this.keyBehaviour.bind(this))}},{key:"hideCurrent",value:function(){if(this.currentActive){var t=this.querySelector('a[aria-controls="'+this.currentActive+'"]');this.dispatchCustomEvent("joomla.tab.hide",t,this.querySelector("#tab-"+this.currentActive)),t.removeAttribute("active"),t.setAttribute("tabindex","-1"),this.querySelector("#"+this.currentActive).removeAttribute("active"),this.querySelector("#"+this.currentActive).setAttribute("aria-hidden","true"),t.removeAttribute("aria-selected"),this.dispatchCustomEvent("joomla.tab.hidden",t,this.querySelector("#tab-"+this.currentActive))}}},{key:"activateTabFromLink",value:function(t){t.preventDefault();var e=this.currentActive;this.hasActive&&this.hideCurrent(),this.dispatchCustomEvent("joomla.tab.show",t.target,this.querySelector("#tab-"+e)),t.target.setAttribute("active",""),t.target.setAttribute("aria-selected","true"),t.target.setAttribute("tabindex","0"),this.querySelector(t.target.hash).setAttribute("active",""),this.querySelector(t.target.hash).removeAttribute("aria-hidden"),this.currentActive=t.target.hash.substring(1),this.dispatchCustomEvent("joomla.tab.shown",t.target,this.querySelector("#tab-"+e)),this.saveState("#tab-"+t.target.hash.substring(1))}},{key:"showTab",value:function(t){document.querySelector("#tab-"+t.id).click()}},{key:"show",value:function(t){t.click()}},{key:"keyBehaviour",value:function(t){var e=this.querySelector("#tab-"+this.currentActive),i=e.parentNode.previousElementSibling||e.parentNode.parentNode.lastElementChild,r=e.parentNode.nextElementSibling||e.parentNode.parentNode.firstElementChild;if(!t.metaKey&&!t.altKey&&-1!==this.tabs.indexOf("#"+document.activeElement.id))switch(t.keyCode){case 37:case 38:t.preventDefault(),t.stopPropagation(),i.querySelector("a").click(),i.querySelector("a").focus();break;case 39:case 40:t.preventDefault(),t.stopPropagation(),r.querySelector("a").click(),r.querySelector("a").focus()}}},{key:"getStorageKey",value:function(){return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/,"").split("#")[0]}},{key:"saveState",value:function(t){var e=this.getStorageKey();sessionStorage.setItem(e,t)}},{key:"setTabState",value:function(){var t=this,e=this,i=this.tabsLinks;if(this.hasNested){if(this.tabLinkHash.length&&""!==this.tabLinkHash[0]){var r=this.tabLinkHash[0].substring(5),n=this.querySelector(""+r);if(n){var a=this.findAncestorByTagNme(n,"joomla-tab");if(this.findAncestorByTagNme(a,"joomla-tab")){var s=this.findAncestorByTagNme(a,"section");s&&this.tabLinkHash.push("#tab-"+s.id)}}}i.forEach(function(i){if(t.tabLinkHash.length){var r="#tab-"+i.id;-1===t.tabLinkHash.indexOf(r)?i.removeAttribute("active"):i.setAttribute("active","")}i.parentNode===e&&t.tabsLinks.push(i)})}else i.forEach(function(e){if(t.tabLinkHash.length){var i="#tab-"+e.hash;t.tabLinkHash.indexOf(i)>-1?e.removeAttribute("active"):e.setAttribute("active","")}}),this.tabsLinks=i}},{key:"toTabs",value:function(){for(var t=this,e=0,i=this.panels.length;e<i;++e)this.panels[e].parentNode.parentNode.parentNode===this&&this.tabsLinks.push(this.panels[e]);this.tabsLinks.length&&this.tabsLinks.forEach(function(e){t.appendChild(e)})}},{key:"toAccordion",value:function(){var t=this;this.panels.length&&this.panels.forEach(function(e){t.querySelector('a[aria-controls="'+e.id+'"]').parentNode.appendChild(e)})}},{key:"changeView",value:function(){if(window.outerWidth>920){if("tabs"===this.view)return;this.toTabs.bind(this),this.view="tabs"}else{if("accordion"===this.view)return;this.toAccordion.bind(this),this.view="accordion"}}},{key:"activateUriHash",value:function(){var t=window.location.href.match(/#\S[^&]*/),e=this.querySelector(t[0]);if(e){var i=this.findAncestorByTagNme(e,"joomla-tab"),r=this.findAncestorByTagNme(i,"joomla-tab");if(r){var n=this.findAncestorByTagNme(i,"section");r.showTab(n),this.show(e)}else this.showTab(e)}}},{key:"findAncestorByTagNme",value:function(t,e){for(;(t=t.parentElement)&&t.nodeName.toLowerCase()!==e;);return t}},{key:"dispatchCustomEvent",value:function(t,e,i){var r=new CustomEvent(t,{bubbles:!0,cancelable:!0});i&&(r.relatedTarget=i),e.dispatchEvent(r),e.removeEventListener(t,e)}}]),e}();customElements.define("joomla-panels",a)},{}]},{},[1]);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1739

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:1739
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- t.timefloatcurrent.innerHTML = (0, _time.secondsToTimeCode)(t.newTime, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2139

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:2139
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- duration.innerHTML = '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L3018

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:3018
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- mute.innerHTML = mode === 'horizontal' ? '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' : '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' + ('<a href="javascript:void(0);" class="' + t.options.classPrefix + 'volume-slider" ') + ('aria-label="' + _i18n2.default.t('mejs.volume-slider') + '" aria-valuemin="0" aria-valuemax="100" role="slider" ') + 'aria-orientation="vertical">' + ('<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>') + ('<div class="' + t.options.classPrefix + 'volume-total">') + ('<div class="' + t.options.classPrefix + 'volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'volume-handle"></div>') + '</div>' + '</a>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: media/vendor/tinymce/plugins/help/plugin.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(){return t}},o={noop:function(){},noarg:function(t){return function(){return t()}},compose:function(t,e){return function(){return t(e.apply(null,arguments))}},constant:r,identity:function(t){return t},tripleEquals:function(t,e){return t===e},curry:function(t){for(var e=new Array(arguments.length-1),n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}},not:function(t){return function(){return!t.apply(null,arguments)}},die:function(t){return function(){throw new Error(t)}},apply:function(t){return t()},call:function(t){t()},never:r(!1),always:r(!0)},a=o.never,i=o.always,u=function(){return c},c=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t},r={fold:function(t,e){return t()},is:a,isSome:a,isNone:i,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},or:n,orThunk:e,map:u,ap:u,each:function(){},bind:u,flatten:u,exists:a,forall:i,filter:u,equals:t,equals_:t,toArray:function(){return[]},toString:o.constant("none()")};return Object.freeze&&Object.freeze(r),r}(),l=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:i,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,or:n,orThunk:n,map:function(e){return l(e(t))},ap:function(e){return e.fold(u,function(e){return l(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:c},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},s={some:l,none:u,from:function(t){return null===t||void 0===t?c:l(t)}},f=void 0===(t=Array.prototype.indexOf)?function(t,e){return d(t,e)}:function(e,n){return t.call(e,n)},m=function(t,e){return f(t,e)>-1},p=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var a=t[o];r[o]=e(a,o,t)}return r},h=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var a=t[r];e(a,r,t)&&n.push(a)}return n},d=function(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return n;return-1},y=(Array.prototype.push,Array.prototype.slice,p),g=h,k=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n,t))return s.some(o)}return s.none()},v=m,b=tinymce.util.Tools.resolve("tinymce.util.I18n"),x=tinymce.util.Tools.resolve("tinymce.Env"),w=x.mac?"⌘":"Ctrl",C=x.mac?"Ctrl + Alt":"Shift + Alt",A={shortcuts:[{shortcut:w+" + B",action:"Bold"},{shortcut:w+" + I",action:"Italic"},{shortcut:w+" + U",action:"Underline"},{shortcut:w+" + A",action:"Select all"},{shortcut:w+" + Y or "+w+" + Shift + Z",action:"Redo"},{shortcut:w+" + Z",action:"Undo"},{shortcut:C+" + 1",action:"Header 1"},{shortcut:C+" + 2",action:"Header 2"},{shortcut:C+" + 3",action:"Header 3"},{shortcut:C+" + 4",action:"Header 4"},{shortcut:C+" + 5",action:"Header 5"},{shortcut:C+" + 6",action:"Header 6"},{shortcut:C+" + 7",action:"Paragraph"},{shortcut:C+" + 8",action:"Div"},{shortcut:C+" + 9",action:"Address"},{shortcut:"Alt + F9",action:"Focus to menubar"},{shortcut:"Alt + F10",action:"Focus to toolbar"},{shortcut:"Alt + F11",action:"Focus to element path"},{shortcut:"Ctrl + Shift + P > Ctrl + Shift + P",action:"Focus to contextual toolbar"},{shortcut:w+" + K",action:"Insert link (if link plugin activated)"},{shortcut:w+" + S",action:"Save (if save plugin activated)"},{shortcut:w+" + F",action:"Find (if searchreplace plugin activated)"}]},S=function(){var t=y(A.shortcuts,function(t){return'<tr data-mce-tabstop="1" tabindex="-1" '+function(t){return'aria-label="Action: '+t.action+", Shortcut: "+t.shortcut.replace(/Ctrl/g,"Control")+'"'}(t)+"><td>"+b.translate(t.action)+"</td><td>"+t.shortcut+"</td></tr>"}).join("");return{title:"Handy Shortcuts",type:"container",style:"overflow-y: auto; overflow-x: hidden; max-height: 250px",items:[{type:"container",html:'<div><table class="mce-table-striped"><thead><th>'+b.translate("Action")+"</th><th>"+b.translate("Shortcut")+"</th></thead>"+t+"</table></div>"}]}},T=void 0===(e=Object.keys)?function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}:e,P=function(t,e){for(var n=T(t),r=0,o=n.length;r<o;r++){var a=n[r];e(t[a],a,t)}},_=function(t,e){var n={};return P(t,function(r,o){var a=e(r,o,t);n[a.k]=a.v}),n},H=function(t,e){var n=[];return P(t,function(t,r){n.push(e(t,r))}),n},O=function(t){return H(t,function(t){return t})},M={bifilter:function(t,e){var n={},r={};return P(t,function(t,o){(e(t,o)?n:r)[o]=t}),{t:n,f:r}},each:P,map:function(t,e){return _(t,function(t,n,r){return{k:n,v:e(t,n,r)}})},mapToArray:H,tupleMap:_,find:function(t,e){for(var n=T(t),r=0,o=n.length;r<o;r++){var a=n[r],i=t[a];if(e(i,a,t))return s.some(i)}return s.none()},keys:T,values:O,size:function(t){return O(t).length}},E=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"compat3x",name:"3.x Compatibility"},{key:"contextmenu",name:"Context Menu"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"}],F=o.curry(function(t,e){return t.replace(/\${([^{}]*)}/g,function(t,n){var r=e[n];return function(t){var e=typeof t;return"string"===e||"number"===e}(r)?r:t})},'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),I=function(t){var e=function(t){var e=M.keys(t.plugins);return void 0===t.settings.forced_plugins?e:g(e,o.not(o.curry(v,t.settings.forced_plugins)))}(t),n=y(e,function(e){return"<li>"+function(t,e){return k(E,function(t){return t.key===e}).fold(function(){var n=t.plugins[e].getMetadata;return"function"==typeof n?F(n()):e},function(t){return F({name:t.name,url:"https://www.tinymce.com/docs/plugins/"+t.key})})}(t,e)+"</li>"}),r=n.length,a=n.join("");return"<p><b>"+b.translate(["Plugins installed ({0}):",r])+"</b></p><ul>"+a+"</ul>"},L=function(t){return{title:"Plugins",type:"container",style:"overflow-y: auto; overflow-x: hidden;",layout:"flex",padding:10,spacing:10,items:[function(t){return{type:"container",html:'<div style="overflow-y: auto; overflow-x: hidden; max-height: 230px; height: 230px;" data-mce-tabstop="1" tabindex="-1">'+I(t)+"</div>",flex:1}}(t),{type:"container",html:'<div style="padding: 10px; background: #e3e7f4; height: 100%;" data-mce-tabstop="1" tabindex="-1"><p><b>'+b.translate("Premium plugins:")+'</b></p><ul><li>PowerPaste</li><li>Spell Checker Pro</li><li>Accessibility Checker</li><li>Advanced Code Editor</li><li>Enhanced Media Embed</li><li>Link Checker</li></ul><br /><p style="float: right;"><a href="https://www.tinymce.com/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+b.translate("Learn more...")+"</a></p></div>",flex:1}]}},B=tinymce.util.Tools.resolve("tinymce.EditorManager"),j=function(){var t,e,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(t=B.majorVersion,e=B.minorVersion,0===t.indexOf("@")?"X.X.X":t+"."+e)+"</a>";return[{type:"label",html:b.translate(["You are using {0}",n])},{type:"spacer",flex:1},{text:"Close",onclick:function(){this.parent().parent().close()}}]},z=function(t,e){return function(){t.windowManager.open({title:"Help",bodyType:"tabpanel",layout:"flex",body:[S(),L(t)],buttons:j(),onPostRender:function(){this.getEl("title").innerHTML='<img src="'+e+'/img/logo.png" alt="TinyMCE Logo" style="display: inline-block; width: 200px; height: 50px">'}})}},D=function(t,e){t.addCommand("mceHelp",z(t,e))},q=function(t,e){t.addButton("help",{icon:"help",onclick:z(t,e)}),t.addMenuItem("Help",{text:"Help",icon:"help",context:"help",onclick:z(t,e)})};n.add("help",function(t,e){q(t,e),D(t,e),t.shortcuts.add("Alt+0","Open help dialog","mceHelp")})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2605

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/inlite/theme.js:2605
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- self.getEl().lastChild.innerHTML = self.encode(e.value);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4104

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/modern/theme.js:4104
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- self.getEl().lastChild.innerHTML = self.encode(e.value);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L8983

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/modern/theme.js:8983
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- body.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L5346

Insecure DOM Manipulation (XSS) in tinymce.js

CWE-79
File Location: media/vendor/tinymce/tinymce.js:5346
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- elm.innerHTML = text;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L10429

Insecure DOM Manipulation (XSS) in tinymce.js

CWE-79
File Location: media/vendor/tinymce/tinymce.js:10429
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L21211

Insecure DOM Manipulation (XSS) in tinymce.js

CWE-79
File Location: media/vendor/tinymce/tinymce.js:21211
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpElm.innerHTML = rng.toString();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L33

Insecure DOM Manipulation (XSS) in webcomponents-ce.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-ce.js:33
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- a,b),e(this.nextSibling,d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");})}N&&r(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=N.call(this,a)});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):v(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName,c=b?this.content:this,
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L186

Insecure DOM Manipulation (XSS) in field-media.js

CWE-79
File Location: build/media/webcomponents/js/field-media/field-media.js:186
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = '<span class="field-media-preview-icon fa fa-picture-o"></span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L82

Insecure DOM Manipulation (XSS) in field-module-order.js

CWE-79
File Location: build/media/webcomponents/js/field-module-order/field-module-order.js:82
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in associations-edit.es6.min.js

CWE-79
File Location: media/com_associations/js/associations-edit.es6.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- Joomla=window.Joomla||{},((e,o)=>{"use strict";e.hideAssociation=((e,s)=>{[].slice.call(o.querySelectorAll("#associations .control-group")).forEach(o=>{const t=o.querySelector(".control-label label");if(t){t.getAttribute("for").replace("_id","")===`${e}_associations_${s.replace("-","_")}`&&(o.style.display="none")}})}),e.showAssociationMessage=(()=>{[].slice.call(o.querySelectorAll("#associations .control-group")).forEach(s=>{s.style.display="none";const t=o.getElementById("associations");if(t){const s=o.createElement("div");s.classList.add("alert"),s.classList.add("alert-info"),s.id="associations-notice",s.innerHTML=e.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE"),t.insertAdjacentElement("afterbegin",s)}})}),o.addEventListener("DOMContentLoaded",()=>{const s=e.getOptions("system.associations.edit"),t=s.formControl||"jform",a=o.getElementById(`${t}_language`);1===parseInt(s.hidden,10)?e.showAssociationMessage():a&&e.hideAssociation(t,a.value),a&&a.addEventListener("change",s=>{e.removeMessages();let a=!1;[].slice.call(o.querySelectorAll("#associations .control-group")).forEach(e=>{const s=e.querySelector(".control-label label").getAttribute("for").replace("_id","").replace("jform_associations_","");e.style.display="block",a||""===o.getElementById(`${t}_associations_${s}_id`).value||(a=!0);const i=o.getElementById(`${t}_associations_${s}_clear`);i.onclick?i.onclick():i.click&&i.click()}),a&&e.renderMessages({warning:[e.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});const i=s.target.value;"*"===i?e.showAssociationMessage():e.hideAssociation(t,i)})})})(Joomla,document);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L13

Insecure DOM Manipulation (XSS) in admin-compare-compare.js

CWE-79
File Location: media/com_contenthistory/js/admin-compare-compare.js:13
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- diff = JsDiff.diffWords(original.innerHTML, changed.innerHTML),
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L238

Insecure DOM Manipulation (XSS) in overrider.js

CWE-79
File Location: media/com_languages/js/overrider.js:238
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('jform_override').value = document.getElementById('override_string' + id).innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L36

Insecure DOM Manipulation (XSS) in edit-images.js

CWE-79
File Location: media/com_media/js/edit-images.js:36
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('media-manager-edit-container').innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L49

Insecure DOM Manipulation (XSS) in admin-module-edit.js

CWE-79
File Location: media/com_modules/js/admin-module-edit.js:49
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpMenu.innerHTML = '<span class=\"badge badge-danger\">' + Joomla.JText._('JNO') + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L70

Insecure DOM Manipulation (XSS) in admin-module-edit.js

CWE-79
File Location: media/com_modules/js/admin-module-edit.js:70
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpMenu.innerHTML = '<span class=\"badge badge-info\">' + Joomla.JText._('JALL') + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in html5.min.js

CWE-79
File Location: media/legacy/js/html5.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(e,t){var n,r,a=e.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,c=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,i="_html5shiv",l=0,m={};function s(){var e=f.elements;return"string"==typeof e?e.split(" "):e}function u(e){var t=m[e[i]];return t||(t={},l++,e[i]=l,m[l]=t),t}function d(e,n,a){return n||(n=t),r?n.createElement(e):(a||(a=u(n)),!(i=a.cache[e]?a.cache[e].cloneNode():c.test(e)?(a.cache[e]=a.createElem(e)).cloneNode():a.createElem(e)).canHaveChildren||o.test(e)||i.tagUrn?i:a.frag.appendChild(i));var i}function h(e){e||(e=t);var a=u(e);return!f.shivCSS||n||a.hasCSS||(a.hasCSS=!!function(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),r||function(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return f.shivMethods?d(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+s().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(f,t.frag)}(e,a),e}!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",n="hidden"in e,r=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){n=!0,r=!0}}();var f={elements:a.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.3",shivCSS:!1!==a.shivCSS,supportsUnknownElements:r,shivMethods:!1!==a.shivMethods,type:"default",shivDocument:h,createElement:d,createDocumentFragment:function(e,n){if(e||(e=t),r)return e.createDocumentFragment();for(var a=(n=n||u(e)).frag.cloneNode(),o=0,c=s(),i=c.length;o<i;o++)a.createElement(c[o]);return a},addElements:function(e,t){var n=f.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),f.elements=n+" "+e,h(t)}};e.html5=f,h(t),"object"==typeof module&&module.exports&&(module.exports=f)}("undefined"!=typeof window?window:this,document);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L33

Insecure DOM Manipulation (XSS) in jupdatecheck.js

CWE-79
File Location: media/plg_quickicon_joomlaupdate/js/jupdatecheck.js:33
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- linkSpan[i].innerHTML = Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L919

Insecure DOM Manipulation (XSS) in calendar.js

CWE-79
File Location: media/system/js/fields/calendar.js:919
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- cell.innerHTML = "&#160;";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L993

Insecure DOM Manipulation (XSS) in calendar.js

CWE-79
File Location: media/system/js/fields/calendar.js:993
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this._nav_month.getElementsByTagName('span')[0].innerHTML = this.params.debug ? month + ' ' + JoomlaCalLocale.months[month] : JoomlaCalLocale.months[month];
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-field-media.min.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-media.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- ((t,e)=>{if(!e)throw new Error("Joomla API is not properly initiated");e.selectedFile={},window.document.addEventListener("onMediaFileSelected",t=>{e.selectedFile=t.detail}),e.doIt=((t,i,s)=>{if(!0===t.success){if(t.data[0].url)if(/local-/.test(t.data[0].adapter)){const i=e.getOptions("system.paths").rootFull;e.selectedFile.url=t.data[0].url.split(i)[1],t.data[0].thumb_path?e.selectedFile.thumb=t.data[0].thumb_path:e.selectedFile.thumb=!1}else t.data[0].thumb_path&&(e.selectedFile.thumb=t.data[0].thumb_path);else e.selectedFile.url=!1;const r=t=>"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName;e.selectedFile.url&&(r(i)||"object"==typeof i?!r(i)&&"object"==typeof i&&i.id?window.parent.Joomla.editors.instances[i.id].replaceSelection(`<img src="${e.selectedFile.url}" alt=""/>`):(i.value=e.selectedFile.url,s.updatePreview()):e.editors.instances[i].replaceSelection(`<img src="${e.selectedFile.url}" alt=""/>`))}}),e.getImage=((t,i,s)=>new Promise((r,l)=>{const o=`${e.getOptions("system.paths").rootFull}administrator/index.php?option=com_media&format=json`;e.request({url:`${o}&task=api.files&url=true&path=${t.path}&${e.getOptions("csrf.token")}=1&format=json`,method:"GET",perform:!0,headers:{"Content-Type":"application/json"},onSuccess:t=>{const l=JSON.parse(t);r(e.doIt(l,i,s))},onError:()=>{l()}})}));t.define("joomla-field-media",class extends HTMLElement{static get observedAttributes(){return["type","base-path","root-folder","url","modal-container","modal-width","modal-height","input","button-select","button-clear","button-save-selected","preview","preview-width","preview-height"]}get type(){return this.getAttribute("type")}set type(t){this.setAttribute("type",t)}get basePath(){return this.getAttribute("base-path")}set basePath(t){this.setAttribute("base-path",t)}get rootFolder(){return this.getAttribute("root-folder")}set rootFolder(t){this.setAttribute("root-folder",t)}get url(){return this.getAttribute("url")}set url(t){this.setAttribute("url",t)}get modalContainer(){return this.getAttribute("modal-container")}set modalContainer(t){this.setAttribute("modal-container",t)}get input(){return this.getAttribute("input")}set input(t){this.setAttribute("input",t)}get buttonSelect(){return this.getAttribute("button-select")}set buttonSelect(t){this.setAttribute("button-select",t)}get buttonClear(){return this.getAttribute("button-clear")}set buttonClear(t){this.setAttribute("button-clear",t)}get buttonSaveSelected(){return this.getAttribute("button-save-selected")}set buttonSaveSelected(t){this.setAttribute("button-save-selected",t)}get modalWidth(){return this.getAttribute(parseInt("modal-width",10))}set modalWidth(t){this.setAttribute("modal-width",t)}get modalHeight(){return this.getAttribute(parseInt("modal-height",10))}set modalHeight(t){this.setAttribute("modal-height",t)}get previewWidth(){return this.getAttribute(parseInt("preview-width",10))}set previewWidth(t){this.setAttribute("preview-width",t)}get previewHeight(){return this.getAttribute(parseInt("preview-height",10))}set previewHeight(t){this.setAttribute("preview-height",t)}get preview(){return this.getAttribute("preview")}set preview(t){this.setAttribute("preview",t)}get previewContainer(){return this.getAttribute("preview-container")}connectedCallback(){const t=this.querySelector(this.buttonSelect),e=this.querySelector(this.buttonClear);this.show=this.show.bind(this),this.modalClose=this.modalClose.bind(this),this.clearValue=this.clearValue.bind(this),this.setValue=this.setValue.bind(this),this.updatePreview=this.updatePreview.bind(this),t.addEventListener("click",this.show),e&&e.addEventListener("click",this.clearValue),this.updatePreview()}disconnectedCallback(){this.querySelector(this.buttonClear).removeEventListener("click",this)}show(){const t=this;this.querySelector('[role="dialog"]').open(),this.querySelector(this.buttonSaveSelected).addEventListener("click",e=>(e.preventDefault(),e.stopPropagation(),this.selectedPath&&t.setValue(this.selectedPath),t.modalClose(),!1))}modalClose(){const t=this.querySelector(this.input);e.getImage(e.selectedFile,t,this),e.Modal.getCurrent().close()}setValue(t){this.querySelector(this.input).value=t,this.updatePreview()}clearValue(){this.setValue("")}updatePreview(){if(-1!==["true","static"].indexOf(this.preview)&&"false"!==this.preview&&this.preview){const t=this.querySelector(this.input).value,i=this.querySelector(".field-media-preview");if(t){i.innerHTML="";const s=new Image;switch(this.type){case"image":s.src=s.src=/http/.test(t)?t:e.getOptions("system.paths").rootFull+t}i.style.width=this.previewWidth,i.appendChild(s)}else i.innerHTML='<span class="field-media-preview-icon fa fa-picture-o"></span>'}}})})(customElements,Joomla);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L116

Insecure DOM Manipulation (XSS) in lint.js

CWE-79
File Location: media/vendor/codemirror/addon/lint/lint.js:116
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tip.innerHTML = ann.messageHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-alert-es5.min.js

CWE-79
File Location: media/vendor/joomla-custom-elements/js/joomla-alert-es5.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function t(e,o,i){function n(s,a){if(!o[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=o[s]={exports:{}};e[s][0].call(c.exports,function(t){var o=e[s][1][t];return n(o||t)},c,c.exports,t,e,o,i)}return o[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,o){"use strict";var i,n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}();i=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":n(e))&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":n(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,HTMLElement),r(e,[{key:"type",get:function(){return this.getAttribute("type")},set:function(t){return this.setAttribute("type",t)}},{key:"dismiss",get:function(){return this.getAttribute("dismiss")}},{key:"acknowledge",get:function(){return this.getAttribute("acknowledge")}},{key:"href",get:function(){return this.getAttribute("href")}}],[{key:"observedAttributes",get:function(){return["type","dismiss","acknowledge","href"]}}]),r(e,[{key:"connectedCallback",value:function(){this.setAttribute("role","alert"),this.classList.add("joomla-alert--show"),this.type&&-1!==["info","warning","danger","success"].indexOf(this.type)||this.setAttribute("type","info"),(this.hasAttribute("dismiss")||this.hasAttribute("acknowledge")||this.hasAttribute("href")&&""!==this.getAttribute("href")&&!this.querySelector("button.joomla-alert--close")&&!this.querySelector("button.joomla-alert-button--close"))&&this.appendCloseButton(),this.dispatchCustomEvent("joomla.alert.show");var t=this.querySelector("button.joomla-alert--close")||this.querySelector("button.joomla-alert-button--close");t&&t.focus()}},{key:"disconnectedCallback",value:function(){this.removeEventListener("joomla.alert.show",this),this.removeEventListener("joomla.alert.close",this),this.removeEventListener("joomla.alert.closed",this),this.firstChild.tagName&&"button"===this.firstChild.tagName.toLowerCase()&&this.firstChild.removeEventListener("click",this)}},{key:"attributeChangedCallback",value:function(t,e,o){switch(t){case"type":(!o||o&&-1===["info","warning","danger","success"].indexOf(o))&&(this.type="info");break;case"dismiss":case"acknowledge":o&&"true"!==o?this.removeCloseButton():this.appendCloseButton();break;case"href":o&&""!==o?this.querySelector("button.joomla-alert-button--close")||this.appendCloseButton():this.removeCloseButton()}}},{key:"close",value:function(){this.dispatchCustomEvent("joomla.alert.close"),this.addEventListener("transitionend",function(){this.dispatchCustomEvent("joomla.alert.closed"),this.parentNode.removeChild(this)},!1),this.classList.remove("joomla-alert--show")}},{key:"dispatchCustomEvent",value:function(t){var e=new CustomEvent(t);e.relatedTarget=this,this.dispatchEvent(e),this.removeEventListener(t,this)}},{key:"appendCloseButton",value:function(){if(!this.querySelector("button.joomla-alert--close")&&!this.querySelector("button.joomla-alert-button--close")){var t=this,e=document.createElement("button");this.hasAttribute("dismiss")?(e.classList.add("joomla-alert--close"),e.innerHTML='<span aria-hidden="true">&times;</span>',e.setAttribute("aria-label",this.getText("JCLOSE","Close"))):(e.classList.add("joomla-alert-button--close"),this.hasAttribute("acknowledge")?e.innerHTML=this.getText("JOK","ok"):e.innerHTML=this.getText("JOPEN","Open")),this.firstChild?this.insertBefore(e,this.firstChild):this.appendChild(e),e&&(this.href?e.addEventListener("click",function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),window.location.href=t.href,t.close()}):e.addEventListener("click",function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),t.getAttribute("data-callback")?(window[t.getAttribute("data-callback")](),t.close()):t.close()})),this.hasAttribute("auto-dismiss")&&setTimeout(function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),t.hasAttribute("data-callback")?window[t.getAttribute("data-callback")]():t.close()},parseInt(t.getAttribute("auto-dismiss"))?t.getAttribute("auto-dismiss"):3e3)}}},{key:"removeCloseButton",value:function(){var t=this.querySelector("button");t&&(t.removeEventListener("click",this),t.parentNode.removeChild(t))}},{key:"getText",value:function(t,e){return window.Joomla&&Joomla.JText&&Joomla.JText._&&"function"==typeof Joomla.JText._&&Joomla.JText._(t)?Joomla.JText._(t):e}}]),e}(),customElements.define("joomla-alert",i)},{}]},{},[1]);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L248

Insecure DOM Manipulation (XSS) in joomla-panels-es5.js

CWE-79
File Location: media/vendor/joomla-custom-elements/js/joomla-panels-es5.js:248
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- aElement.innerHTML = panel.getAttribute('name');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1287

Insecure DOM Manipulation (XSS) in jquery.js

CWE-79
File Location: media/vendor/jquery/js/jquery.js:1287
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = "<a href='' disabled='disabled'></a>" +
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2723

Insecure DOM Manipulation (XSS) in jquery.js

CWE-79
File Location: media/vendor/jquery/js/jquery.js:2723
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = "<input/>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2112

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:2112
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- time.innerHTML = '<span class="' + t.options.classPrefix + 'currenttime">' + (0, _time.secondsToTimeCode)(0, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat) + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2198

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:2198
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration').innerHTML = timecode;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2617

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:2617
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2957

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:2957
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- _temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: media/vendor/tinymce/plugins/table/plugin.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var t,n,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(){return t}},o={noop:function(){},noarg:function(t){return function(){return t()}},compose:function(t,n){return function(){return t(n.apply(null,arguments))}},constant:r,identity:function(t){return t},tripleEquals:function(t,n){return t===n},curry:function(t){for(var n=new Array(arguments.length-1),e=1;e<arguments.length;e++)n[e-1]=arguments[e];return function(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var o=n.concat(e);return t.apply(null,o)}},not:function(t){return function(){return!t.apply(null,arguments)}},die:function(t){return function(){throw new Error(t)}},apply:function(t){return t()},call:function(t){t()},never:r(!1),always:r(!0)},i=o.never,u=o.always,a=function(){return c},c=function(){var t=function(t){return t.isNone()},n=function(t){return t()},e=function(t){return t},r={fold:function(t,n){return t()},is:i,isSome:i,isNone:u,getOr:e,getOrThunk:n,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},or:e,orThunk:n,map:a,ap:a,each:function(){},bind:a,flatten:a,exists:i,forall:u,filter:a,equals:t,equals_:t,toArray:function(){return[]},toString:o.constant("none()")};return Object.freeze&&Object.freeze(r),r}(),l=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:u,isNone:i,getOr:n,getOrThunk:n,getOrDie:n,or:e,orThunk:e,map:function(n){return l(n(t))},ap:function(n){return n.fold(a,function(n){return l(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:c},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(i,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},s={some:l,none:a,from:function(t){return null===t||void 0===t?c:l(t)}},f=void 0===(t=Array.prototype.indexOf)?function(t,n){return b(t,n)}:function(n,e){return t.call(n,e)},d=function(t,n){return f(t,n)>-1},m=function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o,t)}return r},g=function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e,t)},p=function(t,n){for(var e=t.length-1;e>=0;e--)n(t[e],e,t)},h=function(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var i=t[r];n(i,r,t)&&e.push(i)}return e},v=function(t,n){for(var e=0,r=t.length;e<r;e++)if(n(t[e],e,t))return s.some(e);return s.none()},b=function(t,n){for(var e=0,r=t.length;e<r;++e)if(t[e]===n)return e;return-1},w=Array.prototype.push,y=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!Array.prototype.isPrototypeOf(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);w.apply(n,t[e])}return n},x=function(t,n){for(var e=0,r=t.length;e<r;++e)if(!0!==n(t[e],e,t))return!1;return!0},S=Array.prototype.slice,C={map:m,each:g,eachr:p,partition:function(t,n){for(var e=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(n(u,o,t)?e:r).push(u)}return{pass:e,fail:r}},filter:h,groupBy:function(t,n){if(0===t.length)return[];for(var e=n(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=n(a);c!==e&&(r.push(o),o=[]),e=c,o.push(a)}return 0!==o.length&&r.push(o),r},indexOf:function(t,n){var e=f(t,n);return-1===e?s.none():s.some(e)},foldr:function(t,n,e){return p(t,function(t){e=n(e,t)}),e},foldl:function(t,n,e){return g(t,function(t){e=n(e,t)}),e},find:function(t,n){for(var e=0,r=t.length;e<r;e++){var o=t[e];if(n(o,e,t))return s.some(o)}return s.none()},findIndex:v,flatten:y,bind:function(t,n){var e=m(t,n);return y(e)},forall:x,exists:function(t,n){return v(t,n).isSome()},contains:d,equal:function(t,n){return t.length===n.length&&x(t,function(t,e){return t===n[e]})},reverse:function(t){var n=S.call(t,0);return n.reverse(),n},chunk:function(t,n){for(var e=[],r=0;r<t.length;r+=n){var o=t.slice(r,r+n);e.push(o)}return e},difference:function(t,n){return h(t,function(t){return!d(n,t)})},mapToObject:function(t,n){for(var e={},r=0,o=t.length;r<o;r++){var i=t[r];e[String(i)]=n(i,r)}return e},pure:function(t){return[t]},sort:function(t,n){var e=S.call(t,0);return e.sort(n),e},range:function(t,n){for(var e=[],r=0;r<t;r++)e.push(n(r));return e},head:function(t){return 0===t.length?s.none():s.some(t[0])},last:function(t){return 0===t.length?s.none():s.some(t[t.length-1])}},R=void 0===(n=Object.keys)?function(t){var n=[];for(var e in t)t.hasOwnProperty(e)&&n.push(e);return n}:n,T=function(t,n){for(var e=R(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i,t)}},D=function(t,n){var e={};return T(t,function(r,o){var i=n(r,o,t);e[i.k]=i.v}),e},A=function(t,n){var e=[];return T(t,function(t,r){e.push(n(t,r))}),e},k=function(t){return A(t,function(t){return t})},N={bifilter:function(t,n){var e={},r={};return T(t,function(t,o){(n(t,o)?e:r)[o]=t}),{t:e,f:r}},each:T,map:function(t,n){return D(t,function(t,e,r){return{k:e,v:n(t,e,r)}})},mapToArray:A,tupleMap:D,find:function(t,n){for(var e=R(t),r=0,o=e.length;r<o;r++){var i=e[r],u=t[i];if(n(u,i,t))return s.some(u)}return s.none()},keys:R,values:k,size:function(t){return k(t).length}},O=function(t){return function(n){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(n)===t}},E={isString:O("string"),isObject:O("object"),isArray:O("array"),isNull:O("null"),isBoolean:O("boolean"),isUndefined:O("undefined"),isFunction:O("function"),isNumber:O("number")},B=function(t){return t.slice(0).sort()},P={sort:B,reqMessage:function(t,n){throw new Error("All required keys ("+B(t).join(", ")+") were not specified. Specified keys were: "+B(n).join(", ")+".")},unsuppMessage:function(t){throw new Error("Unsupported keys for object: "+B(t).join(", "))},validateStrArr:function(t,n){if(!E.isArray(n))throw new Error("The "+t+" fields must be an array. Was: "+n+".");C.each(n,function(n){if(!E.isString(n))throw new Error("The value "+n+" in the "+t+" fields was not a string.")})},invalidTypeMessage:function(t,n){throw new Error("All values need to be of type: "+n+". Keys ("+B(t).join(", ")+") were not.")},checkDupes:function(t){var n=B(t);C.find(n,function(t,e){return e<n.length-1&&t===n[e+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})}},I={immutable:function(){var t=arguments;return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return C.each(t,function(t,e){r[t]=o.constant(n[e])}),r}},immutableBag:function(t,n){var e=t.concat(n);if(0===e.length)throw new Error("You must specify at least one required or optional field.");return P.validateStrArr("required",t),P.validateStrArr("optional",n),P.checkDupes(e),function(r){var i=N.keys(r);C.forall(t,function(t){return C.contains(i,t)})||P.reqMessage(t,i);var u=C.filter(i,function(t){return!C.contains(e,t)});u.length>0&&P.unsuppMessage(u);var a={};return C.each(t,function(t){a[t]=o.constant(r[t])}),C.each(n,function(t){a[t]=o.constant(Object.prototype.hasOwnProperty.call(r,t)?s.some(r[t]):s.none())}),a}}},W=I.immutable("width","height"),M=I.immutable("rows","columns"),L=I.immutable("row","column"),q=I.immutable("x","y"),F=I.immutable("element","rowspan","colspan"),z=I.immutable("element","rowspan","colspan","isNew"),j={dimensions:W,grid:M,address:L,coords:q,extended:I.immutable("element","rowspan","colspan","row","column"),detail:F,detailnew:z,rowdata:I.immutable("element","cells","section"),elementnew:I.immutable("element","isNew"),rowdatanew:I.immutable("element","cells","section","isNew"),rowcells:I.immutable("cells","section"),rowdetails:I.immutable("details","section"),bounds:I.immutable("startRow","startCol","finishRow","finishCol")},_=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:o.constant(t)}},H={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||e.childNodes.length>1)throw console.error("HTML does not have a single root node",t),"HTML must have a single root node";return _(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return _(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return _(e)},fromDom:_,fromPoint:function(t,n,e){return s.from(t.dom().elementFromPoint(n,e)).map(_)}},V=8,U=9,G=1,X=3,Y=G,K=U,$=function(t){return t.nodeType!==Y&&t.nodeType!==K||0===t.childElementCount},J={all:function(t,n){var e=void 0===n?document:n.dom();return $(e)?[]:C.map(e.querySelectorAll(t),H.fromDom)},is:function(t,n){var e=t.dom();if(e.nodeType!==Y)return!1;if(void 0!==e.matches)return e.matches(n);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(n);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(n);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},one:function(t,n){var e=void 0===n?document:n.dom();return $(e)?s.none():s.from(e.querySelector(t)).map(H.fromDom)}},Q=function(t,n){var e=[],r=function(t){return e.push(t),n(t)},o=n(t);do{o=o.bind(r)}while(o.isSome());return e},Z="undefined"!=typeof window?window:Function("return this;")(),tt=function(t,n){for(var e=void 0!==n&&null!==n?n:Z,r=0;r<t.length&&void 0!==e&&null!==e;++r)e=e[t[r]];return e},nt=function(t,n){var e=t.split(".");return tt(e,n)},et=function(t,n){var e=function(t,n){return nt(t,n)}(t,n);if(void 0===e||null===e)throw t+" not available on this browser";return e},rt=function(){return et("Node")},ot=function(t,n,e){return 0!=(t.compareDocumentPosition(n)&e)},it=function(t,n){return ot(t,n,rt().DOCUMENT_POSITION_CONTAINED_BY)},ut=function(t){var n,e=!1;return function(){return e||(e=!0,n=t.apply(null,arguments)),n}},at=function(){return ct(0,0)},ct=function(t,n){return{major:t,minor:n}},lt={nu:ct,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?at():function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var r=t[e];if(r.test(n))return r}}(t,n);if(!e)return{major:0,minor:0};var r=function(t){return Number(n.replace(e,"$"+t))};return ct(r(1),r(2))}(t,e)},unknown:at},st=function(t,n){return function(){return n===t}},ft=function(t){var n=t.current;return{current:n,version:t.version,isEdge:st("Edge",n),isChrome:st("Chrome",n),isIE:st("IE",n),isOpera:st("Opera",n),isFirefox:st("Firefox",n),isSafari:st("Safari",n)}},dt={unknown:function(){return ft({current:void 0,version:lt.unknown()})},nu:ft,edge:o.constant("Edge"),chrome:o.constant("Chrome"),ie:o.constant("IE"),opera:o.constant("Opera"),firefox:o.constant("Firefox"),safari:o.constant("Safari")},mt=function(t,n){return function(){return n===t}},gt=function(t){var n=t.current;return{current:n,version:t.version,isWindows:mt("Windows",n),isiOS:mt("iOS",n),isAndroid:mt("Android",n),isOSX:mt("OSX",n),isLinux:mt("Linux",n),isSolaris:mt("Solaris",n),isFreeBSD:mt("FreeBSD",n)}},pt={unknown:function(){return gt({current:void 0,version:lt.unknown()})},nu:gt,windows:o.constant("Windows"),ios:o.constant("iOS"),android:o.constant("Android"),linux:o.constant("Linux"),osx:o.constant("OSX"),solaris:o.constant("Solaris"),freebsd:o.constant("FreeBSD")},ht=function(t,n){var e=String(n).toLowerCase();return C.find(t,function(t){return t.search(e)})},vt=function(t,n){return ht(t,n).map(function(t){var e=lt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},bt=function(t,n){return ht(t,n).map(function(t){var e=lt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},wt=function(t,n){return n+t},yt=function(t,n){return t+n},xt=function(t,n){return t.substring(n)},St=function(t,n){return t.substring(0,t.length-n)},Ct=function(t){return""===t?s.none():s.some(t.substr(0,1))},Rt=function(t){return""===t?s.none():s.some(t.substring(1))},Tt=function(t,n,e){return""===n||!(t.length<n.length)&&t.substr(e,e+n.length)===n},Dt=function(t,n){return Tt(t,n,0)},At=function(t,n){return Tt(t,n,t.length-n.length)},kt={supplant:function(t,n){return t.replace(/\${([^{}]*)}/g,function(t,e){var r=n[e];return function(t){var n=typeof t;return"string"===n||"number"===n}(r)?r:t})},startsWith:Dt,removeLeading:function(t,n){return Dt(t,n)?xt(t,n.length):t},removeTrailing:function(t,n){return At(t,n)?St(t,n.length):t},ensureLeading:function(t,n){return Dt(t,n)?t:wt(t,n)},ensureTrailing:function(t,n){return At(t,n)?t:yt(t,n)},endsWith:At,contains:function(t,n){return-1!==t.indexOf(n)},trim:function(t){return t.replace(/^\s+|\s+$/g,"")},lTrim:function(t){return t.replace(/^\s+/g,"")},rTrim:function(t){return t.replace(/\s+$/g,"")},capitalize:function(t){return Ct(t).bind(function(n){return Rt(t).map(function(t){return n.toUpperCase()+t})}).getOr(t)}},Nt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ot=function(t){return function(n){return kt.contains(n,t)}},Et=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return kt.contains(t,"edge/")&&kt.contains(t,"chrome")&&kt.contains(t,"safari")&&kt.contains(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Nt],search:function(t){return kt.contains(t,"chrome")&&!kt.contains(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return kt.contains(t,"msie")||kt.contains(t,"trident")}},{name:"Opera",versionRegexes:[Nt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ot("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ot("firefox")},{name:"Safari",versionRegexes:[Nt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(kt.contains(t,"safari")||kt.contains(t,"mobile/"))&&kt.contains(t,"applewebkit")}}],Bt=[{name:"Windows",search:Ot("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return kt.contains(t,"iphone")||kt.contains(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ot("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ot("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ot("linux"),versionRegexes:[]},{name:"Solaris",search:Ot("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ot("freebsd"),versionRegexes:[]}],Pt={browsers:o.constant(Et),oses:o.constant(Bt)},It=function(t){var n=Pt.browsers(),e=Pt.oses(),r=vt(n,t).fold(dt.unknown,dt.nu),i=bt(e,t).fold(pt.unknown,pt.nu);return{browser:r,os:i,deviceType:function(t,n,e){var r=t.isiOS()&&!0===/ipad/i.test(e),i=t.isiOS()&&!r,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=r||u||a&&!0===/mobile/i.test(e),l=t.isiOS()||t.isAndroid(),s=l&&!c,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(e);return{isiPad:o.constant(r),isiPhone:o.constant(i),isTablet:o.constant(c),isPhone:o.constant(s),isTouch:o.constant(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:o.constant(f)}}(i,r,t)}},Wt={detect:ut(function(){var t=navigator.userAgent;return It(t)})},Mt=function(t,n){return t.dom()===n.dom()},Lt=Wt.detect().browser.isIE()?function(t,n){return it(t.dom(),n.dom())}:function(t,n){var e=t.dom(),r=n.dom();return e!==r&&e.contains(r)},qt={eq:Mt,isEqualNode:function(t,n){return t.dom().isEqualNode(n.dom())},member:function(t,n){return C.exists(n,o.curry(Mt,t))},contains:Lt,is:J.is},Ft=function(t){return H.fromDom(t.dom().ownerDocument)},zt=function(t){var n=t.dom();return s.from(n.parentNode).map(H.fromDom)},jt=function(t){var n=t.dom();return s.from(n.previousSibling).map(H.fromDom)},_t=function(t){var n=t.dom();return s.from(n.nextSibling).map(H.fromDom)},Ht=function(t){var n=t.dom();return C.map(n.childNodes,H.fromDom)},Vt=function(t,n){var e=t.dom().childNodes;return s.from(e[n]).map(H.fromDom)},Ut=I.immutable("element","offset"),Gt={owner:Ft,defaultView:function(t){var n=t.dom().ownerDocument.defaultView;return H.fromDom(n)},documentElement:function(t){var n=Ft(t);return H.fromDom(n.dom().documentElement)},parent:zt,findIndex:function(t){return zt(t).bind(function(n){var e=Ht(n);return C.findIndex(e,function(n){return qt.eq(t,n)})})},parents:function(t,n){for(var e=E.isFunction(n)?n:o.constant(!1),r=t.dom(),i=[];null!==r.parentNode&&void 0!==r.parentNode;){var u=r.parentNode,a=H.fromDom(u);if(i.push(a),!0===e(a))break;r=u}return i},siblings:function(t){return zt(t).map(Ht).map(function(n){return C.filter(n,function(n){return!qt.eq(t,n)})}).getOr([])},prevSibling:jt,offsetParent:function(t){var n=t.dom();return s.from(n.offsetParent).map(H.fromDom)},prevSiblings:function(t){return C.reverse(Q(t,jt))},nextSibling:_t,nextSiblings:function(t){return Q(t,_t)},children:Ht,child:Vt,firstChild:function(t){return Vt(t,0)},lastChild:function(t){return Vt(t,t.dom().childNodes.length-1)},childNodesCount:function(t){return t.dom().childNodes.length},hasChildNodes:function(t){return t.dom().hasChildNodes()},leaf:function(t,n){var e=Ht(t);return e.length>0&&n<e.length?Ut(e[n],0):Ut(t,n)}},Xt=function(t,n,e){return C.bind(Gt.children(t),function(t){return J.is(t,n)?e(t)?[t]:[]:Xt(t,n,e)})},Yt={firstLayer:function(t,n){return Xt(t,n,o.constant(!0))},filterFirstLayer:Xt},Kt=function(t){return t.dom().nodeName.toLowerCase()},$t=function(t){return t.dom().nodeType},Jt=function(t){return function(n){return $t(n)===t}},Qt=Jt(G),Zt=Jt(X),tn=Jt(U),nn={name:Kt,type:$t,value:function(t){return t.dom().nodeValue},isElement:Qt,isText:Zt,isDocument:tn,isComment:function(t){return $t(t)===V||"#comment"===Kt(t)}},en=function(t,n,e){if(!(E.isString(e)||E.isBoolean(e)||E.isNumber(e)))throw console.error("Invalid call to Attr.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},rn=function(t,n,e){en(t.dom(),n,e)},on=function(t,n){var e=t.dom().getAttribute(n);return null===e?void 0:e},un=function(t,n){var e=t.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},an={clone:function(t){return C.foldl(t.dom().attributes,function(t,n){return t[n.name]=n.value,t},{})},set:rn,setAll:function(t,n){var e=t.dom();N.each(n,function(t,n){en(e,n,t)})},get:on,has:un,remove:function(t,n){t.dom().removeAttribute(n)},hasNone:function(t){var n=t.dom().attributes;return void 0===n||null===n||0===n.length},transfer:function(t,n,e){nn.isElement(t)&&nn.isElement(n)&&C.each(e,function(e){!function(t,n,e){un(t,e)&&!un(n,e)&&rn(n,e,on(t,e))}(t,n,e)})}},cn=ut(function(){return ln(H.fromDom(document))}),ln=function(t){var n=t.dom().body;if(null===n||void 0===n)throw"Body is not available yet";return H.fromDom(n)},sn={body:cn,getBody:ln,inBody:function(t){var n=nn.isText(t)?t.dom().parentNode:t.dom();return void 0!==n&&null!==n&&n.ownerDocument.body.contains(n)}},fn=function(t,n){var e=[];return C.each(Gt.children(t),function(t){n(t)&&(e=e.concat([t])),e=e.concat(fn(t,n))}),e},dn={all:function(t){return fn(sn.body(),t)},ancestors:function(t,n,e){return C.filter(Gt.parents(t,e),n)},siblings:function(t,n){return C.filter(Gt.siblings(t),n)},children:function(t,n){return C.filter(Gt.children(t),n)},descendants:fn},mn={all:function(t){return J.all(t)},ancestors:function(t,n,e){return dn.ancestors(t,function(t){return J.is(t,n)},e)},siblings:function(t,n){return dn.siblings(t,function(t){return J.is(t,n)})},children:function(t,n){return dn.children(t,function(t){return J.is(t,n)})},descendants:function(t,n){return J.all(n,t)}};function gn(t,n,e,r,o){return t(e,r)?s.some(e):E.isFunction(o)&&o(e)?s.none():n(e,r,o)}var pn=function(t,n,e){for(var r=t.dom(),i=E.isFunction(e)?e:o.constant(!1);r.parentNode;){r=r.parentNode;var u=H.fromDom(r);if(n(u))return s.some(u);if(i(u))break}return s.none()},hn=function(t,n){return C.find(t.dom().childNodes,o.compose(n,H.fromDom)).map(H.fromDom)},vn=function(t,n){var e=function(t){for(var r=0;r<t.childNodes.length;r++){if(n(H.fromDom(t.childNodes[r])))return s.some(H.fromDom(t.childNodes[r]));var o=e(t.childNodes[r]);if(o.isSome())return o}return s.none()};return e(t.dom())},bn={first:function(t){return vn(sn.body(),t)},ancestor:pn,closest:function(t,n,e){return gn(function(t){return n(t)},pn,t,n,e)},sibling:function(t,n){var e=t.dom();return e.parentNode?hn(H.fromDom(e.parentNode),function(e){return!qt.eq(t,e)&&n(e)}):s.none()},child:hn,descendant:vn},wn=function(t,n,e){return bn.ancestor(t,function(t){return J.is(t,n)},e)},yn={first:function(t){return J.one(t)},ancestor:wn,sibling:function(t,n){return bn.sibling(t,function(t){return J.is(t,n)})},child:function(t,n){return bn.child(t,function(t){return J.is(t,n)})},descendant:function(t,n){return J.one(n,t)},closest:function(t,n,e){return gn(J.is,wn,t,n,e)}},xn=function(t,n,e){var r=void 0!==e?e:o.constant(!1);return r(n)?s.none():C.contains(t,nn.name(n))?s.some(n):yn.ancestor(n,t.join(","),function(t){return J.is(t,"table")||r(t)})},Sn=function(t,n){return Gt.parent(n).map(function(n){return mn.children(n,t)})},Cn=function(t,n){return parseInt(an.get(t,n),10)},Rn={cell:function(t,n){return xn(["td","th"],t,n)},firstCell:function(t){return yn.descendant(t,"th,td")},cells:function(t){return Yt.firstLayer(t,"th,td")},neighbourCells:o.curry(Sn,"th,td"),table:function(t,n){return yn.closest(t,"table",n)},row:function(t,n){return xn(["tr"],t,n)},rows:function(t){return Yt.firstLayer(t,"tr")},notCell:function(t,n){return xn(["caption","tr","tbody","tfoot","thead"],t,n)},neighbourRows:o.curry(Sn,"tr"),attr:Cn,grid:function(t,n,e){var r=Cn(t,n),o=Cn(t,e);return j.grid(r,o)}},Tn=function(t){var n=Rn.rows(t);return C.map(n,function(t){var n=t,e=Gt.parent(n).bind(function(t){var n=nn.name(t);return"tfoot"===n||"thead"===n||"tbody"===n?n:"tbody"}),r=C.map(Rn.cells(t),function(t){var n=an.has(t,"rowspan")?parseInt(an.get(t,"rowspan"),10):1,e=an.has(t,"colspan")?parseInt(an.get(t,"colspan"),10):1;return j.detail(t,n,e)});return j.rowdata(n,r,e)})},Dn=function(t,n){return C.map(t,function(t){var e=C.map(Rn.cells(t),function(t){var n=an.has(t,"rowspan")?parseInt(an.get(t,"rowspan"),10):1,e=an.has(t,"colspan")?parseInt(an.get(t,"colspan"),10):1;return j.detail(t,n,e)});return j.rowdata(t,e,n.section())})},An=function(t,n){return t+","+n},kn=function(t,n){var e=C.bind(t.all(),function(t){return t.cells()});return C.filter(e,n)},Nn={generate:function(t){var n={},e=[],r=t.length,i=0;C.each(t,function(t,r){var o=[];C.each(t.cells(),function(t,e){for(var u=0;void 0!==n[An(r,u)];)u++;for(var a=j.extended(t.element(),t.rowspan(),t.colspan(),r,u),c=0;c<t.colspan();c++)for(var l=0;l<t.rowspan();l++){var s=u+c,f=An(r+l,s);n[f]=a,i=Math.max(i,s+1)}o.push(a)}),e.push(j.rowdata(t.element(),o,t.section()))});var u=j.grid(r,i);return{grid:o.constant(u),access:o.constant(n),all:o.constant(e)}},getAt:function(t,n,e){var r=t.access()[An(n,e)];return void 0!==r?s.some(r):s.none()},findItem:function(t,n,e){var r=kn(t,function(t){return e(n,t.element())});return r.length>0?s.some(r[0]):s.none()},filterItems:kn,justCells:function(t){var n=C.map(t.all(),function(t){return t.cells()});return C.flatten(n)}},On={isSupported:function(t){return void 0!==t.style}},En=function(t,n,e){if(!E.isString(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);On.isSupported(t)&&t.style.setProperty(n,e)},Bn=function(t,n){On.isSupported(t)&&t.style.removeProperty(n)},Pn=function(t,n,e){var r=t.dom();En(r,n,e)},In=function(t,n){return On.isSupported(t)?t.style.getPropertyValue(n):""},Wn=function(t,n){var e=t.dom(),r=In(e,n);return s.from(r).filter(function(t){return t.length>0})},Mn={copy:function(t,n){var e=t.dom(),r=n.dom();On.isSupported(e)&&On.isSupported(r)&&(r.style.cssText=e.style.cssText)},set:Pn,preserve:function(t,n){var e=an.get(t,"style"),r=n(t);return(void 0===e?an.remove:an.set)(t,"style",e),r},setAll:function(t,n){var e=t.dom();N.each(n,function(t,n){En(e,n,t)})},setOptions:function(t,n){var e=t.dom();N.each(n,function(t,n){t.fold(function(){Bn(e,n)},function(t){En(e,n,t)})})},remove:function(t,n){var e=t.dom();Bn(e,n),an.has(t,"style")&&""===kt.trim(an.get(t,"style"))&&an.remove(t,"style")},get:function(t,n){var e=t.dom(),r=window.getComputedStyle(e).getPropertyValue(n),o=""!==r||sn.inBody(t)?r:In(e,n);return null===o?void 0:o},getRaw:Wn,getAllRaw:function(t){var n={},e=t.dom();if(On.isSupported(e))for(var r=0;r<e.style.length;r++){var o=e.style.item(r);n[o]=e.style[o]}return n},isValidValue:function(t,n,e){var r=H.fromTag(t);return Pn(r,n,e),Wn(r,n).isSome()},reflow:function(t){return t.dom().offsetWidth},transfer:function(t,n,e){nn.isElement(t)&&nn.isElement(n)&&C.each(e,function(e){!function(t,n,e){Wn(t,e).each(function(t){Wn(n,e).isNone()&&Pn(n,e,t)})}(t,n,e)})}},Ln=function(t,n){Gt.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},qn=function(t,n){t.dom().appendChild(n.dom())},Fn={before:Ln,after:function(t,n){Gt.nextSibling(t).fold(function(){Gt.parent(t).each(function(t){qn(t,n)})},function(t){Ln(t,n)})},prepend:function(t,n){Gt.firstChild(t).fold(function(){qn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:qn,appendAt:function(t,n,e){Gt.child(t,e).fold(function(){qn(t,n)},function(t){Ln(t,n)})},wrap:function(t,n){Ln(t,n),qn(n,t)}},zn={before:function(t,n){C.each(n,function(n){Fn.before(t,n)})},after:function(t,n){C.each(n,function(e,r){var o=0===r?t:n[r-1];Fn.after(o,e)})},prepend:function(t,n){C.each(n.slice().reverse(),function(n){Fn.prepend(t,n)})},append:function(t,n){C.each(n,function(n){Fn.append(t,n)})}},jn=function(t){var n=t.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},_n={empty:function(t){t.dom().textContent="",C.each(Gt.children(t),function(t){jn(t)})},remove:jn,unwrap:function(t){var n=Gt.children(t);n.length>0&&zn.before(t,n),jn(t)}},Hn=I.immutable("minRow","minCol","maxRow","maxCol"),Vn=function(t,n){var e=t.grid().columns(),r=t.grid().rows(),o=e,i=0,u=0;return N.each(t.access(),function(t){if(n(t)){var e=t.row(),a=e+t.rowspan()-1,c=t.column(),l=c+t.colspan()-1;e<r?r=e:a>i&&(i=a),c<o?o=c:l>u&&(u=l)}}),Hn(r,o,i,u)},Un=function(t,n,e){var r=t[e].element(),o=H.fromTag("td");Fn.append(o,H.fromTag("br")),(n?Fn.append:Fn.prepend)(r,o)},Gn=function(t,n){var e=function(t){return J.is(t.element(),n)},r=Tn(t),o=Nn.generate(r),i=Vn(o,e),u="th:not("+n+"),td:not("+n+")",a=Yt.filterFirstLayer(t,"th,td",function(t){return J.is(t,u)});return C.each(a,_n.remove),function(t,n,e,r){for(var o=n.grid().columns(),i=n.grid().rows(),u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)u<e.minRow()||u>e.maxRow()||c<e.minCol()||c>e.maxCol()||(Nn.getAt(n,u,c).filter(r).isNone()?Un(t,a,u):a=!0)}(r,o,i,e),function(t,n){var e=C.filter(Yt.firstLayer(t,"tr"),function(t){return 0===t.dom().childElementCount});C.each(e,_n.remove),n.minCol()!==n.maxCol()&&n.minRow()!==n.maxRow()||C.each(Yt.firstLayer(t,"th,td"),function(t){an.remove(t,"rowspan"),an.remove(t,"colspan")}),an.remove(t,"width"),an.remove(t,"height"),Mn.remove(t,"width"),Mn.remove(t,"height")}(t,i),t},Xn=function(t,n){return H.fromDom(t.dom().cloneNode(n))},Yn=function(t){return Xn(t,!0)},Kn=function(t,n){var e=H.fromTag(n),r=an.clone(t);return an.setAll(e,r),e},$n=function(t){return Xn(t,!1)},Jn=Yn,Qn=function(t,n){var e=Kn(t,n),r=Gt.children(Yn(t));return zn.append(e,r),e},Zn=function(t,n){var e=function(n){return t(n)?s.from(n.dom().nodeValue):s.none()},r=Wt.detect().browser,o=r.isIE()&&10===r.version.major?function(t){try{return e(t)}catch(t){return s.none()}}:e;return{get:function(e){if(!t(e))throw new Error("Can only get "+n+" value of a "+n+" node");return o(e).getOr("")},getOption:o,set:function(e,r){if(!t(e))throw new Error("Can only set raw "+n+" value of a "+n+" node");e.dom().nodeValue=r}}}(nn.isText,"text"),te={get:function(t){return Zn.get(t)},getOption:function(t){return Zn.getOption(t)},set:function(t,n){Zn.set(t,n)}},ne=function(t){return"img"===nn.name(t)?1:te.getOption(t).fold(function(){return Gt.children(t).length},function(t){return t.length})},ee=["img","br"],re=ne,oe=function(t){var n;return n=t,te.getOption(n).filter(function(t){return 0!==t.trim().length||t.indexOf(" ")>-1}).isSome()||C.contains(ee,nn.name(t))},ie=function(t,n){var e=function(t){for(var r=Gt.children(t),o=r.length-1;o>=0;o--){var i=r[o];if(n(i))return s.some(i);var u=e(i);if(u.isSome())return u}return s.none()};return e(t)},ue={first:function(t){return bn.descendant(t,oe)},last:function(t){return ie(t,oe)}},ae=function(){var t=H.fromTag("td");return Fn.append(t,H.fromTag("br")),t},ce=function(t,n,e){var r=Qn(t,n);return N.each(e,function(t,n){null===t?an.remove(r,n):an.set(r,n,t)}),r},le=function(t){return t},se=function(t){return function(){return H.fromTag("tr",t.dom())}},fe={cellOperations:function(t,n,e){return{row:se(n),cell:function(n){var r=Gt.owner(n.element()),o=H.fromTag(nn.name(n.element()),r.dom()),i=e.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),u=i.length>0?function(t,n,e){return ue.first(t).map(function(r){var o=e.join(","),i=mn.ancestors(r,o,function(n){return qt.eq(n,t)});return C.foldr(i,function(t,n){var e=$n(n);return Fn.append(t,e),e},n)}).getOr(n)}(n.element(),o,i):o;return Fn.append(u,H.fromTag("br")),Mn.copy(n.element(),o),Mn.remove(o,"height"),1!==n.colspan()&&Mn.remove(n.element(),"width"),t(n.element(),o),o},replace:ce,gap:ae}},paste:function(t){return{row:se(t),cell:ae,replace:le,gap:ae}}},de=function(t,n){var e=(n||document).createElement("div");return e.innerHTML=t,Gt.children(H.fromDom(e))},me=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function ge(){return{up:o.constant({selector:yn.ancestor,closest:yn.closest,predicate:bn.ancestor,all:Gt.parents}),down:o.constant({selector:mn.descendants,predicate:dn.descendants}),styles:o.constant({get:Mn.get,getRaw:Mn.getRaw,set:Mn.set,remove:Mn.remove}),attrs:o.constant({get:an.get,set:an.set,remove:an.remove,copyTo:function(t,n){var e=an.clone(t);an.setAll(n,e)}}),insert:o.constant({before:Fn.before,after:Fn.after,afterAll:zn.after,append:Fn.append,appendAll:zn.append,prepend:Fn.prepend,wrap:Fn.wrap}),remove:o.constant({unwrap:_n.unwrap,remove:_n.remove}),create:o.constant({nu:H.fromTag,clone:function(t){return H.fromDom(t.dom().cloneNode(!1))},text:H.fromText}),query:o.constant({comparePosition:function(t,n){return t.dom().compareDocumentPosition(n.dom())},prevSibling:Gt.prevSibling,nextSibling:Gt.nextSibling}),property:o.constant({children:Gt.children,name:nn.name,parent:Gt.parent,isText:nn.isText,isComment:nn.isComment,isElement:nn.isElement,getText:te.get,setText:te.set,isBoundary:function(t){return!!nn.isElement(t)&&("body"===nn.name(t)||C.contains(me,nn.name(t)))},isEmptyTag:function(t){return!!nn.isElement(t)&&C.contains(["br","img","hr","input"],nn.name(t))}}),eq:qt.eq,is:qt.is}}I.immutable("left","right");var pe=function(t,n,e,r){var o=n(t,e);return C.foldr(r,function(e,r){var o=n(t,r);return he(t,e,o)},o)},he=function(t,n,e){return n.bind(function(n){return e.filter(o.curry(t.eq,n))})},ve=function(t,n,e){return e.length>0?function(t,n,e,r){return r(t,n,e[0],e.slice(1))}(t,n,e,pe):s.none()},be=function(t,n){return o.curry(t.eq,n)},we=function(t,n,e,r){var i=void 0!==r?r:o.constant(!1),u=[n].concat(t.up().all(n)),a=[e].concat(t.up().all(e)),c=function(t){return C.findIndex(t,i).fold(function(){return t},function(n){return t.slice(0,n+1)})},l=c(u),s=c(a),f=C.find(l,function(n){return C.exists(s,be(t,n))});return{firstpath:o.constant(l),secondpath:o.constant(s),shared:o.constant(f)}},ye=we,xe=function(t,n,e){return ve(t,n,e)},Se=function(t,n,e,r){return ye(t,n,e,r)},Ce=ge(),Re=function(t,n){return xe(Ce,function(n,e){return t(e)},n)},Te=function(t,n,e){return Se(Ce,t,n,e)},De=function(t,n){return n.column()>=t.startCol()&&n.column()+n.colspan()-1<=t.finishCol()&&n.row()>=t.startRow()&&n.row()+n.rowspan()-1<=t.finishRow()},Ae=function(t,n){var e=n.column(),r=n.column()+n.colspan()-1,o=n.row(),i=n.row()+n.rowspan()-1;return e<=t.finishCol()&&r>=t.startCol()&&o<=t.finishRow()&&i>=t.startRow()},ke=function(t,n){for(var e=!0,r=o.curry(De,n),i=n.startRow();i<=n.finishRow();i++)for(var u=n.startCol();u<=n.finishCol();u++)e=e&&Nn.getAt(t,i,u).exists(r);return e?s.some(n):s.none()},Ne=function(t,n,e){var r=Nn.findItem(t,n,qt.eq),o=Nn.findItem(t,e,qt.eq);return r.bind(function(t){return o.map(function(n){return e=t,r=n,j.bounds(Math.min(e.row(),r.row()),Math.min(e.column(),r.column()),Math.max(e.row()+e.rowspan()-1,r.row()+r.rowspan()-1),Math.max(e.column()+e.colspan()-1,r.column()+r.colspan()-1));var e,r})})},Oe=Ne,Ee=function(t,n,e){return Ne(t,n,e).bind(function(n){return ke(t,n)})},Be=function(t,n,e,r){return Nn.findItem(t,n,qt.eq).bind(function(n){var o=e>0?n.row()+n.rowspan()-1:n.row(),i=r>0?n.column()+n.colspan()-1:n.column();return Nn.getAt(t,o+e,i+r).map(function(t){return t.element()})})},Pe=function(t,n,e){return Oe(t,n,e).map(function(n){var e=Nn.filterItems(t,o.curry(Ae,n));return C.map(e,function(t){return t.element()})})},Ie=function(t,n){return Nn.findItem(t,n,function(t,n){return qt.contains(n,t)}).bind(function(t){return t.element()})},We=function(t){var n=Tn(t);return Nn.generate(n)},Me=function(t,n,e){return Rn.table(t).bind(function(r){var o=We(r);return Be(o,t,n,e)})},Le=function(t,n,e){var r=We(t);return Pe(r,n,e)},qe=function(t,n,e,r,o){var i=We(t),u=qt.eq(t,e)?n:Ie(i,n),a=qt.eq(t,o)?r:Ie(i,r);return Pe(i,u,a)},Fe=function(t,n,e){var r=We(t);return Ee(r,n,e)},ze=function(t,n){return yn.ancestor(t,"table")},je=I.immutableBag(["boxes","start","finish"],[]),_e=function(t,n,e){var r=function(t){return function(n){return e(n)||qt.eq(n,t)}};return qt.eq(t,n)?s.some(je({boxes:s.some([t]),start:t,finish:n})):ze(t).bind(function(o){return ze(n).bind(function(i){if(qt.eq(o,i))return s.some(je({boxes:Le(o,t,n),start:t,finish:n}));if(qt.contains(o,i)){var u=(a=mn.ancestors(n,"td,th",r(o))).length>0?a[a.length-1]:n;return s.some(je({boxes:qe(o,t,o,n,i),start:t,finish:u}))}if(qt.contains(i,o)){var a,c=(a=mn.ancestors(t,"td,th",r(i))).length>0?a[a.length-1]:t;return s.some(je({boxes:qe(i,t,o,n,i),start:t,finish:c}))}return Te(t,n).shared().bind(function(u){return yn.closest(u,"table",e).bind(function(e){var u=mn.ancestors(n,"td,th",r(e)),a=u.length>0?u[u.length-1]:n,c=mn.ancestors(t,"td,th",r(e)),l=c.length>0?c[c.length-1]:t;return s.some(je({boxes:qe(e,t,o,n,i),start:l,finish:a}))})})})})},He={identify:_e,retrieve:function(t,n){var e=mn.descendants(t,n);return e.length>0?s.some(e):s.none()},shiftSelection:function(t,n,e,r,i){return function(t,n){return C.find(t,function(t){return J.is(t,n)})}(t,i).bind(function(t){return Me(t,n,e).bind(function(t){return function(t,n){return yn.ancestor(t,"table").bind(function(e){return yn.descendant(e,n).bind(function(n){return _e(n,t).bind(function(t){return t.boxes().map(function(n){return{boxes:o.constant(n),start:o.constant(t.start()),finish:o.constant(t.finish())}})})})})}(t,r)})})},getEdges:function(t,n,e){return yn.descendant(t,n).bind(function(n){return yn.descendant(t,e).bind(function(t){return Re(ze,[n,t]).map(function(e){return{first:o.constant(n),last:o.constant(t),table:o.constant(e)}})})})}},Ve={retrieve:function(t,n){return He.retrieve(t,n)},retrieveBox:function(t,n,e){return He.getEdges(t,n,e).bind(function(n){var e=function(n){return qt.eq(t,n)},r=yn.ancestor(n.first(),"thead,tfoot,tbody,table",e),o=yn.ancestor(n.last(),"thead,tfoot,tbody,table",e);return r.bind(function(t){return o.bind(function(e){return qt.eq(t,e)?Fe(n.table(),n.first(),n.last()):s.none()})})})}},Ue="data-mce-selected",Ge={selected:o.constant(Ue),selectedSelector:o.constant("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:o.constant("[data-mce-selected]"),firstSelected:o.constant("data-mce-first-selected"),firstSelectedSelector:o.constant("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:o.constant("data-mce-last-selected"),lastSelectedSelector:o.constant("td[data-mce-last-selected],th[data-mce-last-selected]")},Xe=function(t){if(!E.isArray(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],e={};return C.each(t,function(r,o){var i=N.keys(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==e[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!E.isArray(a))throw new Error("case arguments must be an array");n.push(u),e[u]=function(){var e=arguments.length;if(e!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+e);for(var r=new Array(e),i=0;i<r.length;i++)r[i]=arguments[i];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[o].apply(null,r)},match:function(t){var e=N.keys(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));if(!C.forall(n,function(t){return C.contains(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[u].apply(null,r)},log:function(t){console.log(t,{constructors:n,constructor:u,params:r})}}}}),e},Ye=Xe([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Ke={cata:function(t,n,e,r){return t.fold(n,e,r)},none:Ye.none,multiple:Ye.multiple,single:Ye.single},$e=function(t,n){return Ke.cata(n.get(),o.constant([]),o.identity,o.constant([t]))},Je=function(t,n){return Ke.cata(n.get(),s.none,function(n,e){return 0===n.length?s.none():Ve.retrieveBox(t,Ge.firstSelectedSelector(),Ge.lastSelectedSelector()).bind(function(t){return n.length>1?s.some({bounds:o.constant(t),cells:o.constant(n)}):s.none()})},s.none)},Qe=function(t,n){var e=$e(t,n);return e.length>0&&C.forall(e,function(t){return an.has(t,"rowspan")&&parseInt(an.get(t,"rowspan"),10)>1||an.has(t,"colspan")&&parseInt(an.get(t,"colspan"),10)>1})?s.some(e):s.none()},Ze=$e,tr=function(t){return{element:o.constant(t),mergable:s.none,unmergable:s.none,selection:o.constant([t])}},nr=I.immutable("element","clipboard","generators"),er={noMenu:tr,forMenu:function(t,n,e){return{element:o.constant(e),mergable:o.constant(Je(n,t)),unmergable:o.constant(Qe(e,t)),selection:o.constant(Ze(e,t))}},notCell:function(t){return tr(t)},paste:nr,pasteRows:function(t,n,e,r,i){return{element:o.constant(e),mergable:s.none,unmergable:s.none,selection:o.constant(Ze(e,t)),clipboard:o.constant(r),generators:o.constant(i)}}},rr={registerEvents:function(t,n,e,r){t.on("BeforeGetContent",function(e){!0===e.selection&&Ke.cata(n.get(),o.noop,function(n){e.preventDefault(),function(t){return Rn.table(t[0]).map(Jn).map(function(t){return[Gn(t,Ge.attributeSelector())]})}(n).each(function(n){e.content=C.map(n,function(n){return function(t,n){return t.selection.serializer.serialize(n.dom(),{})}(t,n)}).join("")})},o.noop)}),t.on("BeforeSetContent",function(n){!0===n.selection&&!0===n.paste&&s.from(t.dom.getParent(t.selection.getStart(),"th,td")).each(function(o){var i=H.fromDom(o);Rn.table(i).bind(function(o){var u=C.filter(de(n.content),function(t){return"meta"!==nn.name(t)});if(1===u.length&&"table"===nn.name(u[0])){n.preventDefault();var a=H.fromDom(t.getDoc()),c=fe.paste(a),l=er.paste(i,u[0],c);e.pasteCells(o,l).each(function(n){t.selection.setRng(n),t.focus(),r.clear(o)})}})})})}};function or(t,n){var e=function(e){var r=n(e);if(r<=0||null===r){var o=Mn.get(e,t);return parseFloat(o)||0}return r},r=function(t,n){return C.foldl(n,function(n,e){var r=Mn.get(t,e),o=void 0===r?0:parseInt(r,10);return isNaN(o)?n:n+o},0)};return{set:function(n,e){if(!E.isNumber(e)&&!e.match(/^[0-9]+$/))throw t+".set accepts only positive integer values. Value was "+e;var r=n.dom();On.isSupported(r)&&(r.style[t]=e+"px")},get:e,getOuter:e,aggregate:r,max:function(t,n,e){var o=r(t,e);return n>o?n-o:0}}}var ir=or("height",function(t){return sn.inBody(t)?t.dom().getBoundingClientRect().height:t.dom().offsetHeight}),ur=function(t){return ir.get(t)},ar=function(t){return ir.getOuter(t)},cr=or("width",function(t){return t.dom().offsetWidth}),lr=function(t){return cr.get(t)},sr=function(t){return cr.getOuter(t)},fr=Wt.detect(),dr=function(t,n,e){return function(t,n){var e=parseFloat(t);return isNaN(e)?n:e}(Mn.get(t,n),e)},mr=function(t){return fr.browser.isIE()||fr.browser.isEdge()?function(t){var n=dr(t,"padding-top",0),e=dr(t,"padding-bottom",0),r=dr(t,"border-top-width",0),o=dr(t,"border-bottom-width",0),i=t.dom().getBoundingClientRect().height;return"border-box"===Mn.get(t,"box-sizing")?i:i-n-e-(r+o)}(t):dr(t,"height",ur(t))},gr=/(\d+(\.\d+)?)(\w|%)*/,pr=/(\d+(\.\d+)?)%/,hr=/(\d+(\.\d+)?)px|em/,vr=function(t,n){Mn.set(t,"height",n+"px")},br=function(t,n,e,r){var o=parseInt(t,10);return kt.endsWith(t,"%")&&"table"!==nn.name(n)?function(t,n,e,r){var o=Rn.table(t).map(function(t){var r=e(t);return Math.floor(n/100*r)}).getOr(n);return r(t,o),o}(n,o,e,r):o},wr=function(t){var n=function(t){return Mn.getRaw(t,"height").getOrThunk(function(){return mr(t)+"px"})}(t);return n?br(n,t,ur,vr):ur(t)},yr=function(t,n){return an.has(t,n)?parseInt(an.get(t,n),10):1},xr=function(t){return Mn.getRaw(t,"width").fold(function(){return s.from(an.get(t,"width"))},function(t){return s.some(t)})},Sr=function(t,n){return t/n.pixelWidth()*100},Cr={percentageBasedSizeRegex:o.constant(pr),pixelBasedSizeRegex:o.constant(hr),setPixelWidth:function(t,n){Mn.set(t,"width",n+"px")},setPercentageWidth:function(t,n){Mn.set(t,"width",n+"%")},setHeight:vr,getPixelWidth:function(t,n){return xr(t).fold(function(){var n=lr(t);return parseInt(n,10)},function(e){return function(t,n,e){if(hr.test(n)){var r=hr.exec(n);return parseInt(r[1],10)}if(pr.test(n)){var o=pr.exec(n);return function(t,n){return t/100*n.pixelWidth()}(parseFloat(o[1]),e)}var i=lr(t);return parseInt(i,10)}(t,e,n)})},getPercentageWidth:function(t,n){return xr(t).fold(function(){var e=lr(t),r=parseInt(e,10);return Sr(r,n)},function(e){return function(t,n,e){if(pr.test(n)){var r=pr.exec(n);return parseFloat(r[1])}var o=lr(t),i=parseInt(o,10);return Sr(i,e)}(t,e,n)})},getGenericWidth:function(t){return xr(t).bind(function(t){if(gr.test(t)){var n=gr.exec(t);return s.some({width:o.constant(n[1]),unit:o.constant(n[3])})}return s.none()})},setGenericWidth:function(t,n,e){Mn.set(t,"width",n+e)},getHeight:function(t){return function(t,n,e){return e(t)/yr(t,n)}(t,"rowspan",wr)},getRawWidth:xr},Rr={halve:function(t,n){Cr.getGenericWidth(t).each(function(e){var r=e.width()/2;Cr.setGenericWidth(t,r,e.unit()),Cr.setGenericWidth(n,r,e.unit())})}},Tr=function(t,n){var e=n||H.fromDom(document.documentElement);return bn.ancestor(t,o.curry(qt.eq,e)).isSome()},Dr=function(t){var n=t.dom();return n===n.window?t:nn.isDocument(t)?n.defaultView||n.parentWindow:null},Ar=function(t,n){return{left:o.constant(t),top:o.constant(n),translate:function(e,r){return Ar(t+e,n+r)}}},kr=function(t,n){return void 0!==t?t:void 0!==n?n:0},Nr=function(t){var n=t.dom(),e=n.ownerDocument,r=e.body,o=H.fromDom(e.documentElement);return r===n?Ar(r.offsetLeft,r.offsetTop):Tr(t,o)?function(t){var n=t.getBoundingClientRect();return Ar(n.left,n.top)}(n):Ar(0,0)},Or=function(t){var n=t.dom().ownerDocument,e=n.body,r=Dr(H.fromDom(n)),o=n.documentElement,i=kr(r.pageYOffset,o.scrollTop),u=kr(r.pageXOffset,o.scrollLeft),a=kr(o.clientTop,e.clientTop),c=kr(o.clientLeft,e.clientLeft);return Nr(t).translate(u-c,i-a)},Er=I.immutable("row","y"),Br=I.immutable("col","x"),Pr=function(t){return Or(t).left()+sr(t)},Ir=function(t){return Or(t).left()},Wr=function(t,n){return Br(t,Ir(n))},Mr=function(t,n){return Br(t,Pr(n))},Lr=function(t){return Or(t).top()},qr=function(t,n,e){if(0===e.length)return[];var r=C.map(e.slice(1),function(n,e){return n.map(function(n){return t(e,n)})}),o=e[e.length-1].map(function(t){return n(e.length-1,t)});return r.concat([o])},Fr={delta:o.identity,positions:o.curry(qr,function(t,n){return Er(t,Lr(n))},function(t,n){return Er(t,Lr(n)+ar(n))}),edge:Lr},zr={delta:o.identity,edge:Ir,positions:o.curry(qr,Wr,Mr)},jr={height:Fr,rtl:{delta:function(t,n){return-t},edge:Pr,positions:o.curry(qr,Mr,Wr)},ltr:zr},_r={ltr:jr.ltr,rtl:jr.rtl};function Hr(t){var n=function(n){return t(n).isRtl()?_r.rtl:_r.ltr};return{delta:function(t,e){return n(e).delta(t,e)},edge:function(t){return n(t).edge(t)},positions:function(t,e){return n(e).positions(t,e)}}}var Vr={getGridSize:function(t){var n=Tn(t);return Nn.generate(n).grid()}},Ur=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return Ur(e())}}},Gr=function(t,n){return Xr(t,n,{validate:E.isFunction,label:"function"})},Xr=function(t,n,e){if(0===n.length)throw new Error("You must specify at least one required field.");return P.validateStrArr("required",n),P.checkDupes(n),function(r){var o=N.keys(r);C.forall(n,function(t){return C.contains(o,t)})||P.reqMessage(n,o),t(n,o);var i=C.filter(n,function(t){return!e.validate(r[t],t)});return i.length>0&&P.invalidTypeMessage(i,e.label),r}},Yr=o.noop,Kr={exactly:o.curry(Gr,function(t,n){var e=C.filter(n,function(n){return!C.contains(t,n)});e.length>0&&P.unsuppMessage(e)}),ensure:o.curry(Gr,Yr),ensureWith:o.curry(Xr,Yr)},$r=function(t){var n=an.has(t,"colspan")?parseInt(an.get(t,"colspan"),10):1,e=an.has(t,"rowspan")?parseInt(an.get(t,"rowspan"),10):1;return{element:o.constant(t),colspan:o.constant(n),rowspan:o.constant(e)}},Jr=Kr.exactly(["cell","row","replace","gap"]),Qr=function(t,n){Jr(t);var e=Ur(s.none()),r=void 0!==n?n:$r,o=function(n){return function(n){return t.cell(n)}(r(n))},i=function(t){var n=o(t);return e.get().isNone()&&e.set(s.some(n)),u=s.some({item:t,replacement:n}),n},u=s.none();return{getOrInit:function(t,n){return u.fold(function(){return i(t)},function(e){return n(t,e.item)?e.replacement:i(t)})},cursor:e.get}},Zr=function(t,n){return function(e){var r=Ur(s.none());Jr(e);var o=[],i=function(i){var u=e.replace(i,n,{scope:t});return o.push({item:i,sub:u}),r.get().isNone()&&r.set(s.some(u)),u};return{replaceOrInit:function(t,n){return function(t,n){return C.find(o,function(e){return n(e.item,t)})}(t,n).fold(function(){return i(t)},function(e){return n(t,e.item)?e.sub:i(t)})},cursor:r.get}}},to=function(t){Jr(t);var n=Ur(s.none());return{combine:function(e){return n.get().isNone()&&n.set(s.some(e)),function(){var n=t.cell({element:o.constant(e),colspan:o.constant(1),rowspan:o.constant(1)});return Mn.remove(n,"width"),Mn.remove(e,"width"),n}},cursor:n.get}},no=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],eo=function(t,n){var e=t.property().name(n);return C.contains(no,e)},ro=function(t,n){return C.contains(["br","img","hr","input"],t.property().name(n))},oo=eo,io=function(t,n){var e=t.property().name(n);return C.contains(["ol","ul"],e)},uo=ro,ao=ge(),co=function(t){return oo(ao,t)},lo=function(t){return io(ao,t)},so=function(t){return uo(ao,t)},fo=function(t){var n,e=function(t){return"br"===nn.name(t)},r=function(t){return ue.last(t).bind(function(n){var r,o=(r=n,Gt.nextSibling(r).map(function(t){return!!co(t)||(so(t)?"img"!==nn.name(t):void 0)}).getOr(!1));return Gt.parent(n).map(function(r){return!0===o||(i=r,"li"===nn.name(i)||bn.ancestor(i,lo).isSome())||e(n)||co(r)&&!qt.eq(t,r)?[]:[H.fromTag("br")];var i})}).getOr([])},o=0===(n=C.bind(t,function(t){var n=Gt.children(t);return function(t){return C.forall(t,function(t){return e(t)||nn.isText(t)&&0===te.get(t).trim().length})}(n)?[]:n.concat(r(t))})).length?[H.fromTag("br")]:n;_n.empty(t[0]),zn.append(t[0],o)},mo=function(t){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<n.length;o++){var i=n[o];for(var u in i)i.hasOwnProperty(u)&&(r[u]=t(r[u],i[u]))}return r}},go=mo(function(t,n){return E.isObject(t)&&E.isObject(n)?go(t,n):n}),po=mo(function(t,n){return n}),ho={deepMerge:go,merge:po},vo=function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n},bo=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return s.none()},wo=function(t,n){return j.rowcells(n,t.section())},yo=function(t,n){return t.cells()[n]},xo={addCell:function(t,n,e){var r=t.cells(),o=r.slice(0,n),i=r.slice(n),u=o.concat([e]).concat(i);return wo(t,u)},setCells:wo,mutateCell:function(t,n,e){t.cells()[n]=e},getCell:yo,getCellElement:function(t,n){return yo(t,n).element()},mapCells:function(t,n){var e=t.cells(),r=C.map(e,n);return j.rowcells(r,t.section())},cellLength:function(t){return t.cells().length}},So=function(t,n){if(0===t.length)return 0;var e=t[0];return C.findIndex(t,function(t){return!n(e.element(),t.element())}).fold(function(){return t.length},function(t){return t})},Co=function(t,n,e,r){var i=function(t,n){return t[n]}(t,n).cells().slice(e),u=So(i,r),a=function(t,n){return C.map(t,function(t){return xo.getCell(t,n)})}(t,e).slice(n),c=So(a,r);return{colspan:o.constant(u),rowspan:o.constant(c)}},Ro=function(t,n){var e=C.map(t,function(t,n){return C.map(t.cells(),function(t,n){return!1})});return C.map(t,function(r,o){var i=C.bind(r.cells(),function(r,i){if(!1===e[o][i]){var u=Co(t,o,i,n);return function(t,n,r,o){for(var i=t;i<t+r;i++)for(var u=n;u<n+o;u++)e[i][u]=!0}(o,i,u.rowspan(),u.colspan()),[j.detailnew(r.element(),u.rowspan(),u.colspan(),r.isNew())]}return[]});return j.rowdetails(i,r.section())})},To=function(t,n,e){for(var r=[],o=0;o<t.grid().rows();o++){for(var i=[],u=0;u<t.grid().columns();u++){var a=Nn.getAt(t,o,u).map(function(t){return j.elementnew(t.element(),e)}).getOrThunk(function(){return j.elementnew(n.gap(),!0)});i.push(a)}var c=j.rowcells(i,t.all()[o].section());r.push(c)}return r},Do=function(t,n,e,r){e===r?an.remove(t,n):an.set(t,n,e)},Ao=function(t,n){var e=[],r=[],i=function(n,o){n.length>0?function(n,o){var i=yn.child(t,o).getOrThunk(function(){var n=H.fromTag(o,Gt.owner(t).dom());return Fn.append(t,n),n});_n.empty(i);var u=C.map(n,function(t){t.isNew()&&e.push(t.element());var n=t.element();return _n.empty(n),C.each(t.cells(),function(t){t.isNew()&&r.push(t.element()),Do(t.element(),"colspan",t.colspan(),1),Do(t.element(),"rowspan",t.rowspan(),1),Fn.append(n,t.element())}),n});zn.append(i,u)}(n,o):function(n){yn.child(t,n).bind(_n.remove)}(o)},u=[],a=[],c=[];return C.each(n,function(t){switch(t.section()){case"thead":u.push(t);break;case"tbody":a.push(t);break;case"tfoot":c.push(t)}}),i(u,"thead"),i(a,"tbody"),i(c,"tfoot"),{newRows:o.constant(e),newCells:o.constant(r)}},ko=function(t){return C.map(t,function(t){var n=$n(t.element());return C.each(t.cells(),function(t){var e=Jn(t.element());Do(e,"colspan",t.colspan(),1),Do(e,"rowspan",t.rowspan(),1),Fn.append(n,e)}),n})},No=function(t,n){for(var e=[],r=0;r<t;r++)e.push(n(r));return e},Oo=function(t,n){for(var e=[],r=t;r<n;r++)e.push(r);return e},Eo=function(t,n){if(n<0||n>=t.length-1)return s.none();var e=t[n].fold(function(){var e=C.reverse(t.slice(0,n));return bo(e,function(t,n){return t.map(function(t){return{value:t,delta:n+1}})})},function(t){return s.some({value:t,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return bo(e,function(t,n){return t.map(function(t){return{value:t,delta:n+1}})})},function(t){return s.some({value:t,delta:1})});return e.bind(function(t){return r.map(function(n){var e=n.delta+t.delta;return Math.abs(n.value-t.value)/e})})},Bo=function(t,n,e){var r=t();return C.find(r,n).orThunk(function(){return s.from(r[0]).orThunk(e)}).map(function(t){return t.element()})},Po=function(t){var n=t.grid(),e=Oo(0,n.columns()),r=Oo(0,n.rows());return C.map(e,function(n){return Bo(function(){return C.bind(r,function(e){return Nn.getAt(t,e,n).filter(function(t){return t.column()===n}).fold(o.constant([]),function(t){return[t]})})},function(t){return 1===t.colspan()},function(){return Nn.getAt(t,0,n)})})},Io=function(t){var n=t.grid(),e=Oo(0,n.rows()),r=Oo(0,n.columns());return C.map(e,function(n){return Bo(function(){return C.bind(r,function(e){return Nn.getAt(t,n,e).filter(function(t){return t.row()===n}).fold(o.constant([]),function(t){return[t]})})},function(t){return 1===t.rowspan()},function(){return Nn.getAt(t,n,0)})})},Wo=function(t,n,e,r,o){var i=H.fromTag("div");return Mn.setAll(i,{position:"absolute",left:n-r/2+"px",top:e+"px",height:o+"px",width:r+"px"}),an.setAll(i,{"data-column":t,role:"presentation"}),i},Mo=function(t,n,e,r,o){var i=H.fromTag("div");return Mn.setAll(i,{position:"absolute",left:n+"px",top:e-o/2+"px",height:o+"px",width:r+"px"}),an.setAll(i,{"data-row":t,role:"presentation"}),i},Lo=function(t){var n=t.replace(/\./g,"-");return{resolve:function(t){return n+"-"+t}}},qo={resolve:Lo("ephox-snooker").resolve},Fo=function(t,n){var e=an.get(t,n);return void 0===e||""===e?[]:e.split(" ")},zo=Fo,jo=function(t,n,e){var r=Fo(t,n).concat([e]);an.set(t,n,r.join(" "))},_o=function(t,n,e){var r=C.filter(Fo(t,n),function(t){return t!==e});r.length>0?an.set(t,n,r.join(" ")):an.remove(t,n)},Ho=function(t){return zo(t,"class")},Vo=function(t,n){return jo(t,"class",n)},Uo=function(t,n){return _o(t,"class",n)},Go=Ho,Xo=Vo,Yo=Uo,Ko=function(t,n){C.contains(Ho(t),n)?Uo(t,n):Vo(t,n)},$o=function(t){return void 0!==t.dom().classList},Jo=function(t,n){return $o(t)&&t.dom().classList.contains(n)},Qo={add:function(t,n){$o(t)?t.dom().classList.add(n):Xo(t,n)},remove:function(t,n){$o(t)?t.dom().classList.remove(n):Yo(t,n),function(t){0===($o(t)?t.dom().classList:Go(t)).length&&an.remove(t,"class")}(t)},toggle:function(t,n){return $o(t)?t.dom().classList.toggle(n):Ko(t,n)},toggler:function(t,n){var e=$o(t),r=t.dom().classList;return function(t,n,e){var r=e||!1,o=function(){n(),r=!0},i=function(){t(),r=!1};return{on:o,off:i,toggle:function(){(r?i:o)()},isOn:function(){return r}}}(function(){e?r.remove(n):Yo(t,n)},function(){e?r.add(n):Xo(t,n)},Jo(t,n))},has:Jo},Zo=qo.resolve("resizer-bar"),ti=qo.resolve("resizer-rows"),ni=qo.resolve("resizer-cols"),ei=function(t){var n=mn.descendants(t.parent(),"."+Zo);C.each(n,_n.remove)},ri=function(t,n,e){var r=t.origin();C.each(n,function(n,o){n.each(function(n){var o=e(r,n);Qo.add(o,Zo),Fn.append(t.parent(),o)})})},oi=function(t,n,e,r,o,i){var u=Or(n);!function(t,n,e,r){ri(t,n,function(t,n){var o=Mo(n.row(),e.left()-t.left(),n.y()-t.top(),r,7);return Qo.add(o,ti),o})}(t,e.length>0?o.positions(e,n):[],u,sr(n)),function(t,n,e,r){ri(t,n,function(t,n){var o=Wo(n.col(),n.x()-t.left(),e.top()-t.top(),7,r);return Qo.add(o,ni),o})}(t,r.length>0?i.positions(r,n):[],u,ar(n))},ii=function(t,n){var e=mn.descendants(t.parent(),"."+Zo);C.each(e,n)},ui={refresh:function(t,n,e,r){ei(t);var o=Tn(n),i=Nn.generate(o),u=Io(i),a=Po(i);oi(t,n,u,a,e,r)},hide:function(t){ii(t,function(t){Mn.set(t,"display","none")})},show:function(t){ii(t,function(t){Mn.set(t,"display","block")})},destroy:ei,isRowBar:function(t){return Qo.has(t,ti)},isColBar:function(t){return Qo.has(t,ni)}},ai=function(t,n){return C.map(t,function(t){var e=function(t){return bo(t,function(t){return Gt.parent(t.element()).map(function(t){var n=Gt.parent(t).isNone();return j.elementnew(t,n)})}).getOrThunk(function(){return j.elementnew(n.row(),!0)})}(t.details());return j.rowdatanew(e.element(),t.details(),t.section(),e.isNew())})},ci=function(t,n){var e=Ro(t,qt.eq);return ai(e,n)},li=function(t,n){var e=C.flatten(C.map(t.all(),function(t){return t.cells()}));return C.find(e,function(t){return qt.eq(n,t.element())})},si=function(t,n,e,r,i){return function(u,a,c,l,f){var d=Tn(a),m=Nn.generate(d);return n(m,c).map(function(n){var e=function(t,n){return To(t,n,!1)}(m,l),r=t(e,n,qt.eq,i(l)),u=ci(r.grid(),l);return{grid:o.constant(u),cursor:r.cursor}}).fold(function(){return s.none()},function(t){var n=Ao(a,t.grid());return e(a,t.grid(),f),r(a),ui.refresh(u,a,jr.height,f),s.some({cursor:t.cursor,newRows:n.newRows,newCells:n.newCells})})}},fi=ci,di=function(t,n){return Rn.cell(n.element()).bind(function(n){return li(t,n)})},mi=function(t,n){var e=C.map(n.selection(),function(n){return Rn.cell(n).bind(function(n){return li(t,n)})}),r=vo(e);return r.length>0?s.some(r):s.none()},gi=function(t,n){return Rn.cell(n.element()).bind(function(e){return li(t,e).map(function(t){return ho.merge(t,{generators:n.generators,clipboard:n.clipboard})})})},pi=function(t,n){var e=C.map(n.selection(),function(n){return Rn.cell(n).bind(function(n){return li(t,n)})}),r=vo(e);return r.length>0?s.some(ho.merge({cells:r},{generators:n.generators,clipboard:n.clipboard})):s.none()},hi=function(t,n){return n.mergable()},vi=function(t,n){return n.unmergable()},bi=function(t){return{is:function(n){return t===n},isValue:o.always,isError:o.never,getOr:o.constant(t),getOrThunk:o.constant(t),getOrDie:o.constant(t),or:function(n){return bi(t)},orThunk:function(n){return bi(t)},fold:function(n,e){return e(t)},map:function(n){return bi(n(t))},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return s.some(t)}}},wi=function(t){return{is:o.never,isValue:o.never,isError:o.always,getOr:o.identity,getOrThunk:function(t){return t()},getOrDie:function(){return o.die(t)()},or:function(t){return t},orThunk:function(t){return t()},fold:function(n,e){return n(t)},map:function(n){return wi(t)},each:o.noop,bind:function(n){return wi(t)},exists:o.never,forall:o.always,toOption:s.none}},yi={value:bi,error:wi},xi=function(t,n){return C.map(t,function(){return j.elementnew(n.cell(),!0)})},Si=function(t,n,e){return t.concat(No(n,function(n){return xo.setCells(t[t.length-1],xi(t[t.length-1].cells(),e))}))},Ci=function(t,n,e){return C.map(t,function(t){return xo.setCells(t,t.cells().concat(xi(Oo(0,n),e)))})},Ri=function(t,n,e){if(t.row()>=n.length||t.column()>xo.cellLength(n[0]))return yi.error("invalid start address out of table bounds, row: "+t.row()+", column: "+t.column());var r=n.slice(t.row()),i=r[0].cells().slice(t.column()),u=xo.cellLength(e[0]),a=e.length;return yi.value({rowDelta:o.constant(r.length-a),colDelta:o.constant(i.length-u)})},Ti=function(t,n){var e=xo.cellLength(t[0]),r=xo.cellLength(n[0]);return{rowDelta:o.constant(0),colDelta:o.constant(e-r)}},Di=function(t,n,e){var r=n.colDelta()<0?Ci:o.identity;return(n.rowDelta()<0?Si:o.identity)(r(t,Math.abs(n.colDelta()),e),Math.abs(n.rowDelta()),e)},Ai=function(t,n,e,r){if(0===t.length)return t;for(var o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)xo.mutateCell(t[o],i,j.elementnew(r(),!1));return t},ki=function(t,n,e,r){for(var o=!0,i=0;i<t.length;i++)for(var u=0;u<xo.cellLength(t[0]);u++){var a=e(xo.getCellElement(t[i],u),n);!0===a&&!1===o?xo.mutateCell(t[i],u,j.elementnew(r(),!0)):!0===a&&(o=!1)}return t},Ni=function(t,n,e,r){if(n>0&&n<t.length){var o=function(t,n){return C.foldl(t,function(t,e){return C.exists(t,function(t){return n(t.element(),e.element())})?t:t.concat([e])},[])}(t[n-1].cells(),e);C.each(o,function(o){for(var i=s.none(),u=n;u<t.length;u++)for(var a=0;a<xo.cellLength(t[0]);a++){var c=t[u].cells()[a];e(c.element(),o.element())&&(i.isNone()&&(i=s.some(r())),i.each(function(n){xo.mutateCell(t[u],a,j.elementnew(n,!0))}))}})}return t},Oi=function(t,n,e,r){var i=xo.getCell(t[n],e),u=o.curry(r,i.element()),a=t[n];return t.length>1&&xo.cellLength(a)>1&&(e>0&&u(xo.getCellElement(a,e-1))||e<a.length-1&&u(xo.getCellElement(a,e+1))||n>0&&u(xo.getCellElement(t[n-1],e))||n<t.length-1&&u(xo.getCellElement(t[n+1],e)))},Ei=function(t,n,e,r,o){return Ri(t,n,e).map(function(i){var u=Di(n,i,r);return function(t,n,e,r,o){for(var i=t.row(),u=t.column(),a=i+e.length,c=u+xo.cellLength(e[0]),l=i;l<a;l++)for(var s=u;s<c;s++){Oi(n,l,s,o)&&ki(n,xo.getCellElement(n[l],s),o,r.cell);var f=xo.getCellElement(e[l-i],s-u),d=r.replace(f);xo.mutateCell(n[l],s,j.elementnew(d,!0))}return n}(t,u,e,r,o)})},Bi=function(t,n,e,r,o){Ni(n,t,o,r.cell);var i=Ti(e,n),u=Di(e,i,r),a=Ti(n,u),c=Di(n,a,r);return c.slice(0,t).concat(u).concat(c.slice(t,c.length))},Pi=function(t,n,e,r,o){var i=t.slice(0,n),u=t.slice(n),a=xo.mapCells(t[e],function(e,i){return n>0&&n<t.length&&r(xo.getCellElement(t[n-1],i),xo.getCellElement(t[n],i))?xo.getCell(t[n],i):j.elementnew(o(e.element(),r),!0)});return i.concat([a]).concat(u)},Ii=function(t,n,e,r,o){return C.map(t,function(t){var i=n>0&&n<xo.cellLength(t)&&r(xo.getCellElement(t,n-1),xo.getCellElement(t,n))?xo.getCell(t,n):j.elementnew(o(xo.getCellElement(t,e),r),!0);return xo.addCell(t,n,i)})},Wi=function(t,n,e,r,o){var i=e+1;return C.map(t,function(t,u){var a=u===n?j.elementnew(o(xo.getCellElement(t,e),r),!0):xo.getCell(t,e);return xo.addCell(t,i,a)})},Mi=function(t,n,e,r,o){var i=n+1,u=t.slice(0,i),a=t.slice(i),c=xo.mapCells(t[n],function(t,n){return n===e?j.elementnew(o(t.element(),r),!0):t});return u.concat([c]).concat(a)},Li=function(t,n,e){return t.slice(0,n).concat(t.slice(e+1))},qi=function(t,n,e){var r=C.map(t,function(t){var r=t.cells().slice(0,n).concat(t.cells().slice(e+1));return j.rowcells(r,t.section())});return C.filter(r,function(t){return t.cells().length>0})},Fi=function(t,n,e,r){return C.map(t,function(t){return xo.mapCells(t,function(t){return function(t){return C.exists(n,function(n){return e(t.element(),n.element())})}(t)?j.elementnew(r(t.element(),e),!0):t})})},zi=function(t,n,e,r){return void 0!==xo.getCellElement(t[n],e)&&n>0&&r(xo.getCellElement(t[n-1],e),xo.getCellElement(t[n],e))},ji=function(t,n,e){return n>0&&e(xo.getCellElement(t,n-1),xo.getCellElement(t,n))},_i=function(t,n,e,r){var o=C.bind(t,function(r,o){return zi(t,o,n,e)||ji(r,n,e)?[]:[xo.getCell(r,n)]});return Fi(t,o,e,r)},Hi=function(t,n,e,r){var o=t[n],i=C.bind(o.cells(),function(r,i){return zi(t,n,i,e)||ji(o,i,e)?[]:[r]});return Fi(t,i,e,r)},Vi=function(t){return{fold:t}},Ui=function(){return Vi(function(t,n,e,r,o){return t()})},Gi=function(t){return Vi(function(n,e,r,o,i){return e(t)})},Xi=function(t,n){return Vi(function(e,r,o,i,u){return o(t,n)})},Yi=function(t,n,e){return Vi(function(r,o,i,u,a){return u(t,n,e)})},Ki=function(t,n){return Vi(function(e,r,o,i,u){return u(t,n)})},$i=function(t,n,e,r){var i=t.slice(0),u=function(t,n){return 0===t.length?Ui():1===t.length?Gi(0):0===n?Xi(0,1):n===t.length-1?Ki(n-1,n):n>0&&n<t.length-1?Yi(n-1,n,n+1):Ui()}(t,n),a=function(t){return C.map(t,o.constant(0))},c=o.constant(a(i)),l=function(t,n){if(e>=0){var o=Math.max(r.minCellWidth(),i[n]-e);return a(i.slice(0,t)).concat([e,o-i[n]]).concat(a(i.slice(n+1)))}var u=Math.max(r.minCellWidth(),i[t]+e),c=i[t]-u;return a(i.slice(0,t)).concat([u-i[t],c]).concat(a(i.slice(n+1)))},s=l;return u.fold(c,function(t){return r.singleColumnWidth(i[t],e)},s,function(t,n,e){return l(n,e)},function(t,n){if(e>=0)return a(i.slice(0,n)).concat([e]);var o=Math.max(r.minCellWidth(),i[n]+e);return a(i.slice(0,n)).concat([o-i[n]])})},Ji=function(t,n){return an.has(t,n)&&parseInt(an.get(t,n),10)>1},Qi={hasColspan:function(t){return Ji(t,"colspan")},hasRowspan:function(t){return Ji(t,"rowspan")},minWidth:o.constant(10),minHeight:o.constant(10),getInt:function(t,n){return parseInt(Mn.get(t,n),10)}},Zi=function(t,n,e){return Mn.getRaw(t,n).fold(function(){return e(t)+"px"},function(t){return t})},tu=function(t){return Zi(t,"width",Cr.getPixelWidth)},nu=function(t){return Zi(t,"height",Cr.getHeight)},eu=function(t,n,e,r,i){var u=Po(t),a=C.map(u,function(t){return t.map(n.edge)});return C.map(u,function(t,n){return t.filter(o.not(Qi.hasColspan)).fold(function(){var t=Eo(a,n);return r(t)},function(t){return e(t,i)})})},ru=function(t){return t.map(function(t){return t+"px"}).getOr("")},ou=function(t,n,e,r){var i=Io(t),u=C.map(i,function(t){return t.map(n.edge)});return C.map(i,function(t,n){return t.filter(o.not(Qi.hasRowspan)).fold(function(){var t=Eo(u,n);return r(t)},function(t){return e(t)})})},iu={getRawWidths:function(t,n){return eu(t,n,tu,ru)},getPixelWidths:function(t,n,e){return eu(t,n,Cr.getPixelWidth,function(t){return t.getOrThunk(e.minCellWidth)},e)},getPercentageWidths:function(t,n,e){return eu(t,n,Cr.getPercentageWidth,function(t){return t.fold(function(){return e.minCellWidth()},function(t){return t/e.pixelWidth()*100})},e)},getPixelHeights:function(t,n){return ou(t,n,Cr.getHeight,function(t){return t.getOrThunk(Qi.minHeight)})},getRawHeights:function(t,n){return ou(t,n,nu,ru)}},uu=function(t,n,e){for(var r=0,o=t;o<n;o++)r+=void 0!==e[o]?e[o]:0;return r},au=function(t,n){var e=Nn.justCells(t);return C.map(e,function(t){var e=uu(t.column(),t.column()+t.colspan(),n);return{element:t.element,width:o.constant(e),colspan:t.colspan}})},cu=function(t,n){var e=Nn.justCells(t);return C.map(e,function(t){var e=uu(t.row(),t.row()+t.rowspan(),n);return{element:t.element,height:o.constant(e),rowspan:t.rowspan}})},lu=function(t,n){return C.map(t.all(),function(t,e){return{element:t.element,height:o.constant(n[e])}})},su=function(t){var n=parseInt(t,10),e=o.identity;return{width:o.constant(n),pixelWidth:o.constant(n),getWidths:iu.getPixelWidths,getCellDelta:e,singleColumnWidth:function(t,n){return[Math.max(Qi.minWidth(),t+n)-t]},minCellWidth:Qi.minWidth,setElementWidth:Cr.setPixelWidth,setTableWidth:function(t,n,e){var r=C.foldr(n,function(t,n){return t+n},0);Cr.setPixelWidth(t,r)}}},fu=function(t,n){if(Cr.percentageBasedSizeRegex().test(n))return function(t,n){var e=parseFloat(t),r=lr(n);return{width:o.constant(e),pixelWidth:o.constant(r),getWidths:iu.getPercentageWidths,getCellDelta:function(t){return t/r*100},singleColumnWidth:function(t,n){return[100-t]},minCellWidth:function(){return Qi.minWidth()/r*100},setElementWidth:Cr.setPercentageWidth,setTableWidth:function(t,n,r){var o=e+r;Cr.setPercentageWidth(t,o)}}}(Cr.percentageBasedSizeRegex().exec(n)[1],t);if(Cr.pixelBasedSizeRegex().test(n)){var e=Cr.pixelBasedSizeRegex().exec(n);return su(e[1])}var r=lr(t);return su(r)},du=function(t){return Cr.getRawWidth(t).fold(function(){var n=lr(t);return su(n)},function(n){return fu(t,n)})},mu=function(t){return Nn.generate(t)},gu=function(t){var n=Tn(t);return mu(n)},pu={adjustWidth:function(t,n,e,r){var o=du(t),i=o.getCellDelta(n),u=gu(t),a=o.getWidths(u,r,o),c=$i(a,e,i,o),l=C.map(c,function(t,n){return t+a[n]}),s=au(u,l);C.each(s,function(t){o.setElementWidth(t.element(),t.width())}),e===u.grid().columns()-1&&o.setTableWidth(t,l,i)},adjustHeight:function(t,n,e,r){var o=gu(t),i=iu.getPixelHeights(o,r),u=C.map(i,function(t,r){return e===r?Math.max(n+t,Qi.minHeight()):t}),a=cu(o,u),c=lu(o,u);C.each(c,function(t){Cr.setHeight(t.element(),t.height())}),C.each(a,function(t){Cr.setHeight(t.element(),t.height())});var l,s=(l=u,C.foldr(l,function(t,n){return t+n},0));Cr.setHeight(t,s)},adjustWidthTo:function(t,n,e){var r=du(t),o=mu(n),i=r.getWidths(o,e,r),u=au(o,i);C.each(u,function(t){r.setElementWidth(t.element(),t.width())});var a=C.foldr(i,function(t,n){return n+t},0);u.length>0&&r.setElementWidth(t,a)}},hu=function(t){0===Rn.cells(t).length&&_n.remove(t)},vu=I.immutable("grid","cursor"),bu=function(t,n,e){return wu(t,n,e).orThunk(function(){return wu(t,0,0)})},wu=function(t,n,e){return s.from(t[n]).bind(function(t){return s.from(t.cells()[e]).bind(function(t){return s.from(t.element())})})},yu=function(t,n,e){return vu(t,wu(t,n,e))},xu=function(t){return C.foldl(t,function(t,n){return C.exists(t,function(t){return t.row()===n.row()})?t:t.concat([n])},[]).sort(function(t,n){return t.row()-n.row()})},Su=function(t){return C.foldl(t,function(t,n){return C.exists(t,function(t){return t.column()===n.column()})?t:t.concat([n])},[]).sort(function(t,n){return t.column()-n.column()})},Cu=function(t,n,e){var r=Dn(t,e),o=Nn.generate(r);return To(o,n,!0)},Ru=pu.adjustWidthTo,Tu={insertRowBefore:si(function(t,n,e,r){var o=n.row(),i=n.row(),u=Pi(t,i,o,e,r.getOrInit);return yu(u,i,n.column())},di,o.noop,o.noop,Qr),insertRowsBefore:si(function(t,n,e,r){var o=n[0].row(),i=n[0].row(),u=xu(n),a=C.foldl(u,function(t,n){return Pi(t,i,o,e,r.getOrInit)},t);return yu(a,i,n[0].column())},mi,o.noop,o.noop,Qr),insertRowAfter:si(function(t,n,e,r){var o=n.row(),i=n.row()+n.rowspan(),u=Pi(t,i,o,e,r.getOrInit);return yu(u,i,n.column())},di,o.noop,o.noop,Qr),insertRowsAfter:si(function(t,n,e,r){var o=xu(n),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=C.foldl(o,function(t,n){return Pi(t,u,i,e,r.getOrInit)},t);return yu(a,u,n[0].column())},mi,o.noop,o.noop,Qr),insertColumnBefore:si(function(t,n,e,r){var o=n.column(),i=n.column(),u=Ii(t,i,o,e,r.getOrInit);return yu(u,n.row(),i)},di,Ru,o.noop,Qr),insertColumnsBefore:si(function(t,n,e,r){var o=Su(n),i=o[0].column(),u=o[0].column(),a=C.foldl(o,function(t,n){return Ii(t,u,i,e,r.getOrInit)},t);return yu(a,n[0].row(),u)},mi,Ru,o.noop,Qr),insertColumnAfter:si(function(t,n,e,r){var o=n.column(),i=n.column()+n.colspan(),u=Ii(t,i,o,e,r.getOrInit);return yu(u,n.row(),i)},di,Ru,o.noop,Qr),insertColumnsAfter:si(function(t,n,e,r){var o=n[n.length-1].column(),i=n[n.length-1].column()+n[n.length-1].colspan(),u=Su(n),a=C.foldl(u,function(t,n){return Ii(t,i,o,e,r.getOrInit)},t);return yu(a,n[0].row(),i)},mi,Ru,o.noop,Qr),splitCellIntoColumns:si(function(t,n,e,r){var o=Wi(t,n.row(),n.column(),e,r.getOrInit);return yu(o,n.row(),n.column())},di,Ru,o.noop,Qr),splitCellIntoRows:si(function(t,n,e,r){var o=Mi(t,n.row(),n.column(),e,r.getOrInit);return yu(o,n.row(),n.column())},di,o.noop,o.noop,Qr),eraseColumns:si(function(t,n,e,r){var o=Su(n),i=qi(t,o[0].column(),o[o.length-1].column()),u=bu(i,n[0].row(),n[0].column());return vu(i,u)},mi,Ru,hu,Qr),eraseRows:si(function(t,n,e,r){var o=xu(n),i=Li(t,o[0].row(),o[o.length-1].row()),u=bu(i,n[0].row(),n[0].column());return vu(i,u)},mi,o.noop,hu,Qr),makeColumnHeader:si(function(t,n,e,r){var o=_i(t,n.column(),e,r.replaceOrInit);return yu(o,n.row(),n.column())},di,o.noop,o.noop,Zr("row","th")),unmakeColumnHeader:si(function(t,n,e,r){var o=_i(t,n.column(),e,r.replaceOrInit);return yu(o,n.row(),n.column())},di,o.noop,o.noop,Zr(null,"td")),makeRowHeader:si(function(t,n,e,r){var o=Hi(t,n.row(),e,r.replaceOrInit);return yu(o,n.row(),n.column())},di,o.noop,o.noop,Zr("col","th")),unmakeRowHeader:si(function(t,n,e,r){var o=Hi(t,n.row(),e,r.replaceOrInit);return yu(o,n.row(),n.column())},di,o.noop,o.noop,Zr(null,"td")),mergeCells:si(function(t,n,e,r){var i=n.cells();fo(i);var u=Ai(t,n.bounds(),e,o.constant(i[0]));return vu(u,s.from(i[0]))},hi,o.noop,o.noop,to),unmergeCells:si(function(t,n,e,r){var o=C.foldr(n,function(t,n){return ki(t,n,e,r.combine(n))},t);return vu(o,s.from(n[0]))},vi,Ru,o.noop,to),pasteCells:si(function(t,n,e,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=Tn(o),a=Nn.generate(u),To(a,i,!0)),l=j.address(n.row(),n.column());return Ei(l,t,c,n.generators(),e).fold(function(){return vu(t,s.some(n.element()))},function(t){var e=bu(t,n.row(),n.column());return vu(t,e)})},gi,Ru,o.noop,Qr),pasteRowsBefore:si(function(t,n,e,r){var o=t[n.cells[0].row()],i=n.cells[0].row(),u=Cu(n.clipboard(),n.generators(),o),a=Bi(i,t,u,n.generators(),e),c=bu(a,n.cells[0].row(),n.cells[0].column());return vu(a,c)},pi,o.noop,o.noop,Qr),pasteRowsAfter:si(function(t,n,e,r){var o=t[n.cells[0].row()],i=n.cells[n.cells.length-1].row()+n.cells[n.cells.length-1].rowspan(),u=Cu(n.clipboard(),n.generators(),o),a=Bi(i,t,u,n.generators(),e),c=bu(a,n.cells[0].row(),n.cells[0].column());return vu(a,c)},pi,o.noop,o.noop,Qr)},Du=function(t){return H.fromDom(t.getBody())},Au={getBody:Du,getIsRoot:function(t){return function(n){return qt.eq(n,Du(t))}},addSizeSuffix:function(t){return/^[0-9]+$/.test(t)&&(t+="px"),t},removePxSuffix:function(t){return t?t.replace(/px$/,""):""}},ku=function(t){return"rtl"===Mn.get(t,"direction")?"rtl":"ltr"},Nu={onDirection:function(t,n){return function(e){return"rtl"===ku(e)?n:t}},getDirection:ku},Ou={isRtl:o.constant(!1)},Eu={isRtl:o.constant(!0)},Bu={directionAt:function(t){return"rtl"===Nu.getDirection(t)?Eu:Ou}},Pu=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],Iu={"border-collapse":"collapse",width:"100%"},Wu={border:"1"},Mu=function(t){return t.getParam("table_default_styles",Iu,"object")},Lu=function(t){return t.getParam("table_resize_bars",!0,"boolean")},qu=function(t){return t.getParam("table_tab_navigation",!0,"boolean")},Fu=function(t){return t.getParam("forced_root_block","p","string")},zu=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},ju=function(t){return t.getParam("table_row_advtab",!0,"boolean")},_u=function(t){return t.getParam("table_advtab",!0,"boolean")},Hu=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Vu=function(t){return t.getParam("forced_block_attrs",{},"object")},Uu=function(t){return t.getParam("table_cell_class_list",[],"array")},Gu=function(t){return t.getParam("table_row_class_list",[],"array")},Xu=function(t){return t.getParam("table_class_list",[],"array")},Yu=function(t){return!1===t.getParam("table_responsive_width")},Ku=function(t){var n=t.getParam("table_clone_elements");return E.isString(n)?s.some(n.split(/[ ,]/)):Array.isArray(n)?s.some(n):s.none()},$u=function(t){var n=t.getParam("object_resizing",!0);return"table"===n||n},Ju=function(t,n){return t.fire("newrow",{node:n})},Qu=function(t,n){return t.fire("newcell",{node:n})},Zu=function(t,n,e){var r=Tn(t),o=Nn.generate(r);return mi(o,n).map(function(t){var n=To(o,e,!1).slice(t[0].row(),t[t.length-1].row()+t[t.length-1].rowspan()),r=fi(n,e);return ko(r)})},ta=tinymce.util.Tools.resolve("tinymce.util.Tools"),na={applyAlign:function(t,n,e){e&&t.formatter.apply("align"+e,{},n)},applyVAlign:function(t,n,e){e&&t.formatter.apply("valign"+e,{},n)},unApplyAlign:function(t,n){ta.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},unApplyVAlign:function(t,n){ta.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},getTDTHOverallStyle:function(t,n,e){var r;return r=function(n,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],e);if(void 0===n&&(n=i),n!==i)return""}return n}(r,t.select("td,th",n))}},ea=function(t,n){var e=t.dom,r=n.control.rootControl,o=r.toJSON(),i=e.parseStyle(o.style);"style"===n.control.name()?(r.find("#borderStyle").value(i["border-style"]||"")[0].fire("select"),r.find("#borderColor").value(i["border-color"]||"")[0].fire("change"),r.find("#backgroundColor").value(i["background-color"]||"")[0].fire("change"),r.find("#width").value(i.width||"").fire("change"),r.find("#height").value(i.height||"").fire("change")):(i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?Au.addSizeSuffix(o.width):"",i.height=o.height?Au.addSizeSuffix(o.height):""),r.find("#style").value(e.serializeStyle(e.parseStyle(e.serializeStyle(i))))},ra={createStyleForm:function(t){var n=function(){var n=function(t){return t.getParam("color_picker_callback")}(t);if(n)return function(e){return n.call(t,function(t){e.control.value(t).fire("change")},e.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:o.curry(ea,t)},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:o.curry(ea,t),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:n()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:n()}]}]}},buildListItems:function(t,n,e){var r=function(t,e){return e=e||[],ta.each(t,function(t){var o={text:t.text||t.title};t.menu?o.menu=r(t.menu):(o.value=t.value,n&&n(o)),e.push(o)}),e};return r(t,e||[])},updateStyleField:ea,extractAdvancedStyles:function(t,n){var e=t.parseStyle(t.getAttrib(n,"style")),r={};return e["border-style"]&&(r.borderStyle=e["border-style"]),e["border-color"]&&(r.borderColor=e["border-color"]),e["background-color"]&&(r.backgroundColor=e["background-color"]),r.style=t.serializeStyle(e),r}},oa=function(t,n,e){var r,o=t.dom;function i(t,n,e){e&&o.setAttrib(t,n,e)}function u(t,n,e){e&&o.setStyle(t,n,e)}ra.updateStyleField(t,e),r=e.control.rootControl.toJSON(),t.undoManager.transact(function(){ta.each(n,function(e){var a,c;i(e,"scope",r.scope),1===n.length?i(e,"style",r.style):(a=e,c=r.style,a.style.cssText+=";"+c),i(e,"class",r.class),u(e,"width",Au.addSizeSuffix(r.width)),u(e,"height",Au.addSizeSuffix(r.height)),r.type&&e.nodeName.toLowerCase()!==r.type&&(e=o.rename(e,r.type)),1===n.length&&(na.unApplyAlign(t,e),na.unApplyVAlign(t,e)),r.align&&na.applyAlign(t,e,r.align),r.valign&&na.applyVAlign(t,e,r.valign)}),t.focus()})},ia=function(t){var n,e,r,i=[];if(i=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),n=t.dom.getParent(t.selection.getStart(),"td,th"),!i.length&&n&&i.push(n),n=n||i[0]){e=i.length>1?{width:"",height:"",scope:"",class:"",align:"",style:"",type:n.nodeName.toLowerCase()}:function(t,n){var e=t.dom,r={width:e.getStyle(n,"width")||e.getAttrib(n,"width"),height:e.getStyle(n,"height")||e.getAttrib(n,"height"),scope:e.getAttrib(n,"scope"),class:e.getAttrib(n,"class")};return r.type=n.nodeName.toLowerCase(),ta.each("left center right".split(" "),function(e){t.formatter.matchNode(n,"align"+e)&&(r.align=e)}),ta.each("top middle bottom".split(" "),function(e){t.formatter.matchNode(n,"valign"+e)&&(r.valign=e)}),zu(t)&&ta.extend(r,ra.extractAdvancedStyles(e,n)),r}(t,n),Uu(t).length>0&&(r={name:"class",type:"listbox",label:"Class",values:ra.buildListItems(Uu(t),function(n){n.value&&(n.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[n.value]})})})});var u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:o.curry(ra.updateStyleField,t)},{label:"Height",name:"height",onchange:o.curry(ra.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};zu(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:e,body:[{title:"General",type:"form",items:u},ra.createStyleForm(t)],onsubmit:o.curry(oa,t,i)}):t.windowManager.open({title:"Cell properties",data:e,body:u,onsubmit:o.curry(oa,t,i)})}},ua=function(t,n,e){var r=t.getParent(n,"table"),o=n.parentNode,i=t.select(e,r)[0];i||(i=t.create(e),r.firstChild?"CAPTION"===r.firstChild.nodeName?t.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(n),o.hasChildNodes()||t.remove(o)};function aa(t,n,e){var r,o=t.dom;function i(t,n,e){e&&o.setAttrib(t,n,e)}ra.updateStyleField(t,e),r=e.control.rootControl.toJSON(),t.undoManager.transact(function(){ta.each(n,function(e){var u,a,c;i(e,"scope",r.scope),i(e,"style",r.style),i(e,"class",r.class),u=e,a="height",(c=Au.addSizeSuffix(r.height))&&o.setStyle(u,a,c),r.type!==e.parentNode.nodeName.toLowerCase()&&ua(t.dom,e,r.type),1===n.length&&na.unApplyAlign(t,e),r.align&&na.applyAlign(t,e,r.align)}),t.focus()})}var ca=function(t){var n,e,r,i,u,a,c=t.dom,l=[];n=c.getParent(t.selection.getStart(),"table"),e=c.getParent(t.selection.getStart(),"td,th"),ta.each(n.rows,function(t){ta.each(t.cells,function(n){if(c.getAttrib(n,"data-mce-selected")||n===e)return l.push(t),!1})}),(r=l[0])&&(u=l.length>1?{height:"",scope:"",class:"",align:"",type:r.parentNode.nodeName.toLowerCase()}:function(t,n){var e=t.dom,r={height:e.getStyle(n,"height")||e.getAttrib(n,"height"),scope:e.getAttrib(n,"scope"),class:e.getAttrib(n,"class")};return r.type=n.parentNode.nodeName.toLowerCase(),ta.each("left center right".split(" "),function(e){t.formatter.matchNode(n,"align"+e)&&(r.align=e)}),ju(t)&&ta.extend(r,ra.extractAdvancedStyles(e,n)),r}(t,r),Gu(t).length>0&&(i={name:"class",type:"listbox",label:"Class",values:ra.buildListItems(Gu(t),function(n){n.value&&(n.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[n.value]})})})}),a={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},i]},ju(t)?t.windowManager.open({title:"Row properties",data:u,bodyType:"tabpanel",body:[{title:"General",type:"form",items:a},ra.createStyleForm(t)],onsubmit:o.curry(aa,t,l)}):t.windowManager.open({title:"Row properties",data:u,body:a,onsubmit:o.curry(aa,t,l)}))},la=tinymce.util.Tools.resolve("tinymce.Env"),sa={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},fa=function(t,n,e,r,o){void 0===o&&(o=sa);var i=H.fromTag("table");Mn.setAll(i,o.styles),an.setAll(i,o.attributes);var u=H.fromTag("tbody");Fn.append(i,u);for(var a=[],c=0;c<t;c++){for(var l=H.fromTag("tr"),s=0;s<n;s++){var f=c<e||s<r?H.fromTag("th"):H.fromTag("td");s<r&&an.set(f,"scope","row"),c<e&&an.set(f,"scope","col"),Fn.append(f,H.fromTag("br")),o.percentages&&Mn.set(f,"width",100/n+"%"),Fn.append(l,f)}a.push(l)}return zn.append(u,a),i},da=function(t){return t.dom().innerHTML},ma=function(t){var n=H.fromTag("div"),e=H.fromDom(t.dom().cloneNode(!0));return Fn.append(n,e),da(n)},ga=function(t,n){t.selection.select(n.dom(),!0),t.selection.collapse(!0)},pa=function(t,n,e){var r,i=Mu(t),u={styles:i,attributes:function(t){return t.getParam("table_default_attributes",Wu,"object")}(t),percentages:(r=i.width,E.isString(r)&&-1!==r.indexOf("%")&&!Yu(t))},a=fa(e,n,0,0,u);an.set(a,"data-mce-id","__mce");var c=ma(a);return t.insertContent(c),yn.descendant(Au.getBody(t),'table[data-mce-id="__mce"]').map(function(n){return Yu(t)&&Mn.set(n,"width",Mn.get(n,"width")),an.remove(n,"data-mce-id"),function(t,n){C.each(mn.descendants(n,"tr"),function(n){Ju(t,n.dom()),C.each(mn.descendants(n,"th,td"),function(n){Qu(t,n.dom())})})}(t,n),function(t,n){yn.descendant(n,"td,th").each(o.curry(ga,t))}(t,n),n.dom()}).getOr(null)};function ha(t,n,e,r){if("TD"===n.tagName||"TH"===n.tagName)t.setStyle(n,e,r);else if(n.children)for(var o=0;o<n.children.length;o++)ha(t,n.children[o],e,r)}var va=function(t,n,e){var r,o,i=t.dom;ra.updateStyleField(t,e),!1===(o=e.control.rootControl.toJSON()).class&&delete o.class,t.undoManager.transact(function(){n||(n=pa(t,o.cols||1,o.rows||1)),function(t,n,e){var r=t.dom,o={},i={};if(o.class=e.class,i.height=Au.addSizeSuffix(e.height),r.getAttrib(n,"width")&&!Hu(t)?o.width=Au.removePxSuffix(e.width):i.width=Au.addSizeSuffix(e.width),Hu(t)?(i["border-width"]=Au.addSizeSuffix(e.border),i["border-spacing"]=Au.addSizeSuffix(e.cellspacing),ta.extend(o,{"data-mce-border-color":e.borderColor,"data-mce-cell-padding":e.cellpadding,"data-mce-border":e.border})):ta.extend(o,{border:e.border,cellpadding:e.cellpadding,cellspacing:e.cellspacing}),Hu(t)&&n.children)for(var u=0;u<n.children.length;u++)ha(r,n.children[u],{"border-width":Au.addSizeSuffix(e.border),"border-color":e.borderColor,padding:Au.addSizeSuffix(e.cellpadding)});e.style?ta.extend(i,r.parseStyle(e.style)):i=ta.extend({},r.parseStyle(r.getAttrib(n,"style")),i),o.style=r.serializeStyle(i),r.setAttribs(n,o)}(t,n,o),(r=i.select("caption",n)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=la.ie?" ":'<br data-mce-bogus="1"/>',n.insertBefore(r,n.firstChild)),na.unApplyAlign(t,n),o.align&&na.applyAlign(t,n,o.align),t.focus(),t.addVisual()})},ba=function(t,n){var e,r,i,u,a,c=t.dom,l={};!0===n?(e=c.getParent(t.selection.getStart(),"table"))&&(l=function(t,n){var e=t.dom,r={width:e.getStyle(n,"width")||e.getAttrib(n,"width"),height:e.getStyle(n,"height")||e.getAttrib(n,"height"),cellspacing:e.getStyle(n,"border-spacing")||e.getAttrib(n,"cellspacing"),cellpadding:e.getAttrib(n,"data-mce-cell-padding")||e.getAttrib(n,"cellpadding")||na.getTDTHOverallStyle(t.dom,n,"padding"),border:e.getAttrib(n,"data-mce-border")||e.getAttrib(n,"border")||na.getTDTHOverallStyle(t.dom,n,"border"),borderColor:e.getAttrib(n,"data-mce-border-color"),caption:!!e.select("caption",n)[0],class:e.getAttrib(n,"class")};return ta.each("left center right".split(" "),function(e){t.formatter.matchNode(n,"align"+e)&&(r.align=e)}),_u(t)&&ta.extend(r,ra.extractAdvancedStyles(e,n)),r}(t,e)):(r={label:"Cols",name:"cols"},i={label:"Rows",name:"rows"}),Xu(t).length>0&&(l.class&&(l.class=l.class.replace(/\s*mce\-item\-table\s*/g,"")),u={name:"class",type:"listbox",label:"Class",values:ra.buildListItems(Xu(t),function(n){n.value&&(n.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[n.value]})})})}),a={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[r,i,{label:"Width",name:"width",onchange:o.curry(ra.updateStyleField,t)},{label:"Height",name:"height",onchange:o.curry(ra.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,i,{label:"Width",name:"width",onchange:o.curry(ra.updateStyleField,t)},{label:"Height",name:"height",onchange:o.curry(ra.updateStyleField,t)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},u]},_u(t)?t.windowManager.open({title:"Table properties",data:l,bodyType:"tabpanel",body:[{title:"General",type:"form",items:a},ra.createStyleForm(t)],onsubmit:o.curry(va,t,e)}):t.windowManager.open({title:"Table properties",data:l,body:a,onsubmit:o.curry(va,t,e)})},wa=ta.each,ya={registerCommands:function(t,n,e,r,i){var u=Au.getIsRoot(t),a=function(){return H.fromDom(t.dom.getParent(t.selection.getStart(),"th,td"))},c=function(t){return Rn.table(t,u)},l=function(n){var o=a();c(o).each(function(i){var u=er.forMenu(r,i,o);n(i,u).each(function(n){t.selection.setRng(n),t.focus(),e.clear(i)})})},f=function(n){var e=a();return c(e).bind(function(n){var i=H.fromDom(t.getDoc()),u=er.forMenu(r,n,e),a=fe.cellOperations(o.noop,i,s.none());return Zu(n,u,a)})},d=function(n){i.get().each(function(o){var i=C.map(o,function(t){return Jn(t)}),u=a();c(u).bind(function(o){var a=H.fromDom(t.getDoc()),c=fe.paste(a),l=er.pasteRows(r,o,u,i,c);n(o,l).each(function(n){t.selection.setRng(n),t.focus(),e.clear(o)})})})};wa({mceTableSplitCells:function(){l(n.unmergeCells)},mceTableMergeCells:function(){l(n.mergeCells)},mceTableInsertRowBefore:function(){l(n.insertRowsBefore)},mceTableInsertRowAfter:function(){l(n.insertRowsAfter)},mceTableInsertColBefore:function(){l(n.insertColumnsBefore)},mceTableInsertColAfter:function(){l(n.insertColumnsAfter)},mceTableDeleteCol:function(){l(n.deleteColumn)},mceTableDeleteRow:function(){l(n.deleteRow)},mceTableCutRow:function(t){i.set(f()),l(n.deleteRow)},mceTableCopyRow:function(t){i.set(f())},mceTablePasteRowBefore:function(t){d(n.pasteRowsBefore)},mceTablePasteRowAfter:function(t){d(n.pasteRowsAfter)},mceTableDelete:function(){var n=H.fromDom(t.dom.getParent(t.selection.getStart(),"th,td"));Rn.table(n,u).filter(o.not(u)).each(function(n){var e=H.fromText("");Fn.after(n,e),_n.remove(n);var r=t.dom.createRng();r.setStart(e.dom(),0),r.setEnd(e.dom(),0),t.selection.setRng(r)})}},function(n,e){t.addCommand(e,n)}),wa({mceInsertTable:o.curry(ba,t),mceTableProps:o.curry(ba,t,!0),mceTableRowProps:o.curry(ca,t),mceTableCellProps:o.curry(ia,t)},function(n,e){t.addCommand(e,function(t,e){n(e)})})}},xa={only:function(t){var n=s.from(t.dom().documentElement).map(H.fromDom).getOr(t);return{parent:o.constant(n),view:o.constant(t),origin:o.constant(Ar(0,0))}},detached:function(t,n){var e=o.curry(Or,n);return{parent:o.constant(n),view:o.constant(t),origin:e}},body:function(t,n){return{parent:o.constant(n),view:o.constant(t),origin:o.constant(Ar(0,0))}}};function Sa(t){var n=I.immutable.apply(null,t),e=[];return{bind:function(t){if(void 0===t)throw"Event bind error: undefined handler";e.push(t)},unbind:function(t){e=C.filter(e,function(n){return n!==t})},trigger:function(){var t=n.apply(null,arguments);C.each(e,function(n){n(t)})}}}var Ca={create:function(t){return{registry:N.map(t,function(t){return{bind:t.bind,unbind:t.unbind}}),trigger:N.map(t,function(t){return t.trigger})}}},Ra={mode:Kr.exactly(["compare","extract","mutate","sink"]),sink:Kr.exactly(["element","start","stop","destroy"]),api:Kr.exactly(["forceDrop","drop","move","delayDrop"])},Ta={resolve:Lo("ephox-dragster").resolve},Da=function(t,n){return function(e){if(t(e)){var r=H.fromDom(e.target),i=function(){e.stopPropagation()},u=function(){e.preventDefault()},a=o.compose(u,i),c=function(t,n,e,r,i,u,a){return{target:o.constant(t),x:o.constant(n),y:o.constant(e),stop:r,prevent:i,kill:u,raw:o.constant(a)}}(r,e.clientX,e.clientY,i,u,a,e);n(c)}}},Aa=function(t,n,e,r,i){var u=Da(e,r);return t.dom().addEventListener(n,u,i),{unbind:o.curry(ka,t,n,u,i)}},ka=function(t,n,e,r){t.dom().removeEventListener(n,e,r)},Na=function(t,n,e,r){return Aa(t,n,e,r,!1)},Oa=function(t,n,e,r){return Aa(t,n,e,r,!0)},Ea=o.constant(!0),Ba={bind:function(t,n,e){return Na(t,n,Ea,e)},capture:function(t,n,e){return Oa(t,n,Ea,e)}},Pa=Ra.mode({compare:function(t,n){return Ar(n.left()-t.left(),n.top()-t.top())},extract:function(t){return s.some(Ar(t.x(),t.y()))},sink:function(t,n){var e=function(t){var n=ho.merge({layerClass:Ta.resolve("blocker")},t),e=H.fromTag("div");return an.set(e,"role","presentation"),Mn.setAll(e,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Qo.add(e,Ta.resolve("blocker")),Qo.add(e,n.layerClass),{element:function(){return e},destroy:function(){_n.remove(e)}}}(n),r=Ba.bind(e.element(),"mousedown",t.forceDrop),o=Ba.bind(e.element(),"mouseup",t.drop),i=Ba.bind(e.element(),"mousemove",t.move),u=Ba.bind(e.element(),"mouseout",t.delayDrop);return Ra.sink({element:e.element,start:function(t){Fn.append(t,e.element())},stop:function(){_n.remove(e.element())},destroy:function(){e.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,n){t.mutate(n.left(),n.top())}});function Ia(){var t=s.none(),n=Ca.create({move:Sa(["info"])});return{onEvent:function(e,r){r.extract(e).each(function(e){(function(n,e){var r=t.map(function(t){return n.compare(t,e)});return t=s.some(e),r})(r,e).each(function(t){n.trigger.move(t)})})},reset:function(){t=s.none()},events:n.registry}}function Wa(){var t={onEvent:function(t,n){},reset:o.noop},n=Ia(),e=t;return{on:function(){e.reset(),e=n},off:function(){e.reset(),e=t},isOn:function(){return e===n},onEvent:function(t,n){e.onEvent(t,n)},events:n.events}}var Ma=function(t,n){var e=null;return{cancel:function(){null!==e&&(clearTimeout(e),e=null)},throttle:function(){var r=arguments;null!==e&&clearTimeout(e),e=setTimeout(function(){t.apply(null,r),e=null,r=null},n)}}},La=function(t,n,e){var r=!1,o=Ca.create({start:Sa([]),stop:Sa([])}),i=Wa(),u=function(){l.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=Ma(u,200);i.events.move.bind(function(e){n.mutate(t,e.info())});var c=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);if(r)return t.apply(null,n)}},l=n.sink(Ra.api({forceDrop:u,drop:c(u),move:c(function(t,e){a.cancel(),i.onEvent(t,n)}),delayDrop:c(a.throttle)}),e);return{element:l.element,go:function(t){l.start(t),i.on(),o.trigger.start()},on:function(){r=!0},off:function(){r=!1},destroy:function(){l.destroy()},events:o.registry}},qa={transform:function(t,n){var e=void 0!==n?n:{},r=void 0!==e.mode?e.mode:Pa;return La(t,r,n)}};function Fa(){var t=Ca.create({drag:Sa(["xDelta","yDelta","target"])}),n=s.none(),e=function(){var t=Ca.create({drag:Sa(["xDelta","yDelta"])});return{mutate:function(n,e){t.trigger.drag(n,e)},events:t.registry}}();return e.events.drag.bind(function(e){n.each(function(n){t.trigger.drag(e.xDelta(),e.yDelta(),n)})}),{assign:function(t){n=s.some(t)},get:function(){return n},mutate:e.mutate,events:t.registry}}var za={any:function(t){return yn.first(t).isSome()},ancestor:function(t,n,e){return yn.ancestor(t,n,e).isSome()},sibling:function(t,n){return yn.sibling(t,n).isSome()},child:function(t,n){return yn.child(t,n).isSome()},descendant:function(t,n){return yn.descendant(t,n).isSome()},closest:function(t,n,e){return yn.closest(t,n,e).isSome()}},ja=qo.resolve("resizer-bar-dragging");function _a(t,n){var e=jr.height,r=function(t,n,e){var r=Fa(),i=qa.transform(r,{}),u=s.none(),a=function(t,n){return s.from(an.get(t,n))};r.events.drag.bind(function(t){a(t.target(),"data-row").each(function(n){var e=Qi.getInt(t.target(),"top");Mn.set(t.target(),"top",e+t.yDelta()+"px")}),a(t.target(),"data-column").each(function(n){var e=Qi.getInt(t.target(),"left");Mn.set(t.target(),"left",e+t.xDelta()+"px")})});var c=function(t,n){return Qi.getInt(t,n)-parseInt(an.get(t,"data-initial-"+n),10)};i.events.stop.bind(function(){r.get().each(function(r){u.each(function(o){a(r,"data-row").each(function(t){var n=c(r,"top");an.remove(r,"data-initial-top"),g.trigger.adjustHeight(o,n,parseInt(t,10))}),a(r,"data-column").each(function(t){var n=c(r,"left");an.remove(r,"data-initial-left"),g.trigger.adjustWidth(o,n,parseInt(t,10))}),ui.refresh(t,o,e,n)})})});var l=function(n,e){g.trigger.startAdjust(),r.assign(n),an.set(n,"data-initial-"+e,parseInt(Mn.get(n,e),10)),Qo.add(n,ja),Mn.set(n,"opacity","0.2"),i.go(t.parent())},f=Ba.bind(t.parent(),"mousedown",function(t){ui.isRowBar(t.target())&&l(t.target(),"top"),ui.isColBar(t.target())&&l(t.target(),"left")}),d=function(n){return qt.eq(n,t.view())},m=Ba.bind(t.view(),"mouseover",function(r){"table"===nn.name(r.target())||za.ancestor(r.target(),"table",d)?(u="table"===nn.name(r.target())?s.some(r.target()):yn.ancestor(r.target(),"table",d)).each(function(r){ui.refresh(t,r,e,n)}):sn.inBody(r.target())&&ui.destroy(t)}),g=Ca.create({adjustHeight:Sa(["table","delta","row"]),adjustWidth:Sa(["table","delta","column"]),startAdjust:Sa([])});return{destroy:function(){f.unbind(),m.unbind(),i.destroy(),ui.destroy(t)},refresh:function(r){ui.refresh(t,r,e,n)},on:i.on,off:i.off,hideBars:o.curry(ui.hide,t),showBars:o.curry(ui.show,t),events:g.registry}}(t,n,e),i=Ca.create({beforeResize:Sa(["table"]),afterResize:Sa(["table"]),startDrag:Sa([])});return r.events.adjustHeight.bind(function(t){i.trigger.beforeResize(t.table());var n=e.delta(t.delta(),t.table());pu.adjustHeight(t.table(),n,t.row(),e),i.trigger.afterResize(t.table())}),r.events.startAdjust.bind(function(t){i.trigger.startDrag()}),r.events.adjustWidth.bind(function(t){i.trigger.beforeResize(t.table());var e=n.delta(t.delta(),t.table());pu.adjustWidth(t.table(),e,t.column(),n),i.trigger.afterResize(t.table())}),{on:r.on,off:r.off,hideBars:r.hideBars,showBars:r.showBars,destroy:r.destroy,events:i.registry}}var Ha={get:function(t,n){return t.inline?xa.body(Au.getBody(t),function(){var t=H.fromTag("div");return Mn.setAll(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Fn.append(sn.body(),t),t}()):xa.only(H.fromDom(t.getDoc()))},remove:function(t,n){t.inline&&_n.remove(n.parent())}};function Va(t){var n,e,r=s.none(),o=s.none(),i=s.none(),u=/(\d+(\.\d+)?)%/,a=function(t){return"TABLE"===t.nodeName};return t.on("init",function(){var n=Hr(Bu.directionAt),e=Ha.get(t);if(i=s.some(e),$u(t)&&Lu(t)){var u=_a(e,n);u.on(),u.events.startDrag.bind(function(n){r=s.some(t.selection.getRng())}),u.events.afterResize.bind(function(n){var e=n.table(),o=mn.descendants(e,"td[data-mce-style],th[data-mce-style]");C.each(o,function(t){an.remove(t,"data-mce-style")}),r.each(function(n){t.selection.setRng(n),t.focus()}),t.undoManager.add()}),o=s.some(u)}}),t.on("ObjectResizeStart",function(r){var o;a(r.target)&&(n=r.width,o=r.target,e=t.dom.getStyle(o,"width")||t.dom.getAttrib(o,"width"))}),t.on("ObjectResized",function(r){if(a(r.target)){var o=r.target;if(u.test(e)){var i=parseFloat(u.exec(e)[1]),c=r.width*i/n;t.dom.setStyle(o,"width",c+"%")}else{var l=[];ta.each(o.rows,function(n){ta.each(n.cells,function(n){var e=t.dom.getStyle(n,"width",!0);l.push({cell:n,width:e})})}),ta.each(l,function(n){t.dom.setStyle(n.cell,"width",n.width),t.dom.setAttrib(n.cell,"width",null)})}}}),{lazyResize:function(){return o},lazyWire:function(){return i.getOr(xa.only(H.fromDom(t.getBody())))},destroy:function(){o.each(function(t){t.destroy()}),i.each(function(n){Ha.remove(t,n)})}}}var Ua=function(t){return{fold:t}},Ga=function(t){return Ua(function(n,e,r,o){return n(t)})},Xa=function(t){return Ua(function(n,e,r,o){return e(t)})},Ya=function(t,n){return Ua(function(e,r,o,i){return o(t,n)})},Ka=function(t){return Ua(function(n,e,r,o){return o(t)})},$a=function(t,n){return Rn.table(t,n).bind(function(n){var e=Rn.cells(n);return C.findIndex(e,function(n){return qt.eq(t,n)}).map(function(t){return{index:o.constant(t),all:o.constant(e)}})})},Ja=function(t,n){return $a(t,n).fold(function(){return Ga(t)},function(n){return n.index()+1<n.all().length?Ya(t,n.all()[n.index()+1]):Ka(t)})},Qa=function(t,n){return $a(t,n).fold(function(){return Ga()},function(n){return n.index()-1>=0?Ya(t,n.all()[n.index()-1]):Xa(t)})},Za=Xe([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),tc={before:Za.before,on:Za.on,after:Za.after,cata:function(t,n,e,r){return t.fold(n,e,r)},getStart:function(t){return t.fold(o.identity,o.identity,o.identity)}},nc=Xe([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ec=I.immutable("start","soffset","finish","foffset"),rc={domRange:nc.domRange,relative:nc.relative,exact:nc.exact,exactFromRange:function(t){return nc.exact(t.start(),t.soffset(),t.finish(),t.foffset())},range:ec,getWin:function(t){var n=function(t){return t.match({domRange:function(t){return H.fromDom(t.startContainer)},relative:function(t,n){return tc.getStart(t)},exact:function(t,n,e,r){return t}})}(t);return Gt.defaultView(n)}},oc=function(t,n,e,r){var o=Gt.owner(t).dom().createRange();return o.setStart(t.dom(),n),o.setEnd(e.dom(),r),o},ic=function(t,n,e,r){var o=oc(t,n,e,r),i=qt.eq(t,e)&&n===r;return o.collapsed&&!i},uc=function(t,n){var e=(n||document).createDocumentFragment();return C.each(t,function(t){e.appendChild(t.dom())}),H.fromDom(e)},ac=function(t,n){t.selectNodeContents(n.dom())},cc=function(t){t.deleteContents()},lc=function(t){return{left:o.constant(t.left),top:o.constant(t.top),right:o.constant(t.right),bottom:o.constant(t.bottom),width:o.constant(t.width),height:o.constant(t.height)}},sc={create:function(t){return t.document.createRange()},replaceWith:function(t,n){cc(t),t.insertNode(n.dom())},selectNodeContents:function(t,n){var e=t.document.createRange();return ac(e,n),e},selectNodeContentsUsing:ac,relativeToNative:function(t,n,e){var r,o=t.document.createRange();return r=o,n.fold(function(t){r.setStartBefore(t.dom())},function(t,n){r.setStart(t.dom(),n)},function(t){r.setStartAfter(t.dom())}),function(t,n){n.fold(function(n){t.setEndBefore(n.dom())},function(n,e){t.setEnd(n.dom(),e)},function(n){t.setEndAfter(n.dom())})}(o,e),o},exactToNative:function(t,n,e,r,o){var i=t.document.createRange();return i.setStart(n.dom(),e),i.setEnd(r.dom(),o),i},deleteContents:cc,cloneFragment:function(t){var n=t.cloneContents();return H.fromDom(n)},getFirstRect:function(t){var n=t.getClientRects(),e=n.length>0?n[0]:t.getBoundingClientRect();return e.width>0||e.height>0?s.some(e).map(lc):s.none()},getBounds:function(t){var n=t.getBoundingClientRect();return n.width>0||n.height>0?s.some(n).map(lc):s.none()},isWithin:function(t,n){return n.compareBoundaryPoints(t.END_TO_START,t)<1&&n.compareBoundaryPoints(t.START_TO_END,t)>-1},toString:function(t){return t.toString()}},fc=Xe([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),dc=function(t,n,e){return n(H.fromDom(e.startContainer),e.startOffset,H.fromDom(e.endContainer),e.endOffset)},mc=function(t,n){return function(t,n){var e=n.ltr();return e.collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return fc.rtl(H.fromDom(t.endContainer),t.endOffset,H.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return dc(0,fc.ltr,e)}):dc(0,fc.ltr,e)}(0,function(t,n){return n.match({domRange:function(t){return{ltr:o.constant(t),rtl:s.none}},relative:function(n,e){return{ltr:ut(function(){return sc.relativeToNative(t,n,e)}),rtl:ut(function(){return s.some(sc.relativeToNative(t,e,n))})}},exact:function(n,e,r,o){return{ltr:ut(function(){return sc.exactToNative(t,n,e,r,o)}),rtl:ut(function(){return s.some(sc.exactToNative(t,r,o,n,e))})}}})}(t,n))},gc={ltr:fc.ltr,rtl:fc.rtl,diagnose:mc,asLtrRange:function(t,n){return mc(t,n).match({ltr:function(n,e,r,o){var i=t.document.createRange();return i.setStart(n.dom(),e),i.setEnd(r.dom(),o),i},rtl:function(n,e,r,o){var i=t.document.createRange();return i.setStart(r.dom(),o),i.setEnd(n.dom(),e),i}})}},pc=function(t,n,e){return n>=t.left&&n<=t.right&&e>=t.top&&e<=t.bottom},hc=function(t,n,e,r,o){if(0===o)return 0;if(n===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(n-a.left);if(e>a.bottom);else{if(e<a.top||c>i)return u-1;i=c}}return 0},vc={locate:function(t,n,e,r){var o=t.dom().createRange();o.selectNode(n.dom());var i=o.getClientRects();return bo(i,function(t){return pc(t,e,r)?s.some(t):s.none()}).map(function(o){return function(t,n,e,r,o){var i=function(e){var r=t.dom().createRange();return r.setStart(n.dom(),e),r.collapse(!0),r},u=te.get(n).length,a=hc(function(t){return i(t).getBoundingClientRect()},e,r,o.right,u);return i(a)}(t,n,e,r,o)})}},bc=function(t,n,e,r){var o=t.dom().createRange(),i=Gt.children(n);return bo(i,function(n){return o.selectNode(n.dom()),pc(o.getBoundingClientRect(),e,r)?wc(t,n,e,r):s.none()})},wc=function(t,n,e,r){return(nn.isText(n)?vc.locate:bc)(t,n,e,r)},yc=function(t,n,e,r){var o=t.dom().createRange();o.selectNode(n.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,r));return wc(t,n,u,a)},xc=function(t,n){return n-t.left<t.right-n},Sc=function(t,n,e){var r=t.dom().createRange();return r.selectNode(n.dom()),r.collapse(e),r},Cc=function(t,n,e){var r=t.dom().createRange();r.selectNode(n.dom());var o=r.getBoundingClientRect(),i=xc(o,e);return(!0===i?ue.first:ue.last)(n).map(function(n){return Sc(t,n,i)})},Rc=function(t,n,e){var r=n.dom().getBoundingClientRect(),o=xc(r,e);return s.some(Sc(t,n,o))},Tc=function(t,n,e){return(0===Gt.children(n).length?Rc:Cc)(t,n,e)},Dc=document.caretPositionFromPoint?function(t,n,e){return s.from(t.dom().caretPositionFromPoint(n,e)).bind(function(n){if(null===n.offsetNode)return s.none();var e=t.dom().createRange();return e.setStart(n.offsetNode,n.offset),e.collapse(),s.some(e)})}:document.caretRangeFromPoint?function(t,n,e){return s.from(t.dom().caretRangeFromPoint(n,e))}:function(t,n,e){return H.fromPoint(t,n,e).bind(function(r){var o=function(){return Tc(t,r,n)};return 0===Gt.children(r).length?o():function(t,n,e,r){var o=t.dom().createRange();o.selectNode(n.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,r));return yc(t,n,u,a)}(t,r,n,e).orThunk(o)})},Ac=function(t,n,e){var r=H.fromDom(t.document);return Dc(r,n,e).map(function(t){return rc.range(H.fromDom(t.startContainer),t.startOffset,H.fromDom(t.endContainer),t.endOffset)})},kc=function(t,n,e){var r=gc.asLtrRange(t,n),o=H.fromDom(r.commonAncestorContainer);return nn.isElement(o)?function(t,n,e,r){var o=sc.create(t),i=(J.is(n,r)?[n]:[]).concat(mn.descendants(n,r));return C.filter(i,function(t){return sc.selectNodeContentsUsing(o,t),sc.isWithin(e,o)})}(t,o,r,e):[]},Nc=function(t,n){var e=nn.name(t);return"input"===e?tc.after(t):C.contains(["br","img"],e)?0===n?tc.before(t):tc.after(t):tc.on(t,n)},Oc=function(t,n){var e=t.fold(tc.before,Nc,tc.after),r=n.fold(tc.before,Nc,tc.after);return rc.relative(e,r)},Ec=function(t,n,e,r){var o=Nc(t,n),i=Nc(e,r);return rc.relative(o,i)},Bc=function(t){return t.match({domRange:function(t){var n=H.fromDom(t.startContainer),e=H.fromDom(t.endContainer);return Ec(n,t.startOffset,e,t.endOffset)},relative:Oc,exact:Ec})},Pc=Oc,Ic=Ec,Wc=function(t,n){s.from(t.getSelection()).each(function(t){t.removeAllRanges(),t.addRange(n)})},Mc=function(t,n,e,r,o){var i=sc.exactToNative(t,n,e,r,o);Wc(t,i)},Lc=function(t,n){return gc.diagnose(t,n).match({ltr:function(n,e,r,o){Mc(t,n,e,r,o)},rtl:function(n,e,r,o){var i=t.getSelection();i.extend?(i.collapse(n.dom(),e),i.extend(r.dom(),o)):Mc(t,r,o,n,e)}})},qc=function(t){var n=H.fromDom(t.anchorNode),e=H.fromDom(t.focusNode);return ic(n,t.anchorOffset,e,t.focusOffset)?s.some(rc.range(H.fromDom(t.anchorNode),t.anchorOffset,H.fromDom(t.focusNode),t.focusOffset)):function(t){if(t.rangeCount>0){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return s.some(rc.range(H.fromDom(n.startContainer),n.startOffset,H.fromDom(e.endContainer),e.endOffset))}return s.none()}(t)},Fc=function(t){var n=t.getSelection();return n.rangeCount>0?qc(n):s.none()},zc={setExact:function(t,n,e,r,o){var i=Ic(n,e,r,o);Lc(t,i)},getExact:Fc,get:function(t){return Fc(t).map(function(t){return rc.exact(t.start(),t.soffset(),t.finish(),t.foffset())})},setRelative:function(t,n,e){var r=Pc(n,e);Lc(t,r)},toNative:function(t){var n=rc.getWin(t).dom(),e=function(t,e,r,o){return sc.exactToNative(n,t,e,r,o)},r=Bc(t);return gc.diagnose(n,r).match({ltr:e,rtl:e})},setToElement:function(t,n){var e=sc.selectNodeContents(t,n);Wc(t,e)},clear:function(t){t.getSelection().removeAllRanges()},clone:function(t,n){var e=gc.asLtrRange(t,n);return sc.cloneFragment(e)},replace:function(t,n,e){var r=gc.asLtrRange(t,n),o=uc(e,t.document);sc.replaceWith(r,o)},deleteAt:function(t,n){var e=gc.asLtrRange(t,n);sc.deleteContents(e)},forElement:function(t,n){var e=sc.selectNodeContents(t,n);return rc.range(H.fromDom(e.startContainer),e.startOffset,H.fromDom(e.endContainer),e.endOffset)},getFirstRect:function(t,n){var e=gc.asLtrRange(t,n);return sc.getFirstRect(e)},getBounds:function(t,n){var e=gc.asLtrRange(t,n);return sc.getBounds(e)},getAtPoint:function(t,n,e){return Ac(t,n,e)},findWithin:function(t,n,e){return kc(t,n,e)},getAsString:function(t,n){var e=gc.asLtrRange(t,n);return sc.toString(e)},isCollapsed:function(t,n,e,r){return qt.eq(t,e)&&n===r}},jc=tinymce.util.Tools.resolve("tinymce.util.VK"),_c=function(t,n,e,r){return Uc(t,n,Ja(e),r)},Hc=function(t,n,e,r){return Uc(t,n,Qa(e),r)},Vc=function(t,n){var e=rc.exact(n,0,n,0);return zc.toNative(e)},Uc=function(t,n,e,r,o){return e.fold(s.none,s.none,function(t,n){return ue.first(n).map(function(t){return Vc(0,t)})},function(e){return Rn.table(e,n).bind(function(n){var o=er.noMenu(e);return t.undoManager.transact(function(){r.insertRowsAfter(n,o)}),function(t,n){var e=mn.descendants(n,"tr");return C.last(e).bind(function(t){return yn.descendant(t,"td,th").map(function(t){return Vc(0,t)})})}(0,n)})})},Gc=["table","li","dl"],Xc={handle:function(t,n,e,r){if(t.keyCode===jc.TAB){var o=Au.getBody(n),i=function(t){var n=nn.name(t);return qt.eq(t,o)||C.contains(Gc,n)},u=n.selection.getRng();if(u.collapsed){var a=H.fromDom(u.startContainer);Rn.cell(a,i).each(function(o){t.preventDefault(),(t.shiftKey?Hc:_c)(n,i,o,e,r).each(function(t){n.selection.setRng(t)})})}}}},Yc={response:I.immutable("selection","kill")},Kc=function(t){return function(n){return n===t}},$c=Kc(38),Jc=Kc(40),Qc={ltr:{isBackward:Kc(37),isForward:Kc(39)},rtl:{isBackward:Kc(39),isForward:Kc(37)},isUp:$c,isDown:Jc,isNavigation:function(t){return t>=37&&t<=40}},Zc={convertToRange:function(t,n){var e=gc.asLtrRange(t,n);return{start:o.constant(H.fromDom(e.startContainer)),soffset:o.constant(e.startOffset),finish:o.constant(H.fromDom(e.endContainer)),foffset:o.constant(e.endOffset)}},makeSitus:function(t,n,e,r){return{start:o.constant(tc.on(t,n)),finish:o.constant(tc.on(e,r))}}},tl=Wt.detect().browser.isSafari(),nl=function(t){var n=void 0!==t?t.dom():document,e=n.body.scrollLeft||n.documentElement.scrollLeft,r=n.body.scrollTop||n.documentElement.scrollTop;return Ar(e,r)},el=function(t,n,e){(void 0!==e?e.dom():document).defaultView.scrollTo(t,n)},rl=function(t,n){tl&&E.isFunction(t.dom().scrollIntoViewIfNeeded)?t.dom().scrollIntoViewIfNeeded(!1):t.dom().scrollIntoView(n)},ol={get:nl,to:el,by:function(t,n,e){(void 0!==e?e.dom():document).defaultView.scrollBy(t,n)},preserve:function(t,n){var e=nl(t);n();var r=nl(t);e.top()===r.top()&&e.left()===r.left()||el(e.left(),e.top(),t)},capture:function(t){var n=s.none(),e=function(){n=s.some(nl(t))};return e(),{save:e,restore:function(){n.each(function(n){el(n.left(),n.top(),t)})}}},intoView:rl,intoViewIfNeeded:function(t,n){var e=n.dom().getBoundingClientRect(),r=t.dom().getBoundingClientRect();r.top<e.top?rl(t,!0):r.bottom>e.bottom&&rl(t,!1)},setToElement:function(t,n){var e=Or(n),r=H.fromDom(t.document);el(e.left(),e.top(),r)},scrollBarWidth:function(){var t=H.fromHtml('<div style="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;"></div>');Fn.after(sn.body(),t);var n=t.dom().offsetWidth-t.dom().clientWidth;return _n.remove(t),n}};function il(t){return{elementFromPoint:function(n,e){return s.from(t.document.elementFromPoint(n,e)).map(H.fromDom)},getRect:function(t){return t.dom().getBoundingClientRect()},getRangedRect:function(n,e,r,i){var u=rc.exact(n,e,r,i);return zc.getFirstRect(t,u).map(function(t){return N.map(t,o.apply)})},getSelection:function(){return zc.get(t).map(function(n){return Zc.convertToRange(t,n)})},fromSitus:function(n){var e=rc.relative(n.start(),n.finish());return Zc.convertToRange(t,e)},situsFromPoint:function(n,e){return zc.getAtPoint(t,n,e).map(function(t){return{start:o.constant(tc.on(t.start(),t.soffset())),finish:o.constant(tc.on(t.finish(),t.foffset()))}})},clearSelection:function(){zc.clear(t)},setSelection:function(n){zc.setExact(t,n.start(),n.soffset(),n.finish(),n.foffset())},setRelativeSelection:function(n,e){zc.setRelative(t,n,e)},selectContents:function(n){zc.setToElement(t,n)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){return ol.get(H.fromDom(t.document)).top()},scrollBy:function(n,e){ol.by(n,e,H.fromDom(t.document))}}}var ul=function(t,n,e,r,o){if(!qt.eq(e,r))return He.identify(e,r,n).bind(function(n){var r=n.boxes().getOr([]);return r.length>0?(o(t,r,n.start(),n.finish()),s.some(Yc.response(s.some(Zc.makeSitus(e,0,e,re(e))),!0))):s.none()})},al={sync:function(t,n,e,r,o,i,u){return qt.eq(e,o)&&r===i?s.none():yn.closest(e,"td,th",n).bind(function(e){return yn.closest(o,"td,th",n).bind(function(r){return ul(t,n,e,r,u)})})},detect:ul,update:function(t,n,e,r,o){return He.shiftSelection(r,t,n,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(t){return o.clear(e),o.selectRange(e,t.boxes(),t.start(),t.finish()),t.boxes()})}},cl=I.immutableBag(["left","top","right","bottom"],[]),ll={nu:cl,moveUp:function(t,n){return cl({left:t.left(),top:t.top()-n,right:t.right(),bottom:t.bottom()-n})},moveDown:function(t,n){return cl({left:t.left(),top:t.top()+n,right:t.right(),bottom:t.bottom()+n})},moveBottomTo:function(t,n){var e=t.bottom()-t.top();return cl({left:t.left(),top:n-e,right:t.right(),bottom:n})},moveTopTo:function(t,n){var e=t.bottom()-t.top();return cl({left:t.left(),top:n,right:t.right(),bottom:n+e})},getTop:function(t){return t.top()},getBottom:function(t){return t.bottom()},translate:function(t,n,e){return cl({left:t.left()+n,top:t.top()+e,right:t.right()+n,bottom:t.bottom()+e})},toString:function(t){return"("+t.left()+", "+t.top()+") -> ("+t.right()+", "+t.bottom()+")"}},sl=function(t){return ll.nu({left:t.left,top:t.top,right:t.right,bottom:t.bottom})},fl=function(t,n){return s.some(t.getRect(n))},dl=function(t,n,e){return nn.isElement(n)?fl(t,n).map(sl):nn.isText(n)?function(t,n,e){return e>=0&&e<re(n)?t.getRangedRect(n,e,n,e+1):e>0?t.getRangedRect(n,e-1,n,e):s.none()}(t,n,e).map(sl):s.none()},ml=function(t,n){return nn.isElement(n)?fl(t,n).map(sl):nn.isText(n)?t.getRangedRect(n,0,n,re(n)).map(sl):s.none()},gl=I.immutable("item","mode"),pl=function(t,n,e,r){var o=void 0!==r?r:hl;return t.property().parent(n).map(function(t){return gl(t,o)})},hl=function(t,n,e,r){var o=void 0!==r?r:vl;return e.sibling(t,n).map(function(t){return gl(t,o)})},vl=function(t,n,e,r){var o=void 0!==r?r:vl,i=t.property().children(n);return e.first(i).map(function(t){return gl(t,o)})},bl=[{current:pl,next:hl,fallback:s.none()},{current:hl,next:vl,fallback:s.some(pl)},{current:vl,next:vl,fallback:s.some(hl)}],wl=function(t,n,e,r,o){return o=void 0!==o?o:bl,C.find(o,function(t){return t.current===e}).bind(function(e){return e.current(t,n,r,e.next).orThunk(function(){return e.fallback.bind(function(e){return wl(t,n,e,r)})})})},yl={backtrack:pl,sidestep:hl,advance:vl,go:wl},xl={left:function(){return{sibling:function(t,n){return t.query().prevSibling(n)},first:function(t){return t.length>0?s.some(t[t.length-1]):s.none()}}},right:function(){return{sibling:function(t,n){return t.query().nextSibling(n)},first:function(t){return t.length>0?s.some(t[0]):s.none()}}}},Sl=function(t,n,e,r,o,i){return yl.go(t,n,r,o).bind(function(n){return i(n.item())?s.none():e(n.item())?s.some(n.item()):Sl(t,n.item(),e,n.mode(),o,i)})},Cl=function(t,n,e,r){return Sl(t,n,e,yl.sidestep,xl.left(),r)},Rl=function(t,n,e,r){return Sl(t,n,e,yl.sidestep,xl.right(),r)},Tl=function(t,n){return 0===t.property().children(n).length},Dl=function(t,n,e,r){return Cl(t,n,e,r)},Al=function(t,n,e,r){return Rl(t,n,e,r)},kl={before:function(t,n,e){return Dl(t,n,o.curry(Tl,t),e)},after:function(t,n,e){return Al(t,n,o.curry(Tl,t),e)},seekLeft:Dl,seekRight:Al,walkers:function(){return{left:xl.left,right:xl.right}},walk:function(t,n,e,r,o){return yl.go(t,n,e,r,o)},backtrack:yl.backtrack,sidestep:yl.sidestep,advance:yl.advance},Nl=ge(),Ol={gather:function(t,n,e){return kl.gather(Nl,t,n,e)},before:function(t,n){return kl.before(Nl,t,n)},after:function(t,n){return kl.after(Nl,t,n)},seekLeft:function(t,n,e){return kl.seekLeft(Nl,t,n,e)},seekRight:function(t,n,e){return kl.seekRight(Nl,t,n,e)},walkers:function(){return kl.walkers()},walk:function(t,n,e,r){return kl.walk(Nl,t,n,e,r)}},El=Xe([{none:[]},{retry:["caret"]}]),Bl=function(t,n,e){return bn.closest(n,co).fold(o.constant(!1),function(n){return ml(t,n).exists(function(t){return function(t,n){return t.left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right()}(e,t)})})},Pl={point:ll.getTop,adjuster:function(t,n,e,r,o){var i=ll.moveUp(o,5);return Math.abs(e.top()-r.top())<1?El.retry(i):e.bottom()<o.top()?El.retry(i):e.bottom()===o.top()?El.retry(ll.moveUp(o,1)):Bl(t,n,o)?El.retry(ll.translate(i,5,0)):El.none()},move:ll.moveUp,gather:Ol.before},Il={point:ll.getBottom,adjuster:function(t,n,e,r,o){var i=ll.moveDown(o,5);return Math.abs(e.bottom()-r.bottom())<1?El.retry(i):e.top()>o.bottom()?El.retry(i):e.top()===o.bottom()?El.retry(ll.moveDown(o,1)):Bl(t,n,o)?El.retry(ll.translate(i,5,0)):El.none()},move:ll.moveDown,gather:Ol.after},Wl=function(t,n,e,r,o){return 0===o?s.some(r):function(t,n,e){return t.elementFromPoint(n,e).filter(function(t){return"table"===nn.name(t)}).isSome()}(t,r.left(),n.point(r))?function(t,n,e,r,o){return Wl(t,n,e,n.move(r,5),o)}(t,n,e,r,o-1):t.situsFromPoint(r.left(),n.point(r)).bind(function(i){return i.start().fold(s.none,function(i,u){return ml(t,i,u).bind(function(u){return n.adjuster(t,i,u,e,r).fold(s.none,function(r){return Wl(t,n,e,r,o-1)})}).orThunk(function(){return s.some(r)})},s.none)})},Ml=function(t,n,e){var r=t.move(e,5),o=Wl(n,t,e,r,100).getOr(r);return function(t,n,e){return t.point(n)>e.getInnerHeight()?s.some(t.point(n)-e.getInnerHeight()):t.point(n)<0?s.some(-t.point(n)):s.none()}(t,o,n).fold(function(){return n.situsFromPoint(o.left(),t.point(o))},function(e){return n.scrollBy(0,e),n.situsFromPoint(o.left(),t.point(o)-e)})},Ll={tryUp:o.curry(Ml,Pl),tryDown:o.curry(Ml,Il),ieTryUp:function(t,n){return t.situsFromPoint(n.left(),n.top()-5)},ieTryDown:function(t,n){return t.situsFromPoint(n.left(),n.bottom()+5)},getJumpSize:o.constant(5)},ql=Xe([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Fl=function(t){return yn.closest(t,"tr")},zl={verify:function(t,n,e,r,o,i,u){return yn.closest(r,"td,th",u).bind(function(e){return yn.closest(n,"td,th",u).map(function(n){return qt.eq(e,n)?qt.eq(r,e)&&re(e)===o?i(n):ql.none("in same cell"):Re(Fl,[e,n]).fold(function(){return function(t,n,e){var r=t.getRect(n),o=t.getRect(e);return o.right>r.left&&o.left<r.right}(t,n,e)?ql.success():i(n)},function(t){return i(n)})})}).getOr(ql.none("default"))},cata:function(t,n,e,r,o){return t.fold(n,e,r,o)},adt:ql},jl={point:I.immutable("element","offset"),delta:I.immutable("element","deltaOffset"),range:I.immutable("element","start","finish"),points:I.immutable("begin","end"),text:I.immutable("element","text")},_l=(I.immutable("ancestor","descendants","element","index"),I.immutable("parent","children","element","index")),Hl=function(t,n){return C.findIndex(t,o.curry(qt.eq,n))},Vl=function(t){return Gt.parent(t).bind(function(n){var e=Gt.children(n);return Hl(e,t).map(function(r){return _l(n,e,t,r)})})},Ul=function(t){return"br"===nn.name(t)},Gl=function(t,n,e){return n(t,e).bind(function(t){return nn.isText(t)&&0===te.get(t).trim().length?Gl(t,n,e):s.some(t)})},Xl=function(t,n,e,r){return function(t,n){return Gt.child(t,n).filter(Ul).orThunk(function(){return Gt.child(t,n-1).filter(Ul)})}(n,e).bind(function(n){return r.traverse(n).fold(function(){return Gl(n,r.gather,t).map(r.relative)},function(t){return Vl(t).map(function(t){return tc.on(t.parent(),t.index())})})})},Yl=function(t,n,e,r){return(Ul(n)?function(t,n,e){return e.traverse(n).orThunk(function(){return Gl(n,e.gather,t)}).map(e.relative)}(t,n,r):Xl(t,n,e,r)).map(function(t){return{start:o.constant(t),finish:o.constant(t)}})},Kl=function(t){return zl.cata(t,function(t){return s.none()},function(){return s.none()},function(t){return s.some(jl.point(t,0))},function(t){return s.some(jl.point(t,re(t)))})},$l=Wt.detect(),Jl=function(t,n,e,r,o,i){return 0===i?s.none():ts(t,n,e,r,o).bind(function(u){var a=t.fromSitus(u),c=zl.verify(t,e,r,a.finish(),a.foffset(),o.failure,n);return zl.cata(c,function(){return s.none()},function(){return s.some(u)},function(u){return qt.eq(e,u)&&0===r?Ql(t,e,r,ll.moveUp,o):Jl(t,n,u,0,o,i-1)},function(u){return qt.eq(e,u)&&r===re(u)?Ql(t,e,r,ll.moveDown,o):Jl(t,n,u,re(u),o,i-1)})})},Ql=function(t,n,e,r,o){return dl(t,n,e).bind(function(n){return Zl(t,o,r(n,Ll.getJumpSize()))})},Zl=function(t,n,e){return $l.browser.isChrome()||$l.browser.isSafari()||$l.browser.isFirefox()||$l.browser.isEdge()?n.otherRetry(t,e):$l.browser.isIE()?n.ieRetry(t,e):s.none()},ts=function(t,n,e,r,o){return dl(t,e,r).bind(function(n){return Zl(t,o,n)})},ns=function(t,n,e){return function(t,n,e){return t.getSelection().bind(function(r){return Yl(n,r.finish(),r.foffset(),e).fold(function(){return s.some(jl.point(r.finish(),r.foffset()))},function(o){var i=t.fromSitus(o),u=zl.verify(t,r.finish(),r.foffset(),i.finish(),i.foffset(),e.failure,n);return Kl(u)})})}(t,n,e).bind(function(r){return Jl(t,n,r.element(),r.offset(),e,20).map(t.fromSitus)})},es=function(t,n,e){return bn.ancestor(t,n,e).isSome()},rs=Wt.detect(),os=function(t,n,e,r,i){return yn.closest(r,"td,th",n).bind(function(r){return yn.closest(r,"table",n).bind(function(u){return function(t,n){return es(t,function(t){return Gt.parent(t).exists(function(t){return qt.eq(t,n)})})}(i,u)?ns(t,n,e).bind(function(t){return yn.closest(t.finish(),"td,th",n).map(function(n){return{start:o.constant(r),finish:o.constant(n),range:o.constant(t)}})}):s.none()})})},is=function(t,n,e,r,o,i){return rs.browser.isIE()?s.none():i(r,n).orThunk(function(){return os(t,n,e,r,o).map(function(t){var n=t.range();return Yc.response(s.some(Zc.makeSitus(n.start(),n.soffset(),n.finish(),n.foffset())),!0)})})},us=function(t,n,e,r,o,i,u){return os(t,e,r,o,i).bind(function(t){return al.detect(n,e,t.start(),t.finish(),u)})},as=function(t,n){return yn.closest(t,"tr",n).bind(function(t){return yn.closest(t,"table",n).bind(function(e){var r=mn.descendants(e,"tr");return qt.eq(t,r[0])?Ol.seekLeft(e,function(t){return ue.last(t).isSome()},n).map(function(t){var n=re(t);return Yc.response(s.some(Zc.makeSitus(t,n,t,n)),!0)}):s.none()})})},cs=function(t,n){return yn.closest(t,"tr",n).bind(function(t){return yn.closest(t,"table",n).bind(function(e){var r=mn.descendants(e,"tr");return qt.eq(t,r[r.length-1])?Ol.seekRight(e,function(t){return ue.first(t).isSome()},n).map(function(t){return Yc.response(s.some(Zc.makeSitus(t,0,t,0)),!0)}):s.none()})})},ls=function(t,n){return yn.closest(t,"td,th",n)},ss={down:{traverse:Gt.nextSibling,gather:Ol.after,relative:tc.before,otherRetry:Ll.tryDown,ieRetry:Ll.ieTryDown,failure:zl.adt.failedDown},up:{traverse:Gt.prevSibling,gather:Ol.before,relative:tc.before,otherRetry:Ll.tryUp,ieRetry:Ll.ieTryUp,failure:zl.adt.failedUp}},fs=I.immutable("rows","cols"),ds={mouse:function(t,n,e,r){var o=function(t,n,e,r){var o=s.none(),i=function(){o=s.none()};return{mousedown:function(t){r.clear(n),o=ls(t.target(),e)},mouseover:function(i){o.each(function(o){r.clear(n),ls(i.target(),e).each(function(i){He.identify(o,i,e).each(function(e){var u=e.boxes().getOr([]);(u.length>1||1===u.length&&!qt.eq(o,i))&&(r.selectRange(n,u,e.start(),e.finish()),t.selectContents(i))})})})},mouseup:function(){o.each(i)}}}(il(t),n,e,r);return{mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},keyboard:function(t,n,e,r){var i=il(t),u=function(){return r.clear(n),s.none()};return{keydown:function(t,a,c,l,f,d){var m=t.raw().which,g=!0===t.raw().shiftKey;return He.retrieve(n,r.selectedSelector()).fold(function(){return Qc.isDown(m)&&g?o.curry(us,i,n,e,ss.down,l,a,r.selectRange):Qc.isUp(m)&&g?o.curry(us,i,n,e,ss.up,l,a,r.selectRange):Qc.isDown(m)?o.curry(is,i,e,ss.down,l,a,cs):Qc.isUp(m)?o.curry(is,i,e,ss.up,l,a,as):s.none},function(t){var e=function(e){return function(){return bo(e,function(e){return al.update(e.rows(),e.cols(),n,t,r)}).fold(function(){return He.getEdges(n,r.firstSelectedSelector(),r.lastSelectedSelector()).map(function(t){var e=Qc.isDown(m)||d.isForward(m)?tc.after:tc.before;return i.setRelativeSelection(tc.on(t.first(),0),e(t.table())),r.clear(n),Yc.response(s.none(),!0)})},function(t){return s.some(Yc.response(s.none(),!0))})}};return Qc.isDown(m)&&g?e([fs(1,0)]):Qc.isUp(m)&&g?e([fs(-1,0)]):d.isBackward(m)&&g?e([fs(0,-1),fs(-1,0)]):d.isForward(m)&&g?e([fs(0,1),fs(1,0)]):Qc.isNavigation(m)&&!1===g?u:s.none})()},keyup:function(t,o,i,u,a){return He.retrieve(n,r.selectedSelector()).fold(function(){var c=t.raw().which;return 0==(!0===t.raw().shiftKey)?s.none():Qc.isNavigation(c)?al.sync(n,e,o,i,u,a,r.selectRange):s.none()},s.none)}}}},ms=function(t,n){C.each(n,function(n){Qo.remove(t,n)})},gs=function(t){return function(n){Qo.add(n,t)}},ps=function(t){return function(n){ms(n,t)}},hs={byClass:function(t){var n=gs(t.selected()),e=ps([t.selected(),t.lastSelected(),t.firstSelected()]),r=function(n){var r=mn.descendants(n,t.selectedSelector());C.each(r,e)};return{clear:r,selectRange:function(e,o,i,u){r(e),C.each(o,n),Qo.add(i,t.firstSelected()),Qo.add(u,t.lastSelected())},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},byAttr:function(t){var n=function(n){an.remove(n,t.selected()),an.remove(n,t.firstSelected()),an.remove(n,t.lastSelected())},e=function(n){an.set(n,t.selected(),"1")},r=function(e){var r=mn.descendants(e,t.selectedSelector());C.each(r,n)};return{clear:r,selectRange:function(n,o,i,u){r(n),C.each(o,e),an.set(i,t.firstSelected(),"1"),an.set(u,t.lastSelected(),"1")},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}}};function vs(t,n){var e=I.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),r=s.none(),i=hs.byAttr(Ge);return t.on("init",function(u){var a=t.getWin(),c=Au.getBody(t),l=Au.getIsRoot(t),f=ds.mouse(a,c,l,i),d=ds.keyboard(a,c,l,i),m=function(n,e){(function(t){return!0===t.raw().shiftKey})(n)&&(e.kill()&&n.kill(),e.selection().each(function(n){var e=rc.relative(n.start(),n.finish()),r=gc.asLtrRange(a,e);t.selection.setRng(r)}))},g=function(n){var e=v(n);if(e.raw().shiftKey&&Qc.isNavigation(e.raw().which)){var r=t.selection.getRng(),o=H.fromDom(r.startContainer),i=H.fromDom(r.endContainer);d.keyup(e,o,r.startOffset,i,r.endOffset).each(function(t){m(e,t)})}},p=function(t){return!(an.has(t,"data-mce-bogus")||"br"===nn.name(t)||nn.isText(t)&&0===te.get(t).length)},h=function(e){var r,o,i=v(e);n().each(function(t){t.hideBars()}),40===e.which&&(r=H.fromDom(t.getBody()),o=function(t){return Gt.prevSibling(t).bind(function(t){return p(t)?s.some(t):o(t)})},Gt.lastChild(r).bind(function(t){return p(t)?s.some(t):o(t)})).each(function(n){"table"===nn.name(n)&&(Fu(t)?t.dom.add(t.getBody(),Fu(t),Vu(t),"<br/>"):t.dom.add(t.getBody(),"br"))});var u=t.selection.getRng(),a=H.fromDom(t.selection.getStart()),c=H.fromDom(u.startContainer),l=H.fromDom(u.endContainer),f=Bu.directionAt(a).isRtl()?Qc.rtl:Qc.ltr;d.keydown(i,c,u.startOffset,l,u.endOffset,f).each(function(t){m(i,t)}),n().each(function(t){t.showBars()})},v=function(t){var n=H.fromDom(t.target),e=function(){t.stopPropagation()},r=function(){t.preventDefault()},i=o.compose(r,e);return{target:o.constant(n),x:o.constant(t.x),y:o.constant(t.y),stop:e,prevent:r,kill:i,raw:o.constant(t)}},b=function(t){return 0===t.button},w=function(t){b(t)&&f.mousedown(v(t))},y=function(t){var n;(void 0===(n=t).buttons||0!=(1&n.buttons))&&f.mouseover(v(t))},x=function(t){b&&f.mouseup(v(t))};t.on("mousedown",w),t.on("mouseover",y),t.on("mouseup",x),t.on("keyup",g),t.on("keydown",h),t.on("nodechange",function(){var n=t.selection,e=H.fromDom(n.getStart()),r=H.fromDom(n.getEnd()),u=Rn.table(e),a=Rn.table(r);u.bind(function(t){return a.bind(function(n){return qt.eq(t,n)?s.some(!0):s.none()})}).fold(function(){i.clear(c)},o.noop)}),r=s.some(e({mousedown:w,mouseover:y,mouseup:x,keyup:g,keydown:h}))}),{clear:i.clear,destroy:function(){r.each(function(t){})}}}var bs=ta.each,ws={addButtons:function(t){var n=[];function e(n){return function(){t.execCommand(n)}}bs("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:o.curry(ba,t,!0),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},addToolbars:function(t){var n=function(t){var n=t.getParam("table_toolbar",Pu);return""===n||!1===n?[]:E.isString(n)?n.split(/[ ,]/):E.isArray(n)?n:[]}(t);n.length>0&&t.addContextToolbar(function(n){return t.dom.is(n,"table")&&t.getBody().contains(n)},n.join(" "))}},ys={addMenuItems:function(t,n){var e=s.none(),r=[],i=[],u=[],a=[],c=function(t){t.disabled(!0)},l=function(t){t.disabled(!1)},f=function(){var t=this;r.push(t),e.fold(function(){c(t)},function(n){l(t)})},d=function(){var t=this;i.push(t),e.fold(function(){c(t)},function(n){l(t)})};t.on("init",function(){t.on("nodechange",function(o){var f=s.from(t.dom.getParent(t.selection.getStart(),"th,td"));(e=f.bind(function(t){var e=H.fromDom(t);return Rn.table(e).map(function(t){return er.forMenu(n,t,e)})})).fold(function(){C.each(r,c),C.each(i,c),C.each(u,c),C.each(a,c)},function(t){C.each(r,l),C.each(i,l),C.each(u,function(n){n.disabled(t.mergable().isNone())}),C.each(a,function(n){n.disabled(t.unmergable().isNone())})})})});var m=function(t,n,e,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],s=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=n+1+" x "+(e+1),s&&(n=9-n),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(s?o>=n:o<=n)&&i<=e,t.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},g=!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?{text:"Table",icon:"table",context:"table",onclick:o.curry(ba,t)}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(n){n.aria&&(this.parent().hideAll(),n.stopImmediatePropagation(),ba(t))},onshow:function(){m(t,0,0,this.menu.items()[0])},onhide:function(){var n=this.menu.items()[0].getEl().getElementsByTagName("a");t.dom.removeClass(n,"mce-active"),t.dom.addClass(n[0],"mce-active")},menu:[{type:"container",html:function(){var t="";t='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var n=0;n<10;n++){t+="<tr>";for(var e=0;e<10;e++)t+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*n+e)+'" href="#" data-mce-x="'+e+'" data-mce-y="'+n+'"></a></td>';t+="</tr>"}return t+="</table>",t+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(n){var e,r,o=n.target;"A"===o.tagName.toUpperCase()&&(e=parseInt(o.getAttribute("data-mce-x"),10),r=parseInt(o.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(e=9-e),e===this.lastX&&r===this.lastY||(m(t,e,r,n.control),this.lastX=e,this.lastY=r))},onclick:function(n){var e=this;"A"===n.target.tagName.toUpperCase()&&(n.preventDefault(),n.stopPropagation(),e.parent().cancel(),t.undoManager.transact(function(){pa(t,e.lastX+1,e.lastY+1)}),t.addVisual())}}]};function p(n){return function(){t.execCommand(n)}}var h={text:"Table properties",context:"table",onPostRender:f,onclick:o.curry(ba,t,!0)},v={text:"Delete table",context:"table",onPostRender:f,cmd:"mceTableDelete"},b={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:p("mceTableInsertRowBefore"),onPostRender:d},{text:"Insert row after",onclick:p("mceTableInsertRowAfter"),onPostRender:d},{text:"Delete row",onclick:p("mceTableDeleteRow"),onPostRender:d},{text:"Row properties",onclick:p("mceTableRowProps"),onPostRender:d},{text:"-"},{text:"Cut row",onclick:p("mceTableCutRow"),onPostRender:d},{text:"Copy row",onclick:p("mceTableCopyRow"),onPostRender:d},{text:"Paste row before",onclick:p("mceTablePasteRowBefore"),onPostRender:d},{text:"Paste row after",onclick:p("mceTablePasteRowAfter"),onPostRender:d}]},w={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:p("mceTableInsertColBefore"),onPostRender:d},{text:"Insert column after",onclick:p("mceTableInsertColAfter"),onPostRender:d},{text:"Delete column",onclick:p("mceTableDeleteCol"),onPostRender:d}]},y={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:p("mceTableCellProps"),onPostRender:d},{text:"Merge cells",onclick:p("mceTableMergeCells"),onPostRender:function(){var t=this;u.push(t),e.fold(function(){c(t)},function(n){t.disabled(n.mergable().isNone())})}},{text:"Split cell",onclick:p("mceTableSplitCells"),onPostRender:function(){var t=this;a.push(t),e.fold(function(){c(t)},function(n){t.disabled(n.unmergable().isNone())})}}]};t.addMenuItem("inserttable",g),t.addMenuItem("tableprops",h),t.addMenuItem("deletetable",v),t.addMenuItem("row",b),t.addMenuItem("column",w),t.addMenuItem("cell",y)}},xs=function(t,n){return{insertTable:function(n,e){return pa(t,n,e)},setClipboardRows:function(t){return function(t,n){var e=C.map(t,H.fromDom);n.set(s.from(e))}(t,n)},getClipboardRows:function(){return function(t){return t.get().fold(function(){},function(t){return C.map(t,function(t){return t.dom()})})}(n)}}};e.add("table",function(t){var n=Va(t),e=vs(t,n.lazyResize),r=function(t,n){var e=function(t){return"table"===nn.name(Au.getBody(t))},r=Ku(t),i=function(n,e,o,i){return function(u,a){var c=mn.descendants(u,"td[data-mce-style],th[data-mce-style]");C.each(c,function(t){an.remove(t,"data-mce-style")});var l=i(),f=H.fromDom(t.getDoc()),d=Hr(Bu.directionAt),m=fe.cellOperations(o,f,r);return e(u)?n(l,u,a,m,d).bind(function(n){return C.each(n.newRows(),function(n){Ju(t,n.dom())}),C.each(n.newCells(),function(n){Qu(t,n.dom())}),n.cursor().map(function(n){var e=t.dom.createRng();return e.setStart(n.dom(),0),e.setEnd(n.dom(),0),e})}):s.none()}};return{deleteRow:i(Tu.eraseRows,function(n){var r=Vr.getGridSize(n);return!1===e(t)||r.rows()>1},o.noop,n),deleteColumn:i(Tu.eraseColumns,function(n){var r=Vr.getGridSize(n);return!1===e(t)||r.columns()>1},o.noop,n),insertRowsBefore:i(Tu.insertRowsBefore,o.always,o.noop,n),insertRowsAfter:i(Tu.insertRowsAfter,o.always,o.noop,n),insertColumnsBefore:i(Tu.insertColumnsBefore,o.always,Rr.halve,n),insertColumnsAfter:i(Tu.insertColumnsAfter,o.always,Rr.halve,n),mergeCells:i(Tu.mergeCells,o.always,o.noop,n),unmergeCells:i(Tu.unmergeCells,o.always,o.noop,n),pasteRowsBefore:i(Tu.pasteRowsBefore,o.always,o.noop,n),pasteRowsAfter:i(Tu.pasteRowsAfter,o.always,o.noop,n),pasteCells:i(Tu.pasteCells,o.always,o.noop,n)}}(t,n.lazyWire),i=function(t){return{get:function(){var n=Au.getBody(t);return Ve.retrieve(n,Ge.selectedSelector()).fold(function(){return void 0===t.selection.getStart()?Ke.none():Ke.single(t.selection)},function(t){return Ke.multiple(t)})}}}(t),u=Ur(s.none());return ya.registerCommands(t,r,e,i,u),rr.registerEvents(t,i,r,e),ys.addMenuItems(t,i),ws.addButtons(t),ws.addToolbars(t),t.on("PreInit",function(){t.serializer.addTempAttr(Ge.firstSelected()),t.serializer.addTempAttr(Ge.lastSelected())}),qu(t)&&t.on("keydown",function(e){Xc.handle(e,t,r,n.lazyWire)}),t.on("remove",function(){n.destroy(),e.destroy()}),xs(t,u)})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L223

Insecure DOM Manipulation (XSS) in plugin.js

CWE-79
File Location: media/vendor/tinymce/plugins/template/plugin.js:223
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- n.innerHTML = sel;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1670

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/mobile/theme.js:1670
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L24286

Insecure DOM Manipulation (XSS) in tinymce.js

CWE-79
File Location: media/vendor/tinymce/tinymce.js:24286
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- content = $_1qam7ujjdud76lb.trim($_adg5bi5cjdud77f2.trimExternal(editor.serializer, body.innerHTML));
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in webcomponents-ce.min.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-ce.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (function(){"use strict";var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function e(e){var n=t.has(e);return e=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(e),!n&&e}function n(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function o(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function i(t,e,n){n=void 0===n?new Set:n;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var a=r;e(a);var l=a.localName;if("link"===l&&"import"===a.getAttribute("rel")){if((r=a.import)instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)i(r,e,n);r=o(t,a);continue}if("template"===l){r=o(t,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)i(a,e,n)}r=r.firstChild?r.firstChild:o(t,r)}}function r(t,e,n){t[e]=n}function a(){this.a=new Map,this.s=new Map,this.f=[],this.b=!1}function l(t,e){t.b=!0,t.f.push(e)}function c(t,e){t.b&&i(e,function(e){return s(t,e)})}function s(t,e){if(t.b&&!e.__CE_patched){e.__CE_patched=!0;for(var n=0;n<t.f.length;n++)t.f[n](e)}}function h(t,e){var n=[];for(i(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state?t.connectedCallback(o):u(t,o)}}function f(t,e){var n=[];for(i(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state&&t.disconnectedCallback(o)}}function p(t,e,n){var o=(n=void 0===n?{}:n).w||new Set,r=n.i||function(e){return u(t,e)},a=[];if(i(e,function(e){if("link"===e.localName&&"import"===e.getAttribute("rel")){var n=e.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_hasRegistry=!0),n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:e.addEventListener("load",function(){var n=e.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var i=new Set(o);i.delete(n),p(t,n,{w:i,i:r})}})}else a.push(e)},o),t.b)for(e=0;e<a.length;e++)s(t,a[e]);for(e=0;e<a.length;e++)r(a[e])}function u(t,e){if(void 0===e.__CE_state){var o=e.ownerDocument;if((o.defaultView||o.__CE_isImportDocument&&o.__CE_hasRegistry)&&(o=t.a.get(e.localName))){o.constructionStack.push(e);var i=o.constructor;try{try{if(new i!==e)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{o.constructionStack.pop()}}catch(t){throw e.__CE_state=2,t}if(e.__CE_state=1,e.__CE_definition=o,o.attributeChangedCallback)for(o=o.observedAttributes,i=0;i<o.length;i++){var r=o[i],a=e.getAttribute(r);null!==a&&t.attributeChangedCallback(e,r,null,a,null)}n(e)&&t.connectedCallback(e)}}}function d(t){var e=document;this.c=t,this.a=e,this.b=void 0,p(this.c,this.a),"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function m(t){t.b&&t.b.disconnect()}function w(t){if(t.a)throw Error("Already resolved.");t.a=void 0,t.b&&t.b(void 0)}function y(t){this.j=!1,this.c=t,this.o=new Map,this.l=function(t){return t()},this.g=!1,this.m=[],this.u=new d(t)}a.prototype.connectedCallback=function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t)},a.prototype.disconnectedCallback=function(t){var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t)},a.prototype.attributeChangedCallback=function(t,e,n,o,i){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(e)&&r.attributeChangedCallback.call(t,e,n,o,i)},d.prototype.f=function(t){var e=this.a.readyState;for("interactive"!==e&&"complete"!==e||m(this),e=0;e<t.length;e++)for(var n=t[e].addedNodes,o=0;o<n.length;o++)p(this.c,n[o])},y.prototype.define=function(t,n){var o=this;if(!(n instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!e(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.c.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.j)throw Error("A custom element is already being defined.");this.j=!0;try{var i=function(t){var e=r[t];if(void 0!==e&&!(e instanceof Function))throw Error("The '"+t+"' callback must be a function.");return e},r=n.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var a=i("connectedCallback"),l=i("disconnectedCallback"),c=i("adoptedCallback"),s=i("attributeChangedCallback"),h=n.observedAttributes||[]}catch(t){return}finally{this.j=!1}n={localName:t,constructor:n,connectedCallback:a,disconnectedCallback:l,adoptedCallback:c,attributeChangedCallback:s,observedAttributes:h,constructionStack:[]},function(t,e,n){t.a.set(e,n),t.s.set(n.constructor,n)}(this.c,t,n),this.m.push(n),this.g||(this.g=!0,this.l(function(){return function(t){if(!1!==t.g){t.g=!1;for(var e=t.m,n=[],o=new Map,i=0;i<e.length;i++)o.set(e[i].localName,[]);for(p(t.c,document,{i:function(e){if(void 0===e.__CE_state){var i=e.localName,r=o.get(i);r?r.push(e):t.c.a.get(i)&&n.push(e)}}}),i=0;i<n.length;i++)u(t.c,n[i]);for(;0<e.length;){var r=e.shift();i=r.localName,r=o.get(r.localName);for(var a=0;a<r.length;a++)u(t.c,r[a]);(i=t.o.get(i))&&w(i)}}}(o)}))},y.prototype.i=function(t){p(this.c,t)},y.prototype.get=function(t){if(t=this.c.a.get(t))return t.constructor},y.prototype.whenDefined=function(t){if(!e(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var n=this.o.get(t);return n?n.f:(n=new function(){var t=this;this.b=this.a=void 0,this.f=new Promise(function(e){t.b=e,t.a&&e(t.a)})},this.o.set(t,n),this.c.a.get(t)&&!this.m.some(function(e){return e.localName===t})&&w(n),n.f)},y.prototype.v=function(t){m(this.u);var e=this.l;this.l=function(n){return t(function(){return e(n)})}},window.CustomElementRegistry=y,y.prototype.define=y.prototype.define,y.prototype.upgrade=y.prototype.i,y.prototype.get=y.prototype.get,y.prototype.whenDefined=y.prototype.whenDefined,y.prototype.polyfillWrapFlushCallback=y.prototype.v;var g=window.Document.prototype.createElement,b=window.Document.prototype.createElementNS,v=window.Document.prototype.importNode,E=window.Document.prototype.prepend,_=window.Document.prototype.append,C=window.DocumentFragment.prototype.prepend,N=window.DocumentFragment.prototype.append,S=window.Node.prototype.cloneNode,k=window.Node.prototype.appendChild,D=window.Node.prototype.insertBefore,T=window.Node.prototype.removeChild,A=window.Node.prototype.replaceChild,L=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),j=window.Element.prototype.attachShadow,M=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),H=window.Element.prototype.getAttribute,x=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,R=window.Element.prototype.getAttributeNS,F=window.Element.prototype.setAttributeNS,P=window.Element.prototype.removeAttributeNS,I=window.Element.prototype.insertAdjacentElement,z=window.Element.prototype.insertAdjacentHTML,W=window.Element.prototype.prepend,B=window.Element.prototype.append,V=window.Element.prototype.before,X=window.Element.prototype.after,$=window.Element.prototype.replaceWith,q=window.Element.prototype.remove,G=window.HTMLElement,J=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),K=window.HTMLElement.prototype.insertAdjacentElement,Q=window.HTMLElement.prototype.insertAdjacentHTML,U=new function(){};function Y(t,e,o){function i(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r-0]=arguments[r];r=[];for(var a=[],l=0;l<i.length;l++){var c=i[l];if(c instanceof Element&&n(c)&&a.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)r.push(c);else r.push(c)}for(e.apply(this,i),i=0;i<a.length;i++)f(t,a[i]);if(n(this))for(i=0;i<r.length;i++)(a=r[i])instanceof Element&&h(t,a)}}void 0!==o.h&&(e.prepend=i(o.h)),void 0!==o.append&&(e.append=i(o.append))}var Z,tt=window.customElements;if(!tt||tt.forcePolyfill||"function"!=typeof tt.define||"function"!=typeof tt.get){var et=new a;Z=et,window.HTMLElement=function(){function t(){var t=this.constructor,e=Z.s.get(t);if(!e)throw Error("The custom element being constructed was not registered with `customElements`.");var n=e.constructionStack;if(0===n.length)return n=g.call(document,e.localName),Object.setPrototypeOf(n,t.prototype),n.__CE_state=1,n.__CE_definition=e,s(Z,n),n;var o=n[e=n.length-1];if(o===U)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return n[e]=U,Object.setPrototypeOf(o,t.prototype),s(Z,o),o}return t.prototype=G.prototype,t}(),function(){var t=et;r(Document.prototype,"createElement",function(e){if(this.__CE_hasRegistry){var n=t.a.get(e);if(n)return new n.constructor}return e=g.call(this,e),s(t,e),e}),r(Document.prototype,"importNode",function(e,n){return e=v.call(this,e,n),this.__CE_hasRegistry?p(t,e):c(t,e),e}),r(Document.prototype,"createElementNS",function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var o=t.a.get(n);if(o)return new o.constructor}return e=b.call(this,e,n),s(t,e),e}),Y(t,Document.prototype,{h:E,append:_})}(),Y(et,DocumentFragment.prototype,{h:C,append:N}),function(){var t=et;function e(e,o){Object.defineProperty(e,"textContent",{enumerable:o.enumerable,configurable:!0,get:o.get,set:function(e){if(this.nodeType===Node.TEXT_NODE)o.set.call(this,e);else{var i=void 0;if(this.firstChild){var r=this.childNodes,a=r.length;if(0<a&&n(this)){i=Array(a);for(var l=0;l<a;l++)i[l]=r[l]}}if(o.set.call(this,e),i)for(e=0;e<i.length;e++)f(t,i[e])}}})}r(Node.prototype,"insertBefore",function(e,o){if(e instanceof DocumentFragment){var i=Array.prototype.slice.apply(e.childNodes);if(e=D.call(this,e,o),n(this))for(o=0;o<i.length;o++)h(t,i[o]);return e}return i=n(e),o=D.call(this,e,o),i&&f(t,e),n(this)&&h(t,e),o}),r(Node.prototype,"appendChild",function(e){if(e instanceof DocumentFragment){var o=Array.prototype.slice.apply(e.childNodes);if(e=k.call(this,e),n(this))for(var i=0;i<o.length;i++)h(t,o[i]);return e}return o=n(e),i=k.call(this,e),o&&f(t,e),n(this)&&h(t,e),i}),r(Node.prototype,"cloneNode",function(e){return e=S.call(this,e),this.ownerDocument.__CE_hasRegistry?p(t,e):c(t,e),e}),r(Node.prototype,"removeChild",function(e){var o=n(e),i=T.call(this,e);return o&&f(t,e),i}),r(Node.prototype,"replaceChild",function(e,o){if(e instanceof DocumentFragment){var i=Array.prototype.slice.apply(e.childNodes);if(e=A.call(this,e,o),n(this))for(f(t,o),o=0;o<i.length;o++)h(t,i[o]);return e}i=n(e);var r=A.call(this,e,o),a=n(this);return a&&f(t,o),i&&f(t,e),a&&h(t,e),r}),L&&L.get?e(Node.prototype,L):l(t,function(t){e(t,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++)t.push(this.childNodes[e].textContent);return t.join("")},set:function(t){for(;this.firstChild;)T.call(this,this.firstChild);k.call(this,document.createTextNode(t))}})})}(),function(){var t=et;function e(e,o){Object.defineProperty(e,"innerHTML",{enumerable:o.enumerable,configurable:!0,get:o.get,set:function(e){var r=this,a=void 0;if(n(this)&&(a=[],i(this,function(t){t!==r&&a.push(t)})),o.set.call(this,e),a)for(var l=0;l<a.length;l++){var s=a[l];1===s.__CE_state&&t.disconnectedCallback(s)}return this.ownerDocument.__CE_hasRegistry?p(t,this):c(t,this),e}})}function o(e,o){r(e,"insertAdjacentElement",function(e,i){var r=n(i);return e=o.call(this,e,i),r&&f(t,i),n(e)&&h(t,i),e})}function a(e,n){function o(e,n){for(var o=[];e!==n;e=e.nextSibling)o.push(e);for(n=0;n<o.length;n++)p(t,o[n])}r(e,"insertAdjacentHTML",function(t,e){if("beforebegin"===(t=t.toLowerCase())){var i=this.previousSibling;n.call(this,t,e),o(i||this.parentNode.firstChild,this)}else if("afterbegin"===t)i=this.firstChild,n.call(this,t,e),o(this.firstChild,i);else if("beforeend"===t)i=this.lastChild,n.call(this,t,e),o(i||this.firstChild,null);else{if("afterend"!==t)throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");i=this.nextSibling,n.call(this,t,e),o(this.nextSibling,i)}})}j&&r(Element.prototype,"attachShadow",function(t){return this.__CE_shadowRoot=j.call(this,t)}),M&&M.get?e(Element.prototype,M):J&&J.get?e(HTMLElement.prototype,J):l(t,function(t){e(t,{enumerable:!0,configurable:!0,get:function(){return S.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName,n=e?this.content:this,o=g.call(document,this.localName);for(o.innerHTML=t;0<n.childNodes.length;)T.call(n,n.childNodes[0]);for(t=e?o.content:o;0<t.childNodes.length;)k.call(n,t.childNodes[0])}})}),r(Element.prototype,"setAttribute",function(e,n){if(1!==this.__CE_state)return x.call(this,e,n);var o=H.call(this,e);x.call(this,e,n),n=H.call(this,e),t.attributeChangedCallback(this,e,o,n,null)}),r(Element.prototype,"setAttributeNS",function(e,n,o){if(1!==this.__CE_state)return F.call(this,e,n,o);var i=R.call(this,e,n);F.call(this,e,n,o),o=R.call(this,e,n),t.attributeChangedCallback(this,n,i,o,e)}),r(Element.prototype,"removeAttribute",function(e){if(1!==this.__CE_state)return O.call(this,e);var n=H.call(this,e);O.call(this,e),null!==n&&t.attributeChangedCallback(this,e,n,null,null)}),r(Element.prototype,"removeAttributeNS",function(e,n){if(1!==this.__CE_state)return P.call(this,e,n);var o=R.call(this,e,n);P.call(this,e,n);var i=R.call(this,e,n);o!==i&&t.attributeChangedCallback(this,n,o,i,e)}),K?o(HTMLElement.prototype,K):I?o(Element.prototype,I):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),Q?a(HTMLElement.prototype,Q):z?a(Element.prototype,z):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."),Y(t,Element.prototype,{h:W,append:B}),function(t){var e=Element.prototype;function o(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r-0]=arguments[r];r=[];for(var a=[],l=0;l<i.length;l++){var c=i[l];if(c instanceof Element&&n(c)&&a.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)r.push(c);else r.push(c)}for(e.apply(this,i),i=0;i<a.length;i++)f(t,a[i]);if(n(this))for(i=0;i<r.length;i++)(a=r[i])instanceof Element&&h(t,a)}}void 0!==V&&(e.before=o(V)),void 0!==V&&(e.after=o(X)),void 0!==$&&r(e,"replaceWith",function(e){for(var o=[],i=0;i<arguments.length;++i)o[i-0]=arguments[i];i=[];for(var r=[],a=0;a<o.length;a++){var l=o[a];if(l instanceof Element&&n(l)&&r.push(l),l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)i.push(l);else i.push(l)}for(a=n(this),$.apply(this,o),o=0;o<r.length;o++)f(t,r[o]);if(a)for(f(t,this),o=0;o<i.length;o++)(r=i[o])instanceof Element&&h(t,r)}),void 0!==q&&r(e,"remove",function(){var e=n(this);q.call(this),e&&f(t,this)})}(t)}(),document.__CE_hasRegistry=!0;var nt=new y(et);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:nt})}}).call(this);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L160

Insecure DOM Manipulation (XSS) in webcomponents-sd-ce-pf.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-sd-ce-pf.js:160
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- a,b),d(this.nextSibling,e);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");})}Be&&P(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=Be.call(this,a)});Ce&&Ce.get?b(Element.prototype,Ce):Se&&Se.get?b(HTMLElement.prototype,Se):ge(a,function(a){b(a,{enumerable:!0,configurable:!0,get:function(){return ve.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName,c=b?this.content:
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in webcomponents-sd-ce.min.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-sd-ce.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (function(){"use strict";var t,e="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};function o(){o=function(){},e.Symbol||(e.Symbol=i)}var r,i=(r=0,function(t){return"jscomp_symbol_"+(t||"")+r++});function l(){o();var t=e.Symbol.iterator;t||(t=e.Symbol.iterator=e.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&n(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return s(this)}}),l=function(){}}function s(t){var n=0;return function(t){return l(),(t={next:t})[e.Symbol.iterator]=function(){return this},t}(function(){return n<t.length?{done:!1,value:t[n++]}:{done:!0}})}function a(){this.ja=this.root=null,this.N=!1,this.v=this.J=this.$=this.assignedSlot=this.assignedNodes=this.C=null,this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.F=void 0,this.oa=this.da=!1}function c(t){return t.V||(t.V=new a),t.V}function u(t){return t&&t.V}a.prototype.toJSON=function(){return{}};var d=window.ShadyDOM||{};d.xa=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var h=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");d.o=!!(h&&h.configurable&&h.get),d.ha=d.force||!d.xa;var f=navigator.userAgent.match("Trident"),p=navigator.userAgent.match("Edge");function m(t){return(t=u(t))&&void 0!==t.firstChild}function v(t){return"ShadyRoot"===t.sa}function g(t){if(v(t=t.getRootNode()))return t}void 0===d.la&&(d.la=d.o&&(f||p));var y=Element.prototype,b=y.matches||y.matchesSelector||y.mozMatchesSelector||y.msMatchesSelector||y.oMatchesSelector||y.webkitMatchesSelector;function w(t,e){if(t&&e)for(var n,o=Object.getOwnPropertyNames(e),r=0;r<o.length&&(n=o[r]);r++){var i=Object.getOwnPropertyDescriptor(e,n);i&&Object.defineProperty(t,n,i)}}function E(t,e){for(var n=[],o=1;o<arguments.length;++o)n[o-1]=arguments[o];for(o=0;o<n.length;o++)w(t,n[o]);return t}var N=document.createTextNode(""),C=0,S=[];function _(t){S.push(t),N.textContent=C++}new MutationObserver(function(){for(;S.length;)try{S.shift()()}catch(t){throw N.textContent=C++,t}}).observe(N,{characterData:!0});var T=!!document.contains;function O(t,e){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}var x,D=[];function A(t){x||(x=!0,_(M)),D.push(t)}function M(){x=!1;for(var t=!!D.length;D.length;)D.shift()();return t}function L(){this.a=!1,this.addedNodes=[],this.removedNodes=[],this.M=new Set}M.list=D,L.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var t=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];return this.addedNodes=[],this.removedNodes=[],t}return[]};var j={},k=Element.prototype.insertBefore,R=Element.prototype.replaceChild,P=Element.prototype.removeChild,H=Element.prototype.setAttribute,F=Element.prototype.removeAttribute,I=Element.prototype.cloneNode,V=Document.prototype.importNode,B=Element.prototype.addEventListener,U=Element.prototype.removeEventListener,q=Window.prototype.addEventListener,W=Window.prototype.removeEventListener,G=Element.prototype.dispatchEvent,$=Node.prototype.contains||HTMLElement.prototype.contains,z=Document.prototype.getElementById,X=Element.prototype.querySelector,J=DocumentFragment.prototype.querySelector,K=Document.prototype.querySelector,Y=Element.prototype.querySelectorAll,Z=DocumentFragment.prototype.querySelectorAll,Q=Document.prototype.querySelectorAll;j.appendChild=Element.prototype.appendChild,j.insertBefore=k,j.replaceChild=R,j.removeChild=P,j.setAttribute=H,j.removeAttribute=F,j.cloneNode=I,j.importNode=V,j.addEventListener=B,j.removeEventListener=U,j.Ga=q,j.Ha=W,j.dispatchEvent=G,j.contains=$,j.getElementById=z,j.Qa=X,j.Ta=J,j.Oa=K,j.querySelector=function(t){switch(this.nodeType){case Node.ELEMENT_NODE:return X.call(this,t);case Node.DOCUMENT_NODE:return K.call(this,t);default:return J.call(this,t)}},j.Ra=Y,j.Ua=Z,j.Pa=Q,j.querySelectorAll=function(t){switch(this.nodeType){case Node.ELEMENT_NODE:return Y.call(this,t);case Node.DOCUMENT_NODE:return Q.call(this,t);default:return Z.call(this,t)}};var tt=/[&\u00A0"]/g,et=/[&\u00A0<>]/g;function nt(t){switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function ot(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return e}var rt=ot("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),it=ot("style script xmp iframe noembed noframes plaintext noscript".split(" "));function lt(t,e){"template"===t.localName&&(t=t.content);for(var n,o="",r=e?e(t):t.childNodes,i=0,l=r.length;i<l&&(n=r[i]);i++){t:{var s=n,a=t,c=e;switch(s.nodeType){case Node.ELEMENT_NODE:for(var u=s.localName,d="<"+u,h=s.attributes,f=0;a=h[f];f++)d+=" "+a.name+'="'+a.value.replace(tt,nt)+'"';d+=">",s=rt[u]?d:d+lt(s,c)+"</"+u+">";break t;case Node.TEXT_NODE:s=s.data,s=a&&it[a.localName]?s:s.replace(et,nt);break t;case Node.COMMENT_NODE:s="\x3c!--"+s.data+"--\x3e";break t;default:throw window.console.error(s),Error("not implemented")}}o+=s}return o}var st={},at=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),ct=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);function ut(t){var e=[];for(at.currentNode=t,t=at.firstChild();t;)e.push(t),t=at.nextSibling();return e}st.parentNode=function(t){return at.currentNode=t,at.parentNode()},st.firstChild=function(t){return at.currentNode=t,at.firstChild()},st.lastChild=function(t){return at.currentNode=t,at.lastChild()},st.previousSibling=function(t){return at.currentNode=t,at.previousSibling()},st.nextSibling=function(t){return at.currentNode=t,at.nextSibling()},st.childNodes=ut,st.parentElement=function(t){return ct.currentNode=t,ct.parentNode()},st.firstElementChild=function(t){return ct.currentNode=t,ct.firstChild()},st.lastElementChild=function(t){return ct.currentNode=t,ct.lastChild()},st.previousElementSibling=function(t){return ct.currentNode=t,ct.previousSibling()},st.nextElementSibling=function(t){return ct.currentNode=t,ct.nextSibling()},st.children=function(t){var e=[];for(ct.currentNode=t,t=ct.firstChild();t;)e.push(t),t=ct.nextSibling();return e},st.innerHTML=function(t){return lt(t,function(t){return ut(t)})},st.textContent=function(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:t=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1);for(var e,n="";e=t.nextNode();)n+=e.nodeValue;return n;default:return t.nodeValue}};var dt={},ht=d.o,ft=[Node.prototype,Element.prototype,HTMLElement.prototype];function pt(t){var e;t:{for(e=0;e<ft.length;e++){var n=ft[e];if(n.hasOwnProperty(t)){e=n;break t}}e=void 0}if(!e)throw Error("Could not find descriptor for "+t);return Object.getOwnPropertyDescriptor(e,t)}var mt=ht?{parentNode:pt("parentNode"),firstChild:pt("firstChild"),lastChild:pt("lastChild"),previousSibling:pt("previousSibling"),nextSibling:pt("nextSibling"),childNodes:pt("childNodes"),parentElement:pt("parentElement"),previousElementSibling:pt("previousElementSibling"),nextElementSibling:pt("nextElementSibling"),innerHTML:pt("innerHTML"),textContent:pt("textContent"),firstElementChild:pt("firstElementChild"),lastElementChild:pt("lastElementChild"),children:pt("children")}:{},vt=ht?{firstElementChild:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"firstElementChild"),lastElementChild:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"lastElementChild"),children:Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"children")}:{},gt=ht?{firstElementChild:Object.getOwnPropertyDescriptor(Document.prototype,"firstElementChild"),lastElementChild:Object.getOwnPropertyDescriptor(Document.prototype,"lastElementChild"),children:Object.getOwnPropertyDescriptor(Document.prototype,"children")}:{};dt.ia=mt,dt.Sa=vt,dt.Na=gt,dt.parentNode=function(t){return mt.parentNode.get.call(t)},dt.firstChild=function(t){return mt.firstChild.get.call(t)},dt.lastChild=function(t){return mt.lastChild.get.call(t)},dt.previousSibling=function(t){return mt.previousSibling.get.call(t)},dt.nextSibling=function(t){return mt.nextSibling.get.call(t)},dt.childNodes=function(t){return Array.prototype.slice.call(mt.childNodes.get.call(t))},dt.parentElement=function(t){return mt.parentElement.get.call(t)},dt.previousElementSibling=function(t){return mt.previousElementSibling.get.call(t)},dt.nextElementSibling=function(t){return mt.nextElementSibling.get.call(t)},dt.innerHTML=function(t){return mt.innerHTML.get.call(t)},dt.textContent=function(t){return mt.textContent.get.call(t)},dt.children=function(t){switch(t.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:t=vt.children.get.call(t);break;case Node.DOCUMENT_NODE:t=gt.children.get.call(t);break;default:t=mt.children.get.call(t)}return Array.prototype.slice.call(t)},dt.firstElementChild=function(t){switch(t.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:return vt.firstElementChild.get.call(t);case Node.DOCUMENT_NODE:return gt.firstElementChild.get.call(t);default:return mt.firstElementChild.get.call(t)}},dt.lastElementChild=function(t){switch(t.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:return vt.lastElementChild.get.call(t);case Node.DOCUMENT_NODE:return gt.lastElementChild.get.call(t);default:return mt.lastElementChild.get.call(t)}};var yt=d.la?dt:st;function bt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}var wt=d.o,Et=document.implementation.createHTMLDocument("inert"),Nt=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),Ct=Nt&&Nt.get,St=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"),_t={parentElement:{get:function(){var t=u(this);return(t=t&&t.parentNode)&&t.nodeType!==Node.ELEMENT_NODE&&(t=null),void 0!==t?t:yt.parentElement(this)},configurable:!0},parentNode:{get:function(){var t=u(this);return void 0!==(t=t&&t.parentNode)?t:yt.parentNode(this)},configurable:!0},nextSibling:{get:function(){var t=u(this);return void 0!==(t=t&&t.nextSibling)?t:yt.nextSibling(this)},configurable:!0},previousSibling:{get:function(){var t=u(this);return void 0!==(t=t&&t.previousSibling)?t:yt.previousSibling(this)},configurable:!0},nextElementSibling:{get:function(){var t=u(this);if(t&&void 0!==t.nextSibling){for(t=this.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}return yt.nextElementSibling(this)},configurable:!0},previousElementSibling:{get:function(){var t=u(this);if(t&&void 0!==t.previousSibling){for(t=this.previousSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.previousSibling;return t}return yt.previousElementSibling(this)},configurable:!0}},Tt={className:{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},configurable:!0}},Ot={childNodes:{get:function(){if(m(this)){var t=u(this);if(!t.childNodes){t.childNodes=[];for(var e=this.firstChild;e;e=e.nextSibling)t.childNodes.push(e)}var n=t.childNodes}else n=yt.childNodes(this);return n.item=function(t){return n[t]},n},configurable:!0},childElementCount:{get:function(){return this.children.length},configurable:!0},firstChild:{get:function(){var t=u(this);return void 0!==(t=t&&t.firstChild)?t:yt.firstChild(this)},configurable:!0},lastChild:{get:function(){var t=u(this);return void 0!==(t=t&&t.lastChild)?t:yt.lastChild(this)},configurable:!0},textContent:{get:function(){if(m(this)){for(var t,e=[],n=0,o=this.childNodes;t=o[n];n++)t.nodeType!==Node.COMMENT_NODE&&e.push(t.textContent);return e.join("")}return yt.textContent(this)},set:function(t){switch(void 0!==t&&null!==t||(t=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!m(this)&&wt){var e=this.firstChild;(e!=this.lastChild||e&&e.nodeType!=Node.TEXT_NODE)&&bt(this),dt.ia.textContent.set.call(this,t)}else bt(this),(0<t.length||this.nodeType===Node.ELEMENT_NODE)&&this.appendChild(document.createTextNode(t));break;default:this.nodeValue=t}},configurable:!0},firstElementChild:{get:function(){var t=u(this);if(t&&void 0!==t.firstChild){for(t=this.firstChild;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}return yt.firstElementChild(this)},configurable:!0},lastElementChild:{get:function(){var t=u(this);if(t&&void 0!==t.lastChild){for(t=this.lastChild;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.previousSibling;return t}return yt.lastElementChild(this)},configurable:!0},children:{get:function(){var t;return(t=m(this)?Array.prototype.filter.call(this.childNodes,function(t){return t.nodeType===Node.ELEMENT_NODE}):yt.children(this)).item=function(e){return t[e]},t},configurable:!0},innerHTML:{get:function(){return m(this)?lt("template"===this.localName?this.content:this):yt.innerHTML(this)},set:function(t){var e="template"===this.localName?this.content:this;bt(e);var n=this.localName;for(n&&"template"!==n||(n="div"),n=Et.createElement(n),wt?dt.ia.innerHTML.set.call(n,t):n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)},configurable:!0}},xt={shadowRoot:{get:function(){var t=u(this);return t&&t.ja||null},configurable:!0}},Dt={activeElement:{get:function(){var t=St&&St.get?St.get.call(document):d.o?void 0:document.activeElement;if(t&&t.nodeType){var e=!!v(this);if(this===document||e&&this.host!==t&&j.contains.call(this.host,t)){for(e=g(t);e&&e!==this;)e=g(t=e.host);t=this===document?e?null:t:e===this?t:null}else t=null}else t=null;return t},set:function(){},configurable:!0}};function At(t,e,n){for(var o in e){var r=Object.getOwnPropertyDescriptor(t,o);r&&r.configurable||!r&&n?Object.defineProperty(t,o,e[o]):n&&console.warn("Could not define",o,"on",t)}}function Mt(t){At(t,_t),At(t,Tt),At(t,Ot),At(t,Dt)}var Lt=d.o?function(){}:function(t){var e=c(t);e.da||(e.da=!0,At(t,_t,!0),At(t,Tt,!0))},jt=d.o?function(){}:function(t){c(t).oa||(At(t,Ot,!0),At(t,xt,!0))},kt=yt.childNodes;function Rt(t,e,n){Lt(t),n=n||null;var o=c(t),r=c(e),i=n?c(n):null;o.previousSibling=n?i.previousSibling:e.lastChild,(i=u(o.previousSibling))&&(i.nextSibling=t),(i=u(o.nextSibling=n))&&(i.previousSibling=t),o.parentNode=e,n?n===r.firstChild&&(r.firstChild=t):(r.lastChild=t,r.firstChild||(r.firstChild=t)),r.childNodes=null}function Pt(t,e){var n=c(t);if(void 0===n.firstChild)for(e=e||kt(t),n.firstChild=e[0]||null,n.lastChild=e[e.length-1]||null,jt(t),n=0;n<e.length;n++){var o=e[n],r=c(o);r.parentNode=t,r.nextSibling=e[n+1]||null,r.previousSibling=e[n-1]||null,Lt(o)}}var Ht=yt.parentNode;function Ft(t,e,n){if(e===t)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(n){var o=u(n);if(void 0!==(o=o&&o.parentNode)&&o!==t||void 0===o&&Ht(n)!==t)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.")}if(n===e)return e;var r,i;if(e.parentNode&&It(e.parentNode,e),!e.__noInsertionPoint){var a;if(i=r=g(t))"slot"===e.localName?a=[e]:e.querySelectorAll&&(a=e.querySelectorAll("slot")),i=a&&a.length?a:void 0;i&&(o=i,(a=r).a=a.a||[],a.f=a.f||[],a.g=a.g||{},a.a.push.apply(a.a,[].concat(o instanceof Array?o:function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(function(t){l();var e=t[Symbol.iterator];return e?e.call(t):s(t)}(o)))))}if(("slot"===t.localName||i)&&(r=r||g(t))&&ge(r),m(t)){if(r=n,jt(t),void 0!==(i=c(t)).firstChild&&(i.childNodes=null),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(i=e.childNodes,a=0;a<i.length;a++)Rt(i[a],t,r);i=void 0!==(r=c(e)).firstChild?null:void 0,r.firstChild=r.lastChild=i,r.childNodes=i}else Rt(e,t,r);if(r=u(t),Vt(t)){ge(r.root);var d=!0}else r.root&&(d=!0)}return d||(d=v(t)?t.host:t,n?(n=function t(e){var n=e;e&&"slot"===e.localName&&(n=(n=(n=u(e))&&n.v)&&n.length?n[0]:t(e.nextSibling));return n}(n),j.insertBefore.call(d,e,n)):j.appendChild.call(d,e)),Ut(t,e),e}function It(t,e){if(e.parentNode!==t)throw Error("The node to be removed is not a child of this node: "+e);var n=g(e),o=u(t);if(m(t)){var r=c(e),i=c(t);e===i.firstChild&&(i.firstChild=r.nextSibling),e===i.lastChild&&(i.lastChild=r.previousSibling);var l=r.previousSibling,s=r.nextSibling;if(l&&(c(l).nextSibling=s),s&&(c(s).previousSibling=l),r.parentNode=r.previousSibling=r.nextSibling=void 0,void 0!==i.childNodes&&(i.childNodes=null),Vt(t)){ge(o.root);var a=!0}}if(function t(e){var n=u(e);if(n&&void 0!==n.F)for(var o,r=0,i=(n=e.childNodes).length;r<i&&(o=n[r]);r++)t(o);(e=u(e))&&(e.F=void 0)}(e),n){if((r=t&&"slot"===t.localName)&&(a=!0),n.f){for(b in Ne(n),i=n.g)for(l=i[b],s=0;s<l.length;s++){var d=l[s];if(O(e,d)){l.splice(s,1);var h=n.f.indexOf(d);if(0<=h&&n.f.splice(h,1),s--,d=(h=u(d)).v)for(var f=0;f<d.length;f++){var p=d[f],y=he(p);y&&j.removeChild.call(y,p)}h.v=[],h.assignedNodes=[],h=!0}}var b=h}else b=void 0;(b||r)&&ge(n)}return a||(a=v(t)?t.host:t,(!o.root&&"slot"!==e.localName||a===Ht(e))&&j.removeChild.call(a,e)),Ut(t,null,e),e}function Vt(t){return(t=(t=u(t))&&t.root)&&_e(t)}function Bt(t,e){if("slot"===e)Vt(t=t.parentNode)&&ge(u(t).root);else if("slot"===t.localName&&"name"===e&&(e=g(t))){if(e.f){var n=t.pa,o=Ce(t);if(o!==n){var r=(n=e.g[n]).indexOf(t);0<=r&&n.splice(r,1),(n=e.g[o]||(e.g[o]=[])).push(t),1<n.length&&(e.g[o]=Se(n))}}ge(e)}}function Ut(t,e,n){(t=(t=u(t))&&t.C)&&(e&&t.addedNodes.push(e),n&&t.removedNodes.push(n),function(t){t.a||(t.a=!0,_(function(){!function(t){if(t.a){t.a=!1;var e=t.takeRecords();e.length&&t.M.forEach(function(t){t(e)})}}(t)}))}(t))}function qt(t,e,n){var o=[];return function t(e,n,o,r){for(var i,l=0,s=e.length;l<s&&(i=e[l]);l++){var a;if(a=i.nodeType===Node.ELEMENT_NODE){var c=n,u=o,d=r,h=c(a=i);h&&d.push(a),u&&u(h)?a=h:(t(a.childNodes,c,u,d),a=void 0)}if(a)break}}(t.childNodes,e,n,o),o}var Wt=null;function Gt(t,e,n){Wt||(Wt=window.ShadyCSS&&window.ShadyCSS.ScopingShim),Wt&&"class"===e?Wt.setElementClass(t,n):(j.setAttribute.call(t,e,n),Bt(t,e))}var $t="__eventWrappers"+Date.now(),zt={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0};function Xt(t,e){var n=[],o=t;for(t=t===window?window:t.getRootNode();o;)n.push(o),o=o.assignedSlot?o.assignedSlot:o.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&o.host&&(e||o!==t)?o.host:o.parentNode;return n[n.length-1]===document&&n.push(window),n}function Jt(t,e){if(!v)return t;t=Xt(t,!0);for(var n,o,r,i,l=0;l<e.length;l++)if((r=(n=e[l])===window?window:n.getRootNode())!==o&&(i=t.indexOf(r),o=r),!v(r)||-1<i)return n}var Kt={get composed(){return!1!==this.isTrusted&&void 0===this.S&&(this.S=zt[this.type]),this.S||!1},composedPath:function(){return this.ca||(this.ca=Xt(this.__target,this.composed)),this.ca},get target(){return Jt(this.currentTarget,this.composedPath())},get relatedTarget(){return this.U?(this.ea||(this.ea=Xt(this.U,!0)),Jt(this.currentTarget,this.ea)):null},stopPropagation:function(){Event.prototype.stopPropagation.call(this),this.T=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this),this.T=this.na=!0}};function Yt(t){function e(e,n){return(e=new t(e,n)).S=n&&!!n.composed,e}return function(t,e){for(var n in e)t[n]=e[n]}(e,t),e.prototype=t.prototype,e}var Zt={focus:!0,blur:!0};function Qt(t){return t.__target!==t.target||t.U!==t.relatedTarget}function te(t,e,n){if(n=e.__handlers&&e.__handlers[t.type]&&e.__handlers[t.type][n])for(var o,r=0;(o=n[r])&&(!Qt(t)||t.target!==t.relatedTarget)&&(o.call(e,t),!t.na);r++);}function ee(t){var e,n=t.composedPath();Object.defineProperty(t,"currentTarget",{get:function(){return r},configurable:!0});for(var o=n.length-1;0<=o;o--){var r=n[o];if(te(t,r,"capture"),t.T)return}for(Object.defineProperty(t,"eventPhase",{get:function(){return Event.AT_TARGET}}),o=0;o<n.length;o++){var i=u(r=n[o]);if(i=i&&i.root,(0===o||i&&i===e)&&(te(t,r,"bubble"),r!==window&&(e=r.getRootNode()),t.T))break}}function ne(t,e,n,o,r,i){for(var l=0;l<t.length;l++){var s=t[l],a=s.type,c=s.capture,u=s.once,d=s.passive;if(e===s.node&&n===a&&o===c&&r===u&&i===d)return l}return-1}function oe(t,e,n){if(e){var o=typeof e;if(("function"===o||"object"===o)&&("object"!==o||e.handleEvent&&"function"==typeof e.handleEvent)){if(n&&"object"==typeof n)var r=!!n.capture,i=!!n.once,l=!!n.passive;else r=!!n,l=i=!1;var s=n&&n.W||this,a=e[$t];if(a){if(-1<ne(a,s,t,r,i,l))return}else e[$t]=[];a=function(r){if(i&&this.removeEventListener(t,e,n),r.__target||ie(r),s!==this){var l=Object.getOwnPropertyDescriptor(r,"currentTarget");Object.defineProperty(r,"currentTarget",{get:function(){return s},configurable:!0})}if(r.composed||-1<r.composedPath().indexOf(s))if(Qt(r)&&r.target===r.relatedTarget)r.eventPhase===Event.BUBBLING_PHASE&&r.stopImmediatePropagation();else if(r.eventPhase===Event.CAPTURING_PHASE||r.bubbles||r.target===s||s instanceof Window){var a="function"===o?e.call(s,r):e.handleEvent&&e.handleEvent(r);return s!==this&&(l?(Object.defineProperty(r,"currentTarget",l),l=null):delete r.currentTarget),a}},e[$t].push({node:s,type:t,capture:r,once:i,passive:l,Ia:a}),Zt[t]?(this.__handlers=this.__handlers||{},this.__handlers[t]=this.__handlers[t]||{capture:[],bubble:[]},this.__handlers[t][r?"capture":"bubble"].push(a)):(this instanceof Window?j.Ga:j.addEventListener).call(this,t,a,n)}}}function re(t,e,n){if(e){if(n&&"object"==typeof n)var o=!!n.capture,r=!!n.once,i=!!n.passive;else o=!!n,i=r=!1;var l=n&&n.W||this,s=void 0,a=null;try{a=e[$t]}catch(t){}a&&(-1<(r=ne(a,l,t,o,r,i))&&(s=a.splice(r,1)[0].Ia,a.length||(e[$t]=void 0))),(this instanceof Window?j.Ha:j.removeEventListener).call(this,t,s||e,n),s&&Zt[t]&&this.__handlers&&this.__handlers[t]&&(-1<(s=(t=this.__handlers[t][o?"capture":"bubble"]).indexOf(s))&&t.splice(s,1))}}function ie(t){if(t.__target=t.target,t.U=t.relatedTarget,d.o){var e=Object.getPrototypeOf(t);if(!e.hasOwnProperty("__patchProto")){var n=Object.create(e);n.Ka=e,w(n,Kt),e.__patchProto=n}t.__proto__=e.__patchProto}else w(t,Kt)}var le=Yt(window.Event),se=Yt(window.CustomEvent),ae=Yt(window.MouseEvent);function ce(t,e){return{index:t,G:[],L:e}}function ue(t,e,n,o){var r=0,i=0,l=0,s=0,a=Math.min(e-r,o-i);if(0==r&&0==i)t:{for(l=0;l<a;l++)if(t[l]!==n[l])break t;l=a}if(e==t.length&&o==n.length){s=t.length;for(var c=n.length,u=0;u<a-l&&de(t[--s],n[--c]);)u++;s=u}if(i+=l,o-=s,0==(e-=s)-(r+=l)&&0==o-i)return[];if(r==e){for(e=ce(r,0);i<o;)e.G.push(n[i++]);return[e]}if(i==o)return[ce(r,e-r)];for(o=o-(l=i)+1,s=e-(a=r)+1,e=Array(o),c=0;c<o;c++)e[c]=Array(s),e[c][0]=c;for(c=0;c<s;c++)e[0][c]=c;for(c=1;c<o;c++)for(u=1;u<s;u++)if(t[a+u-1]===n[l+c-1])e[c][u]=e[c-1][u-1];else{var d=e[c-1][u]+1,h=e[c][u-1]+1;e[c][u]=d<h?d:h}for(a=e.length-1,l=e[0].length-1,o=e[a][l],t=[];0<a||0<l;)0==a?(t.push(2),l--):0==l?(t.push(3),a--):(s=e[a-1][l-1],(d=(c=e[a-1][l])<(u=e[a][l-1])?c<s?c:s:u<s?u:s)==s?(s==o?t.push(0):(t.push(1),o=s),a--,l--):d==c?(t.push(3),a--,o=c):(t.push(2),l--,o=u));for(t.reverse(),e=void 0,a=[],l=0;l<t.length;l++)switch(t[l]){case 0:e&&(a.push(e),e=void 0),r++,i++;break;case 1:e||(e=ce(r,0)),e.L++,r++,e.G.push(n[i]),i++;break;case 2:e||(e=ce(r,0)),e.L++,r++;break;case 3:e||(e=ce(r,0)),e.G.push(n[i]),i++}return e&&a.push(e),a}function de(t,e){return t===e}var he=yt.parentNode,fe=yt.childNodes,pe={};function me(t){var e=[];do{e.unshift(t)}while(t=t.parentNode);return e}function ve(t,e,n){if(t!==pe)throw new TypeError("Illegal constructor");this.sa="ShadyRoot",t=fe(e),this.host=e,this.b=n&&n.mode,Pt(e,t),(n=u(e)).root=this,n.ja="closed"!==this.b?this:null,(n=c(this)).firstChild=n.lastChild=n.parentNode=n.nextSibling=n.previousSibling=null,n.childNodes=[],this.K=!1,this.a=this.g=this.f=null,n=0;for(var o=t.length;n<o;n++)j.removeChild.call(e,t[n])}function ge(t){t.K||(t.K=!0,A(function(){return ye(t)}))}function ye(t){for(var e;t;){t.K&&(e=t);t:{var n=t;if(v(t=n.host.getRootNode()))for(var o=n.host.childNodes,r=0;r<o.length;r++)if("slot"==(n=o[r]).localName)break t;t=void 0}}e&&e._renderRoot()}function be(t,e,n){var o=c(e),r=o.J;o.J=null,n||(n=(t=t.g[e.slot||"__catchall"])&&t[0]),n?(c(n).assignedNodes.push(e),o.assignedSlot=n):o.assignedSlot=void 0,r!==o.assignedSlot&&o.assignedSlot&&(c(o.assignedSlot).N=!0)}function we(t,e,n){for(var o,r=0;r<n.length&&(o=n[r]);r++)if("slot"==o.localName){var i=u(o).assignedNodes;i&&i.length&&we(t,e,i)}else e.push(n[r])}function Ee(t,e){j.dispatchEvent.call(e,new Event("slotchange")),(e=u(e)).assignedSlot&&Ee(t,e.assignedSlot)}function Ne(t){if(t.a&&t.a.length){for(var e,n=t.a,o=0;o<n.length;o++){var r=n[o];Pt(r),Pt(r.parentNode);var i=Ce(r);t.g[i]?((e=e||{})[i]=!0,t.g[i].push(r)):t.g[i]=[r],t.f.push(r)}if(e)for(var l in e)t.g[l]=Se(t.g[l]);t.a=[]}}function Ce(t){var e=t.name||t.getAttribute("name")||"__catchall";return t.pa=e}function Se(t){return t.sort(function(t,e){t=me(t);for(var n=me(e),o=0;o<t.length;o++){e=t[o];var r=n[o];if(e!==r)return(t=Array.from(e.parentNode.childNodes)).indexOf(e)-t.indexOf(r)}})}function _e(t){return Ne(t),!(!t.f||!t.f.length)}function Te(t){var e=t.getRootNode();return v(e)&&ye(e),(t=u(t))&&t.assignedSlot||null}ve.prototype._renderRoot=function(){if(this.K=!1,this.f){Ne(this);for(var t,e=0;e<this.f.length;e++){var n=u(t=this.f[e]),o=n.assignedNodes;if(n.assignedNodes=[],n.v=[],n.$=o)for(n=0;n<o.length;n++){var r=u(o[n]);r.J=r.assignedSlot,r.assignedSlot===t&&(r.assignedSlot=null)}}for(t=this.host.firstChild;t;t=t.nextSibling)be(this,t);for(e=0;e<this.f.length;e++){if(!(o=u(t=this.f[e])).assignedNodes.length)for(n=t.firstChild;n;n=n.nextSibling)be(this,n,t);if((n=(n=u(t.parentNode))&&n.root)&&_e(n)&&n._renderRoot(),we(this,o.v,o.assignedNodes),n=o.$){for(r=0;r<n.length;r++)u(n[r]).J=null;o.$=null,n.length>o.assignedNodes.length&&(o.N=!0)}o.N&&(o.N=!1,Ee(this,t))}for(e=this.f,t=[],o=0;o<e.length;o++)(r=u(n=e[o].parentNode))&&r.root||!(0>t.indexOf(n))||t.push(n);for(e=0;e<t.length;e++){n=(o=t[e])===this?this.host:o,r=[],o=o.childNodes;for(var i=0;i<o.length;i++){var l=o[i];if("slot"==l.localName){l=u(l).v;for(var s=0;s<l.length;s++)r.push(l[s])}else r.push(l)}o=void 0,i=fe(n),l=ue(r,r.length,i,i.length);for(var a=s=0;s<l.length&&(o=l[s]);s++){for(var c,d=0;d<o.G.length&&(c=o.G[d]);d++)he(c)===n&&j.removeChild.call(n,c),i.splice(o.index+a,1);a-=o.L}for(a=0;a<l.length&&(o=l[a]);a++)for(s=i[o.index],d=o.index;d<o.index+o.L;d++)c=r[d],j.insertBefore.call(n,c,s),i.splice(d,0,c)}}};var Oe={addEventListener:oe.bind(window),removeEventListener:re.bind(window)},xe={addEventListener:oe,removeEventListener:re,appendChild:function(t){return Ft(this,t)},insertBefore:function(t,e){return Ft(this,t,e)},removeChild:function(t){return It(this,t)},replaceChild:function(t,e){return Ft(this,t,e),It(this,e),t},cloneNode:function(t){if("template"==this.localName)var e=j.cloneNode.call(this,t);else if(e=j.cloneNode.call(this,!1),t){t=this.childNodes;for(var n,o=0;o<t.length;o++)n=t[o].cloneNode(!0),e.appendChild(n)}return e},getRootNode:function(){return function t(e){if(e&&e.nodeType){var n=c(e),o=n.F;return void 0===o&&(v(e)?(o=e,n.F=o):(o=(o=e.parentNode)?t(o):e,j.contains.call(document.documentElement,e)&&(n.F=o))),o}}(this)},contains:function(t){return O(this,t)},dispatchEvent:function(t){return M(),j.dispatchEvent.call(this,t)}};Object.defineProperties(xe,{isConnected:{get:function(){if(Ct&&Ct.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;var t=this.ownerDocument;if(T){if(j.contains.call(t,this))return!0}else if(t.documentElement&&j.contains.call(t.documentElement,this))return!0;for(t=this;t&&!(t instanceof Document);)t=t.parentNode||(v(t)?t.host:void 0);return!!(t&&t instanceof Document)},configurable:!0}});var De={get assignedSlot(){return Te(this)}},Ae={querySelector:function(t){return qt(this,function(e){return b.call(e,t)},function(t){return!!t})[0]||null},querySelectorAll:function(t,e){if(e){e=Array.prototype.slice.call(j.querySelectorAll(this,t));var n=this.getRootNode();return e.filter(function(t){return t.getRootNode()==n})}return qt(this,function(e){return b.call(e,t)})}},Me={assignedNodes:function(t){if("slot"===this.localName){var e=this.getRootNode();return v(e)&&ye(e),(e=u(this))&&(t&&t.flatten?e.v:e.assignedNodes)||[]}}},Le=E({setAttribute:function(t,e){Gt(this,t,e)},removeAttribute:function(t){j.removeAttribute.call(this,t),Bt(this,t)},attachShadow:function(t){if(!this)throw"Must provide a host.";if(!t)throw"Not enough arguments.";return new ve(pe,this,t)},get slot(){return this.getAttribute("slot")},set slot(t){Gt(this,"slot",t)},get assignedSlot(){return Te(this)}},Ae,Me);Object.defineProperties(Le,xt);var je=E({importNode:function(t,e){return function t(e,n){if(e.ownerDocument!==document)return j.importNode.call(document,e,n);var o=j.importNode.call(document,e,!1);if(n){e=e.childNodes,n=0;for(var r;n<e.length;n++)r=t(e[n],!0),o.appendChild(r)}return o}(t,e)},getElementById:function(t){return qt(this,function(e){return e.id==t},function(t){return!!t})[0]||null}},Ae);Object.defineProperties(je,{_activeElement:Dt.activeElement});var ke=HTMLElement.prototype.blur,Re=E({blur:function(){var t=u(this);(t=(t=t&&t.root)&&t.activeElement)?t.blur():ke.call(this)}}),Pe={addEventListener:function(t,e,n){"object"!=typeof n&&(n={capture:!!n}),n.W=this,this.host.addEventListener(t,e,n)},removeEventListener:function(t,e,n){"object"!=typeof n&&(n={capture:!!n}),n.W=this,this.host.removeEventListener(t,e,n)},getElementById:function(t){return qt(this,function(e){return e.id==t},function(t){return!!t})[0]||null}};function He(t,e){for(var n=Object.getOwnPropertyNames(e),o=0;o<n.length;o++){var r=n[o],i=Object.getOwnPropertyDescriptor(e,r);i.value?t[r]=i.value:Object.defineProperty(t,r,i)}}if(d.ha){var Fe={inUse:d.ha,patch:function(t){return jt(t),Lt(t),t},isShadyRoot:v,enqueue:A,flush:M,settings:d,filterMutations:function(t,e){var n=e.getRootNode();return t.map(function(t){var e=n===t.target.getRootNode();if(e&&t.addedNodes){if((e=Array.from(t.addedNodes).filter(function(t){return n===t.getRootNode()})).length)return t=Object.create(t),Object.defineProperty(t,"addedNodes",{value:e,configurable:!0}),t}else if(e)return t}).filter(function(t){return t})},observeChildren:function(t,e){var n=c(t);n.C||(n.C=new L),n.C.M.add(e);var o=n.C;return{qa:e,B:o,ta:t,takeRecords:function(){return o.takeRecords()}}},unobserveChildren:function(t){var e=t&&t.B;e&&(e.M.delete(t.qa),e.M.size||(c(t.ta).C=null))},nativeMethods:j,nativeTree:yt};window.ShadyDOM=Fe,window.Event=le,window.CustomEvent=se,window.MouseEvent=ae,function(){for(var t in Zt)window.addEventListener(t,function(t){t.__target||(ie(t),ee(t))},!0)}();var Ie=window.customElements&&window.customElements.nativeHTMLElement||HTMLElement;He(ve.prototype,Pe),He(window.Node.prototype,xe),He(window.Window.prototype,Oe),He(window.Text.prototype,De),He(window.DocumentFragment.prototype,Ae),He(window.Element.prototype,Le),He(window.Document.prototype,je),window.HTMLSlotElement&&He(window.HTMLSlotElement.prototype,Me),He(Ie.prototype,Re),d.o&&(Mt(window.Node.prototype),Mt(window.Text.prototype),Mt(window.DocumentFragment.prototype),Mt(window.Element.prototype),Mt(Ie.prototype),Mt(window.Document.prototype),window.HTMLSlotElement&&Mt(window.HTMLSlotElement.prototype)),function(){var t=ve.prototype;t.__proto__=DocumentFragment.prototype,At(t,_t,!0),At(t,Ot,!0),At(t,Dt,!0),Object.defineProperties(t,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}}),["localName","namespaceURI","prefix"].forEach(function(e){Object.defineProperty(t,e,{value:void 0,configurable:!0})}),["ownerDocument","baseURI","isConnected"].forEach(function(e){Object.defineProperty(t,e,{get:function(){return this.host[e]},configurable:!0})})}(),window.ShadowRoot=ve}var Ve=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function Be(t){var e=Ve.has(t);return t=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(t),!e&&t}function Ue(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function qe(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function We(t,e,n){n=void 0===n?new Set:n;for(var o=t;o;){if(o.nodeType===Node.ELEMENT_NODE){var r=o;e(r);var i=r.localName;if("link"===i&&"import"===r.getAttribute("rel")){if((o=r.import)instanceof Node&&!n.has(o))for(n.add(o),o=o.firstChild;o;o=o.nextSibling)We(o,e,n);o=qe(t,r);continue}if("template"===i){o=qe(t,r);continue}if(r=r.__CE_shadowRoot)for(r=r.firstChild;r;r=r.nextSibling)We(r,e,n)}o=o.firstChild?o.firstChild:qe(t,o)}}function Ge(t,e,n){t[e]=n}function $e(){this.a=new Map,this.w=new Map,this.j=[],this.c=!1}function ze(t,e){t.c=!0,t.j.push(e)}function Xe(t,e){t.c&&We(e,function(e){return t.b(e)})}function Je(t,e){var n=[];for(We(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state?t.connectedCallback(o):Ze(t,o)}}function Ke(t,e){var n=[];for(We(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state&&t.disconnectedCallback(o)}}function Ye(t,e,n){var o=(n=void 0===n?{}:n).Fa||new Set,r=n.R||function(e){return Ze(t,e)},i=[];if(We(e,function(e){if("link"===e.localName&&"import"===e.getAttribute("rel")){var n=e.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_hasRegistry=!0),n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:e.addEventListener("load",function(){var n=e.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var i=new Set(o);i.delete(n),Ye(t,n,{Fa:i,R:r})}})}else i.push(e)},o),t.c)for(e=0;e<i.length;e++)t.b(i[e]);for(e=0;e<i.length;e++)r(i[e])}function Ze(t,e){if(void 0===e.__CE_state){var n=e.ownerDocument;if((n.defaultView||n.__CE_isImportDocument&&n.__CE_hasRegistry)&&(n=t.a.get(e.localName))){n.constructionStack.push(e);var o=n.constructor;try{try{if(new o!==e)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{n.constructionStack.pop()}}catch(t){throw e.__CE_state=2,t}if(e.__CE_state=1,e.__CE_definition=n,n.attributeChangedCallback)for(n=n.observedAttributes,o=0;o<n.length;o++){var r=n[o],i=e.getAttribute(r);null!==i&&t.attributeChangedCallback(e,r,null,i,null)}Ue(e)&&t.connectedCallback(e)}}}function Qe(t){var e=document;this.h=t,this.a=e,this.B=void 0,Ye(this.h,this.a),"loading"===this.a.readyState&&(this.B=new MutationObserver(this.b.bind(this)),this.B.observe(this.a,{childList:!0,subtree:!0}))}function tn(t){t.B&&t.B.disconnect()}function en(t){if(t.a)throw Error("Already resolved.");t.a=void 0,t.b&&t.b(void 0)}function nn(t){this.X=!1,this.h=t,this.aa=new Map,this.Y=function(t){return t()},this.I=!1,this.Z=[],this.ra=new Qe(t)}$e.prototype.b=function(t){if(this.c&&!t.__CE_patched){t.__CE_patched=!0;for(var e=0;e<this.j.length;e++)this.j[e](t)}},$e.prototype.connectedCallback=function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t)},$e.prototype.disconnectedCallback=function(t){var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t)},$e.prototype.attributeChangedCallback=function(t,e,n,o,r){var i=t.__CE_definition;i.attributeChangedCallback&&-1<i.observedAttributes.indexOf(e)&&i.attributeChangedCallback.call(t,e,n,o,r)},Qe.prototype.b=function(t){var e=this.a.readyState;for("interactive"!==e&&"complete"!==e||tn(this),e=0;e<t.length;e++)for(var n=t[e].addedNodes,o=0;o<n.length;o++)Ye(this.h,n[o])},(t=nn.prototype).define=function(t,e){var n=this;if(!(e instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!Be(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.h.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.X)throw Error("A custom element is already being defined.");this.X=!0;try{var o=function(t){var e=r[t];if(void 0!==e&&!(e instanceof Function))throw Error("The '"+t+"' callback must be a function.");return e},r=e.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var i=o("connectedCallback"),l=o("disconnectedCallback"),s=o("adoptedCallback"),a=o("attributeChangedCallback"),c=e.observedAttributes||[]}catch(t){return}finally{this.X=!1}e={localName:t,constructor:e,connectedCallback:i,disconnectedCallback:l,adoptedCallback:s,attributeChangedCallback:a,observedAttributes:c,constructionStack:[]},function(t,e,n){t.a.set(e,n),t.w.set(n.constructor,n)}(this.h,t,e),this.Z.push(e),this.I||(this.I=!0,this.Y(function(){return function(t){if(!1!==t.I){t.I=!1;for(var e=t.Z,n=[],o=new Map,r=0;r<e.length;r++)o.set(e[r].localName,[]);for(Ye(t.h,document,{R:function(e){if(void 0===e.__CE_state){var r=e.localName,i=o.get(r);i?i.push(e):t.h.a.get(r)&&n.push(e)}}}),r=0;r<n.length;r++)Ze(t.h,n[r]);for(;0<e.length;){var i=e.shift();r=i.localName,i=o.get(i.localName);for(var l=0;l<i.length;l++)Ze(t.h,i[l]);(r=t.aa.get(r))&&en(r)}}}(n)}))},t.R=function(t){Ye(this.h,t)},t.get=function(t){if(t=this.h.a.get(t))return t.constructor},t.whenDefined=function(t){if(!Be(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var e=this.aa.get(t);return e?e.c:(e=new function(){var t=this;this.b=this.a=void 0,this.c=new Promise(function(e){t.b=e,t.a&&e(t.a)})},this.aa.set(t,e),this.h.a.get(t)&&!this.Z.some(function(e){return e.localName===t})&&en(e),e.c)},t.Aa=function(t){tn(this.ra);var e=this.Y;this.Y=function(n){return t(function(){return e(n)})}},window.CustomElementRegistry=nn,nn.prototype.define=nn.prototype.define,nn.prototype.upgrade=nn.prototype.R,nn.prototype.get=nn.prototype.get,nn.prototype.whenDefined=nn.prototype.whenDefined,nn.prototype.polyfillWrapFlushCallback=nn.prototype.Aa;var on=window.Document.prototype.createElement,rn=window.Document.prototype.createElementNS,ln=window.Document.prototype.importNode,sn=window.Document.prototype.prepend,an=window.Document.prototype.append,cn=window.DocumentFragment.prototype.prepend,un=window.DocumentFragment.prototype.append,dn=window.Node.prototype.cloneNode,hn=window.Node.prototype.appendChild,fn=window.Node.prototype.insertBefore,pn=window.Node.prototype.removeChild,mn=window.Node.prototype.replaceChild,vn=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),gn=window.Element.prototype.attachShadow,yn=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),bn=window.Element.prototype.getAttribute,wn=window.Element.prototype.setAttribute,En=window.Element.prototype.removeAttribute,Nn=window.Element.prototype.getAttributeNS,Cn=window.Element.prototype.setAttributeNS,Sn=window.Element.prototype.removeAttributeNS,_n=window.Element.prototype.insertAdjacentElement,Tn=window.Element.prototype.insertAdjacentHTML,On=window.Element.prototype.prepend,xn=window.Element.prototype.append,Dn=window.Element.prototype.before,An=window.Element.prototype.after,Mn=window.Element.prototype.replaceWith,Ln=window.Element.prototype.remove,jn=window.HTMLElement,kn=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Rn=window.HTMLElement.prototype.insertAdjacentElement,Pn=window.HTMLElement.prototype.insertAdjacentHTML,Hn=new function(){};function Fn(t,e,n){function o(e){return function(n){for(var o=[],r=0;r<arguments.length;++r)o[r-0]=arguments[r];r=[];for(var i=[],l=0;l<o.length;l++){var s=o[l];if(s instanceof Element&&Ue(s)&&i.push(s),s instanceof DocumentFragment)for(s=s.firstChild;s;s=s.nextSibling)r.push(s);else r.push(s)}for(e.apply(this,o),o=0;o<i.length;o++)Ke(t,i[o]);if(Ue(this))for(o=0;o<r.length;o++)(i=r[o])instanceof Element&&Je(t,i)}}void 0!==n.P&&(e.prepend=o(n.P)),void 0!==n.append&&(e.append=o(n.append))}var In=window.customElements;if(!In||In.forcePolyfill||"function"!=typeof In.define||"function"!=typeof In.get){var Vn=new $e;!function(){var t=Vn;window.HTMLElement=function(){function e(){var e=this.constructor,n=t.w.get(e);if(!n)throw Error("The custom element being constructed was not registered with `customElements`.");var o=n.constructionStack;if(0===o.length)return o=on.call(document,n.localName),Object.setPrototypeOf(o,e.prototype),o.__CE_state=1,o.__CE_definition=n,t.b(o),o;var r=o[n=o.length-1];if(r===Hn)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return o[n]=Hn,Object.setPrototypeOf(r,e.prototype),t.b(r),r}return e.prototype=jn.prototype,e}()}(),function(){var t=Vn;Ge(Document.prototype,"createElement",function(e){if(this.__CE_hasRegistry){var n=t.a.get(e);if(n)return new n.constructor}return e=on.call(this,e),t.b(e),e}),Ge(Document.prototype,"importNode",function(e,n){return e=ln.call(this,e,n),this.__CE_hasRegistry?Ye(t,e):Xe(t,e),e}),Ge(Document.prototype,"createElementNS",function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var o=t.a.get(n);if(o)return new o.constructor}return e=rn.call(this,e,n),t.b(e),e}),Fn(t,Document.prototype,{P:sn,append:an})}(),Fn(Vn,DocumentFragment.prototype,{P:cn,append:un}),function(){var t=Vn;function e(e,n){Object.defineProperty(e,"textContent",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(e){if(this.nodeType===Node.TEXT_NODE)n.set.call(this,e);else{var o=void 0;if(this.firstChild){var r=this.childNodes,i=r.length;if(0<i&&Ue(this)){o=Array(i);for(var l=0;l<i;l++)o[l]=r[l]}}if(n.set.call(this,e),o)for(e=0;e<o.length;e++)Ke(t,o[e])}}})}Ge(Node.prototype,"insertBefore",function(e,n){if(e instanceof DocumentFragment){var o=Array.prototype.slice.apply(e.childNodes);if(e=fn.call(this,e,n),Ue(this))for(n=0;n<o.length;n++)Je(t,o[n]);return e}return o=Ue(e),n=fn.call(this,e,n),o&&Ke(t,e),Ue(this)&&Je(t,e),n}),Ge(Node.prototype,"appendChild",function(e){if(e instanceof DocumentFragment){var n=Array.prototype.slice.apply(e.childNodes);if(e=hn.call(this,e),Ue(this))for(var o=0;o<n.length;o++)Je(t,n[o]);return e}return n=Ue(e),o=hn.call(this,e),n&&Ke(t,e),Ue(this)&&Je(t,e),o}),Ge(Node.prototype,"cloneNode",function(e){return e=dn.call(this,e),this.ownerDocument.__CE_hasRegistry?Ye(t,e):Xe(t,e),e}),Ge(Node.prototype,"removeChild",function(e){var n=Ue(e),o=pn.call(this,e);return n&&Ke(t,e),o}),Ge(Node.prototype,"replaceChild",function(e,n){if(e instanceof DocumentFragment){var o=Array.prototype.slice.apply(e.childNodes);if(e=mn.call(this,e,n),Ue(this))for(Ke(t,n),n=0;n<o.length;n++)Je(t,o[n]);return e}o=Ue(e);var r=mn.call(this,e,n),i=Ue(this);return i&&Ke(t,n),o&&Ke(t,e),i&&Je(t,e),r}),vn&&vn.get?e(Node.prototype,vn):ze(t,function(t){e(t,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++)t.push(this.childNodes[e].textContent);return t.join("")},set:function(t){for(;this.firstChild;)pn.call(this,this.firstChild);hn.call(this,document.createTextNode(t))}})})}(),function(){var t=Vn;function e(e,n){Object.defineProperty(e,"innerHTML",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(e){var o=this,r=void 0;if(Ue(this)&&(r=[],We(this,function(t){t!==o&&r.push(t)})),n.set.call(this,e),r)for(var i=0;i<r.length;i++){var l=r[i];1===l.__CE_state&&t.disconnectedCallback(l)}return this.ownerDocument.__CE_hasRegistry?Ye(t,this):Xe(t,this),e}})}function n(e,n){Ge(e,"insertAdjacentElement",function(e,o){var r=Ue(o);return e=n.call(this,e,o),r&&Ke(t,o),Ue(e)&&Je(t,o),e})}function o(e,n){function o(e,n){for(var o=[];e!==n;e=e.nextSibling)o.push(e);for(n=0;n<o.length;n++)Ye(t,o[n])}Ge(e,"insertAdjacentHTML",function(t,e){if("beforebegin"===(t=t.toLowerCase())){var r=this.previousSibling;n.call(this,t,e),o(r||this.parentNode.firstChild,this)}else if("afterbegin"===t)r=this.firstChild,n.call(this,t,e),o(this.firstChild,r);else if("beforeend"===t)r=this.lastChild,n.call(this,t,e),o(r||this.firstChild,null);else{if("afterend"!==t)throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");r=this.nextSibling,n.call(this,t,e),o(this.nextSibling,r)}})}gn&&Ge(Element.prototype,"attachShadow",function(t){return this.__CE_shadowRoot=gn.call(this,t)}),yn&&yn.get?e(Element.prototype,yn):kn&&kn.get?e(HTMLElement.prototype,kn):ze(t,function(t){e(t,{enumerable:!0,configurable:!0,get:function(){return dn.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName,n=e?this.content:this,o=on.call(document,this.localName);for(o.innerHTML=t;0<n.childNodes.length;)pn.call(n,n.childNodes[0]);for(t=e?o.content:o;0<t.childNodes.length;)hn.call(n,t.childNodes[0])}})}),Ge(Element.prototype,"setAttribute",function(e,n){if(1!==this.__CE_state)return wn.call(this,e,n);var o=bn.call(this,e);wn.call(this,e,n),n=bn.call(this,e),t.attributeChangedCallback(this,e,o,n,null)}),Ge(Element.prototype,"setAttributeNS",function(e,n,o){if(1!==this.__CE_state)return Cn.call(this,e,n,o);var r=Nn.call(this,e,n);Cn.call(this,e,n,o),o=Nn.call(this,e,n),t.attributeChangedCallback(this,n,r,o,e)}),Ge(Element.prototype,"removeAttribute",function(e){if(1!==this.__CE_state)return En.call(this,e);var n=bn.call(this,e);En.call(this,e),null!==n&&t.attributeChangedCallback(this,e,n,null,null)}),Ge(Element.prototype,"removeAttributeNS",function(e,n){if(1!==this.__CE_state)return Sn.call(this,e,n);var o=Nn.call(this,e,n);Sn.call(this,e,n);var r=Nn.call(this,e,n);o!==r&&t.attributeChangedCallback(this,n,o,r,e)}),Rn?n(HTMLElement.prototype,Rn):_n?n(Element.prototype,_n):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),Pn?o(HTMLElement.prototype,Pn):Tn?o(Element.prototype,Tn):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."),Fn(t,Element.prototype,{P:On,append:xn}),function(t){var e=Element.prototype;function n(e){return function(n){for(var o=[],r=0;r<arguments.length;++r)o[r-0]=arguments[r];r=[];for(var i=[],l=0;l<o.length;l++){var s=o[l];if(s instanceof Element&&Ue(s)&&i.push(s),s instanceof DocumentFragment)for(s=s.firstChild;s;s=s.nextSibling)r.push(s);else r.push(s)}for(e.apply(this,o),o=0;o<i.length;o++)Ke(t,i[o]);if(Ue(this))for(o=0;o<r.length;o++)(i=r[o])instanceof Element&&Je(t,i)}}void 0!==Dn&&(e.before=n(Dn)),void 0!==Dn&&(e.after=n(An)),void 0!==Mn&&Ge(e,"replaceWith",function(e){for(var n=[],o=0;o<arguments.length;++o)n[o-0]=arguments[o];o=[];for(var r=[],i=0;i<n.length;i++){var l=n[i];if(l instanceof Element&&Ue(l)&&r.push(l),l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)o.push(l);else o.push(l)}for(i=Ue(this),Mn.apply(this,n),n=0;n<r.length;n++)Ke(t,r[n]);if(i)for(Ke(t,this),n=0;n<o.length;n++)(r=o[n])instanceof Element&&Je(t,r)}),void 0!==Ln&&Ge(e,"remove",function(){var e=Ue(this);Ln.call(this),e&&Ke(t,this)})}(t)}(),document.__CE_hasRegistry=!0;var Bn=new nn(Vn);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:Bn})}function Un(){this.end=this.start=0,this.rules=this.parent=this.previous=null,this.cssText=this.parsedCssText="",this.atRule=!1,this.type=0,this.parsedSelector=this.selector=this.keyframesName=""}function qn(t){var e=Wn,n=t=t.replace(Kn,"").replace(Yn,""),o=new Un;o.start=0,o.end=n.length;for(var r=o,i=0,l=n.length;i<l;i++)if("{"===n[i]){r.rules||(r.rules=[]);var s=r,a=s.rules[s.rules.length-1]||null;(r=new Un).start=i+1,r.parent=s,r.previous=a,s.rules.push(r)}else"}"===n[i]&&(r.end=i+1,r=r.parent||o);return e(o,t)}function Wn(t,e){var n=e.substring(t.start,t.end-1);if(t.parsedCssText=t.cssText=n.trim(),t.parent&&(n=(n=(n=function(t){return t.replace(/\\([0-9a-f]{1,6})\s/gi,function(t,e){for(e=6-(t=e).length;e--;)t="0"+t;return"\\"+t})}(n=e.substring(t.previous?t.previous.end:t.parent.start,t.start-1))).replace(oo," ")).substring(n.lastIndexOf(";")+1),n=t.parsedSelector=t.selector=n.trim(),t.atRule=0===n.indexOf("@"),t.atRule?0===n.indexOf("@media")?t.type=Xn:n.match(no)&&(t.type=zn,t.keyframesName=t.selector.split(oo).pop()):t.type=0===n.indexOf("--")?Jn:$n),n=t.rules)for(var o,r=0,i=n.length;r<i&&(o=n[r]);r++)Wn(o,e);return t}var Gn,$n=1,zn=7,Xn=4,Jn=1e3,Kn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,Yn=/@import[^;]*;/gim,Zn=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,Qn=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,to=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,eo=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,no=/^@[^\s]*keyframes/,oo=/\s+/g,ro=!(window.ShadyDOM&&window.ShadyDOM.inUse);function io(t){Gn=(!t||!t.shimcssproperties)&&(ro||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)")))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?Gn=window.ShadyCSS.nativeCss:window.ShadyCSS?(io(window.ShadyCSS),window.ShadyCSS=void 0):io(window.WebComponents&&window.WebComponents.flags);var lo=Gn,so=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,ao=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,co=/(--[\w-]+)\s*([:,;)]|$)/gi,uo=/(animation\s*:)|(animation-name\s*:)/,ho=/@media\s(.*)/,fo=/\{[^}]*\}/g,po=new Set;function mo(t,e){return t?("string"==typeof t&&(t=qn(t)),e&&yo(t,e),function t(e,n,o){o=void 0===o?"":o;var r="";if(e.cssText||e.rules){var i,l=e.rules;if((i=l)&&(i=!((i=l[0])&&i.selector&&0===i.selector.indexOf("--"))),i){i=0;for(var s,a=l.length;i<a&&(s=l[i]);i++)r=t(s,n,r)}else n=n?e.cssText:(n=(n=e.cssText).replace(Zn,"").replace(Qn,"")).replace(to,"").replace(eo,""),(r=n.trim())&&(r=" "+r+"\n")}return r&&(e.selector&&(o+=e.selector+" {\n"),o+=r,e.selector&&(o+="}\n\n")),o}(t,lo)):""}function vo(t){return!t.__cssRules&&t.textContent&&(t.__cssRules=qn(t.textContent)),t.__cssRules||null}function go(t){return!!t.parent&&t.parent.type===zn}function yo(t,e,n,o){if(t){var r=!1,i=t.type;if(o&&i===Xn){var l=t.selector.match(ho);l&&(window.matchMedia(l[1]).matches||(r=!0))}if(i===$n?e(t):n&&i===zn?n(t):i===Jn&&(r=!0),(t=t.rules)&&!r){r=0,i=t.length;for(var s;r<i&&(s=t[r]);r++)yo(s,e,n,o)}}}function bo(t,e,n,o){var r=document.createElement("style");return e&&r.setAttribute("scope",e),r.textContent=t,Eo(r,n,o),r}var wo=null;function Eo(t,e,n){(e=e||document.head).insertBefore(t,n&&n.nextSibling||e.firstChild),wo?t.compareDocumentPosition(wo)===Node.DOCUMENT_POSITION_PRECEDING&&(wo=t):wo=t}function No(t,e){ro?t.setAttribute("class",e):window.ShadyDOM.nativeMethods.setAttribute.call(t,"class",e)}function Co(t){var e=t.localName,n="";return e?-1<e.indexOf("-")||(n=e,e=t.getAttribute&&t.getAttribute("is")||""):(e=t.is,n=t.extends),{is:e,H:n}}function So(){}function _o(t,e,n){var o=Jo;t.__styleScoped?t.__styleScoped=null:function t(e,n,o,r){n.nodeType===Node.ELEMENT_NODE&&To(n,o,r);if(n="template"===n.localName?(n.content||n.La).childNodes:n.children||n.childNodes)for(var i=0;i<n.length;i++)t(e,n[i],o,r)}(o,t,e||"",n)}function To(t,e,n){if(e)if(t.classList)n?(t.classList.remove("style-scope"),t.classList.remove(e)):(t.classList.add("style-scope"),t.classList.add(e));else if(t.getAttribute){var o=t.getAttribute(zo);n?o&&No(t,e=o.replace("style-scope","").replace(e,"")):No(t,(o?o+" ":"")+"style-scope "+e)}}function Oo(t,e,n){var o=Jo,r=t.__cssBuild;return ro||"shady"===r?e=mo(e,n):e=function(t,e,n,o,r){var i=xo(n,o);return n=n?Go+n:"",mo(e,function(e){e.c||(e.selector=e.l=Do(t,e,t.b,n,i),e.c=!0),r&&r(e,n,i)})}(o,e,(t=Co(t)).is,t.H,n)+"\n\n",e.trim()}function xo(t,e){return e?"[is="+t+"]":t}function Do(t,e,n,o,r){var i=e.selector.split(Ro);if(!go(e)){e=0;for(var l,s=i.length;e<s&&(l=i[e]);e++)i[e]=n.call(t,l,o,r)}return i.join(Ro)}function Ao(t){return t.replace(jo,function(t,e,n){return-1<n.indexOf("+")?n=n.replace(/\+/g,"___"):-1<n.indexOf("___")&&(n=n.replace(/___/g,"+")),":"+e+"("+n+")"})}function Mo(t,e){return(t=t.split($o))[0]+=e,t.join($o)}function Lo(t){t.selector===Io&&(t.selector="html")}So.prototype.b=function(t,e,n){var o=!1;t=t.trim();var r=jo.test(t);return r&&(t=Ao(t=t.replace(jo,function(t,e,n){return":"+e+"("+n.replace(/\s/g,"")+")"}))),t=(t=t.replace(Bo,Fo+" $1")).replace(Po,function(t,r,i){return o||(t=function(t,e,n,o){var r=t.indexOf(Vo);if(0<=t.indexOf(Fo)?t=function(t,e){var n=t.match(Uo);return(n=n&&n[2].trim()||"")?n[0].match(Ho)?t.replace(Uo,function(t,n,o){return e+o}):n.split(Ho)[0]===e?n:Xo:t.replace(Fo,e)}(t,o):0!==r&&(t=n?Mo(t,n):t),n=!1,0<=r&&(e="",n=!0),n){var i=!0;n&&(t=t.replace(qo,function(t,e){return" > "+e}))}return{value:t=t.replace(Wo,function(t,e,n){return'[dir="'+n+'"] '+e+", "+e+'[dir="'+n+'"]'}),va:e,stop:i}}(i,r,e,n),o=o||t.stop,r=t.va,i=t.value),r+i}),r&&(t=Ao(t)),t},So.prototype.c=function(t){return t.match(Vo)?this.b(t,ko):Mo(t.trim(),ko)},e.Object.defineProperties(So.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});var jo=/:(nth[-\w]+)\(([^)]+)\)/,ko=":not(.style-scope)",Ro=",",Po=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Ho=/[[.:#*]/,Fo=":host",Io=":root",Vo="::slotted",Bo=new RegExp("^("+Vo+")"),Uo=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,qo=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Wo=/(.*):dir\((?:(ltr|rtl))\)/,Go=".",$o=":",zo="class",Xo="should_not_match",Jo=new So;function Ko(t,e,n,o){this.u=t||null,this.b=e||null,this.ba=n||[],this.D=null,this.H=o||"",this.a=this.m=this.A=null}function Yo(t){return t?t.__styleInfo:null}function Zo(t,e){return t.__styleInfo=e}function Qo(t){var e=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return e&&e.call(this,t)}Ko.prototype.c=function(){return this.u},Ko.prototype._getStyleRules=Ko.prototype.c;var tr=navigator.userAgent.match("Trident");function er(){}function nr(t){if(!t.i){var e={},n={};or(t,n)&&(e.s=n,t.rules=null),e.cssText=t.parsedCssText.replace(fo,"").replace(so,""),t.i=e}}function or(t,e){var n=t.i;if(!n){n=t.parsedCssText;for(var o;t=so.exec(n);)"inherit"===(o=(t[2]||t[3]).trim())&&"unset"===o||(e[t[1].trim()]=o),o=!0;return o}if(n.s)return Object.assign(e,n.s),!0}function rr(t,e,n){return e&&(e=0<=e.indexOf(";")?ir(t,e,n):function t(e,n){var o=e.indexOf("var(");if(-1===o)return n(e,"","","");t:{for(var r=0,i=o+3,l=e.length;i<l;i++)if("("===e[i])r++;else if(")"===e[i]&&0==--r)break t;i=-1}return r=e.substring(o+4,i),o=e.substring(0,o),e=t(e.substring(i+1),n),-1===(i=r.indexOf(","))?n(o,r.trim(),"",e):n(o,r.substring(0,i).trim(),r.substring(i+1).trim(),e)}(e,function(e,o,r,i){return o?((o=rr(t,n[o],n))&&"initial"!==o?"apply-shim-inherit"===o&&(o="inherit"):o=rr(t,n[r]||r,n)||r,e+(o||"")+i):e+i})),e&&e.trim()||""}function ir(t,e,n){e=e.split(";");for(var o,r,i=0;i<e.length;i++)if(o=e[i]){if(ao.lastIndex=0,r=ao.exec(o))o=rr(t,n[r[1]],n);else if(-1!==(r=o.indexOf(":"))){var l=o.substring(r);l=rr(t,l=l.trim(),n)||l,o=o.substring(0,r)+l}e[i]=o&&o.lastIndexOf(";")===o.length-1?o.slice(0,-1):o||""}return e.join(";")}function lr(t,e){var n={},o={},r=e&&e.__cssBuild;return yo(e,function(e){!function(t,e,n,o){if(e.i||nr(e),e.i.s){var r=Co(t);t=r.is,r=r.H,r=t?xo(t,r):"html";var i=e.parsedSelector,l=":host > *"===i||"html"===i,s=0===i.indexOf(":host")&&!l;"shady"===n&&(s=!(l=i===r+" > *."+r||-1!==i.indexOf("html"))&&0===i.indexOf(r)),"shadow"===n&&(l=":host > *"===i||"html"===i,s=s&&!l),(l||s)&&(n=r,s&&(e.l||(e.l=Do(Jo,e,Jo.b,t?Go+t:"",r)),n=e.l||r),o({Ca:n,za:s,Va:l}))}}(t,e,r,function(r){Qo.call(t.Ma||t,r.Ca)&&(r.za?or(e,n):or(e,o))})},null,!0),{Ba:o,ya:n}}function sr(t,e,n,o){var r=Co(e),i=xo(r.is,r.H),l=new RegExp("(?:^|[^.#[:])"+(e.extends?"\\"+i.slice(0,-1)+"\\]":i)+"($|[.:[\\s>+~])"),s=function(t,e){t=t.b;var n={};if(!ro&&t)for(var o=0,r=t[o];o<t.length;r=t[++o]){var i=r,l=e;i.j=new RegExp("\\b"+i.keyframesName+"(?!\\B|-)","g"),i.a=i.keyframesName+"-"+l,i.l=i.l||i.selector,i.selector=i.l.replace(i.keyframesName,i.a),n[r.keyframesName]=ar(r)}return n}(r=Yo(e).u,o);return Oo(e,r,function(e){var r="";if(e.i||nr(e),e.i.cssText&&(r=ir(t,e.i.cssText,n)),e.cssText=r,!ro&&!go(e)&&e.cssText){var a=r=e.cssText;if(null==e.ga&&(e.ga=uo.test(r)),e.ga)if(null==e.O)for(var c in e.O=[],s)r!==(a=(a=s[c])(r))&&(r=a,e.O.push(c));else{for(c=0;c<e.O.length;++c)r=(a=s[e.O[c]])(r);a=r}e.cssText=a,e.l=e.l||e.selector,r="."+o,a=0;for(var u,d=(c=e.l.split(",")).length;a<d&&(u=c[a]);a++)c[a]=u.match(l)?u.replace(i,r):r+" "+u;e.selector=c.join(",")}})}function ar(t){return function(e){return e.replace(t.j,t.a)}}function cr(t,e){var n=ur,o=vo(t);t.textContent=mo(o,function(t){var o=t.cssText=t.parsedCssText;t.i&&t.i.cssText&&(o=o.replace(Zn,"").replace(Qn,""),t.cssText=ir(n,o,e))})}e.Object.defineProperties(er.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var ur=new er,dr={},hr=window.customElements;if(hr&&!ro){var fr=hr.define;hr.define=function(t,e,n){var o=document.createComment(" Shady DOM styles for "+t+" "),r=document.head;r.insertBefore(o,(wo?wo.nextSibling:null)||r.firstChild),wo=o,dr[t]=o,fr.call(hr,t,e,n)}}function pr(){this.cache={}}function mr(){}function vr(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.target!==document.documentElement&&n.target!==document.head)for(var o=0;o<n.addedNodes.length;o++){var r=n.addedNodes[o];if(r.nodeType===Node.ELEMENT_NODE){var i=r.getRootNode(),l=r,s=[];if(l.classList?s=Array.from(l.classList):l instanceof window.SVGElement&&l.hasAttribute("class")&&(s=l.getAttribute("class").split(/\s+/)),(l=-1<(s=(l=s).indexOf(Jo.a))?l[s+1]:"")&&i===r.ownerDocument)_o(r,l,!0);else if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(i=i.host))if(l===(i=Co(i).is))for(r=window.ShadyDOM.nativeMethods.querySelectorAll.call(r,":not(."+Jo.a+")"),i=0;i<r.length;i++)To(r[i],l);else l&&_o(r,l,!0),_o(r,i)}}}}if(pr.prototype.store=function(t,e,n,o){var r=this.cache[t]||[];r.push({s:e,styleElement:n,m:o}),100<r.length&&r.shift(),this.cache[t]=r},pr.prototype.fetch=function(t,e,n){if(t=this.cache[t])for(var o=t.length-1;0<=o;o--){var r,i=t[o];t:{for(r=0;r<n.length;r++){var l=n[r];if(i.s[l]!==e[l]){r=!1;break t}}r=!0}if(r)return i}},!ro){var gr=new MutationObserver(vr),yr=function(t){gr.observe(t,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)yr(document);else{var br=function(){yr(document.body)};window.HTMLImports?window.HTMLImports.whenReady(br):requestAnimationFrame(function(){if("loading"===document.readyState){var t=function(){br(),document.removeEventListener("readystatechange",t)};document.addEventListener("readystatechange",t)}else br()})}mr=function(){vr(gr.takeRecords())}}var wr=mr,Er={},Nr=Promise.resolve();function Cr(t){(t=Er[t])&&(t._applyShimCurrentVersion=t._applyShimCurrentVersion||0,t._applyShimValidatingVersion=t._applyShimValidatingVersion||0,t._applyShimNextVersion=(t._applyShimNextVersion||0)+1)}function Sr(t){return t._applyShimCurrentVersion===t._applyShimNextVersion}var _r=new pr;function Tr(){this.fa={},this.c=document.documentElement;var t=new Un;t.rules=[],this.j=Zo(this.c,new Ko(t)),this.w=!1,this.b=this.a=null}function Or(t){!t.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(t.a=window.ShadyCSS.ApplyShim,t.a.invalidCallback=Cr),function(t){!t.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(t.b=window.ShadyCSS.CustomStyleInterface,t.b.transformCallback=function(e){t.ka(e)},t.b.validateCallback=function(){requestAnimationFrame(function(){(t.b.enqueued||t.w)&&t.flushCustomStyles()})})}(t)}function xr(t,e){return(e=e.getRootNode().host)?Yo(e)?e:xr(t,e):t.c}function Dr(t,e,n){var o=Yo(t=xr(t,e));t=Object.create(o.A||null);var r=lr(e,n.u);for(var i in e=function(t,e){var n={},o=[];return yo(t,function(t){t.i||nr(t);var r=t.l||t.parsedSelector;e&&t.i.s&&r&&Qo.call(e,r)&&(or(t,n),t=t.index,r=parseInt(t/32,10),o[r]=(o[r]||0)|1<<t%32)},null,!0),{s:n,key:o}}(o.u,e).s,Object.assign(t,r.ya,e,r.Ba),e=n.D)((r=e[i])||0===r)&&(t[i]=r);for(i=ur,e=Object.getOwnPropertyNames(t),r=0;r<e.length;r++)t[o=e[r]]=rr(i,t[o],t);n.A=t}(t=Tr.prototype).ma=function(){wr()},t.wa=function(t){return vo(t)},t.Ea=function(t){return mo(t)},t.prepareTemplate=function(t,e,n){if(!t.j){t.j=!0,t.name=e,t.extends=n,Er[e]=t;for(var o=(o=t.content.querySelector("style"))&&o.getAttribute("css-build")||"",r=[],i=t.content.querySelectorAll("style"),l=0;l<i.length;l++){var s=i[l];if(s.hasAttribute("shady-unscoped")){if(!ro){var a=s.textContent;po.has(a)||(po.add(a),a=s.cloneNode(!0),document.head.appendChild(a)),s.parentNode.removeChild(s)}}else r.push(s.textContent),s.parentNode.removeChild(s)}r=r.join("").trim(),n={is:e,extends:n,Ja:o},ro||_o(t.content,e),Or(this),i=ao.test(r)||so.test(r),ao.lastIndex=0,so.lastIndex=0,r=qn(r),i&&lo&&this.a&&this.a.transformRules(r,e),t._styleAst=r,t.w=o,o=[],lo||(o=function(t){var e={},n=[],o=0;for(var r in yo(t,function(t){nr(t),t.index=o++,t=t.i.cssText;for(var n;n=co.exec(t);){var r=n[1];":"!==n[2]&&(e[r]=!0)}},function(t){n.push(t)}),t.b=n,t=[],e)t.push(r);return t}(t._styleAst)),o.length&&!lo||(r=ro?t.content:null,e=dr[e],e=(i=Oo(n,t._styleAst)).length?bo(i,n.is,r,e):void 0,t.a=e),t.c=o}},t.flushCustomStyles=function(){if(Or(this),this.b){var t=this.b.processStyles();if(this.b.enqueued){if(lo)for(var e=0;e<t.length;e++){var n=this.b.getStyleForCustomStyle(t[e]);if(n&&lo&&this.a){var o=vo(n);Or(this),this.a.transformRules(o),n.textContent=mo(o)}}else for(Dr(this,this.c,this.j),e=0;e<t.length;e++)(n=this.b.getStyleForCustomStyle(t[e]))&&cr(n,this.j.A);this.b.enqueued=!1,this.w&&!lo&&this.styleDocument()}}},t.styleElement=function(t,e){var n=Co(t).is,o=Yo(t);if(!o){var r=Co(t);o=r.is,r=r.H;var i=dr[o];if(o=Er[o])var l=o._styleAst,s=o.c;o=Zo(t,new Ko(l,i,s,r))}if(t!==this.c&&(this.w=!0),e&&(o.D=o.D||{},Object.assign(o.D,e)),lo){if(o.D)for(var a in e=o.D)null===a?t.style.removeProperty(a):t.style.setProperty(a,e[a]);((a=Er[n])||t===this.c)&&a&&a.a&&!Sr(a)&&((Sr(a)||a._applyShimValidatingVersion!==a._applyShimNextVersion)&&(Or(this),this.a&&this.a.transformRules(a._styleAst,n),a.a.textContent=Oo(t,o.u),function(t){t._applyShimValidatingVersion=t._applyShimNextVersion,t.b||(t.b=!0,Nr.then(function(){t._applyShimCurrentVersion=t._applyShimNextVersion,t.b=!1}))}(a)),ro&&(n=t.shadowRoot)&&(n.querySelector("style").textContent=Oo(t,o.u)),o.u=a._styleAst)}else if(Dr(this,t,o),o.ba&&o.ba.length){n=o,a=Co(t).is,o=(e=_r.fetch(a,n.A,n.ba))?e.styleElement:null,l=n.m,(s=e&&e.m)||(s=a+"-"+(s=this.fa[a]=(this.fa[a]||0)+1)),n.m=s,s=n.m,r=ur,r=o?o.textContent||"":sr(r,t,n.A,s);var c=(i=Yo(t)).a;c&&!ro&&c!==o&&(c._useCount--,0>=c._useCount&&c.parentNode&&c.parentNode.removeChild(c)),ro?i.a?(i.a.textContent=r,o=i.a):r&&(o=bo(r,s,t.shadowRoot,i.b)):o?o.parentNode||(tr&&-1<r.indexOf("@media")&&(o.textContent=r),Eo(o,null,i.b)):r&&(o=bo(r,s,null,i.b)),o&&(o._useCount=o._useCount||0,i.a!=o&&o._useCount++,i.a=o),s=o,ro||(o=n.m,i=r=t.getAttribute("class")||"",l&&(i=r.replace(new RegExp("\\s*x-scope\\s*"+l+"\\s*","g")," ")),r!==(i+=(i?" ":"")+"x-scope "+o)&&No(t,i)),e||_r.store(a,n.A,s,n.m)}},t.styleDocument=function(t){this.styleSubtree(this.c,t)},t.styleSubtree=function(t,e){var n=t.shadowRoot;if((n||t===this.c)&&this.styleElement(t,e),e=n&&(n.children||n.childNodes))for(t=0;t<e.length;t++)this.styleSubtree(e[t]);else if(t=t.children||t.childNodes)for(e=0;e<t.length;e++)this.styleSubtree(t[e])},t.ka=function(t){var e=this,n=vo(t);yo(n,function(t){if(ro)Lo(t);else{var n=Jo;t.selector=t.parsedSelector,Lo(t),t.selector=t.l=Do(n,t,n.c,void 0,void 0)}lo&&(Or(e),e.a&&e.a.transformRule(t))}),lo?t.textContent=mo(n):this.j.u.rules.push(n)},t.getComputedStyleValue=function(t,e){var n;return lo||(n=(Yo(t)||Yo(xr(this,t))).A[e]),(n=n||window.getComputedStyle(t).getPropertyValue(e))?n.trim():""},t.Da=function(t,e){var n=t.getRootNode();if(e=e?e.split(/\s/):[],!(n=n.host&&n.host.localName)){var o=t.getAttribute("class");if(o){o=o.split(/\s/);for(var r=0;r<o.length;r++)if(o[r]===Jo.a){n=o[r+1];break}}}n&&e.push(Jo.a,n),lo||(n=Yo(t))&&n.m&&e.push(ur.a,n.m),No(t,e.join(" "))},t.ua=function(t){return Yo(t)},Tr.prototype.flush=Tr.prototype.ma,Tr.prototype.prepareTemplate=Tr.prototype.prepareTemplate,Tr.prototype.styleElement=Tr.prototype.styleElement,Tr.prototype.styleDocument=Tr.prototype.styleDocument,Tr.prototype.styleSubtree=Tr.prototype.styleSubtree,Tr.prototype.getComputedStyleValue=Tr.prototype.getComputedStyleValue,Tr.prototype.setElementClass=Tr.prototype.Da,Tr.prototype._styleInfoForNode=Tr.prototype.ua,Tr.prototype.transformCustomStyleForDocument=Tr.prototype.ka,Tr.prototype.getStyleAst=Tr.prototype.wa,Tr.prototype.styleAstToString=Tr.prototype.Ea,Tr.prototype.flushCustomStyles=Tr.prototype.flushCustomStyles,Object.defineProperties(Tr.prototype,{nativeShadow:{get:function(){return ro}},nativeCss:{get:function(){return lo}}});var Ar,Mr,Lr=new Tr;window.ShadyCSS&&(Ar=window.ShadyCSS.ApplyShim,Mr=window.ShadyCSS.CustomStyleInterface),window.ShadyCSS={ScopingShim:Lr,prepareTemplate:function(t,e,n){Lr.flushCustomStyles(),Lr.prepareTemplate(t,e,n)},styleSubtree:function(t,e){Lr.flushCustomStyles(),Lr.styleSubtree(t,e)},styleElement:function(t){Lr.flushCustomStyles(),Lr.styleElement(t)},styleDocument:function(t){Lr.flushCustomStyles(),Lr.styleDocument(t)},flushCustomStyles:function(){Lr.flushCustomStyles()},getComputedStyleValue:function(t,e){return Lr.getComputedStyleValue(t,e)},nativeCss:lo,nativeShadow:ro},Ar&&(window.ShadyCSS.ApplyShim=Ar),Mr&&(window.ShadyCSS.CustomStyleInterface=Mr)}).call(this);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L218

Insecure DOM Manipulation (XSS) in field-simple-color.js

CWE-79
File Location: build/media/webcomponents/js/field-simple-color/field-simple-color.js:218
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- close.innerHTML = this.textClose;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in admin-compare-compare.min.js

CWE-79
File Location: media/com_contenthistory/js/admin-compare-compare.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.addEventListener("DOMContentLoaded",function(){function e(e,n){var t=n.nextElementSibling,d="",o=null,r=JsDiff.diffWords(e.innerHTML,n.innerHTML),a=document.createDocumentFragment();r.forEach(function(e){d=e.added?"#a6f3a6":e.removed?"#f8cbcb":"",(o=document.createElement("span")).style.backgroundColor=d,o.style.borderRadius=".2rem",o.appendChild(document.createTextNode(e.value)),a.appendChild(o)}),t.appendChild(a)}for(var n=document.querySelectorAll(".original"),t=0,d=n.length;t<d;t++)e(n[t],n[t].nextElementSibling)});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L123

Insecure DOM Manipulation (XSS) in indexer.js

CWE-79
File Location: media/com_finder/js/indexer.js:123
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- progressMessage.innerHTML = message;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L248

Insecure DOM Manipulation (XSS) in edit-images.js

CWE-79
File Location: media/com_media/js/edit-images.js:248
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- baseContainer.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in extensionupdatecheck.es6.min.js

CWE-79
File Location: media/plg_quickicon_extensionupdate/js/extensionupdatecheck.es6.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (()=>{"use strict";document.addEventListener("DOMContentLoaded",()=>{if(Joomla.getOptions("js-extensions-update")){const e=Joomla.getOptions("js-extensions-update");Joomla.request({url:`${e.ajaxUrl}&eid=0&skip=700`,method:"GET",data:"",perform:!0,onSuccess:n=>{const t=document.getElementById("plg_quickicon_extensionupdate"),s=t.querySelectorAll("span.j-links-link"),o=JSON.parse(n);if(o instanceof Array)if(0===o.length){t.classList.add("success");for(let e=0,n=s.length;e<n;e+=1)s[e].innerHTML=Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE")}else{const n={message:[`${Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE").replace("%s",`<span class="badge badge-light">${o.length}</span>`)}<button class="btn btn-primary" onclick="document.location='${e.url}'">${Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON")}</button>`],error:["info"]};Joomla.renderMessages(n),window.scrollTo(0,0),t.classList.add("danger");for(let e=0,n=s.length;e<n;e+=1)s[e].innerHTML=Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND").replace("%s",`<span class="badge badge-light">${o.length}</span>`)}else{t.classList.add("danger");for(let e=0,n=s.length;e<n;e+=1)s[e].innerHTML=Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_ERROR")}},onError:()=>{const e=document.getElementById("plg_quickicon_extensionupdate"),n=e.querySelectorAll("span.j-links-link");e.classList.add("danger");for(let e=0,t=n.length;e<t;e+=1)n[e].innerHTML=Joomla.JText._("PLG_QUICKICON_EXTENSIONUPDATE_ERROR")}})}})})();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in jupdatecheck.min.js

CWE-79
File Location: media/plg_quickicon_joomlaupdate/js/jupdatecheck.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var e=function(){if(Joomla.getOptions("js-joomla-update")){var e=Joomla.getOptions("js-joomla-update");Joomla.request({url:e.ajaxUrl+"&eid=700&cache_timeout=3600",method:"GET",data:"",perform:!0,onSuccess:function(o,n){var a=document.getElementById("plg_quickicon_joomlaupdate"),t=a.querySelectorAll("span.j-links-link"),l=JSON.parse(o);if(l instanceof Array)if(0===l.length){a.classList.add("success");for(var s=0,r=t.length;s<r;s++)t[s].innerHTML=Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_UPTODATE")}else{if(l.shift().version!=e.version){var i={message:[Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE").replace("%s",'<span class="badge badge-light">'+l.length+"</span>")+'<button class="btn btn-primary" onclick="document.location=\''+e.url+"'\">"+Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTOON")+"</button>"],error:["info"]};Joomla.renderMessages(i),window.scrollTo(0,0),a.classList.add("danger");for(s=0,r=t.length;s<r;s++)t[s].innerHTML=Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND").replace("%s",'<span class="badge badge-light">'+l.length+"</span>")}else for(s=0,r=t.length;s<r;s++)t[s].innerHTML=Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_UPTODATE")}else{a.classList.add("danger");for(s=0,r=t.length;s<r;s++)t[s].innerHTML=Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_ERROR")}},onError:function(e){var o=document.getElementById("plg_quickicon_joomlaupdate"),n=o.querySelectorAll("span.j-links-link");o.classList.add("danger");for(var a=0,t=n.length;a<t;a++)n[a].innerHTML=Joomla.JText._("PLG_QUICKICON_JOOMLAUPDATE_ERROR")}})}};document.addEventListener("DOMContentLoaded",function(){setTimeout(e,2e3)})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in core.min.js

CWE-79
File Location: media/system/js/core.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},Joomla.Modal={current:"",setCurrent:function(e){this.current=e},getCurrent:function(){return this.current}},function(e,t){"use strict";e.submitform=function(e,n,o){n||(n=t.getElementById("adminForm")),e&&(n.task.value=e),n.noValidate=!o,o?n.hasAttribute("novalidate")&&n.removeAttribute("novalidate"):n.setAttribute("novalidate","");var r=t.createElement("input");r.style.display="none",r.type="submit",n.appendChild(r).click(),n.removeChild(r)},e.submitbutton=function(n,o,r){var s=t.querySelector(o||"form.form-validate");if(s){if(void 0===r||null===r){var i=n.split("."),a=s.getAttribute("data-cancel-task");a||(a=i[0]+".cancel"),r=n!==a}r&&!t.formvalidator.isValid(s)||e.submitform(n,s)}else e.submitform(n)},e.JText={strings:{},_:function(t,n){var o=e.getOptions("joomla.jtext");return o&&(this.load(o),e.loadOptions({"joomla.jtext":null})),n=void 0===n?"":n,t=t.toUpperCase(),void 0!==this.strings[t]?this.strings[t]:n},load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.strings[t.toUpperCase()]=e[t]);return this}},e.optionsStorage=e.optionsStorage||null,e.getOptions=function(t,n){return e.optionsStorage||e.loadOptions(),void 0!==e.optionsStorage[t]?e.optionsStorage[t]:n},e.loadOptions=function(n){if(!n){for(var o,r,s,i=t.querySelectorAll(".joomla-script-options.new"),a=0,l=0,c=i.length;l<c;l++)o=(r=i[l]).text||r.textContent,(s=JSON.parse(o))&&(e.loadOptions(s),a++),r.className=r.className.replace(" new"," loaded");if(a)return}if(e.optionsStorage){if(n)for(var d in n)n.hasOwnProperty(d)&&(null!==n[d]&&"object"==typeof e.optionsStorage[d]&&"object"==typeof n[d]?e.optionsStorage[d]=e.extend(e.optionsStorage[d],n[d]):e.optionsStorage[d]=n[d])}else e.optionsStorage=n||{}},e.replaceTokens=function(e){if(/^[0-9A-F]{32}$/i.test(e)){var n,o,r,s=t.getElementsByTagName("input");for(n=0,r=s.length;n<r;n++)"hidden"==(o=s[n]).type&&"1"==o.value&&32==o.name.length&&(o.name=e)}},e.checkAll=function(t,n){if(!t.form)return!1;n=n||"cb";var o,r,s,i=0;for(o=0,s=t.form.elements.length;o<s;o++)(r=t.form.elements[o]).type==t.type&&0===r.id.indexOf(n)&&(r.checked=t.checked,i+=r.checked?1:0);return t.form.boxchecked&&(t.form.boxchecked.value=i,e.Event.dispatch(t.form.boxchecked,"change")),!0},e.renderMessages=function(n,o,r,s){var i,a,l,c,d,m,u,f;for(a in i=void 0===o||o&&"#system-message-container"===o?t.getElementById("system-message-container"):t.querySelector(o),(void 0===r||r&&!1===r)&&e.removeMessages(i),n)if(n.hasOwnProperty(a)){if(l=n[a],"object"==typeof window.customElements&&"function"==typeof window.customElements.get("joomla-alert"))c=t.createElement("joomla-alert"),["notice","message","error"].indexOf(a)>-1?(f="notice"===a?"info":a,f="message"===a?"success":f,f="error"===a?"danger":f):f="info",c.setAttribute("type",f),c.setAttribute("dismiss","true"),s&&parseInt(s)>0&&c.setAttribute("autodismiss",s);else{c=t.createElement("div"),["notice","message","error"].indexOf(a)>-1?(f="notice"===a?"info":a,f="message"===a?"success":f,f="error"===a?"danger":f):f="info",c.className="alert "+f;var p=t.createElement("button");p.setAttribute("type","button"),p.setAttribute("data-dismiss","alert"),p.className="close",p.innerHTML="×",c.appendChild(p)}for(void 0!==e.JText._(a)&&((d=t.createElement("h4")).className="alert-heading",d.innerHTML=e.JText._(a)?e.JText._(a):a,c.appendChild(d)),m=l.length-1;m>=0;m--)(u=t.createElement("div")).innerHTML=l[m],c.appendChild(u);i.appendChild(c),"object"!=typeof window.customElements&&"function"!=typeof window.customElements.get("joomla-alert")&&s&&parseInt(s)>0&&setTimeout(function(){e.removeMessages(i)},s)}},e.removeMessages=function(e){var n;if(n=e||t.getElementById("system-message-container"),"object"==typeof window.customElements&&window.customElements.get("joomla-alert")){var o=n.querySelectorAll("joomla-alert");if(o.length)for(var r=0,s=o.length;r<s;r++)o[r].close()}else{for(;n.firstChild;)n.removeChild(n.firstChild);n.style.display="none",n.offsetHeight,n.style.display=""}},e.ajaxErrorsMessages=function(t,n,o){var r={};if("parsererror"===n){for(var s=t.responseText.trim(),i=[],a=s.length-1;a>=0;a--)i.unshift(["&#",s[a].charCodeAt(),";"].join(""));s=i.join(""),r.error=[e.JText._("JLIB_JS_AJAX_ERROR_PARSE").replace("%s",s)]}else"nocontent"===n?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_NO_CONTENT")]:"timeout"===n?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_TIMEOUT")]:"abort"===n?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_CONNECTION_ABORT")]:t.responseJSON&&t.responseJSON.message?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" <em>"+t.responseJSON.message+"</em>"]:t.statusText?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" <em>"+t.statusText+"</em>"]:r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)];return r},e.isChecked=function(n,o){if(void 0===o&&(o=t.getElementById("adminForm")),o.boxchecked.value=n?parseInt(o.boxchecked.value)+1:parseInt(o.boxchecked.value)-1,e.Event.dispatch(o.boxchecked,"change"),o.elements["checkall-toggle"]){var r,s,i,a=!0;for(r=0,i=o.elements.length;r<i;r++)if("checkbox"==(s=o.elements[r]).type&&"checkall-toggle"!=s.name&&!s.checked){a=!1;break}o.elements["checkall-toggle"].checked=a}},e.tableOrdering=function(n,o,r,s){void 0===s&&(s=t.getElementById("adminForm")),s.filter_order.value=n,s.filter_order_Dir.value=o,e.submitform(r,s)},window.getSelectedValue=function(e,n){var o=t[e][n],r=o.selectedIndex;return null!==r&&r>-1?o.options[r].value:null},window.listItemTask=function(t,n){return e.listItemTask(t,n)},e.listItemTask=function(e,n){var o,r=t.adminForm,s=0,i=r[e];if(!i)return!1;for(;o=r["cb"+s];)o.checked=!1,s++;return i.checked=!0,r.boxchecked.value=1,window.submitform(n),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){window.checkAll_button(e,t)},window.checkAll_button=function(n,o){var r,s;for(o=o||"saveorder",r=0;r<=n;r++){if(!(s=t.adminForm["cb"+r]))return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");s.checked=!0}e.submitform(o)},e.loadingLayer=function(n,o){if(n=n||"show",o=o||t.body,"load"===n){var r=(e.getOptions("system.paths")||{}).root||"",s=t.createElement("div");s.id="loading-logo",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.opacity="0.8",s.style.filter="alpha(opacity=80)",s.style.overflow="hidden",s.style["z-index"]="10000",s.style.display="none",s.style["background-color"]="#fff",s.style["background-image"]='url("'+r+'/media/system/images/ajax-loader.gif")',s.style["background-position"]="center",s.style["background-repeat"]="no-repeat",s.style["background-attachment"]="fixed",o.appendChild(s)}else t.getElementById("loading-logo")||e.loadingLayer("load",o),t.getElementById("loading-logo").style.display="show"==n?"block":"none";return t.getElementById("loading-logo")},e.extend=function(e,t){for(var n in null===e&&(e={}),t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},e.request=function(t){t=e.extend({url:"",method:"GET",data:null,perform:!0},t);try{var n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");if(n.open(t.method,t.url,!0),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("X-Ajax-Engine","Joomla!"),"GET"!==t.method){var o=e.getOptions("csrf.token","");o&&n.setRequestHeader("X-CSRF-Token",o),t.headers&&t.headers["Content-Type"]||n.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(t.headers)for(var r in t.headers)t.headers.hasOwnProperty(r)&&n.setRequestHeader(r,t.headers[r]);if(n.onreadystatechange=function(){4===n.readyState&&(200===n.status?t.onSuccess&&t.onSuccess.call(window,n.responseText,n):t.onError&&t.onError.call(window,n))},t.perform){if(t.onBefore&&!1===t.onBefore.call(window,n))return n;n.send(t.data)}}catch(e){return window.console&&console.log(e),!1}return n},e.localStorageEnabled=function(){var e="joomla-cms";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}},e.WebComponents=function(){var n=e.getOptions("webcomponents");if(n&&n.length){var o,r=!1,s=[],i=!1,a=function(){window.WebComponents.ready=!0,t.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0})),m()},l=function(){window.customElements&&customElements.polyfillWrapFlushCallback&&customElements.polyfillWrapFlushCallback(function(e){o=e,i&&o()})},c=function(){window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(window.document),r=!0,d().then(a)},d=function(){i=!1;return Promise.all(s.map(function(e){return e instanceof Function?e():e})).then(function(){i=!0,s.length=0,o&&o()}).catch(function(e){console.error(e)})};window.WebComponents=window.WebComponents||{ready:!1,_batchCustomElements:l,waitFor:function(e){e&&(s.push(e),r&&d())}};var m=function(){n&&n.length&&n.forEach(function(e){if(e.match(/\.js/g)){var n,o=t.createElement("script");if(function(){try{return new Function("(a = 0) => a"),!0}catch(e){return!1}}())o.src=e;else e.match(/\.min\.js/g)?n=e.replace(/\.min\.js/g,"-es5.min.js"):e.match(/\.js/g)&&(n=e.replace(/\.js/g,"-es5.js")),o.src=n}o&&t.head.appendChild(o)})},u="core.min.js",f=t.querySelector('script[src*="'+u+'"]');if(f||(u="core.js",f=t.querySelector('script[src*="'+u+'"]')),!f)throw new Error("core(.min).js is not registered correctly!");var p=[];(!("attachShadow"in Element.prototype&&"getRootNode"in Element.prototype)||window.ShadyDOM&&window.ShadyDOM.force)&&p.push("sd"),window.customElements&&!window.customElements.forcePolyfill||p.push("ce");var h=function(){var e=t.createElement("template");if(!("content"in e))return!0;if(!(e.content.cloneNode()instanceof DocumentFragment))return!0;var n=t.createElement("template");n.content.appendChild(t.createElement("div")),e.content.appendChild(n);var o=e.cloneNode(!0);return 0===o.content.childNodes.length||0===o.content.firstChild.content.childNodes.length}();if(window.Promise&&Array.from&&window.URL&&window.Symbol&&!h||(p=["sd-ce-pf"]),p.length){var g=t.createElement("script"),w="media/vendor/webcomponentsjs/js/webcomponents-"+p.join("-")+".min.js",v=f.src.match(/\?.*/)[0],y=e.getOptions("system.paths");if(!y)throw new Error("core(.min).js is not registered correctly!");g.src=y.rootFull+w+(v||""),"loading"===t.readyState?(g.setAttribute("onload","window.WebComponents._batchCustomElements()"),t.write(g.outerHTML),t.addEventListener("DOMContentLoaded",c)):(g.addEventListener("load",function(){l(),c()}),g.addEventListener("error",function(){throw new Error("Could not load polyfill bundle"+url)}),t.head.appendChild(g))}else r=!0,"complete"===t.readyState?a():(window.addEventListener("load",c),window.addEventListener("DOMContentLoaded",function(){window.removeEventListener("load",c),c()}))}}}(Joomla,document),function(e,t){"use strict";t.Event||(t.Event={},t.Event.dispatch=function(t,n,o){var r;"string"==typeof t&&(o=n,n=t,t=e),o=o||{},e.CustomEvent&&"function"==typeof e.CustomEvent?r=new CustomEvent(n,{detail:o,bubbles:!0,cancelable:!0}):((r=document.createEvent("Event")).initEvent(n,!0,!0),r.detail=o),t.dispatchEvent(r)},t.Event.listenOnce=function(e,t,n){var o=function(r){return e.removeEventListener(t,o),n.call(e,r)};e.addEventListener(t,o)})}(window,Joomla),document.addEventListener("DOMContentLoaded",function(){Joomla.WebComponents()});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L668

Insecure DOM Manipulation (XSS) in calendar.js

CWE-79
File Location: media/system/js/fields/calendar.js:668
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- cell.innerHTML = JoomlaCalLocale.shortDays[(i + fdow) % 7];
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L103

Insecure DOM Manipulation (XSS) in joomla-field-module-order-es5.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-module-order-es5.js:103
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L82

Insecure DOM Manipulation (XSS) in joomla-field-module-order.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-module-order.js:82
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-field-module-order.min.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-module-order.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- customElements.define("joomla-field-module-order",class extends HTMLElement{constructor(){super(),this.linkedFieldSelector="",this.linkedFieldElement="",this.originalPosition="",this.writeDynaList.bind(this),this.getNewOrder.bind(this)}connectedCallback(){if(this.linkedFieldSelector=this.getAttribute("data-linked-field")||"jform_position",!this.linkedFieldSelector)throw new Error("No linked field defined!");if(this.linkedFieldElement=document.getElementById(this.linkedFieldSelector),!this.linkedFieldElement)throw new Error("No linked field defined!");const e=this;this.originalPosition=this.linkedFieldElement.value,this.getNewOrder(this.originalPosition),this.linkedFieldElement.addEventListener("change",()=>{e.originalPosition=e.linkedFieldElement.value,e.getNewOrder(e.linkedFieldElement.value)})}writeDynaList(e,t,i,n){let s=0;const l=document.createElement("select");this.hasOwnProperty("disabled")&&l.setAttribute("disabled",""),this.getAttribute("onchange")&&l.setAttribute("onchange",this.getAttribute("onchange")),this.getAttribute("size")&&l.setAttribute("size",this.getAttribute("size")),l.classList.add(e.itemClass),l.setAttribute("name",e.name),l.id=e.id;for(let e in t){if(!t.hasOwnProperty(e))continue;const d=document.createElement("option"),r=t[e];d.value=r[1],d.innerHTML=r[2],(i&&n===r[1]||!i&&0===s)&&d.setAttribute("selected","selected"),l.appendChild(d),s++}this.innerHTML="",this.appendChild(l)}getNewOrder(e){const t=this.getAttribute("data-url"),i=this.getAttribute("data-client-id"),n=this.getAttribute("data-ordering"),s=this.getAttribute("data-name"),l=this.getAttribute("data-client-attr")?this.getAttribute("data-client-attr"):"custom-select",d=this.getAttribute("id")+"_1",r=[],o=this;Joomla.request({url:`${t}client_id=${i}&position=${e}`,method:"GET",perform:!0,headers:{"Content-Type":"application/x-www-form-urlencoded"},onSuccess:function(e,t){if(e&&(e=JSON.parse(e)).data.length>0){for(let t=0;t<e.data.length;++t)r[t]=e.data[t].split(",");o.writeDynaList({name:s,id:d,itemClass:l},r,o.originalPosition,n)}"object"==typeof e.messages&&null!==e.messages&&Joomla.renderMessages(e.messages)}})}});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-field-simple-color-es5.min.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-simple-color-es5.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return r(t[a][1][e]||e)},c,c.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}}()({1:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(e){var t=9,n=27,r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o=function(e){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return e.select="",e.options=[],e.icon="",e.panel="",e.buttons=[],e.focusableElements=null,e.focusableSelectors=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,HTMLElement),i(o,[{key:"connectedCallback",value:function(){var e=this;if(this.select=this.querySelector("select"),!this.select)throw new Error("Simple color field requires a select element");this.options=[].slice.call(this.select.querySelectorAll("option")),this.select.classList.add("hidden"),this.options.forEach(function(t){var n=t.value,i="swatch";"none"===n&&(i+=" nocolor",n="transparent"),t.selected&&(i+=" active");var r=document.createElement("button");r.setAttribute("class",i),r.style.backgroundColor=n,r.setAttribute("type","button");var o="transparent"===n?e.textTransp:e.getColorName(n);r.innerHTML='<span class="sr-only">'+o+"</span>",e.buttons.push(r)});var t=document.createElement("button");t.setAttribute("class","btn-close"),t.setAttribute("type","button"),t.innerHTML=this.textClose,this.buttons.push(t);var n=this.select.value,i="";"none"===n&&(i+=" nocolor",n="transparent"),this.icon=document.createElement("button"),i&&this.icon.setAttribute("class",i);var r="simple-color-"+Math.random().toString(36).substr(2,10);this.icon.setAttribute("type","button"),this.icon.setAttribute("tabindex","0"),this.icon.style.backgroundColor=n,this.icon.innerHTML='<span class="sr-only">'+this.textSelect+"</span>",this.icon.id=r,this.select.insertAdjacentElement("beforebegin",this.icon),this.icon.addEventListener("click",this.show.bind(this)),this.panel=document.createElement("div"),this.panel.classList.add("simplecolors-panel"),this.panel.setAttribute("aria-labelledby",r),this.hide=this.hide.bind(this),this.colorSelect=this.colorSelect.bind(this),this.buttons.forEach(function(t){t.classList.contains("btn-close")?t.addEventListener("click",e.hide):t.addEventListener("click",e.colorSelect),e.panel.insertAdjacentElement("beforeend",t)}),this.appendChild(this.panel),this.focusableElements=[].slice.call(this.panel.querySelectorAll(this.focusableSelectors.join())),this.keys=this.keys.bind(this),this.hide=this.hide.bind(this),this.mousedown=this.mousedown.bind(this)}},{key:"disconnectedCallback",value:function(){}},{key:"show",value:function(){document.addEventListener("mousedown",this.hide),this.addEventListener("keydown",this.keys),this.panel.addEventListener("mousedown",this.mousedown),this.panel.setAttribute("data-open","");var e=this.panel.querySelector("button");e&&e.focus()}},{key:"hide",value:function(){document.removeEventListener("mousedown",this.hide,!1),this.removeEventListener("keydown",this.keys),this.panel.hasAttribute("data-open")&&this.panel.removeAttribute("data-open"),this.icon.focus()}},{key:"colorSelect",value:function(e){var t="",n="",i="";e.target.classList.contains("nocolor")?(t="none",n="transparent",i="nocolor"):(t=this.rgb2hex(e.target.style.backgroundColor),n=t),this.buttons.forEach(function(e){e.classList.contains("active")&&e.classList.remove("active")}),e.target.classList.add("active"),this.icon.classList.remove("nocolor"),this.icon.setAttribute("class",i),this.icon.style.backgroundColor=n,this.hide(),this.options.forEach(function(e){e.selected&&e.removeAttribute("selected"),e.value===n&&e.setAttribute("selected","")})}},{key:"keys",value:function(e){if(e.keyCode===n&&this.hide(),e.keyCode===t){var i=this.focusableElements.indexOf(document.activeElement);!e.shiftKey||0!==i&&-1!==i||(this.focusableElements[this.focusableElements.length-1].focus(),e.preventDefault()),e.shiftKey||i!==this.focusableElements.length-1||(this.focusableElements[0].focus(),e.preventDefault())}}},{key:"mousedown",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"getColorName",value:function(e){var t=e;if(4===e.length){var n=e.split("");t=n[0]+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]}for(var i in r)if(r.hasOwnProperty(i)&&t.toLowerCase()===r[i])return i;return this.textColor+" "+e.replace("#","").split("").join(", ")}},{key:"rgb2hex",value:function(e){var t=function(e){return("0"+parseInt(e,10).toString(16)).slice(-2)},n=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return"#"+t(n[1])+t(n[2])+t(n[3])}},{key:"textSelect",get:function(){return this.getAttribute("text-select")}},{key:"textColor",get:function(){return this.getAttribute("text-color")}},{key:"textClose",get:function(){return this.getAttribute("text-close")}},{key:"textTransp",get:function(){return this.getAttribute("text-transparent")}}],[{key:"observedAttributes",get:function(){return["text-select","text-color","text-close","text-transparent"]}}]),o}();e.define("joomla-field-simple-color",o)}(customElements)},{}]},{},[1]);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-field-simple-color.min.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-simple-color.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (e=>{const t={TAB:9,ESC:27},s={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};e.define("joomla-field-simple-color",class extends HTMLElement{constructor(){super(),this.select="",this.options=[],this.icon="",this.panel="",this.buttons=[],this.focusableElements=null,this.focusableSelectors=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])']}connectedCallback(){if(this.select=this.querySelector("select"),!this.select)throw new Error("Simple color field requires a select element");this.options=[].slice.call(this.select.querySelectorAll("option")),this.select.classList.add("hidden"),this.options.forEach(e=>{let t=e.value,s="swatch";"none"===t&&(s+=" nocolor",t="transparent"),e.selected&&(s+=" active");const i=document.createElement("button");i.setAttribute("class",s),i.style.backgroundColor=t,i.setAttribute("type","button");const a="transparent"===t?this.textTransp:this.getColorName(t);i.innerHTML=`<span class="sr-only">${a}</span>`,this.buttons.push(i)});const e=document.createElement("button");e.setAttribute("class","btn-close"),e.setAttribute("type","button"),e.innerHTML=this.textClose,this.buttons.push(e);let t=this.select.value,s="";"none"===t&&(s+=" nocolor",t="transparent"),this.icon=document.createElement("button"),s&&this.icon.setAttribute("class",s);const i=`simple-color-${Math.random().toString(36).substr(2,10)}`;this.icon.setAttribute("type","button"),this.icon.setAttribute("tabindex","0"),this.icon.style.backgroundColor=t,this.icon.innerHTML='<span class="sr-only">'+this.textSelect+"</span>",this.icon.id=i,this.select.insertAdjacentElement("beforebegin",this.icon),this.icon.addEventListener("click",this.show.bind(this)),this.panel=document.createElement("div"),this.panel.classList.add("simplecolors-panel"),this.panel.setAttribute("aria-labelledby",i),this.hide=this.hide.bind(this),this.colorSelect=this.colorSelect.bind(this),this.buttons.forEach(e=>{e.classList.contains("btn-close")?e.addEventListener("click",this.hide):e.addEventListener("click",this.colorSelect),this.panel.insertAdjacentElement("beforeend",e)}),this.appendChild(this.panel),this.focusableElements=[].slice.call(this.panel.querySelectorAll(this.focusableSelectors.join())),this.keys=this.keys.bind(this),this.hide=this.hide.bind(this),this.mousedown=this.mousedown.bind(this)}disconnectedCallback(){}static get observedAttributes(){return["text-select","text-color","text-close","text-transparent"]}get textSelect(){return this.getAttribute("text-select")}get textColor(){return this.getAttribute("text-color")}get textClose(){return this.getAttribute("text-close")}get textTransp(){return this.getAttribute("text-transparent")}show(){document.addEventListener("mousedown",this.hide),this.addEventListener("keydown",this.keys),this.panel.addEventListener("mousedown",this.mousedown),this.panel.setAttribute("data-open","");const e=this.panel.querySelector("button");e&&e.focus()}hide(){document.removeEventListener("mousedown",this.hide,!1),this.removeEventListener("keydown",this.keys),this.panel.hasAttribute("data-open")&&this.panel.removeAttribute("data-open"),this.icon.focus()}colorSelect(e){let t="",s="",i="";e.target.classList.contains("nocolor")?(t="none",s="transparent",i="nocolor"):(t=this.rgb2hex(e.target.style.backgroundColor),s=t),this.buttons.forEach(e=>{e.classList.contains("active")&&e.classList.remove("active")}),e.target.classList.add("active"),this.icon.classList.remove("nocolor"),this.icon.setAttribute("class",i),this.icon.style.backgroundColor=s,this.hide(),this.options.forEach(e=>{e.selected&&e.removeAttribute("selected"),e.value===s&&e.setAttribute("selected","")})}keys(e){if(e.keyCode===t.ESC&&this.hide(),e.keyCode===t.TAB){const t=this.focusableElements.indexOf(document.activeElement);!e.shiftKey||0!==t&&-1!==t||(this.focusableElements[this.focusableElements.length-1].focus(),e.preventDefault()),e.shiftKey||t!==this.focusableElements.length-1||(this.focusableElements[0].focus(),e.preventDefault())}}mousedown(e){e.stopPropagation(),e.preventDefault()}getColorName(e){let t=e;if(4===e.length){const s=e.split("");t=s[0]+s[1]+s[1]+s[2]+s[2]+s[3]+s[3]}for(const e in s)if(s.hasOwnProperty(e)&&t.toLowerCase()===s[e])return e;return this.textColor+" "+e.replace("#","").split("").join(", ")}rgb2hex(e){const t=e=>("0"+parseInt(e,10).toString(16)).slice(-2),s=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return"#"+t(s[1])+t(s[2])+t(s[3])}})})(customElements);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L94

Insecure DOM Manipulation (XSS) in joomla-field-user.js

CWE-79
File Location: media/system/webcomponents/js/joomla-field-user.js:94
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.modalBody.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in dialog.min.js

CWE-79
File Location: media/vendor/codemirror/addon/dialog/dialog.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function o(e,o,n){var t;return(t=e.getWrapperElement().appendChild(document.createElement("div"))).className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?t.innerHTML=o:t.appendChild(o),t}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),l=!1,c=this;function a(e){if("string"==typeof e)s.value=e;else{if(l)return;l=!0,u.parentNode.removeChild(u),c.focus(),r.onClose&&r.onClose(u)}}var f,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",function(e){r.onInput(e,s.value,a)}),r.onKeyUp&&e.on(s,"keyup",function(e){r.onKeyUp(e,s.value,a)}),e.on(s,"keydown",function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,a)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),a()),13==o.keyCode&&i(s.value,o))}),!1!==r.closeOnBlur&&e.on(s,"blur",a)):(f=u.getElementsByTagName("button")[0])&&(e.on(f,"click",function(){a(),c.focus()}),!1!==r.closeOnBlur&&e.on(f,"blur",a),f.focus()),a}),e.defineExtension("openConfirm",function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),l=u.getElementsByTagName("button"),c=!1,a=this,f=1;function s(){c||(c=!0,u.parentNode.removeChild(u),a.focus())}l[0].focus();for(var d=0;d<l.length;++d){var p=l[d];!function(o){e.on(p,"click",function(n){e.e_preventDefault(n),s(),o&&o(a)})}(i[d]),e.on(p,"blur",function(){--f,setTimeout(function(){f<=0&&s()},200)}),e.on(p,"focus",function(){++f})}}),e.defineExtension("openNotification",function(t,i){n(this,a);var r,u=o(this,t,i&&i.bottom),l=!1,c=i&&void 0!==i.duration?i.duration:5e3;function a(){l||(l=!0,clearTimeout(r),u.parentNode.removeChild(u))}return e.on(u,"click",function(o){e.e_preventDefault(o),a()}),c&&(r=setTimeout(a,c)),a})});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in lint.min.js

CWE-79
File Location: media/vendor/codemirror/addon/lint/lint.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e="CodeMirror-lint-markers";function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(e,o,r){var i=function(e,n){var o=document.createElement("div");function r(e){if(!o.parentNode)return t.off(document,"mousemove",r);o.style.top=Math.max(0,e.clientY-o.offsetHeight-5)+"px",o.style.left=e.clientX+5+"px"}return o.className="CodeMirror-lint-tooltip",o.appendChild(n.cloneNode(!0)),document.body.appendChild(o),t.on(document,"mousemove",r),r(e),null!=o.style.opacity&&(o.style.opacity=1),o}(e,o);function a(){var e;t.off(r,"mouseout",a),i&&((e=i).parentNode&&(null==e.style.opacity&&n(e),e.style.opacity=0,setTimeout(function(){n(e)},600)),i=null)}var s=setInterval(function(){if(i)for(var t=r;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}if(!i)return clearInterval(s)},400);t.on(r,"mouseout",a)}function r(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){!function(t,e){var n=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(n.className))return;for(var r=n.getBoundingClientRect(),i=(r.left+r.right)/2,a=(r.top+r.bottom)/2,l=t.findMarksAt(t.coordsChar({left:i,top:a},"client")),u=[],c=0;c<l.length;++c){var f=l[c].__annotation;f&&u.push(f)}u.length&&function(t,e){for(var n=e.target||e.srcElement,r=document.createDocumentFragment(),i=0;i<t.length;i++){var a=t[i];r.appendChild(s(a))}o(e,r,n)}(u,e)}(t,e)},this.waitingFor=0}function i(t){var n=t.state.lint;n.hasGutter&&t.clearGutter(e);for(var o=0;o<n.marked.length;++o)n.marked[o].clear();n.marked.length=0}function a(e,n,r,i){var a=document.createElement("div"),s=a;return a.className="CodeMirror-lint-marker-"+n,r&&((s=a.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker-multiple"),0!=i&&t.on(s,"mouseover",function(t){o(t,e,s)}),a}function s(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+e,void 0!==t.messageHTML?n.innerHTML=t.messageHTML:n.appendChild(document.createTextNode(t.message)),n}function l(e){var n=e.state.lint.options,o=n.options||n,r=n.getAnnotations||e.getHelper(t.Pos(0,0),"lint");if(r)if(n.async||r.async)!function(e,n,o){var r=e.state.lint,i=++r.waitingFor;function a(){i=-1,e.off("change",a)}e.on("change",a),n(e.getValue(),function(n,o){e.off("change",a),r.waitingFor==i&&(o&&n instanceof t&&(n=o),e.operation(function(){u(e,n)}))},o,e)}(e,r,o);else{var i=r(e.getValue(),o,e);if(!i)return;i.then?i.then(function(t){e.operation(function(){u(e,t)})}):e.operation(function(){u(e,i)})}}function u(t,n){i(t);for(var o,r=t.state.lint,l=r.options,u=function(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}(n),c=0;c<u.length;++c){var f=u[c];if(f){for(var m=null,d=r.hasGutter&&document.createDocumentFragment(),p=0;p<f.length;++p){var h=f[p],v=h.severity;v||(v="error"),m="error"==(o=m)?o:v,l.formatAnnotation&&(h=l.formatAnnotation(h)),r.hasGutter&&d.appendChild(s(h)),h.to&&r.marked.push(t.markText(h.from,h.to,{className:"CodeMirror-lint-mark-"+v,__annotation:h}))}r.hasGutter&&t.setGutterMarker(c,e,a(d,m,f.length>1,r.options.tooltips))}}l.onUpdateLinting&&l.onUpdateLinting(n,u,t)}function c(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){l(t)},e.options.delay||500))}t.defineOption("lint",!1,function(n,o,a){if(a&&a!=t.Init&&(i(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",c),t.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),o){for(var s=n.getOption("gutters"),u=!1,f=0;f<s.length;++f)s[f]==e&&(u=!0);var m=n.state.lint=new r(n,(d=o)instanceof Function?{getAnnotations:d}:(d&&!0!==d||(d={}),d),u);!1!==m.options.lintOnChange&&n.on("change",c),0!=m.options.tooltips&&"gutter"!=m.options.tooltips&&t.on(n.getWrapperElement(),"mouseover",m.onMouseOver),l(n)}var d}),t.defineExtension("performLint",function(){this.state.lint&&l(this)})});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L214

Insecure DOM Manipulation (XSS) in merge.js

CWE-79
File Location: media/vendor/codemirror/addon/merge/merge.js:214
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db&nbsp;&nbsp;\u21da";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in joomla-panels.js

CWE-79
File Location: media/vendor/joomla-custom-elements/js/joomla-panels.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- class JoomlaPanelsElement extends HTMLElement{static get observedAttributes(){return["recall","orientation","view","responsive","collapse-width"]}get recall(){return this.getAttribute("recall")}set recall(t){return this.setAttribute("recall",t)}get view(){return this.getAttribute("view")}set view(t){this.setAttribute("view",t)}get orientation(){return this.getAttribute("orientation")||"horizontal"}set orientation(t){this.setAttribute("orientation",t)}get responsive(){return this.getAttribute("responsive")}set responsive(t){this.setAttribute("responsive",t)}get collapseWidth(){return this.getAttribute("collapse-width")}set collapseWidth(t){this.setAttribute("collapse-width",t)}constructor(){super(),this.hasActive=!1,this.currentActive="",this.hasNested=!1,this.isNested=!1,this.tabs=[],this.tabsLinks=[],this.panels=[],this.tabLinkHash=[]}connectedCallback(){if((!this.orientation||this.orientation&&-1===["horizontal","vertical"].indexOf(this.orientation))&&this.setAttribute("orientation","horizontal"),this.view=this.getAttribute("view")||"tabs",this.recall=this.recall||"false",this.responsive=this.getAttribute("responsive")||"false",this.collapseWidth=this.getAttribute("collapseWidth")||0,this.panels=[].slice.call(this.querySelectorAll("section")),!this.panels.length)throw new Error("`Joomla-panels` require one ore more panels!");if(this.findAncestorByTagNme(this,"joomla-tab")&&(this.isNested=!0),this.querySelector("joomla-tab")&&(this.hasNested=!0),this.recall){const t=sessionStorage.getItem(this.getStorageKey());t&&!/@\[/.test(t)&&this.tabLinkHash.push(t),this.setTabState()}"ul"!==this.firstElementChild.tagName&&this.createNavigation(),this.panels.forEach(t=>{t.setAttribute("role","tabpanel"),this.tabs.push(`#tab-${t.id}`),t.hasAttribute("active")&&(this.hasActive=!0,this.currentActive=t.id,this.querySelector(`#tab-${t.id}`).setAttribute("aria-selected","true"),this.querySelector(`#tab-${t.id}`).setAttribute("active",""),this.querySelector(`#tab-${t.id}`).setAttribute("tabindex","0"))}),this.hasActive||(this.tabsLinks[0].setAttribute("active",""),this.hasActive=!0,this.currentActive=this.panels[0].id,this.tabsLinks[0].setAttribute("aria-selected","true"),this.tabsLinks[0].setAttribute("tabindex","0"),this.tabsLinks[0].setAttribute("active",""),this.panels[0].setAttribute("active","")),window.location.href.match(/#tab-/),"accordion"===this.view&&this.toAccordion.bind(this)(),"true"===this.responsive&&(this.changeView.bind(this),window.addEventListener("resize",this.changeView.bind(this)))}disconnectedCallback(){const t=this,e=this.querySelector("ul");[].slice.call(e.querySelectorAll("a")).forEach(e=>{e.removeEventListener("click",t.activateTabFromLink,!0)}),e.removeEventListener("keydown",t.keyBehaviour,!0)}createNavigation(){const t=this;let e="";"ul"!==this.firstElementChild.tagName.toLowerCase()&&(e=document.createElement("ul")),e.setAttribute("role","tablist"),this.panels.forEach(i=>{if(!i.id)throw new Error("`joomla-panels` All panels require an ID");if(i.parentNode!==this)return;const s=i.getAttribute("active")||!1,a=document.createElement("li"),r=document.createElement("a");a.setAttribute("role","presentation"),r.setAttribute("role","tab"),r.setAttribute("aria-controls",i.id),r.setAttribute("aria-selected",s?"true":"false"),r.setAttribute("tabindex",s?"0":"-1"),r.setAttribute("href",`#${i.id}`),r.setAttribute("id",`tab-${i.id}`),r.innerHTML=i.getAttribute("name"),s&&r.setAttribute("active",""),r.addEventListener("click",t.activateTabFromLink.bind(t)),this.tabsLinks.push(r),a.append(r),e.append(a),i.setAttribute("aria-labelledby",`tab-${i.id}`),s||i.setAttribute("aria-hidden","true")}),this.insertAdjacentElement("afterbegin",e),this.querySelector("ul").addEventListener("keydown",this.keyBehaviour.bind(this))}hideCurrent(){if(this.currentActive){const t=this.querySelector(`a[aria-controls="${this.currentActive}"]`);this.dispatchCustomEvent("joomla.tab.hide",t,this.querySelector(`#tab-${this.currentActive}`)),t.removeAttribute("active"),t.setAttribute("tabindex","-1"),this.querySelector(`#${this.currentActive}`).removeAttribute("active"),this.querySelector(`#${this.currentActive}`).setAttribute("aria-hidden","true"),t.removeAttribute("aria-selected"),this.dispatchCustomEvent("joomla.tab.hidden",t,this.querySelector(`#tab-${this.currentActive}`))}}activateTabFromLink(t){t.preventDefault();const e=this.currentActive;this.hasActive&&this.hideCurrent(),this.dispatchCustomEvent("joomla.tab.show",t.target,this.querySelector(`#tab-${e}`)),t.target.setAttribute("active",""),t.target.setAttribute("aria-selected","true"),t.target.setAttribute("tabindex","0"),this.querySelector(t.target.hash).setAttribute("active",""),this.querySelector(t.target.hash).removeAttribute("aria-hidden"),this.currentActive=t.target.hash.substring(1),this.dispatchCustomEvent("joomla.tab.shown",t.target,this.querySelector(`#tab-${e}`)),this.saveState(`#tab-${t.target.hash.substring(1)}`)}showTab(t){document.querySelector(`#tab-${t.id}`).click()}show(t){t.click()}keyBehaviour(t){const e=this.querySelector(`#tab-${this.currentActive}`),i=e.parentNode.previousElementSibling||e.parentNode.parentNode.lastElementChild,s=e.parentNode.nextElementSibling||e.parentNode.parentNode.firstElementChild;if(!t.metaKey&&!t.altKey&&-1!==this.tabs.indexOf(`#${document.activeElement.id}`))switch(t.keyCode){case 37:case 38:t.preventDefault(),t.stopPropagation(),i.querySelector("a").click(),i.querySelector("a").focus();break;case 39:case 40:t.preventDefault(),t.stopPropagation(),s.querySelector("a").click(),s.querySelector("a").focus()}}getStorageKey(){return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/,"").split("#")[0]}saveState(t){const e=this.getStorageKey();sessionStorage.setItem(e,t)}setTabState(){const t=this,e=this.tabsLinks;if(this.hasNested){if(this.tabLinkHash.length&&""!==this.tabLinkHash[0]){const t=this.tabLinkHash[0].substring(5),e=this.querySelector(`${t}`);if(e){const t=this.findAncestorByTagNme(e,"joomla-tab");if(this.findAncestorByTagNme(t,"joomla-tab")){const e=this.findAncestorByTagNme(t,"section");e&&this.tabLinkHash.push(`#tab-${e.id}`)}}}e.forEach(e=>{if(this.tabLinkHash.length){const t=`#tab-${e.id}`;-1===this.tabLinkHash.indexOf(t)?e.removeAttribute("active"):e.setAttribute("active","")}e.parentNode===t&&this.tabsLinks.push(e)})}else e.forEach(t=>{if(this.tabLinkHash.length){const e=`#tab-${t.hash}`;this.tabLinkHash.indexOf(e)>-1?t.removeAttribute("active"):t.setAttribute("active","")}}),this.tabsLinks=e}toTabs(){const t=this;for(let t=0,e=this.panels.length;t<e;++t)this.panels[t].parentNode.parentNode.parentNode===this&&this.tabsLinks.push(this.panels[t]);this.tabsLinks.length&&this.tabsLinks.forEach(e=>{t.appendChild(e)})}toAccordion(){const t=this;this.panels.length&&this.panels.forEach(e=>{t.querySelector('a[aria-controls="'+e.id+'"]').parentNode.appendChild(e)})}changeView(){if(window.outerWidth>920){if("tabs"===this.view)return;this.toTabs.bind(this),this.view="tabs"}else{if("accordion"===this.view)return;this.toAccordion.bind(this),this.view="accordion"}}activateUriHash(){const t=window.location.href.match(/#\S[^&]*/),e=this.querySelector(t[0]);if(e){const t=this.findAncestorByTagNme(e,"joomla-tab"),i=this.findAncestorByTagNme(t,"joomla-tab");if(i){const s=this.findAncestorByTagNme(t,"section");i.showTab(s),this.show(e)}else this.showTab(e)}}findAncestorByTagNme(t,e){for(;(t=t.parentElement)&&t.nodeName.toLowerCase()!==e;);return t}dispatchCustomEvent(t,e,i){const s=new CustomEvent(t,{bubbles:!0,cancelable:!0});i&&(s.relatedTarget=i),e.dispatchEvent(s),e.removeEventListener(t,e)}}customElements.define("joomla-panels",JoomlaPanelsElement);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1492

Insecure DOM Manipulation (XSS) in jquery.ui.core.js

CWE-79
File Location: media/vendor/jquery-ui/js/jquery.ui.core.js:1492
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- testElement.innerHTML = "";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L9795

Insecure DOM Manipulation (XSS) in jquery.js

CWE-79
File Location: media/vendor/jquery/js/jquery.js:9795
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- body.innerHTML = "<form></form><form></form>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1219

Insecure DOM Manipulation (XSS) in mediaelement-and-player.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement-and-player.js:1219
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- fullscreenBtn.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + fullscreenTitle + '" aria-label="' + fullscreenTitle + '" tabindex="0"></button>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L3729

Insecure DOM Manipulation (XSS) in mediaelement.js

CWE-79
File Location: media/vendor/mediaelement/js/mediaelement.js:3729
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: media/vendor/tinymce/plugins/paste/plugin.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||(void 0!==window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},r=function(e,t){return{clipboard:e,quirks:t}},i=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},o=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},a=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},s=function(e,t){return e.fire("paste",{ieFake:t})},l={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},u=function(e,t,n){"text"===t.pasteFormat?(t.pasteFormat="html",a(e,!1)):(t.pasteFormat="text",a(e,!0),function(e,t){return!1===t.get()&&l.shouldPlainTextInform(e)}(e,n)&&(function(e,t){e.notificationManager.open({text:e.translate(t),type:"info"})}(e,"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),n.set(!0))),e.focus()},c=function(e,t,n){e.addCommand("mceTogglePlainTextPaste",function(){u(e,t,n)}),e.addCommand("mceInsertClipboardContent",function(e,n){n.content&&t.pasteHtml(n.content,n.internal),n.text&&t.pasteText(n.text)})},f=tinymce.util.Tools.resolve("tinymce.Env"),d=tinymce.util.Tools.resolve("tinymce.util.Delay"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=tinymce.util.Tools.resolve("tinymce.util.VK"),g="\x3c!-- x-tinymce/html --\x3e",v={mark:function(e){return g+e},unmark:function(e){return e.replace(g,"")},isMarked:function(e){return-1!==e.indexOf(g)},internalHtmlMime:function(){return"x-tinymce/html"}},h=tinymce.util.Tools.resolve("tinymce.html.Entities"),y=function(e){return e.replace(/\r?\n/g,"<br>")},b=function(e,t,n){var r=e.split(/\n\n/),i=function(e,t){var n,r=[],i="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+h.encodeAllRaw(t[n])+'"');r.length&&(i+=" "+r.join(" "))}return i+">"}(t,n),o="</"+t+">",a=m.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===a.length?a[0]:m.map(a,function(e){return i+e+o}).join("")},x={isPlainText:function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},convert:function(e,t,n){return t?b(e,t,n):y(e)},toBRs:y,toBlockElements:b},P=tinymce.util.Tools.resolve("tinymce.html.DomParser"),w=tinymce.util.Tools.resolve("tinymce.html.Node"),T=tinymce.util.Tools.resolve("tinymce.html.Schema"),C=tinymce.util.Tools.resolve("tinymce.html.Serializer");function _(e,t){return m.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var D={filter:_,innerText:function(e){var t=T(),n=P({},t),r="",i=t.getShortEndedElements(),o=m.makeMap("script noscript style textarea video audio iframe object"," "),a=t.getBlockElements();return e=_(e,[/<!\[[^\]]+\]>/g]),function e(t){var n=t.name,s=t;if("br"!==n)if(i[n]&&(r+=" "),o[n])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))do{e(t)}while(t=t.next);a[n]&&s.next&&(r+="\n","p"===n&&(r+="\n"))}else r+="\n"}(n.parse(e)),r},trimHtml:function(e){return e=_(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?" ":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function k(e){var t,n;return n=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),m.each(n,function(n){if(n.test(e))return t=!0,!1}),t}function R(e){var t,n,r=1;function i(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)do{t+=i(e)}while(e=e.next);return t}function o(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!o(e,t))return!1}while(e=e.next);return!0}function a(e,i,a){var s=e._listLevel||r;s!==r&&(s<r?t&&(t=t.parent.parent):(n=t,t=null)),t&&t.name===i?t.append(e):(n=n||t,t=new w(i,1),a>1&&t.attr("start",""+a),e.wrap(t)),e.name="li",s>r&&n&&n.lastChild.append(t),r=s,function e(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)do{e(t)}while(t=t.next)}(e),o(e,/^\u00a0+/),o(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),o(e,/^\u00a0+/)}for(var s=[],l=e.firstChild;void 0!==l&&null!==l;)if(s.push(l),null!==(l=l.walk()))for(;void 0!==l&&l.parent!==e;)l=l.walk();for(var u=0;u<s.length;u++)if("p"===(e=s[u]).name&&e.firstChild){var c=i(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){a(e,"ul");continue}if(k(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),a(e,"ol",d);continue}if(e._listLevel){a(e,"ul",1);continue}t=null}else n=t,t=null}function E(e,t,n,r){var i,o={},a=e.dom.parseStyle(r);return m.each(a,function(a,s){switch(s){case"mso-list":(i=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(i[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":s="text-align";break;case"vert-align":s="vertical-align";break;case"font-color":case"mso-foreground":s="color";break;case"mso-background":case"mso-highlight":s="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(o[s]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==s.indexOf("mso-comment")?0!==s.indexOf("mso-")&&("all"===l.getRetainStyleProps(e)||t&&t[s])&&(o[s]=a):n.remove()}),/(bold)/i.test(o["font-weight"])&&(delete o["font-weight"],n.wrap(new w("b",1))),/(italic)/i.test(o["font-style"])&&(delete o["font-style"],n.wrap(new w("i",1))),(o=e.dom.serializeStyle(o,n.name))||null}var M={preProcess:function(e,t){return l.shouldUseDefaultFilters(e)?function(e,t){var n,r;(n=l.getRetainStyleProps(e))&&(r=m.makeMap(n.split(/[, ]/))),t=D.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi," "],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join(" "):""}]]);var i=l.getWordValidElements(e),o=T({valid_elements:i,valid_children:"-li[p]"});m.each(o.elements,function(e){e.attributes.class||(e.attributes.class={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var a=P({},o);a.addAttributeFilter("style",function(t){for(var n,i=t.length;i--;)(n=t[i]).attr("style",E(e,r,n,n.attr("style"))),"span"===n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),a.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),a.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),a.addNodeFilter("a",function(e){for(var t,n,r,i=e.length;i--;)if(n=(t=e[i]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=a.parse(t);return l.shouldConvertWordFakeLists(e)&&R(s),t=C({validate:e.settings.validate},o).serialize(s)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},S=function(e,t){return{content:e,cancelled:t}},F=function(e,t,n,r){var a=i(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!a.isDefaultPrevented()?function(e,t,n,r){var i=e.dom.create("div",{style:"display:none"},t),a=o(e,i,n,r);return S(a.node.innerHTML,a.isDefaultPrevented())}(e,a.content,n,r):S(a.content,a.isDefaultPrevented())},I=function(e,t,n){var r=M.isWordContent(t),i=r?M.preProcess(e,t):t;return F(e,i,n,r)},A=function(e,t){return e.insertContent(t,{merge:l.shouldMergeFormats(e),paste:!0}),!0},B=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},O=function(e){return B(e)&&/.(gif|jpe?g|png)$/.test(e)},H=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!B(t))&&function(e,t,n){return e.undoManager.extra(function(){n(e,t)},function(){e.execCommand("mceInsertLink",!1,t)}),!0}(e,t,n)},N=function(e,t,n){return!!O(t)&&function(e,t,n){return e.undoManager.extra(function(){n(e,t)},function(){e.insertContent('<img src="'+t+'">')}),!0}(e,t,n)},L=function(e,t){!1===l.isSmartPasteEnabled(e)?A(e,t):function(e,t){m.each([H,N,A],function(n){return!0!==n(e,t,A)})}(e,t)},$=function(e,t,n){var r=n||v.isMarked(t),i=I(e,v.unmark(t),r);!1===i.cancelled&&L(e,i.content)},W=function(e,t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),t=x.convert(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),$(e,t,!1)},j=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var i=e.types[r];try{t[i]=e.getData(i)}catch(e){t[i]=""}}}return t},V=function(e,t){return t in e&&e[t].length>0},z=function(e){return V(e,"text/html")||V(e,"text/plain")},K=function(e,t,n,r){var i=D.createIdGenerator("mceclip");t&&(e.selection.setRng(t),t=null);var o,a,s,l,u=n.result,c=-1!==(a=(o=u).indexOf(","))?o.substr(a+1):null,f=i(),d=e.settings.images_reuse_filename&&r.name?function(e,t){var n=t.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?e.dom.encode(n[1]):null}(e,r.name):f,m=new Image;if(m.src=u,s=e.settings,l=m,!s.images_dataimg_filter||s.images_dataimg_filter(l)){var p,g=e.editorUpload.blobCache,v=void 0;(p=g.findFirst(function(e){return e.base64()===c}))?v=p:(v=g.create(f,r,c,d),g.add(v)),$(e,'<img src="'+v.blobUri()+'">',!1)}else $(e,'<img src="'+u+'">',!1)},U=function(e,t,n){var r="paste"===t.type?t.clipboardData:t.dataTransfer;function i(r){var i,o,a,s=!1;if(r)for(i=0;i<r.length;i++)if(o=r[i],/^image\/(jpeg|png|gif|bmp)$/.test(o.type)){var l=o.getAsFile?o.getAsFile():o;(a=new window.FileReader).onload=K.bind(null,e,n,a,l),a.readAsDataURL(l),t.preventDefault(),s=!0}return s}if(e.settings.paste_data_images&&r)return i(r.items)||i(r.files)},G=function(e){return p.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},X=function(e,t,n){var r,i=0;function o(n,r,i,o){var a,s;V(n,"text/html")?a=n["text/html"]:(a=t.getHtml(),o=o||v.isMarked(a),t.isDefaultContent(a)&&(i=!0)),a=D.trimHtml(a),t.remove(),s=!1===o&&x.isPlainText(a),a.length&&!s||(i=!0),i&&(a=V(n,"text/plain")&&s?n["text/plain"]:D.innerText(a)),t.isDefaultContent(a)?r||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):i?W(e,a):$(e,a,o)}e.on("keydown",function(n){function o(e){G(e)&&!e.isDefaultPrevented()&&t.remove()}if(G(n)&&!n.isDefaultPrevented()){if((r=n.shiftKey&&86===n.keyCode)&&f.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(n.stopImmediatePropagation(),i=(new Date).getTime(),f.ie&&r)return n.preventDefault(),void s(e,!0);t.remove(),t.create(),e.once("keyup",o),e.once("paste",function(){e.off("keyup",o)})}}),e.on("paste",function(a){var s=(new Date).getTime(),l=function(e,t){var n=j(t.clipboardData||e.getDoc().dataTransfer);return D.isMsEdge()?m.extend(n,{"text/html":""}):n}(e,a),u=(new Date).getTime()-s,c=(new Date).getTime()-i-u<1e3,p="text"===n||r,g=V(l,v.internalHtmlMime());r=!1,a.isDefaultPrevented()||function(e){var t=e.clipboardData;return-1!==navigator.userAgent.indexOf("Android")&&t&&t.items&&0===t.items.length}(a)?t.remove():z(l)||!U(e,a,t.getLastRng()||e.selection.getRng())?(c||a.preventDefault(),!f.ie||c&&!a.ieFake||V(l,"text/html")||(t.create(),e.dom.bind(t.getEl(),"paste",function(e){e.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),l["text/html"]=t.getHtml()),V(l,"text/html")?(a.preventDefault(),g||(g=v.isMarked(l["text/html"])),o(l,c,p,g)):d.setEditorTimeout(e,function(){o(l,c,p,g)},0)):t.remove()})},q=function(e){return e.dom.get("mcepastebin")},Y=function(e,t){return t===e},Z=function(t){var n=e(null);return{create:function(){return function(e,t,n){var r,i,o=e.dom,a=e.getBody(),s=e.dom.getViewPort(e.getWin()).y,l=20;t.set(e.selection.getRng());var u=t.get();if(e.inline&&(i=e.selection.getScrollContainer())&&i.scrollTop>0&&(s=i.scrollTop),u.getClientRects){var c=function(e){var t,n,r,i=e.startContainer;if((t=e.getClientRects()).length)return t[0];if(e.collapsed&&1===i.nodeType){for(r=i.childNodes[u.startOffset];r&&3===r.nodeType&&!r.data.length;)r=r.nextSibling;if(r)return"BR"===r.tagName&&(n=o.doc.createTextNode("\ufeff"),r.parentNode.insertBefore(n,r),(e=o.createRng()).setStartBefore(n),e.setEndAfter(n),t=e.getClientRects(),o.remove(n)),t.length?t[0]:void 0}}(u);if(c)l=s+(c.top-o.getPos(a).y);else{l=s;var d=u.startContainer;d&&(3===d.nodeType&&d.parentNode!==a&&(d=d.parentNode),1===d.nodeType&&(l=o.getPos(d,i||a).y))}}r=e.dom.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(f.ie||f.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(a,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),r.focus(),e.selection.select(r,!0)}(t,n,"%MCEPASTEBIN%")},remove:function(){return function(e,t){if(q(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(t,n)},getEl:function(){return q(t)},getHtml:function(){return function(e){var t,n,r,i,o,a=function(t,n){t.appendChild(n),e.dom.remove(n,!0)};for(n=m.grep(e.getBody().childNodes,function(e){return"mcepastebin"===e.id}),t=n.shift(),m.each(n,function(e){a(t,e)}),r=(i=e.dom.select("div[id=mcepastebin]",t)).length-1;r>=0;r--)o=e.dom.create("div"),t.insertBefore(o,i[r]),a(o,i[r]);return t?t.innerHTML:""}(t)},getLastRng:function(){return function(e){return e.get()}(n)},isDefault:function(){return function(e,t){var n,r=q(e);return(n=r)&&"mcepastebin"===n.id&&Y(t,r.innerHTML)}(t,"%MCEPASTEBIN%")},isDefaultContent:function(e){return Y("%MCEPASTEBIN%",e)}}},J=function(e){var t=Z(e),n=l.isPasteAsTextEnabled(e)?"text":"html";return e.on("preInit",function(){return function(e,t,n){var r;X(e,t,n),e.parser.addNodeFilter("img",function(t,n,i){var o=function(e){e.attr("data-mce-object")||r===f.transparentSrc||e.remove()},a=function(e){return 0===e.indexOf("webkit-fake-url")},s=function(e){return 0===e.indexOf("data:")};if(!e.settings.paste_data_images&&function(e){return e.data&&!0===e.data.paste}(i))for(var l=t.length;l--;)(r=t[l].attributes.map.src)&&(a(r)?o(t[l]):!e.settings.allow_html_data_urls&&s(r)&&o(t[l]))})}(e,t,n)}),{pasteFormat:n,pasteHtml:function(t,n){return $(e,t,n)},pasteText:function(t){return W(e,t)},pasteImageData:function(t,n){return U(e,t,n)},getDataTransferItems:j,hasHtmlOrText:z,hasContentType:V}},Q=function(){},ee=function(e,t,n){if(!function(e){return!1===f.iOS&&void 0!==e&&"function"==typeof e.setData&&!0!==D.isMsEdge()}(e))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(v.internalHtmlMime(),t),!0}catch(e){return!1}},te=function(e,t,n,r){ee(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},ne=function(e){return function(t,n){var r=v.mark(t),i=e.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=e.dom.create("div",{contenteditable:"true"},r);e.dom.setStyles(i,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),i.appendChild(o),e.dom.add(e.getBody(),i);var a=e.selection.getRng();o.focus();var s=e.dom.createRng();s.selectNodeContents(o),e.selection.setRng(s),setTimeout(function(){e.selection.setRng(a),i.parentNode.removeChild(i),n()},0)}},re=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},ie=function(e){e.on("cut",function(e){return function(t){!1===e.selection.isCollapsed()&&te(t,re(e),ne(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})}}(e)),e.on("copy",function(e){return function(t){!1===e.selection.isCollapsed()&&te(t,re(e),ne(e),Q)}}(e))},oe=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ae=function(e,t){return oe.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},se=function(e,t){e.focus(),e.selection.setRng(t)},le=function(e,t,n){l.shouldBlockDrop(e)&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),l.shouldPasteDataImages(e)||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.on("drop",function(r){var i,o;if(o=ae(e,r),!r.isDefaultPrevented()&&!n.get()){i=t.getDataTransferItems(r.dataTransfer);var a,s=t.hasContentType(i,v.internalHtmlMime());if((t.hasHtmlOrText(i)&&(!(a=i["text/plain"])||0!==a.indexOf("file://"))||!t.pasteImageData(r,o))&&o&&l.shouldFilterDrop(e)){var u=i["mce-internal"]||i["text/html"]||i["text/plain"];u&&(r.preventDefault(),d.setEditorTimeout(e,function(){e.undoManager.transact(function(){i["mce-internal"]&&e.execCommand("Delete"),se(e,o),u=D.trimHtml(u),i["text/html"]?t.pasteHtml(u,s):t.pasteText(u)})}))}}}),e.on("dragstart",function(e){n.set(!0)}),e.on("dragover dragend",function(t){l.shouldPasteDataImages(e)&&!1===n.get()&&(t.preventDefault(),se(e,ae(e,t))),"dragend"===t.type&&n.set(!1)})},ue=function(e){var t=e.plugins.paste,n=l.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=l.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function ce(e,t){e.on("PastePreProcess",function(n){n.content=t(e,n.content,n.internal,n.wordContent)})}function fe(e,t){if(!M.isWordContent(t))return t;var n=[];m.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return t=D.filter(t,[[r,"$1"]]),t=D.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function de(e,t,n,r){if(r||n)return t;var i,o=l.getWebkitStyles(e);if(!1===l.shouldRemoveWebKitStyles(e)||"all"===o)return t;if(o&&(i=o.split(/[, ]/)),i){var a=e.dom,s=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var o=a.parseStyle(a.decode(n),"span"),l={};if("none"===i)return t+r;for(var u=0;u<i.length;u++){var c=o[i[u]],f=a.getStyle(s,i[u],!0);/color/.test(i[u])&&(c=a.toHex(c),f=a.toHex(f)),f!==c&&(l[i[u]]=c)}return(l=a.serializeStyle(l,"span"))?t+' style="'+l+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function me(e,t){e.$("a",t).find("font,u").each(function(t,n){e.dom.remove(n,!0)})}var pe=function(e){f.webkit&&ce(e,de),f.ie&&(ce(e,fe),function(e,t){e.on("PastePostProcess",function(n){t(e,n.node)})}(e,me))},ge=function(e){return function(){return e}},ve=function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var i=t.concat(n);return e.apply(null,i)}},he=(ge(!1),ge(!0),function(e,t){var n=ve((ge(!1),ge(!0),function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat),e.on("PastePlainTextToggle",function(e){r.active(e.state)})}),e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})}),ye=e(!1);t.add("paste",function(t){if(!1===n(t)){var i=J(t),o=pe(t),a=e(!1);return he(t,i),c(t,i,ye),ue(t),ie(t),le(t,i,a),r(i,o)}})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2362

Insecure DOM Manipulation (XSS) in plugin.js

CWE-79
File Location: media/vendor/tinymce/plugins/table/plugin.js:2362
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L217

Insecure DOM Manipulation (XSS) in plugin.js

CWE-79
File Location: media/vendor/tinymce/plugins/template/plugin.js:217
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- n.innerHTML = $_fmug07pzjdud7d7z.getDateTime(editor, $_6gyjmapxjdud7d7x.getCdateFormat(editor));
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1235

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/mobile/theme.js:1235
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L9847

Insecure DOM Manipulation (XSS) in theme.js

CWE-79
File Location: media/vendor/tinymce/themes/modern/theme.js:9847
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- self.getEl().innerHTML = createOptions(e.value);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L20479

Insecure DOM Manipulation (XSS) in tinymce.js

CWE-79
File Location: media/vendor/tinymce/tinymce.js:20479
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- resizeHelper.innerHTML = width + ' &times; ' + height;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L93

Insecure DOM Manipulation (XSS) in webcomponents-sd-ce-pf.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-sd-ce-pf.js:93
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- a=M.children(this);a.item=function(b){return a[b]};return a},configurable:!0},innerHTML:{get:function(){return ub(this)?qc("template"===this.localName?this.content:this):M.innerHTML(this)},set:function(a){var b="template"===this.localName?this.content:this;wc(b);var c=this.localName;c&&"template"!==c||(c="div");c=yc.createElement(c);for(xc?J.Ca.innerHTML.set.call(c,a):c.innerHTML=a;c.firstChild;)b.appendChild(c.firstChild)},configurable:!0}},Jc={shadowRoot:{get:function(){var a=A(this);return a&&
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L35

Insecure DOM Manipulation (XSS) in webcomponents-sd.js

CWE-79
File Location: media/vendor/webcomponentsjs/js/webcomponents-sd.js:35
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- E.innerHTML=function(a){return G.innerHTML.get.call(a)};E.textContent=function(a){return G.textContent.get.call(a)};E.children=function(a){switch(a.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:a=kb.children.get.call(a);break;case Node.DOCUMENT_NODE:a=lb.children.get.call(a);break;default:a=G.children.get.call(a)}return Array.prototype.slice.call(a)};
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1492

Insecure DOM Manipulation (XSS) in jquery.ui.core.js

CWE-79
File Location: build/media/vendor/jquery-ui/js/jquery.ui.core.js:1492
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- testElement.innerHTML = "";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L188

Insecure DOM Manipulation (XSS) in field-media.js

CWE-79
File Location: build/media/webcomponents/js/field-media/field-media.js:188
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L112

Insecure DOM Manipulation (XSS) in field-permissions.js

CWE-79
File Location: build/media/webcomponents/js/field-permissions/field-permissions.js:112
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- badgeSpan.innerHTML = response.data.text;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L82

Insecure DOM Manipulation (XSS) in indexer.js

CWE-79
File Location: media/com_finder/js/indexer.js:82
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- progressMessage.innerHTML = json.message;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L87

Insecure DOM Manipulation (XSS) in admin-module-edit.js

CWE-79
File Location: media/com_modules/js/admin-module-edit.js:87
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpStatus.innerHTML = '<span class=\"badge badge-danger\">' + Joomla.JText._('JNO') + '</span>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in helpsite.min.js

CWE-79
File Location: media/legacy/js/helpsite.min.js:1
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- "use strict";var resetHelpSiteList=function(){var e=this.getAttribute("rel"),t=this.getAttribute("showDefault");Joomla.request({url:"index.php?option=com_users&task=profile.gethelpsites&format=json",method:"GET",data:"",perform:!0,headers:{"Content-Type":"application/json;charset=utf-8"},onSuccess:function(n,o){var r;n=JSON.parse(n),document.getElementById(e).innerHTML="",n.data.forEach(function(n){""===n.value&&"true"!==t||((r=document.createElement("option")).value=n.value,r.innerHTML=n.text,document.getElementById(e).appendChild(r))})},onError:function(e){Joomla.removeMessages(),Joomla.renderMessages(Joomla.ajaxErrorsMessages(e))}})};document.addEventListener("DOMContentLoaded",function(){document.getElementById("helpsite-refresh").addEventListener("click",resetHelpSiteList)});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L71

Insecure DOM Manipulation (XSS) in html5.js

CWE-79
File Location: media/legacy/js/html5.js:71
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- p.innerHTML = 'x<style>' + cssText + '</style>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L112

Insecure DOM Manipulation (XSS) in client.es6.js

CWE-79
File Location: media/plg_installer_webinstaller/js/client.es6.js:112
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- jedContainer.innerHTML = response.data.html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L353

Insecure DOM Manipulation (XSS) in client.js

CWE-79
File Location: media/plg_installer_webinstaller/js/client.js:353
Security Score:
72 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- uploadUrlContainer.innerHTML = installUrl;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output