UNPKG

reactjs-tiptap-editor

Version:

A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React

45 lines (41 loc) 502 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ws=require("./index-CSvnpArE.cjs"),br=require("react/jsx-runtime"),ya=require("react"),Pe=require("./RichTextEditor-DaQRHXru.cjs"),Es=require("./index-Dz3YxLE7.cjs");var je={},Ai="1.13.7",Da=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ht=Array.prototype,Ci=Object.prototype,va=typeof Symbol<"u"?Symbol.prototype:null,As=Ht.push,rt=Ht.slice,Kn=Ci.toString,Cs=Ci.hasOwnProperty,qc=typeof ArrayBuffer<"u",Fs=typeof DataView<"u",Ss=Array.isArray,xa=Object.keys,_a=Object.create,Ua=qc&&ArrayBuffer.isView,Bs=isNaN,ks=isFinite,Pc=!{toString:null}.propertyIsEnumerable("toString"),Ta=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ws=Math.pow(2,53)-1;function Oe(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),i=Array(t),c=0;c<t;c++)i[c]=arguments[c+n];switch(n){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i);case 2:return e.call(this,arguments[0],arguments[1],i)}var r=Array(n+1);for(c=0;c<n;c++)r[c]=arguments[c];return r[n]=i,e.apply(this,r)}}function ln(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function zc(e){return e===null}function Fi(e){return e===void 0}function Si(e){return e===!0||e===!1||Kn.call(e)==="[object Boolean]"}function jc(e){return!!(e&&e.nodeType===1)}function Ne(e){var n="[object "+e+"]";return function(t){return Kn.call(t)===n}}const Gt=Ne("String"),Bi=Ne("Number"),Xc=Ne("Date"),Vc=Ne("RegExp"),Hc=Ne("Error"),ki=Ne("Symbol"),Wi=Ne("ArrayBuffer");var Gc=Ne("Function"),Rs=Da.document&&Da.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof Rs!="function"&&(Gc=function(e){return typeof e=="function"||!1});const Re=Gc,Zc=Ne("Object");var $c=Fs&&(!/\[native code\]/.test(String(DataView))||Zc(new DataView(new ArrayBuffer(8)))),Ri=typeof Map<"u"&&Zc(new Map),Ns=Ne("DataView");function Os(e){return e!=null&&Re(e.getInt8)&&Wi(e.buffer)}const Qn=$c?Os:Ns,fn=Ss||Ne("Array");function hn(e,n){return e!=null&&Cs.call(e,n)}var Ti=Ne("Arguments");(function(){Ti(arguments)||(Ti=function(e){return hn(e,"callee")})})();const Zt=Ti;function Yc(e){return!ki(e)&&ks(e)&&!isNaN(parseFloat(e))}function Ni(e){return Bi(e)&&Bs(e)}function Oi(e){return function(){return e}}function Kc(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Ws}}function Qc(e){return function(n){return n==null?void 0:n[e]}}const Pt=Qc("byteLength"),Is=Kc(Pt);var Ls=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Ms(e){return Ua?Ua(e)&&!Qn(e):Is(e)&&Ls.test(Kn.call(e))}const Ii=qc?Ms:Oi(!1),Le=Qc("length");function qs(e){for(var n={},t=e.length,i=0;i<t;++i)n[e[i]]=!0;return{contains:function(c){return n[c]===!0},push:function(c){return n[c]=!0,e.push(c)}}}function Jc(e,n){n=qs(n);var t=Ta.length,i=e.constructor,c=Re(i)&&i.prototype||Ci,r="constructor";for(hn(e,r)&&!n.contains(r)&&n.push(r);t--;)r=Ta[t],r in e&&e[r]!==c[r]&&!n.contains(r)&&n.push(r)}function Be(e){if(!ln(e))return[];if(xa)return xa(e);var n=[];for(var t in e)hn(e,t)&&n.push(t);return Pc&&Jc(e,n),n}function eu(e){if(e==null)return!0;var n=Le(e);return typeof n=="number"&&(fn(e)||Gt(e)||Zt(e))?n===0:Le(Be(e))===0}function Li(e,n){var t=Be(n),i=t.length;if(e==null)return!i;for(var c=Object(e),r=0;r<i;r++){var a=t[r];if(n[a]!==c[a]||!(a in c))return!1}return!0}function we(e){if(e instanceof we)return e;if(!(this instanceof we))return new we(e);this._wrapped=e}we.VERSION=Ai;we.prototype.value=function(){return this._wrapped};we.prototype.valueOf=we.prototype.toJSON=we.prototype.value;we.prototype.toString=function(){return String(this._wrapped)};function wa(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Pt(e))}var Ea="[object DataView]";function wi(e,n,t,i){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var c=typeof e;return c!=="function"&&c!=="object"&&typeof n!="object"?!1:nu(e,n,t,i)}function nu(e,n,t,i){e instanceof we&&(e=e._wrapped),n instanceof we&&(n=n._wrapped);var c=Kn.call(e);if(c!==Kn.call(n))return!1;if($c&&c=="[object Object]"&&Qn(e)){if(!Qn(n))return!1;c=Ea}switch(c){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return va.valueOf.call(e)===va.valueOf.call(n);case"[object ArrayBuffer]":case Ea:return nu(wa(e),wa(n),t,i)}var r=c==="[object Array]";if(!r&&Ii(e)){var a=Pt(e);if(a!==Pt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;r=!0}if(!r){if(typeof e!="object"||typeof n!="object")return!1;var o=e.constructor,u=n.constructor;if(o!==u&&!(Re(o)&&o instanceof o&&Re(u)&&u instanceof u)&&"constructor"in e&&"constructor"in n)return!1}t=t||[],i=i||[];for(var l=t.length;l--;)if(t[l]===e)return i[l]===n;if(t.push(e),i.push(n),r){if(l=e.length,l!==n.length)return!1;for(;l--;)if(!wi(e[l],n[l],t,i))return!1}else{var b=Be(e),m;if(l=b.length,Be(n).length!==l)return!1;for(;l--;)if(m=b[l],!(hn(n,m)&&wi(e[m],n[m],t,i)))return!1}return t.pop(),i.pop(),!0}function tu(e,n){return wi(e,n)}function Ln(e){if(!ln(e))return[];var n=[];for(var t in e)n.push(t);return Pc&&Jc(e,n),n}function Mi(e){var n=Le(e);return function(t){if(t==null)return!1;var i=Ln(t);if(Le(i))return!1;for(var c=0;c<n;c++)if(!Re(t[e[c]]))return!1;return e!==au||!Re(t[qi])}}var qi="forEach",ru="has",Pi=["clear","delete"],iu=["get",ru,"set"],Ps=Pi.concat(qi,iu),au=Pi.concat(iu),zs=["add"].concat(Pi,qi,ru);const ou=Ri?Mi(Ps):Ne("Map"),cu=Ri?Mi(au):Ne("WeakMap"),uu=Ri?Mi(zs):Ne("Set"),su=Ne("WeakSet");function En(e){for(var n=Be(e),t=n.length,i=Array(t),c=0;c<t;c++)i[c]=e[n[c]];return i}function du(e){for(var n=Be(e),t=n.length,i=Array(t),c=0;c<t;c++)i[c]=[n[c],e[n[c]]];return i}function zi(e){for(var n={},t=Be(e),i=0,c=t.length;i<c;i++)n[e[t[i]]]=t[i];return n}function Jn(e){var n=[];for(var t in e)Re(e[t])&&n.push(t);return n.sort()}function ji(e,n){return function(t){var i=arguments.length;if(n&&(t=Object(t)),i<2||t==null)return t;for(var c=1;c<i;c++)for(var r=arguments[c],a=e(r),o=a.length,u=0;u<o;u++){var l=a[u];(!n||t[l]===void 0)&&(t[l]=r[l])}return t}}const Xi=ji(Ln),On=ji(Be),Vi=ji(Ln,!0);function js(){return function(){}}function lu(e){if(!ln(e))return{};if(_a)return _a(e);var n=js();n.prototype=e;var t=new n;return n.prototype=null,t}function fu(e,n){var t=lu(e);return n&&On(t,n),t}function hu(e){return ln(e)?fn(e)?e.slice():Xi({},e):e}function pu(e,n){return n(e),e}function Hi(e){return fn(e)?e:[e]}we.toPath=Hi;function it(e){return we.toPath(e)}function Gi(e,n){for(var t=n.length,i=0;i<t;i++){if(e==null)return;e=e[n[i]]}return t?e:void 0}function Zi(e,n,t){var i=Gi(e,it(n));return Fi(i)?t:i}function gu(e,n){n=it(n);for(var t=n.length,i=0;i<t;i++){var c=n[i];if(!hn(e,c))return!1;e=e[c]}return!!t}function $t(e){return e}function wn(e){return e=On({},e),function(n){return Li(n,e)}}function Yt(e){return e=it(e),function(n){return Gi(n,e)}}function at(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(i){return e.call(n,i)};case 3:return function(i,c,r){return e.call(n,i,c,r)};case 4:return function(i,c,r,a){return e.call(n,i,c,r,a)}}return function(){return e.apply(n,arguments)}}function mu(e,n,t){return e==null?$t:Re(e)?at(e,n,t):ln(e)&&!fn(e)?wn(e):Yt(e)}function Kt(e,n){return mu(e,n,1/0)}we.iteratee=Kt;function Me(e,n,t){return we.iteratee!==Kt?we.iteratee(e,n):mu(e,n,t)}function bu(e,n,t){n=Me(n,t);for(var i=Be(e),c=i.length,r={},a=0;a<c;a++){var o=i[a];r[o]=n(e[o],o,e)}return r}function $i(){}function yu(e){return e==null?$i:function(n){return Zi(e,n)}}function Du(e,n,t){var i=Array(Math.max(0,e));n=at(n,t,1);for(var c=0;c<e;c++)i[c]=n(c);return i}function zt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const In=Date.now||function(){return new Date().getTime()};function vu(e){var n=function(r){return e[r]},t="(?:"+Be(e).join("|")+")",i=RegExp(t),c=RegExp(t,"g");return function(r){return r=r==null?"":""+r,i.test(r)?r.replace(c,n):r}}const xu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},_u=vu(xu),Xs=zi(xu),Uu=vu(Xs),Tu=we.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var yr=/(.)^/,Vs={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Hs=/\\|'|\r|\n|\u2028|\u2029/g;function Gs(e){return"\\"+Vs[e]}var Zs=/^\s*(\w|\$)+\s*$/;function wu(e,n,t){!n&&t&&(n=t),n=Vi({},n,we.templateSettings);var i=RegExp([(n.escape||yr).source,(n.interpolate||yr).source,(n.evaluate||yr).source].join("|")+"|$","g"),c=0,r="__p+='";e.replace(i,function(l,b,m,g,f){return r+=e.slice(c,f).replace(Hs,Gs),c=f+l.length,b?r+=`'+ ((__t=(`+b+`))==null?'':_.escape(__t))+ '`:m?r+=`'+ ((__t=(`+m+`))==null?'':__t)+ '`:g&&(r+=`'; `+g+` __p+='`),l}),r+=`'; `;var a=n.variable;if(a){if(!Zs.test(a))throw new Error("variable is not a bare identifier: "+a)}else r=`with(obj||{}){ `+r+`} `,a="obj";r=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; `+r+`return __p; `;var o;try{o=new Function(a,"_",r)}catch(l){throw l.source=r,l}var u=function(l){return o.call(this,l,we)};return u.source="function("+a+`){ `+r+"}",u}function Eu(e,n,t){n=it(n);var i=n.length;if(!i)return Re(t)?t.call(e):t;for(var c=0;c<i;c++){var r=e==null?void 0:e[n[c]];r===void 0&&(r=t,c=i),e=Re(r)?r.call(e):r}return e}var $s=0;function Au(e){var n=++$s+"";return e?e+n:n}function Cu(e){var n=we(e);return n._chain=!0,n}function Fu(e,n,t,i,c){if(!(i instanceof n))return e.apply(t,c);var r=lu(e.prototype),a=e.apply(r,c);return ln(a)?a:r}var An=Oe(function(e,n){var t=An.placeholder,i=function(){for(var c=0,r=n.length,a=Array(r),o=0;o<r;o++)a[o]=n[o]===t?arguments[c++]:n[o];for(;c<arguments.length;)a.push(arguments[c++]);return Fu(e,i,this,this,a)};return i});An.placeholder=we;const Yi=Oe(function(e,n,t){if(!Re(e))throw new TypeError("Bind must be called on a function");var i=Oe(function(c){return Fu(e,i,n,this,t.concat(c))});return i}),ze=Kc(Le);function Cn(e,n,t,i){if(i=i||[],!n&&n!==0)n=1/0;else if(n<=0)return i.concat(e);for(var c=i.length,r=0,a=Le(e);r<a;r++){var o=e[r];if(ze(o)&&(fn(o)||Zt(o)))if(n>1)Cn(o,n-1,t,i),c=i.length;else for(var u=0,l=o.length;u<l;)i[c++]=o[u++];else t||(i[c++]=o)}return i}const Su=Oe(function(e,n){n=Cn(n,!1,!1);var t=n.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var i=n[t];e[i]=Yi(e[i],e)}return e});function Bu(e,n){var t=function(i){var c=t.cache,r=""+(n?n.apply(this,arguments):i);return hn(c,r)||(c[r]=e.apply(this,arguments)),c[r]};return t.cache={},t}const Ki=Oe(function(e,n,t){return setTimeout(function(){return e.apply(null,t)},n)}),ku=An(Ki,we,1);function Wu(e,n,t){var i,c,r,a,o=0;t||(t={});var u=function(){o=t.leading===!1?0:In(),i=null,a=e.apply(c,r),i||(c=r=null)},l=function(){var b=In();!o&&t.leading===!1&&(o=b);var m=n-(b-o);return c=this,r=arguments,m<=0||m>n?(i&&(clearTimeout(i),i=null),o=b,a=e.apply(c,r),i||(c=r=null)):!i&&t.trailing!==!1&&(i=setTimeout(u,m)),a};return l.cancel=function(){clearTimeout(i),o=0,i=c=r=null},l}function Ru(e,n,t){var i,c,r,a,o,u=function(){var b=In()-c;n>b?i=setTimeout(u,n-b):(i=null,t||(a=e.apply(o,r)),i||(r=o=null))},l=Oe(function(b){return o=this,r=b,c=In(),i||(i=setTimeout(u,n),t&&(a=e.apply(o,r))),a});return l.cancel=function(){clearTimeout(i),i=r=o=null},l}function Nu(e,n){return An(n,e)}function Qt(e){return function(){return!e.apply(this,arguments)}}function Ou(){var e=arguments,n=e.length-1;return function(){for(var t=n,i=e[n].apply(this,arguments);t--;)i=e[t].call(this,i);return i}}function Iu(e,n){return function(){if(--e<1)return n.apply(this,arguments)}}function Qi(e,n){var t;return function(){return--e>0&&(t=n.apply(this,arguments)),e<=1&&(n=null),t}}const Lu=An(Qi,2);function Ji(e,n,t){n=Me(n,t);for(var i=Be(e),c,r=0,a=i.length;r<a;r++)if(c=i[r],n(e[c],c,e))return c}function Mu(e){return function(n,t,i){t=Me(t,i);for(var c=Le(n),r=e>0?0:c-1;r>=0&&r<c;r+=e)if(t(n[r],r,n))return r;return-1}}const Jt=Mu(1),ea=Mu(-1);function na(e,n,t,i){t=Me(t,i,1);for(var c=t(n),r=0,a=Le(e);r<a;){var o=Math.floor((r+a)/2);t(e[o])<c?r=o+1:a=o}return r}function qu(e,n,t){return function(i,c,r){var a=0,o=Le(i);if(typeof r=="number")e>0?a=r>=0?r:Math.max(r+o,a):o=r>=0?Math.min(r+1,o):r+o+1;else if(t&&r&&o)return r=t(i,c),i[r]===c?r:-1;if(c!==c)return r=n(rt.call(i,a,o),Ni),r>=0?r+a:-1;for(r=e>0?a:o-1;r>=0&&r<o;r+=e)if(i[r]===c)return r;return-1}}const ta=qu(1,Jt,na),Pu=qu(-1,ea);function et(e,n,t){var i=ze(e)?Jt:Ji,c=i(e,n,t);if(c!==void 0&&c!==-1)return e[c]}function zu(e,n){return et(e,wn(n))}function $e(e,n,t){n=at(n,t);var i,c;if(ze(e))for(i=0,c=e.length;i<c;i++)n(e[i],i,e);else{var r=Be(e);for(i=0,c=r.length;i<c;i++)n(e[r[i]],r[i],e)}return e}function tn(e,n,t){n=Me(n,t);for(var i=!ze(e)&&Be(e),c=(i||e).length,r=Array(c),a=0;a<c;a++){var o=i?i[a]:a;r[a]=n(e[o],o,e)}return r}function ju(e){var n=function(t,i,c,r){var a=!ze(t)&&Be(t),o=(a||t).length,u=e>0?0:o-1;for(r||(c=t[a?a[u]:u],u+=e);u>=0&&u<o;u+=e){var l=a?a[u]:u;c=i(c,t[l],l,t)}return c};return function(t,i,c,r){var a=arguments.length>=3;return n(t,at(i,r,4),c,a)}}const Rn=ju(1),jt=ju(-1);function sn(e,n,t){var i=[];return n=Me(n,t),$e(e,function(c,r,a){n(c,r,a)&&i.push(c)}),i}function Xu(e,n,t){return sn(e,Qt(Me(n)),t)}function Xt(e,n,t){n=Me(n,t);for(var i=!ze(e)&&Be(e),c=(i||e).length,r=0;r<c;r++){var a=i?i[r]:r;if(!n(e[a],a,e))return!1}return!0}function Vt(e,n,t){n=Me(n,t);for(var i=!ze(e)&&Be(e),c=(i||e).length,r=0;r<c;r++){var a=i?i[r]:r;if(n(e[a],a,e))return!0}return!1}function Ve(e,n,t,i){return ze(e)||(e=En(e)),(typeof t!="number"||i)&&(t=0),ta(e,n,t)>=0}const Vu=Oe(function(e,n,t){var i,c;return Re(n)?c=n:(n=it(n),i=n.slice(0,-1),n=n[n.length-1]),tn(e,function(r){var a=c;if(!a){if(i&&i.length&&(r=Gi(r,i)),r==null)return;a=r[n]}return a==null?a:a.apply(r,t)})});function er(e,n){return tn(e,Yt(n))}function Hu(e,n){return sn(e,wn(n))}function ra(e,n,t){var i=-1/0,c=-1/0,r,a;if(n==null||typeof n=="number"&&typeof e[0]!="object"&&e!=null){e=ze(e)?e:En(e);for(var o=0,u=e.length;o<u;o++)r=e[o],r!=null&&r>i&&(i=r)}else n=Me(n,t),$e(e,function(l,b,m){a=n(l,b,m),(a>c||a===-1/0&&i===-1/0)&&(i=l,c=a)});return i}function Gu(e,n,t){var i=1/0,c=1/0,r,a;if(n==null||typeof n=="number"&&typeof e[0]!="object"&&e!=null){e=ze(e)?e:En(e);for(var o=0,u=e.length;o<u;o++)r=e[o],r!=null&&r<i&&(i=r)}else n=Me(n,t),$e(e,function(l,b,m){a=n(l,b,m),(a<c||a===1/0&&i===1/0)&&(i=l,c=a)});return i}var Ys=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function ia(e){return e?fn(e)?rt.call(e):Gt(e)?e.match(Ys):ze(e)?tn(e,$t):En(e):[]}function aa(e,n,t){if(n==null||t)return ze(e)||(e=En(e)),e[zt(e.length-1)];var i=ia(e),c=Le(i);n=Math.max(Math.min(n,c),0);for(var r=c-1,a=0;a<n;a++){var o=zt(a,r),u=i[a];i[a]=i[o],i[o]=u}return i.slice(0,n)}function Zu(e){return aa(e,1/0)}function $u(e,n,t){var i=0;return n=Me(n,t),er(tn(e,function(c,r,a){return{value:c,index:i++,criteria:n(c,r,a)}}).sort(function(c,r){var a=c.criteria,o=r.criteria;if(a!==o){if(a>o||a===void 0)return 1;if(a<o||o===void 0)return-1}return c.index-r.index}),"value")}function nr(e,n){return function(t,i,c){var r=n?[[],[]]:{};return i=Me(i,c),$e(t,function(a,o){var u=i(a,o,t);e(r,a,u)}),r}}const Yu=nr(function(e,n,t){hn(e,t)?e[t].push(n):e[t]=[n]}),Ku=nr(function(e,n,t){e[t]=n}),Qu=nr(function(e,n,t){hn(e,t)?e[t]++:e[t]=1}),Ju=nr(function(e,n,t){e[t?0:1].push(n)},!0);function es(e){return e==null?0:ze(e)?e.length:Be(e).length}function Ks(e,n,t){return n in t}const oa=Oe(function(e,n){var t={},i=n[0];if(e==null)return t;Re(i)?(n.length>1&&(i=at(i,n[1])),n=Ln(e)):(i=Ks,n=Cn(n,!1,!1),e=Object(e));for(var c=0,r=n.length;c<r;c++){var a=n[c],o=e[a];i(o,a,e)&&(t[a]=o)}return t}),ns=Oe(function(e,n){var t=n[0],i;return Re(t)?(t=Qt(t),n.length>1&&(i=n[1])):(n=tn(Cn(n,!1,!1),String),t=function(c,r){return!Ve(n,r)}),oa(e,t,i)});function ca(e,n,t){return rt.call(e,0,Math.max(0,e.length-(n==null||t?1:n)))}function Nn(e,n,t){return e==null||e.length<1?n==null||t?void 0:[]:n==null||t?e[0]:ca(e,e.length-n)}function Tn(e,n,t){return rt.call(e,n==null||t?1:n)}function ts(e,n,t){return e==null||e.length<1?n==null||t?void 0:[]:n==null||t?e[e.length-1]:Tn(e,Math.max(0,e.length-n))}function rs(e){return sn(e,Boolean)}function is(e,n){return Cn(e,n,!1)}const ua=Oe(function(e,n){return n=Cn(n,!0,!0),sn(e,function(t){return!Ve(n,t)})}),as=Oe(function(e,n){return ua(e,n)});function nt(e,n,t,i){Si(n)||(i=t,t=n,n=!1),t!=null&&(t=Me(t,i));for(var c=[],r=[],a=0,o=Le(e);a<o;a++){var u=e[a],l=t?t(u,a,e):u;n&&!t?((!a||r!==l)&&c.push(u),r=l):t?Ve(r,l)||(r.push(l),c.push(u)):Ve(c,u)||c.push(u)}return c}const os=Oe(function(e){return nt(Cn(e,!0,!0))});function cs(e){for(var n=[],t=arguments.length,i=0,c=Le(e);i<c;i++){var r=e[i];if(!Ve(n,r)){var a;for(a=1;a<t&&Ve(arguments[a],r);a++);a===t&&n.push(r)}}return n}function tt(e){for(var n=e&&ra(e,Le).length||0,t=Array(n),i=0;i<n;i++)t[i]=er(e,i);return t}const us=Oe(tt);function ss(e,n){for(var t={},i=0,c=Le(e);i<c;i++)n?t[e[i]]=n[i]:t[e[i][0]]=e[i][1];return t}function ds(e,n,t){n==null&&(n=e||0,e=0),t||(t=n<e?-1:1);for(var i=Math.max(Math.ceil((n-e)/t),0),c=Array(i),r=0;r<i;r++,e+=t)c[r]=e;return c}function ls(e,n){if(n==null||n<1)return[];for(var t=[],i=0,c=e.length;i<c;)t.push(rt.call(e,i,i+=n));return t}function sa(e,n){return e._chain?we(n).chain():n}function da(e){return $e(Jn(e),function(n){var t=we[n]=e[n];we.prototype[n]=function(){var i=[this._wrapped];return As.apply(i,arguments),sa(this,t.apply(we,i))}}),we}$e(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var n=Ht[e];we.prototype[e]=function(){var t=this._wrapped;return t!=null&&(n.apply(t,arguments),(e==="shift"||e==="splice")&&t.length===0&&delete t[0]),sa(this,t)}});$e(["concat","join","slice"],function(e){var n=Ht[e];we.prototype[e]=function(){var t=this._wrapped;return t!=null&&(t=n.apply(t,arguments)),sa(this,t)}});const Qs=Object.freeze(Object.defineProperty({__proto__:null,VERSION:Ai,after:Iu,all:Xt,allKeys:Ln,any:Vt,assign:On,before:Qi,bind:Yi,bindAll:Su,chain:Cu,chunk:ls,clone:hu,collect:tn,compact:rs,compose:Ou,constant:Oi,contains:Ve,countBy:Qu,create:fu,debounce:Ru,default:we,defaults:Vi,defer:ku,delay:Ki,detect:et,difference:ua,drop:Tn,each:$e,escape:_u,every:Xt,extend:Xi,extendOwn:On,filter:sn,find:et,findIndex:Jt,findKey:Ji,findLastIndex:ea,findWhere:zu,first:Nn,flatten:is,foldl:Rn,foldr:jt,forEach:$e,functions:Jn,get:Zi,groupBy:Yu,has:gu,head:Nn,identity:$t,include:Ve,includes:Ve,indexBy:Ku,indexOf:ta,initial:ca,inject:Rn,intersection:cs,invert:zi,invoke:Vu,isArguments:Zt,isArray:fn,isArrayBuffer:Wi,isBoolean:Si,isDataView:Qn,isDate:Xc,isElement:jc,isEmpty:eu,isEqual:tu,isError:Hc,isFinite:Yc,isFunction:Re,isMap:ou,isMatch:Li,isNaN:Ni,isNull:zc,isNumber:Bi,isObject:ln,isRegExp:Vc,isSet:uu,isString:Gt,isSymbol:ki,isTypedArray:Ii,isUndefined:Fi,isWeakMap:cu,isWeakSet:su,iteratee:Kt,keys:Be,last:ts,lastIndexOf:Pu,map:tn,mapObject:bu,matcher:wn,matches:wn,max:ra,memoize:Bu,methods:Jn,min:Gu,mixin:da,negate:Qt,noop:$i,now:In,object:ss,omit:ns,once:Lu,pairs:du,partial:An,partition:Ju,pick:oa,pluck:er,property:Yt,propertyOf:yu,random:zt,range:ds,reduce:Rn,reduceRight:jt,reject:Xu,rest:Tn,restArguments:Oe,result:Eu,sample:aa,select:sn,shuffle:Zu,size:es,some:Vt,sortBy:$u,sortedIndex:na,tail:Tn,take:Nn,tap:pu,template:wu,templateSettings:Tu,throttle:Wu,times:Du,toArray:ia,toPath:Hi,transpose:tt,unescape:Uu,union:os,uniq:nt,unique:nt,uniqueId:Au,unzip:tt,values:En,where:Hu,without:as,wrap:Nu,zip:us},Symbol.toStringTag,{value:"Module"}));var Ei=da(Qs);Ei._=Ei;const Js=Object.freeze(Object.defineProperty({__proto__:null,VERSION:Ai,after:Iu,all:Xt,allKeys:Ln,any:Vt,assign:On,before:Qi,bind:Yi,bindAll:Su,chain:Cu,chunk:ls,clone:hu,collect:tn,compact:rs,compose:Ou,constant:Oi,contains:Ve,countBy:Qu,create:fu,debounce:Ru,default:Ei,defaults:Vi,defer:ku,delay:Ki,detect:et,difference:ua,drop:Tn,each:$e,escape:_u,every:Xt,extend:Xi,extendOwn:On,filter:sn,find:et,findIndex:Jt,findKey:Ji,findLastIndex:ea,findWhere:zu,first:Nn,flatten:is,foldl:Rn,foldr:jt,forEach:$e,functions:Jn,get:Zi,groupBy:Yu,has:gu,head:Nn,identity:$t,include:Ve,includes:Ve,indexBy:Ku,indexOf:ta,initial:ca,inject:Rn,intersection:cs,invert:zi,invoke:Vu,isArguments:Zt,isArray:fn,isArrayBuffer:Wi,isBoolean:Si,isDataView:Qn,isDate:Xc,isElement:jc,isEmpty:eu,isEqual:tu,isError:Hc,isFinite:Yc,isFunction:Re,isMap:ou,isMatch:Li,isNaN:Ni,isNull:zc,isNumber:Bi,isObject:ln,isRegExp:Vc,isSet:uu,isString:Gt,isSymbol:ki,isTypedArray:Ii,isUndefined:Fi,isWeakMap:cu,isWeakSet:su,iteratee:Kt,keys:Be,last:ts,lastIndexOf:Pu,map:tn,mapObject:bu,matcher:wn,matches:wn,max:ra,memoize:Bu,methods:Jn,min:Gu,mixin:da,negate:Qt,noop:$i,now:In,object:ss,omit:ns,once:Lu,pairs:du,partial:An,partition:Ju,pick:oa,pluck:er,property:Yt,propertyOf:yu,random:zt,range:ds,reduce:Rn,reduceRight:jt,reject:Xu,rest:Tn,restArguments:Oe,result:Eu,sample:aa,select:sn,shuffle:Zu,size:es,some:Vt,sortBy:$u,sortedIndex:na,tail:Tn,take:Nn,tap:pu,template:wu,templateSettings:Tu,throttle:Wu,times:Du,toArray:ia,toPath:Hi,transpose:tt,unescape:Uu,union:os,uniq:nt,unique:nt,uniqueId:Au,unzip:tt,values:En,where:Hu,without:as,wrap:Nu,zip:us},Symbol.toStringTag,{value:"Module"})),Se=Pe.getAugmentedNamespace(Js);var ct={},Xe={},Dr={exports:{}},ut={exports:{}},Aa;function Mn(){if(Aa)return ut.exports;Aa=1;var e=function(){return this===void 0}();if(e)ut.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(b,m){var g=Object.getOwnPropertyDescriptor(b,m);return!!(!g||g.writable||g.set)}};else{var n={}.hasOwnProperty,t={}.toString,i={}.constructor.prototype,c=function(b){var m=[];for(var g in b)n.call(b,g)&&m.push(g);return m},r=function(b,m){return{value:b[m]}},a=function(b,m,g){return b[m]=g.value,b},o=function(b){return b},u=function(b){try{return Object(b).constructor.prototype}catch{return i}},l=function(b){try{return t.call(b)==="[object Array]"}catch{return!1}};ut.exports={isArray:l,keys:c,names:c,defineProperty:a,getDescriptor:r,freeze:o,getPrototypeOf:u,isES5:e,propertyIsWritable:function(){return!0}}}return ut.exports}var Pn,Ca;function Ae(){if(Ca)return Pn;Ca=1;var e=Mn(),n=typeof navigator>"u",t={e:{}},i,c=typeof self<"u"?self:typeof window<"u"?window:typeof Pe.commonjsGlobal<"u"?Pe.commonjsGlobal:Pn!==void 0?Pn:null;function r(){try{var k=i;return i=null,k.apply(this,arguments)}catch(re){return t.e=re,t}}function a(k){return i=k,r}var o=function(k,re){var ae={}.hasOwnProperty;function J(){this.constructor=k,this.constructor$=re;for(var ue in re.prototype)ae.call(re.prototype,ue)&&ue.charAt(ue.length-1)!=="$"&&(this[ue+"$"]=re.prototype[ue])}return J.prototype=re.prototype,k.prototype=new J,k.prototype};function u(k){return k==null||k===!0||k===!1||typeof k=="string"||typeof k=="number"}function l(k){return typeof k=="function"||typeof k=="object"&&k!==null}function b(k){return u(k)?new Error(w(k)):k}function m(k,re){var ae=k.length,J=new Array(ae+1),ue;for(ue=0;ue<ae;++ue)J[ue]=k[ue];return J[ue]=re,J}function g(k,re,ae){if(e.isES5){var J=Object.getOwnPropertyDescriptor(k,re);if(J!=null)return J.get==null&&J.set==null?J.value:ae}else return{}.hasOwnProperty.call(k,re)?k[re]:void 0}function f(k,re,ae){if(u(k))return k;var J={value:ae,configurable:!0,enumerable:!1,writable:!0};return e.defineProperty(k,re,J),k}function y(k){throw k}var h=function(){var k=[Array.prototype,Object.prototype,Function.prototype],re=function(ue){for(var pe=0;pe<k.length;++pe)if(k[pe]===ue)return!0;return!1};if(e.isES5){var ae=Object.getOwnPropertyNames;return function(ue){for(var pe=[],le=Object.create(null);ue!=null&&!re(ue);){var fe;try{fe=ae(ue)}catch{return pe}for(var me=0;me<fe.length;++me){var ye=fe[me];if(!le[ye]){le[ye]=!0;var Ue=Object.getOwnPropertyDescriptor(ue,ye);Ue!=null&&Ue.get==null&&Ue.set==null&&pe.push(ye)}}ue=e.getPrototypeOf(ue)}return pe}}else{var J={}.hasOwnProperty;return function(ue){if(re(ue))return[];var pe=[];e:for(var le in ue)if(J.call(ue,le))pe.push(le);else{for(var fe=0;fe<k.length;++fe)if(J.call(k[fe],le))continue e;pe.push(le)}return pe}}}(),s=/this\s*\.\s*\S+\s*=/;function p(k){try{if(typeof k=="function"){var re=e.names(k.prototype),ae=e.isES5&&re.length>1,J=re.length>0&&!(re.length===1&&re[0]==="constructor"),ue=s.test(k+"")&&e.names(k).length>0;if(ae||J||ue)return!0}return!1}catch{return!1}}function d(k){return k}var D=/^[a-z$_][a-z$_0-9]*$/i;function U(k){return D.test(k)}function _(k,re,ae){for(var J=new Array(k),ue=0;ue<k;++ue)J[ue]=re+ue+ae;return J}function w(k){try{return k+""}catch{return"[no string representation]"}}function E(k){return k!==null&&typeof k=="object"&&typeof k.message=="string"&&typeof k.name=="string"}function S(k){try{f(k,"isOperational",!0)}catch{}}function A(k){return k==null?!1:k instanceof Error.__BluebirdErrorTypes__.OperationalError||k.isOperational===!0}function I(k){return E(k)&&e.propertyIsWritable(k,"stack")}var $=function(){return"stack"in new Error?function(k){return I(k)?k:new Error(w(k))}:function(k){if(I(k))return k;try{throw new Error(w(k))}catch(re){return re}}}();function T(k){return{}.toString.call(k)}function R(k,re,ae){for(var J=e.names(k),ue=0;ue<J.length;++ue){var pe=J[ue];if(ae(pe))try{e.defineProperty(re,pe,e.getDescriptor(k,pe))}catch{}}}var x=function(k){return e.isArray(k)?k:null};if(typeof Symbol<"u"&&Symbol.iterator){var X=typeof Array.from=="function"?function(k){return Array.from(k)}:function(k){for(var re=[],ae=k[Symbol.iterator](),J;!(J=ae.next()).done;)re.push(J.value);return re};x=function(k){return e.isArray(k)?k:k!=null&&typeof k[Symbol.iterator]=="function"?X(k):null}}var W=typeof process<"u"&&T(process).toLowerCase()==="[object process]",O=typeof process<"u"&&typeof process.env<"u";function Z(k){return O?process.env[k]:void 0}function q(){if(typeof Promise=="function")try{var k=new Promise(function(){});if({}.toString.call(k)==="[object Promise]")return Promise}catch{}}function Q(k,re){return k.bind(re)}var L={isClass:p,isIdentifier:U,inheritedDataKeys:h,getDataPropertyOrDefault:g,thrower:y,isArray:e.isArray,asArray:x,notEnumerableProp:f,isPrimitive:u,isObject:l,isError:E,canEvaluate:n,errorObj:t,tryCatch:a,inherits:o,withAppended:m,maybeWrapAsError:b,toFastProperties:d,filledRange:_,toString:w,canAttachTrace:I,ensureErrorObject:$,originatesFromRejection:A,markAsOriginatingFromRejection:S,classString:T,copyDescriptors:R,hasDevTools:typeof chrome<"u"&&chrome&&typeof chrome.loadTimes=="function",isNode:W,hasEnvVariables:O,env:Z,global:c,getNativePromise:q,domainBind:Q};L.isRecentNode=L.isNode&&function(){var k=process.versions.node.split(".").map(Number);return k[0]===0&&k[1]>10||k[0]>0}(),L.isNode&&L.toFastProperties(process);try{throw new Error}catch(k){L.lastLineError=k}return Pn=L,Pn}var st={exports:{}},vr,Fa;function ed(){if(Fa)return vr;Fa=1;var e=Ae(),n,t=function(){throw new Error(`No async scheduler available See http://goo.gl/MqrFmX `)},i=e.getNativePromise();if(e.isNode&&typeof MutationObserver>"u"){var c=Pe.commonjsGlobal.setImmediate,r=process.nextTick;n=e.isRecentNode?function(o){c.call(Pe.commonjsGlobal,o)}:function(o){r.call(process,o)}}else if(typeof i=="function"&&typeof i.resolve=="function"){var a=i.resolve();n=function(o){a.then(o)}}else typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))?n=function(){var o=document.createElement("div"),u={attributes:!0},l=!1,b=document.createElement("div"),m=new MutationObserver(function(){o.classList.toggle("foo"),l=!1});m.observe(b,u);var g=function(){l||(l=!0,b.classList.toggle("foo"))};return function(y){var h=new MutationObserver(function(){h.disconnect(),y()});h.observe(o,u),g()}}():typeof setImmediate<"u"?n=function(o){setImmediate(o)}:typeof setTimeout<"u"?n=function(o){setTimeout(o,0)}:n=t;return vr=n,vr}var xr,Sa;function nd(){if(Sa)return xr;Sa=1;function e(t,i,c,r,a){for(var o=0;o<a;++o)c[o+r]=t[o+i],t[o+i]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}return n.prototype._willBeOverCapacity=function(t){return this._capacity<t},n.prototype._pushOne=function(t){var i=this.length();this._checkCapacity(i+1);var c=this._front+i&this._capacity-1;this[c]=t,this._length=i+1},n.prototype.push=function(t,i,c){var r=this.length()+3;if(this._willBeOverCapacity(r)){this._pushOne(t),this._pushOne(i),this._pushOne(c);return}var a=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[a+0&o]=t,this[a+1&o]=i,this[a+2&o]=c,this._length=r},n.prototype.shift=function(){var t=this._front,i=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,i},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(t){var i=this._capacity;this._capacity=t;var c=this._front,r=this._length,a=c+r&i-1;e(this,0,this,i,a)},xr=n,xr}var Ba;function td(){if(Ba)return st.exports;Ba=1;var e;try{throw new Error}catch(u){e=u}var n=ed(),t=nd(),i=Ae();function c(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new t(16),this._normalQueue=new t(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var u=this;this.drainQueues=function(){u._drainQueues()},this._schedule=n}c.prototype.setScheduler=function(u){var l=this._schedule;return this._schedule=u,this._customScheduler=!0,l},c.prototype.hasCustomScheduler=function(){return this._customScheduler},c.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},c.prototype.disableTrampolineIfNecessary=function(){i.hasDevTools&&(this._trampolineEnabled=!1)},c.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},c.prototype.fatalError=function(u,l){l?(process.stderr.write("Fatal "+(u instanceof Error?u.stack:u)+` `),process.exit(2)):this.throwLater(u)},c.prototype.throwLater=function(u,l){if(arguments.length===1&&(l=u,u=function(){throw l}),typeof setTimeout<"u")setTimeout(function(){u(l)},0);else try{this._schedule(function(){u(l)})}catch{throw new Error(`No async scheduler available See http://goo.gl/MqrFmX `)}};function r(u,l,b){this._lateQueue.push(u,l,b),this._queueTick()}function a(u,l,b){this._normalQueue.push(u,l,b),this._queueTick()}function o(u){this._normalQueue._pushOne(u),this._queueTick()}return i.hasDevTools?(c.prototype.invokeLater=function(u,l,b){this._trampolineEnabled?r.call(this,u,l,b):this._schedule(function(){setTimeout(function(){u.call(l,b)},100)})},c.prototype.invoke=function(u,l,b){this._trampolineEnabled?a.call(this,u,l,b):this._schedule(function(){u.call(l,b)})},c.prototype.settlePromises=function(u){this._trampolineEnabled?o.call(this,u):this._schedule(function(){u._settlePromises()})}):(c.prototype.invokeLater=r,c.prototype.invoke=a,c.prototype.settlePromises=o),c.prototype._drainQueue=function(u){for(;u.length()>0;){var l=u.shift();if(typeof l!="function"){l._settlePromises();continue}var b=u.shift(),m=u.shift();l.call(b,m)}},c.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},c.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},c.prototype._reset=function(){this._isTickUsed=!1},st.exports=c,st.exports.firstLineError=e,st.exports}var _r,ka;function dn(){if(ka)return _r;ka=1;var e=Mn(),n=e.freeze,t=Ae(),i=t.inherits,c=t.notEnumerableProp;function r(p,d){function D(U){if(!(this instanceof D))return new D(U);c(this,"message",typeof U=="string"?U:d),c(this,"name",p),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return i(D,Error),D}var a,o,u=r("Warning","warning"),l=r("CancellationError","cancellation error"),b=r("TimeoutError","timeout error"),m=r("AggregateError","aggregate error");try{a=TypeError,o=RangeError}catch{a=r("TypeError","type error"),o=r("RangeError","range error")}for(var g="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),f=0;f<g.length;++f)typeof Array.prototype[g[f]]=="function"&&(m.prototype[g[f]]=Array.prototype[g[f]]);e.defineProperty(m.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),m.prototype.isOperational=!0;var y=0;m.prototype.toString=function(){var p=Array(y*4+1).join(" "),d=` `+p+`AggregateError of: `;y++,p=Array(y*4+1).join(" ");for(var D=0;D<this.length;++D){for(var U=this[D]===this?"[Circular AggregateError]":this[D]+"",_=U.split(` `),w=0;w<_.length;++w)_[w]=p+_[w];U=_.join(` `),d+=U+` `}return y--,d};function h(p){if(!(this instanceof h))return new h(p);c(this,"name","OperationalError"),c(this,"message",p),this.cause=p,this.isOperational=!0,p instanceof Error?(c(this,"message",p.message),c(this,"stack",p.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}i(h,Error);var s=Error.__BluebirdErrorTypes__;return s||(s=n({CancellationError:l,TimeoutError:b,OperationalError:h,RejectionError:h,AggregateError:m}),e.defineProperty(Error,"__BluebirdErrorTypes__",{value:s,writable:!1,enumerable:!1,configurable:!1})),_r={Error,TypeError:a,RangeError:o,CancellationError:s.CancellationError,OperationalError:s.OperationalError,TimeoutError:s.TimeoutError,AggregateError:s.AggregateError,Warning:u},_r}var Ur,Wa;function rd(){return Wa||(Wa=1,Ur=function(e,n){var t=Ae(),i=t.errorObj,c=t.isObject;function r(m,g){if(c(m)){if(m instanceof e)return m;var f=o(m);if(f===i){g&&g._pushContext();var y=e.reject(f.e);return g&&g._popContext(),y}else if(typeof f=="function"){if(l(m)){var y=new e(n);return m._then(y._fulfill,y._reject,void 0,y,null),y}return b(m,f,g)}}return m}function a(m){return m.then}function o(m){try{return a(m)}catch(g){return i.e=g,i}}var u={}.hasOwnProperty;function l(m){try{return u.call(m,"_promise0")}catch{return!1}}function b(m,g,f){var y=new e(n),h=y;f&&f._pushContext(),y._captureStackTrace(),f&&f._popContext();var s=!0,p=t.tryCatch(g).call(m,d,D);s=!1,y&&p===i&&(y._rejectCallback(p.e,!0,!0),y=null);function d(U){y&&(y._resolveCallback(U),y=null)}function D(U){y&&(y._rejectCallback(U,s,!0),y=null)}return h}return r}),Ur}var Tr,Ra;function id(){return Ra||(Ra=1,Tr=function(e,n,t,i,c){var r=Ae();r.isArray;function a(u){switch(u){case-2:return[];case-3:return{}}}function o(u){var l=this._promise=new e(n);u instanceof e&&l._propagateFrom(u,3),l._setOnCancel(this),this._values=u,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return r.inherits(o,c),o.prototype.length=function(){return this._length},o.prototype.promise=function(){return this._promise},o.prototype._init=function u(l,b){var m=t(this._values,this._promise);if(m instanceof e){m=m._target();var g=m._bitField;if(this._values=m,(g&50397184)===0)return this._promise._setAsyncGuaranteed(),m._then(u,this._reject,void 0,this,b);if((g&33554432)!==0)m=m._value();else return(g&16777216)!==0?this._reject(m._reason()):this._cancel()}if(m=r.asArray(m),m===null){var f=i("expecting an array or an iterable object but got "+r.classString(m)).reason();this._promise._rejectCallback(f,!1);return}if(m.length===0){b===-5?this._resolveEmptyArray():this._resolve(a(b));return}this._iterate(m)},o.prototype._iterate=function(u){var l=this.getActualLength(u.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var b=this._promise,m=!1,g=null,f=0;f<l;++f){var y=t(u[f],b);y instanceof e?(y=y._target(),g=y._bitField):g=null,m?g!==null&&y.suppressUnhandledRejections():g!==null?(g&50397184)===0?(y._proxy(this,f),this._values[f]=y):(g&33554432)!==0?m=this._promiseFulfilled(y._value(),f):(g&16777216)!==0?m=this._promiseRejected(y._reason(),f):m=this._promiseCancelled(f):m=this._promiseFulfilled(y,f)}m||b._setAsyncGuaranteed()},o.prototype._isResolved=function(){return this._values===null},o.prototype._resolve=function(u){this._values=null,this._promise._fulfill(u)},o.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},o.prototype._reject=function(u){this._values=null,this._promise._rejectCallback(u,!1)},o.prototype._promiseFulfilled=function(u,l){this._values[l]=u;var b=++this._totalResolved;return b>=this._length?(this._resolve(this._values),!0):!1},o.prototype._promiseCancelled=function(){return this._cancel(),!0},o.prototype._promiseRejected=function(u){return this._totalResolved++,this._reject(u),!0},o.prototype._resultCancelled=function(){if(!this._isResolved()){var u=this._values;if(this._cancel(),u instanceof e)u.cancel();else for(var l=0;l<u.length;++l)u[l]instanceof e&&u[l].cancel()}},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(u){return u},o}),Tr}var wr,Na;function ad(){return Na||(Na=1,wr=function(e){var n=!1,t=[];e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){};function i(){this._trace=new i.CapturedTrace(r())}i.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,t.push(this._trace))},i.prototype._popContext=function(){if(this._trace!==void 0){var a=t.pop(),o=a._promiseCreated;return a._promiseCreated=null,o}return null};function c(){if(n)return new i}function r(){var a=t.length-1;if(a>=0)return t[a]}return i.CapturedTrace=null,i.create=c,i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var a=e.prototype._pushContext,o=e.prototype._popContext,u=e._peekContext,l=e.prototype._peekContext,b=e.prototype._promiseCreated;i.deactivateLongStackTraces=function(){e.prototype._pushContext=a,e.prototype._popContext=o,e._peekContext=u,e.prototype._peekContext=l,e.prototype._promiseCreated=b,n=!1},n=!0,e.prototype._pushContext=i.prototype._pushContext,e.prototype._popContext=i.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var m=this._peekContext();m&&m._promiseCreated==null&&(m._promiseCreated=this)}},i}),wr}var Er,Oa;function od(){return Oa||(Oa=1,Er=function(e,n){var t=e._getDomain,i=e._async,c=dn().Warning,r=Ae(),a=r.canAttachTrace,o,u,l=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,b=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,f=null,y=!1,h,s=!!(r.env("BLUEBIRD_DEBUG")!=0&&(r.env("BLUEBIRD_DEBUG")||r.env("NODE_ENV")==="development")),p=!!(r.env("BLUEBIRD_WARNINGS")!=0&&(s||r.env("BLUEBIRD_WARNINGS"))),d=!!(r.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(s||r.env("BLUEBIRD_LONG_STACK_TRACES"))),D=r.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(p||!!r.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var M=this._target();M._bitField=M._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){(this._bitField&524288)===0&&(this._setRejectionIsUnhandled(),i.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){Ue("rejectionHandled",o,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=this._bitField|268435456},e.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!==0},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var M=this._settledValue();this._setUnhandledRejectionIsNotified(),Ue("unhandledRejection",u,M,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|262144},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},e.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},e.prototype._warn=function(M,j,K){return ae(M,j,K||this)},e.onPossiblyUnhandledRejection=function(M){var j=t();u=typeof M=="function"?j===null?M:r.domainBind(j,M):void 0},e.onUnhandledRejectionHandled=function(M){var j=t();o=typeof M=="function"?j===null?M:r.domainBind(j,M):void 0};var U=function(){};e.longStackTraces=function(){if(i.haveItemsQueued()&&!G.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);if(!G.longStackTraces&&H()){var M=e.prototype._captureStackTrace,j=e.prototype._attachExtraTrace;G.longStackTraces=!0,U=function(){if(i.haveItemsQueued()&&!G.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);e.prototype._captureStackTrace=M,e.prototype._attachExtraTrace=j,n.deactivateLongStackTraces(),i.enableTrampoline(),G.longStackTraces=!1},e.prototype._captureStackTrace=Q,e.prototype._attachExtraTrace=L,n.activateLongStackTraces(),i.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return G.longStackTraces&&H()};var _=function(){try{if(typeof CustomEvent=="function"){var M=new CustomEvent("CustomEvent");return r.global.dispatchEvent(M),function(j,K){var te=new CustomEvent(j.toLowerCase(),{detail:K,cancelable:!0});return!r.global.dispatchEvent(te)}}else if(typeof Event=="function"){var M=new Event("CustomEvent");return r.global.dispatchEvent(M),function(K,te){var se=new Event(K.toLowerCase(),{cancelable:!0});return se.detail=te,!r.global.dispatchEvent(se)}}else{var M=document.createEvent("CustomEvent");return M.initCustomEvent("testingtheevent",!1,!0,{}),r.global.dispatchEvent(M),function(K,te){var se=document.createEvent("CustomEvent");return se.initCustomEvent(K.toLowerCase(),!1,!0,te),!r.global.dispatchEvent(se)}}}catch{}return function(){return!1}}(),w=function(){return r.isNode?function(){return process.emit.apply(process,arguments)}:r.global?function(M){var j="on"+M.toLowerCase(),K=r.global[j];return K?(K.apply(r.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}();function E(M,j){return{promise:j}}var S={promiseCreated:E,promiseFulfilled:E,promiseRejected:E,promiseResolved:E,promiseCancelled:E,promiseChained:function(M,j,K){return{promise:j,child:K}},warning:function(M,j){return{warning:j}},unhandledRejection:function(M,j,K){return{reason:j,promise:K}},rejectionHandled:E},A=function(M){var j=!1;try{j=w.apply(null,arguments)}catch(te){i.throwLater(te),j=!0}var K=!1;try{K=_(M,S[M].apply(null,arguments))}catch(te){i.throwLater(te),K=!0}return K||j};e.config=function(M){if(M=Object(M),"longStackTraces"in M&&(M.longStackTraces?e.longStackTraces():!M.longStackTraces&&e.hasLongStackTraces()&&U()),"warnings"in M){var j=M.warnings;G.warnings=!!j,D=G.warnings,r.isObject(j)&&"wForgottenReturn"in j&&(D=!!j.wForgottenReturn)}if("cancellation"in M&&M.cancellation&&!G.cancellation){if(i.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=X,e.prototype._propagateFrom=W,e.prototype._onCancel=R,e.prototype._setOnCancel=x,e.prototype._attachCancellationCallback=T,e.prototype._execute=$,Z=W,G.cancellation=!0}return"monitoring"in M&&(M.monitoring&&!G.monitoring?(G.monitoring=!0,e.prototype._fireEvent=A):!M.monitoring&&G.monitoring&&(G.monitoring=!1,e.prototype._fireEvent=I)),e};function I(){return!1}e.prototype._fireEvent=I,e.prototype._execute=function(M,j,K){try{M(j,K)}catch(te){return te}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(M){},e.prototype._attachCancellationCallback=function(M){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(M,j){};function $(M,j,K){var te=this;try{M(j,K,function(se){if(typeof se!="function")throw new TypeError("onCancel must be a function, got: "+r.toString(se));te._attachCancellationCallback(se)})}catch(se){return se}}function T(M){if(!this._isCancellable())return this;var j=this._onCancel();j!==void 0?r.isArray(j)?j.push(M):this._setOnCancel([j,M]):this._setOnCancel(M)}function R(){return this._onCancelField}function x(M){this._onCancelField=M}function X(){this._cancellationParent=void 0,this._onCancelField=void 0}function W(M,j){if((j&1)!==0){this._cancellationParent=M;var K=M._branchesRemainingToCancel;K===void 0&&(K=0),M._branchesRemainingToCancel=K+1}(j&2)!==0&&M._isBound()&&this._setBoundTo(M._boundTo)}function O(M,j){(j&2)!==0&&M._isBound()&&this._setBoundTo(M._boundTo)}var Z=O;function q(){var M=this._boundTo;return M!==void 0&&M instanceof e?M.isFulfilled()?M.value():void 0:M}function Q(){this._trace=new ie(this._peekContext())}function L(M,j){if(a(M)){var K=this._trace;if(K!==void 0&&j&&(K=K._parent),K!==void 0)K.attachExtraTrace(M);else if(!M.__stackCleaned__){var te=me(M);r.notEnumerableProp(M,"stack",te.message+` `+te.stack.join(` `)),r.notEnumerableProp(M,"__stackCleaned__",!0)}}}function k(M,j,K,te,se){if(M===void 0&&j!==null&&D){if(se!==void 0&&se._returnedNonUndefined()||(te._bitField&65535)===0)return;K&&(K=K+" ");var he="",ve="";if(j._trace){for(var be=j._trace.stack.split(` `),Y=le(be),oe=Y.length-1;oe>=0;--oe){var ce=Y[oe];if(!b.test(ce)){var ge=ce.match(m);ge&&(he="at "+ge[1]+":"+ge[2]+":"+ge[3]+" ");break}}if(Y.length>0){for(var _e=Y[0],oe=0;oe<be.length;++oe)if(be[oe]===_e){oe>0&&(ve=` `+be[oe-1]);break}}}var xe="a promise was created in a "+K+"handler "+he+"but was not returned from it, see http://goo.gl/rRqMUw"+ve;te._warn(xe,!0,j)}}function re(M,j){var K=M+" is deprecated and will be removed in a future version.";return j&&(K+=" Use "+j+" instead."),ae(K)}function ae(M,j,K){if(G.warnings){var te=new c(M),se;if(j)K._attachExtraTrace(te);else if(G.longStackTraces&&(se=e._peekContext()))se.attachExtraTrace(te);else{var he=me(te);te.stack=he.message+` `+he.stack.join(` `)}A("warning",te)||ye(te,"",!0)}}function J(M,j){for(var K=0;K<j.length-1;++K)j[K].push("From previous event:"),j[K]=j[K].join(` `);return K<j.length&&(j[K]=j[K].join(` `)),M+` `+j.join(` `)}function ue(M){for(var j=0;j<M.length;++j)(M[j].length===0||j+1<M.length&&M[j][0]===M[j+1][0])&&(M.splice(j,1),j--)}function pe(M){for(var j=M[0],K=1;K<M.length;++K){for(var te=M[K],se=j.length-1,he=j[se],ve=-1,be=te.length-1;be>=0;--be)if(te[be]===he){ve=be;break}for(var be=ve;be>=0;--be){var Y=te[be];if(j[se]===Y)j.pop(),se--;else break}j=te}}function le(M){for(var j=[],K=0;K<M.length;++K){var te=M[K],se=te===" (No stack trace)"||g.test(te),he=se&&V(te);se&&!he&&(y&&te.charAt(0)!==" "&&(te=" "+te),j.push(te))}return j}function fe(M){for(var j=M.stack.replace(/\s+$/g,"").split(` `),K=0;K<j.length;++K){var te=j[K];if(te===" (No stack trace)"||g.test(te))break}return K>0&&M.name!="SyntaxError"&&(j=j.slice(K)),j}function me(M){var j=M.stack,K=M.toString();return j=typeof j=="string"&&j.length>0?fe(M):[" (No stack trace)"],{message:K,stack:M.name=="SyntaxError"?j:le(j)}}function ye(M,j,K){if(typeof console<"u"){var te;if(r.isObject(M)){var se=M.stack;te=j+f(se,M)}else te=j+String(M);typeof h=="function"?h(te,K):(typeof console.log=="function"||typeof console.log=="object")&&console.log(te)}}function Ue(M,j,K,te){var se=!1;try{typeof j=="function"&&(se=!0,M==="rejectionHandled"?j(te):j(K,te))}catch(he){i.throwLater(he)}M==="unhandledRejection"?!A(M,K,te)&&!se&&ye(K,"Unhandled rejection "):A(M,te)}function Ee(M){var j;if(typeof M=="function")j="[function "+(M.name||"anonymous")+"]";else{j=M&&typeof M.toString=="function"?M.toString():r.toString(M);var K=/\[object [a-zA-Z0-9$_]+\]/;if(K.test(j))try{var te=JSON.stringify(M);j=te}catch{}j.length===0&&(j="(empty array)")}return"(<"+v(j)+">, no stack trace)"}function v(M){var j=41;return M.length<j?M:M.substr(0,j-3)+"..."}function H(){return typeof ne=="function"}var V=function(){return!1},N=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function B(M){var j=M.match(N);if(j)return{fileName:j[1],line:parseInt(j[2],10)}}function z(M,j){if(H()){for(var K=M.stack.split(` `),te=j.stack.split(` `),se=-1,he=-1,ve,be,Y=0;Y<K.length;++Y){var oe=B(K[Y]);if(oe){ve=oe.fileName,se=oe.line;break}}for(var Y=0;Y<te.length;++Y){var oe=B(te[Y]);if(oe){be=oe.fileName,he=oe.line;break}}se<0||he<0||!ve||!be||ve!==be||se>=he||(V=function(ce){if(l.test(ce))return!0;var ge=B(ce);return!!(ge&&ge.fileName===ve&&se<=ge.line&&ge.line<=he)})}}function ie(M){this._parent=M,this._promisesCreated=0;var j=this._length=1+(M===void 0?0:M._length);ne(this,ie),j>32&&this.uncycle()}r.inherits(ie,Error),n.CapturedTrace=ie,ie.prototype.uncycle=function(){var M=this._length;if(!(M<2)){for(var j=[],K={},te=0,se=this;se!==void 0;++te)j.push(se),se=se._parent;M=this._length=te;for(var te=M-1;te>=0;--te){var he=j[te].stack;K[he]===void 0&&(K[he]=te)}for(var te=0;te<M;++te){var ve=j[te].stack,be=K[ve];if(be!==void 0&&be!==te){be>0&&(j[be-1]._parent=void 0,j[be-1]._length=1),j[te]._parent=void 0,j[te]._length=1;var Y=te>0?j[te-1]:this;be<M-1?(Y._parent=j[be+1],Y._parent.uncycle(),Y._length=Y._parent._length+1):(Y._parent=void 0,Y._length=1);for(var oe=Y._length+1,ce=te-2;ce>=0;--ce)j[ce]._length=oe,oe++;return}}}},ie.prototype.attachExtraTrace=function(M){if(!M.__stackCleaned__){this.uncycle();for(var j=me(M),K=j.message,te=[j.stack],se=this;se!==void 0;)te.push(le(se.stack.split(` `))),se=se._parent;pe(te),ue(te),r.notEnumerableProp(M,"stack",J(K,te)),r.notEnumerableProp(M,"__stackCleane