diff --git a/README.md b/README.md index b5c8e5428..e49ab05bf 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ ## What is Mithril.js? -A modern client-side JavaScript framework for building Single Page Applications. It's small (9.02 KB gzipped), fast and provides routing and XHR utilities out of the box. +A modern client-side JavaScript framework for building Single Page Applications. It's small (9.03 KB gzipped), fast and provides routing and XHR utilities out of the box. Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍. diff --git a/docs/recent-changes.md b/docs/recent-changes.md index c1d26506c..aa475f184 100644 --- a/docs/recent-changes.md +++ b/docs/recent-changes.md @@ -1,4 +1,15 @@ +# Release v2.2.12 + +### Patch Changes + +#### [disable Terser's "reduce_funcs" option for performance (@kfule)](https://github.com/MithrilJS/mithril.js/pull/3000) + +Terser's “reduce_funcs” option seems to degrade performance. So, disable it. +#### [Bump chokidar from 4.0.1 to 4.0.3 in the normal group across 1 directory (@dependabot[bot])](https://github.com/MithrilJS/mithril.js/pull/2998) + +Bumps the normal group with 1 update in the / directory: [chokidar](https://github.com/paulmillr/chokidar). Updates `chokidar` from 4.0.1 to 4.0.3. Release notes. + # Release v2.2.11 ### Patch Changes diff --git a/mithril.min.js b/mithril.min.js index 4a0ea4f9c..54a35751a 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,n,r,o,l){return{tag:e,key:t,attrs:n,children:r,text:o,dom:l,domSize:void 0,state:void 0,events:void 0,instance:void 0}}e.normalize=function(t){return Array.isArray(t)?e("[",void 0,void 0,e.normalizeChildren(t),void 0,void 0):null==t||"boolean"==typeof t?null:"object"==typeof t?t:e("#",void 0,void 0,String(t),void 0,void 0)},e.normalizeChildren=function(t){var n=[];if(t.length){for(var r=null!=t[0]&&null!=t[0].key,o=1;o0&&(a.className=i.join(" ")),function(e){for(var t in e)if(n.call(e,t))return!1;return!0}(a)&&(a=null),o[e]={tag:l,attrs:a}}function i(e,t){var r=t.attrs,o=n.call(r,"class"),l=o?r.class:r.className;return t.tag=e.tag,null!=e.attrs?(r=Object.assign({},e.attrs,r),null==l&&null==e.attrs.className||(r.className=null!=l?null!=e.attrs.className?String(e.attrs.className)+" "+String(l):l:null!=e.attrs.className?e.attrs.className:null)):null!=l&&(r.className=l),o&&(r.class=null),"input"===e.tag&&n.call(r,"type")&&(r=Object.assign({type:r.type},r)),t.attrs=r,t}function a(n){if(null==n||"string"!=typeof n&&"function"!=typeof n&&"function"!=typeof n.view)throw Error("The selector must be either a string or a component.");var r=t.apply(1,arguments);return"string"==typeof n&&(r.children=e.normalizeChildren(r.children),"["!==n)?i(o[n]||l(n),r):(r.tag=n,r)}a.trust=function(t){return null==t&&(t=""),e("<",void 0,void 0,t,void 0,void 0)},a.fragment=function(){var n=t.apply(0,arguments);return n.tag="[",n.children=e.normalizeChildren(n.children),n};var s=new WeakMap;var u={delayedRemoval:s,domFor:function*(e,t={}){var n=e.dom,r=e.domSize,o=t.generation;if(null!=n)do{var l=n.nextSibling;s.get(n)===o&&(yield n,r--),n=l}while(r)}},f=u.delayedRemoval,c=u.domFor,d=function(){var t,n,r={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function o(e){return e.ownerDocument}function l(e){return e.attrs&&e.attrs.xmlns||r[e.tag]}function i(e,t){if(e.state!==t)throw new Error("'vnode.state' must not be modified.")}function a(e){var t=e.state;try{return this.apply(t,arguments)}finally{i(e,t)}}function s(e){try{return o(e).activeElement}catch(e){return null}}function u(e,t,n,r,o,l,i){for(var a=n;a'+t.children+"",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var a,s=o(e).createDocumentFragment();a=i.firstChild;)s.appendChild(a);k(e,s,r)}function v(e,t,n,r,o,l){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)u(e,n,0,n.length,r,o,l);else if(null==n||0===n.length)E(e,t,0,t.length);else{var i=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,s=0,f=0;if(!i)for(;f=f&&S>=s&&(p=t[k],v=n[S],p.key===v.key);)p!==v&&h(e,p,v,r,o,l),null!=v.dom&&(o=v.dom),k--,S--;for(;k>=f&&S>=s&&(c=t[f],m=n[s],c.key===m.key);)f++,s++,c!==m&&h(e,c,m,r,b(t,f,o),l);for(;k>=f&&S>=s&&s!==S&&c.key===v.key&&p.key===m.key;)x(e,p,g=b(t,f,o)),p!==m&&h(e,p,m,r,g,l),++s<=--S&&x(e,c,o),c!==v&&h(e,c,v,r,o,l),null!=v.dom&&(o=v.dom),f++,p=t[--k],v=n[S],c=t[f],m=n[s];for(;k>=f&&S>=s&&p.key===v.key;)p!==v&&h(e,p,v,r,o,l),null!=v.dom&&(o=v.dom),S--,p=t[--k],v=n[S];if(s>S)E(e,t,f,k+1);else if(f>k)u(e,n,s,S+1,r,o,l);else{var j,O,A=o,C=S-s+1,T=new Array(C),N=0,$=0,L=2147483647,R=0;for($=0;$=s;$--){null==j&&(j=y(t,f,k+1));var I=j[(v=n[$]).key];null!=I&&(L=I>>1)+(r>>>1)+(n&r&1);e[t[a]]0&&(w[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;n-- >0;)t[n]=r,r=w[r];return w.length=0,t}(T)).length-1,$=S;$>=s;$--)m=n[$],-1===T[$-s]?d(e,m,r,l,o):O[N]===$-s?N--:x(e,m,o),null!=m.dom&&(o=n[$].dom);else for($=S;$>=s;$--)m=n[$],-1===T[$-s]&&d(e,m,r,l,o),null!=m.dom&&(o=n[$].dom)}}else{var P=t.lengthP&&E(e,t,s,t.length),n.length>P&&u(e,n,s,n.length,r,o,l)}}}function h(t,n,r,o,i,s){var u=n.tag;if(u===r.tag){if(r.state=n.state,r.events=n.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=a.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=a.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(r,n))return;if("string"==typeof u)switch(null!=r.attrs&&P(r.attrs,r,o),u){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(n,r);break;case"<":!function(e,t,n,r,o){t.children!==n.children?(j(e,t,void 0),p(e,n,r,o)):(n.dom=t.dom,n.domSize=t.domSize)}(t,n,r,s,i);break;case"[":!function(e,t,n,r,o,l){v(e,t.children,n.children,r,o,l);var i=0,a=n.children;if(n.dom=null,null!=a){for(var s=0;s-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}function $(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(o=n[r])&&(r.includes("-")?e.style.setProperty(r,String(o)):e.style[r]=String(o))}else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&(r.includes("-")?e.style.setProperty(r,o):e.style[r]=o)}for(var r in t)null!=t[r]&&null==n[r]&&(r.includes("-")?e.style.removeProperty(r):e.style[r]="")}}function L(){this._=t}function R(e,n,r){if(null!=e.events){if(e.events._=t,e.events[n]===r)return;null==r||"function"!=typeof r&&"object"!=typeof r?(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0):(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=r)}else null==r||"function"!=typeof r&&"object"!=typeof r||(e.events=new L,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=r)}function I(e,t,n){"function"==typeof e.oninit&&a.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(a.bind(e.oncreate,t))}function P(e,t,n){"function"==typeof e.onupdate&&n.push(a.bind(e.onupdate,t))}return L.prototype=Object.create(null),L.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(r,o,l){if(!r)throw new TypeError("DOM element being rendered to does not exist.");if(null!=g&&r.contains(g))throw new TypeError("Node is currently being rendered to and thus is locked.");var i=t,a=g,u=[],f=s(r),c=r.namespaceURI;g=r,t="function"==typeof l?l:void 0,n={};try{null==r.vnodes&&(r.textContent=""),o=e.normalizeChildren(Array.isArray(o)?o:[o]),v(r,r.vnodes,o,u,null,"http://www.w3.org/1999/xhtml"===c?void 0:c),r.vnodes=o,null!=f&&s(r)!==f&&"function"==typeof f.focus&&f.focus();for(var d=0;d=0&&(o.splice(l,2),l<=i&&(i-=2),t(n,[])),null!=r&&(o.push(n,r),t(n,e(r),s))},redraw:s}}(d,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:null,"undefined"!=typeof console?console:null),p=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t=[];for(var n in e)r(n,e[n]);return t.join("&");function r(e,n){if(Array.isArray(n))for(var o=0;o=0&&(m+=e.slice(n,o)),u>=0&&(m+=(n<0?"?":"&")+s.slice(u,c));var v=p(a);return v&&(m+=(n<0&&u<0?"?":"&")+v),r>=0&&(m+=e.slice(r)),f>=0&&(m+=(r<0?"":"&")+s.slice(f)),m},h=function(e,t){function r(e){return new Promise(e)}function o(e,t){for(var r in e.headers)if(n.call(e.headers,r)&&r.toLowerCase()===t)return!0;return!1}return r.prototype=Promise.prototype,r.__proto__=Promise,{request:function(l,i){"string"!=typeof l?(i=l,l=l.url):null==i&&(i={});var a=function(t,r){return new Promise((function(l,i){t=v(t,r.params);var a,s=null!=r.method?r.method.toUpperCase():"GET",u=r.body,f=(null==r.serialize||r.serialize===JSON.serialize)&&!(u instanceof e.FormData||u instanceof e.URLSearchParams),c=r.responseType||("function"==typeof r.extract?"":"json"),d=new e.XMLHttpRequest,m=!1,p=!1,h=d,y=d.abort;for(var g in d.abort=function(){m=!0,y.call(this)},d.open(s,t,!1!==r.async,"string"==typeof r.user?r.user:void 0,"string"==typeof r.password?r.password:void 0),f&&null!=u&&!o(r,"content-type")&&d.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof r.deserialize||o(r,"accept")||d.setRequestHeader("Accept","application/json, text/*"),r.withCredentials&&(d.withCredentials=r.withCredentials),r.timeout&&(d.timeout=r.timeout),d.responseType=c,r.headers)n.call(r.headers,g)&&d.setRequestHeader(g,r.headers[g]);d.onreadystatechange=function(e){if(!m&&4===e.target.readyState)try{var n,o=e.target.status>=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(t),a=e.target.response;if("json"===c){if(!e.target.responseType&&"function"!=typeof r.extract)try{a=JSON.parse(e.target.responseText)}catch(e){a=null}}else c&&"text"!==c||null==a&&(a=e.target.responseText);if("function"==typeof r.extract?(a=r.extract(e.target,r),o=!0):"function"==typeof r.deserialize&&(a=r.deserialize(a)),o){if("function"==typeof r.type)if(Array.isArray(a))for(var s=0;s-1&&s.pop();for(var f=0;f0&&(a.className=i.join(" ")),l(a)&&(a=null),o[e]={tag:n,attrs:a}}function a(e,t){var r=t.attrs,o=n.call(r,"class"),l=o?r.class:r.className;return t.tag=e.tag,null!=e.attrs?(r=Object.assign({},e.attrs,r),null==l&&null==e.attrs.className||(r.className=null!=l?null!=e.attrs.className?String(e.attrs.className)+" "+String(l):l:null!=e.attrs.className?e.attrs.className:null)):null!=l&&(r.className=l),o&&(r.class=null),"input"===e.tag&&n.call(r,"type")&&(r=Object.assign({type:r.type},r)),t.attrs=r,t}function s(n){if(null==n||"string"!=typeof n&&"function"!=typeof n&&"function"!=typeof n.view)throw Error("The selector must be either a string or a component.");var r=t.apply(1,arguments);return"string"==typeof n&&(r.children=e.normalizeChildren(r.children),"["!==n)?a(o[n]||i(n),r):(r.tag=n,r)}s.trust=function(t){return null==t&&(t=""),e("<",void 0,void 0,t,void 0,void 0)},s.fragment=function(){var n=t.apply(0,arguments);return n.tag="[",n.children=e.normalizeChildren(n.children),n};var u=new WeakMap;var f={delayedRemoval:u,domFor:function*(e,t={}){var n=e.dom,r=e.domSize,o=t.generation;if(null!=n)do{var l=n.nextSibling;u.get(n)===o&&(yield n,r--),n=l}while(r)}},c=f.delayedRemoval,d=f.domFor,m=function(){var t,n,r={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function o(e){return e.ownerDocument}function l(e){return e.attrs&&e.attrs.xmlns||r[e.tag]}function i(e,t){if(e.state!==t)throw new Error("'vnode.state' must not be modified.")}function a(e){var t=e.state;try{return this.apply(t,arguments)}finally{i(e,t)}}function s(e){try{return o(e).activeElement}catch(e){return null}}function u(e,t,n,r,o,l,i){for(var a=n;a'+t.children+"",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var a,s=o(e).createDocumentFragment();a=i.firstChild;)s.appendChild(a);L(e,s,r)}function h(e,t,n,r,l){var i=o(e).createDocumentFragment();if(null!=t.children){var a=t.children;u(i,a,0,a.length,n,null,r)}t.dom=i.firstChild,t.domSize=i.childNodes.length,L(e,i,l)}function y(e,t,n,r,i){var a=t.tag,s=t.attrs,f=s&&s.is,c=(r=l(t)||r)?f?o(e).createElementNS(r,a,{is:f}):o(e).createElementNS(r,a):f?o(e).createElement(a,{is:f}):o(e).createElement(a);if(t.dom=c,null!=s&&F(t,s,r),L(e,c,i),!R(t)&&null!=t.children){var d=t.children;u(c,d,0,d.length,n,null,r),"select"===t.tag&&null!=s&&U(t,s)}}function g(t,n){var r;if("function"==typeof t.tag.view){if(t.state=Object.create(t.tag),null!=(r=t.state.view).$$reentrantLock$$)return;r.$$reentrantLock$$=!0}else{if(t.state=void 0,null!=(r=t.tag).$$reentrantLock$$)return;r.$$reentrantLock$$=!0,t.state=null!=t.tag.prototype&&"function"==typeof t.tag.prototype.view?new t.tag(t):t.tag(t)}if(W(t.state,t,n),null!=t.attrs&&W(t.attrs,t,n),t.instance=e.normalize(a.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");r.$$reentrantLock$$=null}function w(e,t,n,r,o){g(t,n),null!=t.instance?(f(e,t.instance,n,r,o),t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0):t.domSize=0}function b(e,t,n,r,o,l){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)u(e,n,0,n.length,r,o,l);else if(null==n||0===n.length)I(e,t,0,t.length);else{var i=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,s=0,c=0;if(!i)for(;c=c&&g>=s&&(p=t[y],v=n[g],p.key===v.key);)p!==v&&x(e,p,v,r,o,l),null!=v.dom&&(o=v.dom),y--,g--;for(;y>=c&&g>=s&&(d=t[c],m=n[s],d.key===m.key);)c++,s++,d!==m&&x(e,d,m,r,N(t,c,o),l);for(;y>=c&&g>=s&&s!==g&&d.key===v.key&&p.key===m.key;)$(e,p,h=N(t,c,o)),p!==m&&x(e,p,m,r,h,l),++s<=--g&&$(e,d,o),d!==v&&x(e,d,v,r,o,l),null!=v.dom&&(o=v.dom),c++,p=t[--y],v=n[g],d=t[c],m=n[s];for(;y>=c&&g>=s&&p.key===v.key;)p!==v&&x(e,p,v,r,o,l),null!=v.dom&&(o=v.dom),g--,p=t[--y],v=n[g];if(s>g)I(e,t,c,y+1);else if(c>y)u(e,n,s,g+1,r,o,l);else{var w,b,k=o,S=g-s+1,E=new Array(S),z=0,j=0,A=2147483647,C=0;for(j=0;j=s;j--){null==w&&(w=O(t,c,y+1));var L=w[(v=n[j]).key];null!=L&&(A=L=s;j--)m=n[j],-1===E[j-s]?f(e,m,r,l,o):b[z]===j-s?z--:$(e,m,o),null!=m.dom&&(o=n[j].dom);else for(j=g;j>=s;j--)m=n[j],-1===E[j-s]&&f(e,m,r,l,o),null!=m.dom&&(o=n[j].dom)}}else{var R=t.lengthR&&I(e,t,s,t.length),n.length>R&&u(e,n,s,n.length,r,o,l)}}}function x(e,t,n,r,o,l){var i=t.tag;if(i===n.tag){if(n.state=t.state,n.events=t.events,Y(n,t))return;if("string"==typeof i)switch(null!=n.attrs&&X(n.attrs,n,r),i){case"#":k(t,n);break;case"<":S(e,t,n,l,o);break;case"[":E(e,t,n,r,o,l);break;default:z(t,n,r,l)}else j(e,t,n,r,o,l)}else P(e,t),f(e,n,r,l,o)}function k(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children),t.dom=e.dom}function S(e,t,n,r,o){t.children!==n.children?(D(e,t,void 0),v(e,n,r,o)):(n.dom=t.dom,n.domSize=t.domSize)}function E(e,t,n,r,o,l){b(e,t.children,n.children,r,o,l);var i=0,a=n.children;if(n.dom=null,null!=a){for(var s=0;s>>1)+(r>>>1)+(n&r&1);e[t[a]]0&&(C[o]=t[n-1]),t[n]=o)}}for(r=t[(n=t.length)-1];n-- >0;)t[n]=r,r=C[r];return C.length=0,t}function N(e,t,n){for(;t-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}function Q(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(o=n[r])&&(r.includes("-")?e.style.setProperty(r,String(o)):e.style[r]=String(o))}else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&(r.includes("-")?e.style.setProperty(r,o):e.style[r]=o)}for(var r in t)null!=t[r]&&null==n[r]&&(r.includes("-")?e.style.removeProperty(r):e.style[r]="")}}function G(){this._=t}function V(e,n,r){if(null!=e.events){if(e.events._=t,e.events[n]===r)return;null==r||"function"!=typeof r&&"object"!=typeof r?(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0):(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=r)}else null==r||"function"!=typeof r&&"object"!=typeof r||(e.events=new G,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=r)}function W(e,t,n){"function"==typeof e.oninit&&a.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(a.bind(e.oncreate,t))}function X(e,t,n){"function"==typeof e.onupdate&&n.push(a.bind(e.onupdate,t))}function Y(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=a.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=a.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}return G.prototype=Object.create(null),G.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(r,o,l){if(!r)throw new TypeError("DOM element being rendered to does not exist.");if(null!=A&&r.contains(A))throw new TypeError("Node is currently being rendered to and thus is locked.");var i=t,a=A,u=[],f=s(r),c=r.namespaceURI;A=r,t="function"==typeof l?l:void 0,n={};try{null==r.vnodes&&(r.textContent=""),o=e.normalizeChildren(Array.isArray(o)?o:[o]),b(r,r.vnodes,o,u,null,"http://www.w3.org/1999/xhtml"===c?void 0:c),r.vnodes=o,null!=f&&s(r)!==f&&"function"==typeof f.focus&&f.focus();for(var d=0;d=0&&(o.splice(l,2),l<=i&&(i-=2),t(n,[])),null!=r&&(o.push(n,r),t(n,e(r),s))},redraw:s}}(m,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:null,"undefined"!=typeof console?console:null),v=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t=[];for(var n in e)r(n,e[n]);return t.join("&");function r(e,n){if(Array.isArray(n))for(var o=0;o=0&&(m+=e.slice(n,o)),u>=0&&(m+=(n<0?"?":"&")+s.slice(u,c));var p=v(a);return p&&(m+=(n<0&&u<0?"?":"&")+p),r>=0&&(m+=e.slice(r)),f>=0&&(m+=(r<0?"":"&")+s.slice(f)),m},y=function(e,t){function r(e){return new Promise(e)}function o(t,r){return new Promise((function(o,i){t=h(t,r.params);var a,s=null!=r.method?r.method.toUpperCase():"GET",u=r.body,f=(null==r.serialize||r.serialize===JSON.serialize)&&!(u instanceof e.FormData||u instanceof e.URLSearchParams),c=r.responseType||("function"==typeof r.extract?"":"json"),d=new e.XMLHttpRequest,m=!1,p=!1,v=d,y=d.abort;for(var g in d.abort=function(){m=!0,y.call(this)},d.open(s,t,!1!==r.async,"string"==typeof r.user?r.user:void 0,"string"==typeof r.password?r.password:void 0),f&&null!=u&&!l(r,"content-type")&&d.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof r.deserialize||l(r,"accept")||d.setRequestHeader("Accept","application/json, text/*"),r.withCredentials&&(d.withCredentials=r.withCredentials),r.timeout&&(d.timeout=r.timeout),d.responseType=c,r.headers)n.call(r.headers,g)&&d.setRequestHeader(g,r.headers[g]);d.onreadystatechange=function(e){if(!m&&4===e.target.readyState)try{var n,l=e.target.status>=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(t),a=e.target.response;if("json"===c){if(!e.target.responseType&&"function"!=typeof r.extract)try{a=JSON.parse(e.target.responseText)}catch(e){a=null}}else c&&"text"!==c||null==a&&(a=e.target.responseText);if("function"==typeof r.extract?(a=r.extract(e.target,r),l=!0):"function"==typeof r.deserialize&&(a=r.deserialize(a)),l){if("function"==typeof r.type)if(Array.isArray(a))for(var s=0;s-1&&s.pop();for(var f=0;f-1&&(t=n[a][1](t,r()))})),t}),r);return a(t),a},t["fantasy-land/of"]=t;var n=!1;function t(n){var r,i=[],u=[];function c(e){return arguments.length&&e!==t.SKIP&&(n=e,a(c)&&(c._changing(),c._state="active",i.slice().forEach((function(t,e){a(t)&&t(this[e](n))}),u.slice()))),n}function o(){return(r=t()).map((function(n){return!0===n&&(c._parents.forEach((function(n){n._unregisterChild(c)})),c._state="ended",c._parents.length=i.length=u.length=0),n})),r}return c.constructor=t,c._state=arguments.length&&n!==t.SKIP?"active":"pending",c._parents=[],c._changing=function(){a(c)&&(c._state="changing"),i.forEach((function(n){n._changing()}))},c._map=function(e,r){var a=r?t():t(e(n));return a._parents.push(c),i.push(a),u.push(e),a},c.map=function(n){return c._map(n,"active"!==c._state)},c.toJSON=function(){return null!=n&&"function"==typeof n.toJSON?n.toJSON():n},c["fantasy-land/map"]=c.map,c["fantasy-land/ap"]=function(n){return e((function(n,t){return n()(t())}),[n,c])},c._unregisterChild=function(n){var t=i.indexOf(n);-1!==t&&(i.splice(t,1),u.splice(t,1))},Object.defineProperty(c,"end",{get:function(){return r||o()}}),c}function e(n,e){var r=e.every((function(n){if(n.constructor!==t)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream.");return"active"===n._state})),a=r?t(n.apply(null,e.concat([e]))):t(),i=[],u=e.map((function(t){return t._map((function(u){return i.push(t),(r||e.every((function(n){return"pending"!==n._state})))&&(r=!0,a(n.apply(null,e.concat([i]))),i=[]),u}),!0)})),c=a.end.map((function(n){!0===n&&(u.forEach((function(n){n.end(!0)})),c.end(!0))}));return a}function r(n){return e((function(){return n.map((function(n){return n()}))}),n)}function a(n){return"pending"===n._state||"active"===n._state||"changing"===n._state}Object.defineProperty(t,"HALT",{get:function(){return n||console.log("HALT is deprecated and has been renamed to SKIP"),n=!0,t.SKIP}}),"undefined"!=typeof module?module.exports=t:"function"!=typeof window.m||"stream"in window.m?window.m={stream:t}:window.m.stream=t}(); \ No newline at end of file +!function(){"use strict";t.SKIP={},t.lift=function(){var n=arguments[0],t=Array.prototype.slice.call(arguments,1);return r(t).map((function(t){return n.apply(void 0,t)}))},t.scan=function(n,e,r){var a=r.map((function(r){var a=n(e,r);return a!==t.SKIP&&(e=a),a}));return a(e),a},t.merge=r,t.combine=e,t.scanMerge=function(n,t){var r=n.map((function(n){return n[0]})),a=e((function(){var e=arguments[arguments.length-1];return r.forEach((function(r,a){e.indexOf(r)>-1&&(t=n[a][1](t,r()))})),t}),r);return a(t),a},t["fantasy-land/of"]=t;var n=!1;function t(n){var r,i=[],u=[];function c(e){return arguments.length&&e!==t.SKIP&&(n=e,a(c)&&(c._changing(),c._state="active",i.slice().forEach((function(t,e){a(t)&&t(this[e](n))}),u.slice()))),n}return c.constructor=t,c._state=arguments.length&&n!==t.SKIP?"active":"pending",c._parents=[],c._changing=function(){a(c)&&(c._state="changing"),i.forEach((function(n){n._changing()}))},c._map=function(e,r){var a=r?t():t(e(n));return a._parents.push(c),i.push(a),u.push(e),a},c.map=function(n){return c._map(n,"active"!==c._state)},c.toJSON=function(){return null!=n&&"function"==typeof n.toJSON?n.toJSON():n},c["fantasy-land/map"]=c.map,c["fantasy-land/ap"]=function(n){return e((function(n,t){return n()(t())}),[n,c])},c._unregisterChild=function(n){var t=i.indexOf(n);-1!==t&&(i.splice(t,1),u.splice(t,1))},Object.defineProperty(c,"end",{get:function(){return r||((r=t()).map((function(n){return!0===n&&(c._parents.forEach((function(n){n._unregisterChild(c)})),c._state="ended",c._parents.length=i.length=u.length=0),n})),r)}}),c}function e(n,e){var r=e.every((function(n){if(n.constructor!==t)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream.");return"active"===n._state})),a=r?t(n.apply(null,e.concat([e]))):t(),i=[],u=e.map((function(t){return t._map((function(u){return i.push(t),(r||e.every((function(n){return"pending"!==n._state})))&&(r=!0,a(n.apply(null,e.concat([i]))),i=[]),u}),!0)})),c=a.end.map((function(n){!0===n&&(u.forEach((function(n){n.end(!0)})),c.end(!0))}));return a}function r(n){return e((function(){return n.map((function(n){return n()}))}),n)}function a(n){return"pending"===n._state||"active"===n._state||"changing"===n._state}Object.defineProperty(t,"HALT",{get:function(){return n||console.log("HALT is deprecated and has been renamed to SKIP"),n=!0,t.SKIP}}),"undefined"!=typeof module?module.exports=t:"function"!=typeof window.m||"stream"in window.m?window.m={stream:t}:window.m.stream=t}(); \ No newline at end of file