From 80bd7d7509fd829132cd83dcb05808639bd88aff Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 28 Jun 2023 10:27:42 +0200 Subject: [PATCH] DEV: Update diffhtml from 1.0.0-beta.20 to 1.0.0-beta.29 (#22311) It was already up to date in package.json but wasn't plugged in. --- app/assets/javascripts/discourse/app/lib/public-js-versions.js | 2 +- public/javascripts/diffhtml/1.0.0-beta.20/diffhtml.min.js | 1 - public/javascripts/diffhtml/1.0.0-beta.29/diffhtml.min.js | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 public/javascripts/diffhtml/1.0.0-beta.20/diffhtml.min.js create mode 100644 public/javascripts/diffhtml/1.0.0-beta.29/diffhtml.min.js diff --git a/app/assets/javascripts/discourse/app/lib/public-js-versions.js b/app/assets/javascripts/discourse/app/lib/public-js-versions.js index e76928e6b10..b92c9da219b 100644 --- a/app/assets/javascripts/discourse/app/lib/public-js-versions.js +++ b/app/assets/javascripts/discourse/app/lib/public-js-versions.js @@ -7,7 +7,7 @@ export const PUBLIC_JS_VERSIONS = { "chart.min.js": "chart.js/3.5.1/chart.min.js", "chartjs-plugin-datalabels.min.js": "chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js", - "diffhtml.min.js": "diffhtml/1.0.0-beta.20/diffhtml.min.js", + "diffhtml.min.js": "diffhtml/1.0.0-beta.29/diffhtml.min.js", "jquery.magnific-popup.min.js": "magnific-popup/1.1.0/jquery.magnific-popup.min.js", "pikaday.js": "pikaday/1.8.2/pikaday.js", diff --git a/public/javascripts/diffhtml/1.0.0-beta.20/diffhtml.min.js b/public/javascripts/diffhtml/1.0.0-beta.20/diffhtml.min.js deleted file mode 100644 index d81e24a0881..00000000000 --- a/public/javascripts/diffhtml/1.0.0-beta.20/diffhtml.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.diff={}))}(this,function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e){for(var r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:typeof t,n=arguments.length>3?arguments[3]:void 0;if(n&&e in n)return n[e];var a="DIFF_".concat(e.replace(/[^a-zA-Z0-9]/,"")).toLowerCase();if(fe){var o=new de(ce.search);if(o.has(a))return h(decodeURIComponent(String(o.get(a))),r)}return he&&a in ae.env?h(ae.env[a],r):t}function v(e,t,n){var a=null;if(Se.protected.has(e)||Se.allocated.has(e))a=e;else if(!e||we(e)){var o=e?e.length:0;n=[];for(var i=0;i3?O-3:0),x=3;x2&&void 0!==arguments[2]?arguments[2]:{};r.parser||(r.parser={}),t||(t=Ae);var n=new Set(p("rawElements",Le,"array",r.parser)),a=new Set(p("selfClosingElements",Ie,"array",r.parser)),o=/)-->|<(\/?)([a-z\-\_][a-z0-9\-\_]*)\s*([^>]*?)(\/?)>/gi,i=v("#document-fragment",null,[]),s=[i],c=i,d=-1;if(!e.includes("<")&&e)return Ve(c,e,t),i;for(var l,u,f=0;l=o.exec(e);f++){d>-1&&d+l[0].length0){var m=e.slice(0,h);m&&!Me.exec(m)&&Ve(c,m,t)}if(d=o.lastIndex,"!"!==l[0][1]){var g=xe.exec(l[2]),N=g&&t.tags[g[1]],b=N?N.name||N:l[2];if(!l[1]&&(!l[4]&&De[c.rawNodeName]&&De[c.rawNodeName][b]&&(s.pop(),c=s[s.length-1]),c=c.childNodes[c.childNodes.push(Pe(l[2],l[3],t))-1],s.push(c),r.parser.strict||n.has(b))){var y=""),T=e.indexOf(y,o.lastIndex);if(n.has(b)){-1===T?d=o.lastIndex=e.length+1:(d=T+y.length,o.lastIndex=d,l[1]=" ");var E=e.slice(l.index+l[0].length,T);Ve(c,E,t)}}if(l[1]||l[4]||a.has(b))for(;c;){if("/"===l[4]&&g){s.pop(),c=s[s.length-1];break}if(N&&c.rawNodeName===b){s.pop(),c=s[s.length-1];break}if(c.rawNodeName===b){s.pop(),c=s[s.length-1];break}var w=je[c.rawNodeName];{if(!w||!w[b])break;s.pop(),c=s[s.length-1]}}}}var S=e.slice(-1===d?0:d);if(S&&Ve(c,S,t),i.childNodes.length&&"html"===i.childNodes[0].nodeName){var k={before:[],after:[]},R={after:[]},O=i.childNodes[0],M=!0,x=!0;if(O.childNodes=O.childNodes.filter(function(e){if("body"===e.nodeName||"head"===e.nodeName)return"head"===e.nodeName&&(M=!1),"body"===e.nodeName&&(x=!1),!0;e.nodeType===G.ELEMENT&&(M&&x?k.before.push(e):!M&&x?k.after.push(e):x||R.after.push(e))}),O.childNodes[0]&&"head"===O.childNodes[0].nodeName){var A=O.childNodes[0].childNodes;A.unshift.apply(A,k.before),A.push.apply(A,k.after)}else{var C=v("head",null,[]);if(C){var _=C.childNodes;_.unshift.apply(_,k.before),_.push.apply(_,k.after),O.childNodes.unshift(C)}}if(O.childNodes[1]&&"body"===O.childNodes[1].nodeName){var L=O.childNodes[1].childNodes;L.push.apply(L,R.after)}else{var I=v("body",null,[]);if(I){var D=I.childNodes;D.push.apply(D,R.after),O.childNodes.push(I)}}}return i}function g(e){if(He(e),e.childNodes.length)for(var t=0;t1&&(e.newTree=v(u.childNodes))}e.newTree||(e.newTree=v(n)),e.oldTree=t.oldTree;var h=e.oldTree,p=e.newTree;if(o&&h&&p){var m="string"!=typeof p.rawNodeName,N=p.nodeType===G.FRAGMENT,b=N&&!m?p.childNodes:p;e.newTree=v(d,l,b)}}function k(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];e||(e=X.OBJ),t||(t=X.OBJ);var o=n.svgElements,i=void 0===o?new Set:o,s=e.nodeName,c=t.nodeName,d=e===X.OBJ||a,l="svg"===c||i.has(t),u=null;if(te.size&&te.forEach(function(n){var a=n(e,t);a&&a===e?u=r:!1===a?u=!1:a&&(t=a)}),null!==u||!t)return u;if(c===Ze){if(s===Ze&&e.nodeValue!==t.nodeValue)return r.push(Y.NODE_VALUE,e,t.nodeValue,e.nodeValue),e.nodeValue=t.nodeValue,r;if(d)return r.push(Y.NODE_VALUE,t,t.nodeValue,null),r}var f=t.childNodes||[];if(t.nodeType===G.ELEMENT){var h=d?X.OBJ:e.attributes,p=t.attributes||{};for(var v in p){var m=p[v];v in h&&h[v]===p[v]||(d||(h[v]=m),(e&&"script"===e.nodeName||"script"!==t.nodeName||"type"!==v)&&r.push(Y.SET_ATTRIBUTE,d?t:e,v,m))}if(!d)for(var g in h)g in p||(r.push(Y.REMOVE_ATTRIBUTE,e,g),delete h[g])}if(a){for(var N=0;NA&&M.splice(F,1),r.push(Y.REPLACE_CHILD,_,C)}}else f.splice(A,0,C),x+=1}else M.push(_),k(null,_,r,n,!0),r.push(Y.INSERT_BEFORE,e,_,null);else!1===k(C,null,r,n,!0)&&f.splice(A,0,C)}if(M.length!==f.length){for(var B=f.length;B1&&void 0!==arguments[1]?arguments[1]:oe.document,r=arguments.length>2?arguments[2]:void 0,n=v(e),a=K.get(n);if(a)return a;var o=n.nodeName,i=n.rawNodeName,s=void 0===i?o:i,c=n.childNodes,d=void 0===c?[]:c;r=r||"svg"===o;var l=null,u=null;if(ee.forEach(function(e){(u=e(n))&&(l=u)}),!t)return l;null===l&&(l="#text"===o?t.createTextNode(n.nodeValue||X.STR):"#document-fragment"===o?t.createDocumentFragment():r?t.createElementNS(qe,s):t.createElement(s),"script"===o&&(l.type="no-execute"));var f=l;K.set(n,f);for(var h=0;h1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:X.OBJ,r=[],n=t.ownerDocument,a=t.svgElements,o=void 0===a?new Set:a,i=e.length,c=0;;){var d=e[c];if(c===i)break;switch(d){case Y.SET_ATTRIBUTE:if("break"===function(){var t=e[c+1],a=e[c+2],i=C(e[c+3]);c+=4;var d=o.has(t),l=R(t,n,d);if(!l)return"break";var u=l.getAttribute(a),f=A("attributeChanged",t,a,u,i);return g(t),f.length?(Promise.all(f).then(function(){return rt(t,l,a,i)}),r.push.apply(r,s(f))):rt(t,l,a,i),"break"}())break;case Y.REMOVE_ATTRIBUTE:if("break"===function(){var t=e[c+1],a=e[c+2];c+=3;var i=o.has(t),d=R(t,n,i);if(!d)return"break";var l=d.getAttribute(a),u=A("attributeChanged",t,a,l,null);return g(t),u.length?(Promise.all(u).then(function(){return nt(d,a)}),r.push.apply(r,s(u))):nt(d,a),"break"}())break;case Y.NODE_VALUE:if("break"===function(){var t=e[c+1],a=e[c+2],i=e[c+3],d=o.has(t);c+=4;var l=R(t,n,d);if(!l)return"break";g(t);var u=A("textChanged",t,i,a);return u.length?(Promise.all(u).then(function(){return at(l,a)}),r.push.apply(r,s(u))):at(l,a),"break"}())break;case Y.INSERT_BEFORE:var l=e[c+1],u=e[c+2],f=e[c+3];c+=4;var h=K.get(l);if(!h)break;var p=o.has(u);g(u);var v=f&&R(f,n,p),m=R(u,n,p);h.insertBefore(m,v||null),r.push.apply(r,s(A("attached",u)));break;case Y.REPLACE_CHILD:if("break"===function(){var t,a,i,d=e[c+1],l=e[c+2];c+=3;var u=o.has(d),f=K.get(l),h=R(d,n,u);if(!f||!f.parentNode)return"break";g(d);var p=null===(t=Z.get("attached"))||void 0===t?void 0:t.size,v=null===(a=Z.get("detached"))||void 0===a?void 0:a.size,m=null===(i=Z.get("replaced"))||void 0===i?void 0:i.size;if(!p&&!v&&!m)return f.parentNode&&(f.parentNode.replaceChild(h,f),N(l)),"break";f.parentNode&&f.parentNode.insertBefore(h,f);var b=[].concat(s(p&&A("attached",d)||X.ARR),s(v&&A("detached",l)||X.ARR),s(m&&A("replaced",l,d)||X.ARR));return b.length?(Promise.all(b).then(function(){f.parentNode&&f.parentNode.removeChild(f),N(l)}),r.push.apply(r,s(b))):(f.parentNode&&f.parentNode.removeChild(f),N(l)),"break"}())break;case Y.REMOVE_CHILD:if("break"===function(){var t=e[c+1];c+=2;var n=K.get(t);if(!n||!n.parentNode)return"break";var a=A("detached",t);return a.length?(Promise.all(a).then(function(){n.parentNode&&n.parentNode.removeChild(n),N(t)}),r.push.apply(r,s(a))):(n.parentNode&&n.parentNode.removeChild(n),N(t)),"break"}())break}}return r}function L(e){var t=e.mount,r=e.state,n=e.patches,a=r.mutationObserver,o=r.measure,i=r.scriptsToExecute;o("patch node");var c=t.ownerDocument,d=e.promises||[];r.ownerDocument=c||oe.document,a&&a.disconnect();var l=function(e){"script"===e.nodeName&&i.set(e,e.attributes.type)};ee.add(l),r.ownerDocument&&d.push.apply(d,s(_(n,r))),ee.delete(l),e.promises=d,o("patch node")}function I(e){var t=e.promises;return t&&t.length?e.promise=Promise.all(t).then(function(){return e.end()}):e.promise=Promise.resolve(e.end())}function D(e){var t=e.state,r=e.input,n=e.config,a=t.measure,o=n.inner;if("string"==typeof r){a("parsing input for new tree");var i,s=m(r,void 0,n),c=s.childNodes;i=v(o?c:c[0]||c),i&&(e.newTree=i),a("parsing input for new tree")}}function j(e){return e.replace(/[&<>]/g,function(e){return"&#".concat(e.charCodeAt(0),";")})}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:X.STR,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.inner=!0,r.executeScripts=!("executeScripts"in r)||r.executeScripts,r.tasks=r.tasks||ot,st.create(e,t,r).start()}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:X.STR,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.inner=!1,r.executeScripts=!("executeScripts"in r)||r.executeScripts,r.tasks=r.tasks||ot,st.create(e,t,r).start()}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=v(),n=new Set(t.tasks||ot);n.delete(it.endAsPromise),n.add(function(e){return B(e.oldTree)}),t.tasks=s(n),t.inner=!0;var a="";try{a=st.create(r,e,t).start()}catch(e){throw w(r),e}return w(r),a}function F(e){var t=ft(e);return t.length?" "+t.map(function(t){var r=e[t],n=!r,a="object"==typeof r||"function"==typeof r;return"".concat(t).concat(n||a?"":'="'.concat(String(r),'"'))}).join(" "):""}function B(e){var t="";if(!e)return t;var r=e.childNodes,n=e.nodeType,a=e.nodeName,o=e.nodeValue,i=e.attributes;if(11===n)for(var s=0;s").concat(c,"")}}else t+="<".concat(a).concat(F(i),">");return t}function z(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n")1?t-1:0),n=1;n/i,xe=new RegExp("".concat(Oe,"([^_]*)__")),Ae={tags:[],attributes:{},children:{}},Ce=Object.assign,_e=Array.isArray,Le=["script","noscript","style","template"],Ie=["meta","img","link","input","area","br","hr","area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],De={li:{li:!0},p:{p:!0,div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0}},je={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},Ve=function(e,t,r){var n;if(!("childNodes"in e.attributes)){if(t&&!Me.test(t)&&!xe.test(t))return e.childNodes.push(v("#text",t));for(var a=[],o=t.split(xe),i=0;i\/=\uFDD0-\uFDEF\uFFFE\uFFFF]*)\s*(=\s*("([^"]+)"|'([^']+)'|(\S+)))?/gi;if(a=xe.exec(e))return Pe(r.tags[a[1]],t,r);for(var i,s={};i=o.exec(t||X.STR);){var c="string"==typeof e,d=i[1],l=void 0;if(""===d){var u=t.match(xe);l=u?u[0]:""}var f=i[6]||i[5]||i[4],h=l||f||(c?i[1]:f||!0),p=String(h).match(xe);if(p&&p.length)for(var m=String(h).split(xe),g=xe.exec(d),N=g?r.attributes[g[1]]:d,b=0;b0&&void 0!==arguments[0]?arguments[0]:X.STR,t=arguments.length>1?arguments[1]:void 0,r=K.get(t);e?r.setAttribute("type",e):r.removeAttribute("type")}),t.previousMarkup="outerHTML"in c?c.outerHTML:X.STR,r.executeScripts&&s.forEach(function(e,r){var n=K.get(r),a=n.cloneNode(!0);n&&(q.has(n)&&(w(n),q.set(a,t)),K.set(r,a),n.parentNode&&n.parentNode.replaceChild(a,n))}),s.clear(),Ee.memory.free.size<2*Ee.memory.allocated.size&&b(),this.endedCallbacks.forEach(function(t){return t(e)}),this.endedCallbacks.clear(),o("finalize"),o("render"),this}},{key:"onceEnded",value:function(e){this.endedCallbacks.add(e)}}],[{key:"create",value:function(t,r,n){return new e(t,r,n)}},{key:"flow",value:function(e,t){for(var r=e,n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:typeof t,n=arguments.length>3?arguments[3]:void 0,a=ue.location,o=ue.URLSearchParams,i=void 0!==o,s=void 0!==a,c=i&&s,l=de.env;if(n&&e in n)return n[e];var d="DIFF_".concat(e.replace(/[^a-zA-Z0-9]/,""));if(c){var u=new o(a.search),f=d.toLowerCase();if(u.has(f))return g(decodeURIComponent(String(u.get(f))),r)}var h=d.toUpperCase();return l&&h in de.env?g(de.env[h.toUpperCase()],r):t}function N(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0;r3?C-3:0),A=3;A2&&void 0!==arguments[2]?arguments[2]:{};r.parser||(r.parser={}),t||(t=Me);var n=new Set(b("rawElements",_e,"array",r.parser)),a=new Set(b("selfClosingElements",De,"array",r.parser)),o=/)-->|<(\/?)([a-z\-\_][a-z0-9\-\_]*)\s*([^>]*?)(".*?"|'.*?')?(\/?)>/gi,i=y("#document-fragment",null,[]),c=[i],l=i,d=-1;if(!e.includes("<")&&e)return Ve(l,e,t),i;for(var u,f,h=0;u=o.exec(e);h++){var p=u,v=s(p,6),m=v[0],g=v[1],N=v[2],T=v[3],E=v[4],w=v[5];d>-1&&d+m.length0){var O=e.slice(0,S);O&&!xe.exec(O)&&Ve(l,O,t)}if(d=o.lastIndex,"!"!==u[0][1]){var k=Ce.exec(N),R=k&&t.tags[k[1]],x=R?R.name||R:N,C=void 0;if(!g){!u[4]&&Le[l.rawNodeName]&&Le[l.rawNodeName][x]&&(c.pop(),l=c[c.length-1]);var M=T+(E||"");if(l=l.childNodes[l.childNodes.push(Pe(N,M,t))-1],c.push(l),r.parser.strict||n.has(x)){var A=""),I=e.indexOf(A,o.lastIndex);if(n.has(x)){-1===I?d=o.lastIndex=e.length+1:(d=I+A.length,o.lastIndex=d,C=!0);var _=e.slice(u.index+m.length,I);Ve(l,_,t)}}}if(C||g||w||a.has(x))for(;l;){if("/"===w&&k){c.pop(),l=c[c.length-1];break}if(R&&l.rawNodeName===x){c.pop(),l=c[c.length-1];break}if(l.rawNodeName===x){c.pop(),l=c[c.length-1];break}var D=je[l.rawNodeName];{if(!D||!D[x])break;c.pop(),l=c[c.length-1]}}}}var L=e.slice(-1===d?0:d);if(L&&Ve(l,L,t),i.childNodes.length&&"html"===i.childNodes[0].nodeName){var j={before:[],after:[]},V={after:[]},P=i.childNodes[0],F=!0,H=!0;if(P.childNodes=P.childNodes.filter(function(e){if("body"===e.nodeName||"head"===e.nodeName)return"head"===e.nodeName&&(F=!1),"body"===e.nodeName&&(H=!1),!0;e.nodeType===K.ELEMENT&&(F&&H?j.before.push(e):!F&&H?j.after.push(e):H||V.after.push(e))}),P.childNodes[0]&&"head"===P.childNodes[0].nodeName){var B=P.childNodes[0].childNodes;B.unshift.apply(B,j.before),B.push.apply(B,j.after)}else{var z=y("head",null,[]);if(z){var U=z.childNodes;U.unshift.apply(U,j.before),U.push.apply(U,j.after),P.childNodes.unshift(z)}}if(P.childNodes[1]&&"body"===P.childNodes[1].nodeName){var J=P.childNodes[1].childNodes;J.push.apply(J,V.after)}else{var G=y("body",null,[]);if(G){var X=G.childNodes;X.push.apply(X,V.after),P.childNodes.push(G)}}}return i}function E(e){var t=e.mount,r=e.input,n=r,a=Be++;return b("collectMetrics",!1)?function(e){e="[".concat(a,"] ").concat(e);var r=t.host;t&&r?e="".concat(r.constructor.name," ").concat(e):n&&"function"==typeof n.rawNodeName&&(e="".concat(n.rawNodeName.name," ").concat(e));var o="".concat(e,"-end");if(He.has(e)){var i=He.get(e)||0,s=(performance.now()-i).toFixed(3);He.delete(e),performance.mark(o),performance.measure("".concat(Fe," ").concat(e," (").concat(s,"ms)"),e,o)}else He.set(e,performance.now()),performance.mark(e)}:Q.FUN}function w(e){if(ze(e),e.childNodes.length)for(var t=0;t1&&(e.newTree=y(d.childNodes))}e.oldTree=t.oldTree;var p=e.oldTree,v=e.newTree;if(o&&p&&v){var m="string"!=typeof v.rawNodeName,g=v.nodeType===K.FRAGMENT,b=g&&!m?v.childNodes:v;e.newTree=y(c,l,b)}}function M(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Q.OBJ,o=arguments.length>5?arguments[5]:void 0;e||(e=Q.OBJ),t||(t=Q.OBJ);var i=n.svgElements,s=void 0===i?new Set:i,c=e.nodeName,l=t.nodeName,d=e===Q.OBJ||o,u="svg"===l||s.has(t),f=null;if(se.size&&se.forEach(function(n){var o=n(e,t,a);o&&o===e?f=r:!1===o?f=!1:o&&(t=o)}),null!==f||!t)return f;if(l===Qe){if(c===Qe&&e.nodeValue!==t.nodeValue)return r.push(W.NODE_VALUE,e,t.nodeValue,e.nodeValue),e.nodeValue=t.nodeValue,r;if(d)return r.push(W.NODE_VALUE,t,t.nodeValue,null),r}var h=t.childNodes||[];if(t.nodeType===K.ELEMENT){var p=d?Q.OBJ:e.attributes,v=t.attributes||{};for(var m in v){var g=v[m];m in p&&p[m]===v[m]||(d||(p[m]=g),(e&&"script"===e.nodeName||"script"!==t.nodeName||"type"!==m)&&r.push(W.SET_ATTRIBUTE,d?t:e,m,g))}if(!d)for(var b in p)b in v||(r.push(W.REMOVE_ATTRIBUTE,e,b),delete p[b])}if(o){for(var N=0;NA&&x.splice(B,1),r.push(W.REPLACE_CHILD,_,I)}}else h.splice(A,0,I),C+=1}else x.push(_),M(null,_,r,n,a,!0),r.push(W.INSERT_BEFORE,e,_,null);else!1===M(I,null,r,n,a,!0)&&h.splice(A,0,I)}if(x.length!==h.length){for(var z=h.length;z1&&void 0!==arguments[1]?arguments[1]:ue.document,r=arguments.length>2?arguments[2]:void 0,n=y(e),a=ne.get(n);if(a)return a;var o=n.nodeName,i=n.rawNodeName,s=void 0===i?o:i,c=n.childNodes,l=void 0===c?[]:c;r=r||"svg"===o;var d=null,u=null;if(ie.forEach(function(e){(u=e(n))&&(d=u)}),!t)return d;var f=d;f||(f="#text"===o?t.createTextNode(n.nodeValue||Q.STR):"#document-fragment"===o?t.createDocumentFragment():r?t.createElementNS(We,s):t.createElement(s),"script"===o&&(f.type="no-execute")),ne.set(n,f);for(var h=0;h1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:Q.OBJ,r=[],n=t.ownerDocument,a=t.svgElements,o=void 0===a?new Set:a,i=e.length,s=0;;){var l=e[s];if(s===i)break;switch(l){case W.REMOVE_ATTRIBUTE:case W.SET_ATTRIBUTE:if("break"===function(){var t=l===W.SET_ATTRIBUTE,a=e[s+1],i=e[s+2],d=t?j(e[s+3]):null;s+=t?4:3;var u=o.has(a),f=A(a,n,u),h=f.getAttribute(i),p=L("attributeChanged",a,i,h,d);w(a);var v=t?st:ct;return p.length?(Promise.all(p).then(function(){return v(a,f,i,d)}),r.push.apply(r,c(p))):v(a,f,i,d),"break"}())break;case W.NODE_VALUE:if("break"===function(){var t=e[s+1],a=e[s+2],i=e[s+3],l=o.has(t);s+=4;var d=A(t,n,l);w(t);var u=L("textChanged",t,i,a);return u.length?(Promise.all(u).then(function(){return lt(d,a)}),r.push.apply(r,c(u))):lt(d,a),"break"}())break;case W.INSERT_BEFORE:var d=e[s+1],u=e[s+2],f=e[s+3];if(s+=4,!ne.has(d)&&d!==rt)continue;var h=ne.get(d);if(d===rt){var p=ne.get(f);p&&(h=p.parentNode,f=p.nextSibling?p.nextSibling:null)}var v=o.has(u);w(u);var m=f&&A(f,n,v),g=A(u,n,v);h.insertBefore(g,m||null),r.push.apply(r,c(L("attached",u)));break;case W.REPLACE_CHILD:if("break"===function(){var t,a,i,l=e[s+1],d=e[s+2];s+=3;var u=o.has(l),f=ne.get(d),h=A(l,n,u);if(!f||!f.parentNode)return"break";w(l);var p=null===(t=te.get("attached"))||void 0===t?void 0:t.size,v=null===(a=te.get("detached"))||void 0===a?void 0:a.size,m=null===(i=te.get("replaced"))||void 0===i?void 0:i.size;if(!p&&!v&&!m)return f.parentNode.replaceChild(h,f),S(d),"break";f.parentNode.insertBefore(h,f);var g=[].concat(c(p&&L("attached",l)||Q.ARR),c(v&&L("detached",d)||Q.ARR),c(m&&L("replaced",d,l)||Q.ARR));return g.length?(Promise.all(g).then(function(){f.parentNode&&f.parentNode.removeChild(f),S(d)}),r.push.apply(r,c(g))):(f.parentNode.removeChild(f),S(d)),"break"}())break;case W.REMOVE_CHILD:if("break"===function(){var t=e[s+1];s+=2;var n=ne.get(t);if(!n||!n.parentNode)return"break";var a=L("detached",t);return a.length?(Promise.all(a).then(function(){n.parentNode&&n.parentNode.removeChild(n),S(t)}),r.push.apply(r,c(a))):(n.parentNode.removeChild(n),S(t)),"break"}())break}}return r}function P(e){var t=e.mount,r=e.state,n=e.patches,a=r.mutationObserver,o=r.measure,i=r.scriptsToExecute;o("patch node");var s=t.ownerDocument,l=e.promises||[];r.ownerDocument=s||ue.document,a&&a.disconnect();var d=function(e){"script"===e.nodeName&&i.set(e,e.attributes.type)};ie.add(d),r.ownerDocument&&l.push.apply(l,c(V(n,r))),ie.delete(d),e.promises=l,o("patch node")}function F(e){var t=e.promises;return t&&t.length?e.promise=Promise.all(t).then(function(){return e.end()}):e.promise=Promise.resolve(e.end())}function H(){return Boolean(dt&&"noModule"in dt)}function B(e){var t=e.state,r=e.input,n=e.config,a=t.measure;if("string"==typeof r){a("parsing input for new tree");var o=T(r,void 0,n),i=o.childNodes,s=y(i);s&&(e.newTree=s),a("parsing input for new tree")}}function z(e){return e.replace(/[&<>]/g,function(e){return"&#".concat(e.charCodeAt(0),";")})}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.STR,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.inner=!0,r.executeScripts=!("executeScripts"in r)||r.executeScripts,r.tasks=r.tasks||ft,pt.create(e,t,r).start()}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.STR,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.inner=!1,r.executeScripts=!("executeScripts"in r)||r.executeScripts,r.tasks=r.tasks||ft,pt.create(e,t,r).start()}function G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=y(),n=new Set(t.tasks||ft);n.delete(ht.patchNode),n.delete(ht.endAsPromise),n.add(function(e){return q(e.oldTree)}),t.tasks=c(n),t.inner=!0;var a="";try{a=pt.create(r,e,t).start()}catch(e){throw x(r),e}return x(r),a}function X(e){var t=gt(e);return t.length?" "+t.map(function(t){var r=e[t],n=!r,a="object"==typeof r||"function"==typeof r;return!0===r?t:"".concat(t).concat(n||a?"":'="'.concat(String(r),'"'))}).join(" "):""}function q(e){var t="";if(!e)return t;var r=e.childNodes,n=e.nodeType,a=e.nodeName,o=e.nodeValue,i=e.attributes;if(11===n)for(var s=0;s").concat(c,"")}}else t+="<".concat(a).concat(X(i),">");return t}function Y(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n")1?t-1:0),n=1;n/i,Ce=new RegExp("".concat(Re,"([^_]*)__")),Me={tags:[],attributes:{},children:{}},Ae=Object.assign,Ie=Array.isArray,_e=["script","noscript","style","template"],De=["source","embed","param","track","input","meta","link","area","base","col","wbr","img","br","hr"],Le={li:{li:!0},p:{p:!0,div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0}},je={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},Ve=function(e,t,r){var n;if(!("childNodes"in e.attributes)){if(t&&!xe.test(t)&&!Ce.test(t))return e.childNodes.push(y("#text",t));for(var a=[],o=t.split(Ce),i=0;i\/=\uFDD0-\uFDEF\uFFFE\uFFFF]*)\s*(=\s*("([^"]+)"|'([^']+)'|(\S+)))?/gi;if(a=Ce.exec(e))return Pe(r.tags[a[1]],t,r);for(var i,s={};i=o.exec(t||Q.STR);){var c="string"==typeof e,l=i[1],d=void 0;if(""===l){var u=t.match(Ce);d=u?u[0]:""}var f=i[6]||i[5]||i[4],h=d||f||(c?i[1]:f||!0),p="''"===h||'""'===h?Q.STR:h,v=String(p).match(Ce);if(v&&v.length)for(var m=String(p).split(Ce),g=Ce.exec(l),b=g?r.attributes[g[1]]:l,N=0;N