canvas-editor-engine 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/index.d.ts +574 -18
  2. package/dist/index.mjs.js +2 -0
  3. package/dist/index.mjs.js.LICENSE.txt +8 -0
  4. package/package.json +10 -4
  5. package/dist/components/canvas.component.d.ts +0 -21
  6. package/dist/components/canvas.component.js +0 -90
  7. package/dist/components/excretions.component.d.ts +0 -32
  8. package/dist/components/excretions.component.js +0 -280
  9. package/dist/components/loading.component.d.ts +0 -14
  10. package/dist/components/loading.component.js +0 -96
  11. package/dist/components/pipette.component.d.ts +0 -23
  12. package/dist/components/pipette.component.js +0 -149
  13. package/dist/components/slot.component.d.ts +0 -10
  14. package/dist/components/slot.component.js +0 -31
  15. package/dist/config.d.ts +0 -23
  16. package/dist/config.js +0 -67
  17. package/dist/filters/collection/vague.d.ts +0 -13
  18. package/dist/filters/collection/vague.js +0 -150
  19. package/dist/filters/index.d.ts +0 -2
  20. package/dist/filters/index.js +0 -5
  21. package/dist/index.js +0 -69
  22. package/dist/services/component.service.d.ts +0 -5
  23. package/dist/services/component.service.js +0 -37
  24. package/dist/services/crop.service.d.ts +0 -7
  25. package/dist/services/crop.service.js +0 -50
  26. package/dist/services/download.service.d.ts +0 -4
  27. package/dist/services/download.service.js +0 -15
  28. package/dist/services/draw.service.d.ts +0 -17
  29. package/dist/services/draw.service.js +0 -152
  30. package/dist/services/event.service.d.ts +0 -16
  31. package/dist/services/event.service.js +0 -35
  32. package/dist/services/logger.service.d.ts +0 -20
  33. package/dist/services/logger.service.js +0 -38
  34. package/dist/services/projects.service.d.ts +0 -11
  35. package/dist/services/projects.service.js +0 -98
  36. package/dist/services/pull-project.service.d.ts +0 -8
  37. package/dist/services/pull-project.service.js +0 -34
  38. package/dist/services/store.service.d.ts +0 -6
  39. package/dist/services/store.service.js +0 -11
  40. package/dist/services/through-history.service.d.ts +0 -12
  41. package/dist/services/through-history.service.js +0 -49
  42. package/dist/services/tool-layers.service.d.ts +0 -4
  43. package/dist/services/tool-layers.service.js +0 -12
  44. package/dist/services/tool.service.d.ts +0 -10
  45. package/dist/services/tool.service.js +0 -56
  46. package/dist/store/history.state.d.ts +0 -15
  47. package/dist/store/history.state.js +0 -76
  48. package/dist/store/image.state.d.ts +0 -30
  49. package/dist/store/image.state.js +0 -70
  50. package/dist/store/store.d.ts +0 -13
  51. package/dist/store/store.js +0 -31
  52. package/dist/types/canvas.d.ts +0 -10
  53. package/dist/types/canvas.js +0 -3
  54. package/dist/types/cursor.d.ts +0 -9
  55. package/dist/types/cursor.js +0 -3
  56. package/dist/types/excretion.d.ts +0 -27
  57. package/dist/types/excretion.js +0 -5
  58. package/dist/types/general.d.ts +0 -24
  59. package/dist/types/general.js +0 -5
  60. package/dist/types/history.d.ts +0 -7
  61. package/dist/types/history.js +0 -2
  62. package/dist/types/image.d.ts +0 -48
  63. package/dist/types/image.js +0 -10
  64. package/dist/types/log.d.ts +0 -13
  65. package/dist/types/log.js +0 -5
  66. package/dist/types/pipette.d.ts +0 -1
  67. package/dist/types/pipette.js +0 -2
  68. package/dist/types/project.d.ts +0 -38
  69. package/dist/types/project.js +0 -14
  70. package/dist/utils/convert.d.ts +0 -12
  71. package/dist/utils/convert.js +0 -27
  72. package/dist/utils/filter.d.ts +0 -21
  73. package/dist/utils/filter.js +0 -150
  74. package/dist/utils/guid4.d.ts +0 -13
  75. package/dist/utils/guid4.js +0 -111
  76. package/dist/utils/project-file-serializer.d.ts +0 -13
  77. package/dist/utils/project-file-serializer.js +0 -79
  78. package/dist/web-component.d.ts +0 -30
  79. package/dist/web-component.js +0 -108
@@ -0,0 +1,2 @@
1
+ /*! For license information please see index.mjs.js.LICENSE.txt */
2
+ (()=>{var t={543:function(t,n,e){var r;t=e.nmd(t),function(){var o,i="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,f=128,s=1/0,l=9007199254740991,p=NaN,h=4294967295,d=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",_="[object Date]",m="[object Error]",b="[object Function]",x="[object GeneratorFunction]",w="[object Map]",S="[object Number]",j="[object Object]",E="[object Promise]",A="[object RegExp]",C="[object Set]",O="[object String]",I="[object Symbol]",P="[object WeakMap]",z="[object ArrayBuffer]",L="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",F=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,q=RegExp(G.source),$=RegExp(Z.source),Y=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(nt.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ft=/[()=,{}\[\]\/\s]/,st=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,xt="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",jt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ot="["+xt+"]",It="["+Ct+"]",Pt="["+wt+"]",zt="\\d+",Lt="["+St+"]",Tt="["+jt+"]",kt="[^"+xt+Ct+zt+St+jt+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Dt="[^"+xt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Bt="["+Et+"]",Wt="\\u200d",Vt="(?:"+Tt+"|"+kt+")",Ft="(?:"+Bt+"|"+kt+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",Ht="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gt="(?:"+Pt+"|"+Rt+")?",Zt="["+At+"]?",qt=Zt+Gt+"(?:"+Wt+"(?:"+[Dt,Nt,Mt].join("|")+")"+Zt+Gt+")*",$t="(?:"+[Lt,Nt,Mt].join("|")+")"+qt,Yt="(?:"+[Dt+Pt+"?",Pt,Nt,Mt,Ot].join("|")+")",Kt=RegExp("['’]","g"),Xt=RegExp(Pt,"g"),Jt=RegExp(Rt+"(?="+Rt+")|"+Yt+qt,"g"),Qt=RegExp([Bt+"?"+Tt+"+"+Ut+"(?="+[It,Bt,"$"].join("|")+")",Ft+"+"+Ht+"(?="+[It,Bt+Vt,"$"].join("|")+")",Bt+"?"+Vt+"+"+Ut,Bt+"+"+Ht,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zt,$t].join("|"),"g"),tn=RegExp("["+Wt+xt+wt+At+"]"),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,en=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rn=-1,on={};on[T]=on[k]=on[R]=on[D]=on[N]=on[M]=on[B]=on[W]=on[V]=!0,on[v]=on[g]=on[z]=on[y]=on[L]=on[_]=on[m]=on[b]=on[w]=on[S]=on[j]=on[A]=on[C]=on[O]=on[P]=!1;var un={};un[v]=un[g]=un[z]=un[L]=un[y]=un[_]=un[T]=un[k]=un[R]=un[D]=un[N]=un[w]=un[S]=un[j]=un[A]=un[C]=un[O]=un[I]=un[M]=un[B]=un[W]=un[V]=!0,un[m]=un[b]=un[P]=!1;var an={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},cn=parseFloat,fn=parseInt,sn="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g,ln="object"==typeof self&&self&&self.Object===Object&&self,pn=sn||ln||Function("return this")(),hn=n&&!n.nodeType&&n,dn=hn&&t&&!t.nodeType&&t,vn=dn&&dn.exports===hn,gn=vn&&sn.process,yn=function(){try{return dn&&dn.require&&dn.require("util").types||gn&&gn.binding&&gn.binding("util")}catch(t){}}(),_n=yn&&yn.isArrayBuffer,mn=yn&&yn.isDate,bn=yn&&yn.isMap,xn=yn&&yn.isRegExp,wn=yn&&yn.isSet,Sn=yn&&yn.isTypedArray;function jn(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function En(t,n,e,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var u=t[o];n(r,u,e(u),t)}return r}function An(t,n){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==n(t[e],e,t););return t}function Cn(t,n){for(var e=null==t?0:t.length;e--&&!1!==n(t[e],e,t););return t}function On(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return!1;return!0}function In(t,n){for(var e=-1,r=null==t?0:t.length,o=0,i=[];++e<r;){var u=t[e];n(u,e,t)&&(i[o++]=u)}return i}function Pn(t,n){return!(null==t||!t.length)&&Wn(t,n,0)>-1}function zn(t,n,e){for(var r=-1,o=null==t?0:t.length;++r<o;)if(e(n,t[r]))return!0;return!1}function Ln(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}function Tn(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}function kn(t,n,e,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(e=t[++o]);++o<i;)e=n(e,t[o],o,t);return e}function Rn(t,n,e,r){var o=null==t?0:t.length;for(r&&o&&(e=t[--o]);o--;)e=n(e,t[o],o,t);return e}function Dn(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return!0;return!1}var Nn=Hn("length");function Mn(t,n,e){var r;return e(t,(function(t,e,o){if(n(t,e,o))return r=e,!1})),r}function Bn(t,n,e,r){for(var o=t.length,i=e+(r?1:-1);r?i--:++i<o;)if(n(t[i],i,t))return i;return-1}function Wn(t,n,e){return n==n?function(t,n,e){for(var r=e-1,o=t.length;++r<o;)if(t[r]===n)return r;return-1}(t,n,e):Bn(t,Fn,e)}function Vn(t,n,e,r){for(var o=e-1,i=t.length;++o<i;)if(r(t[o],n))return o;return-1}function Fn(t){return t!=t}function Un(t,n){var e=null==t?0:t.length;return e?qn(t,n)/e:p}function Hn(t){return function(n){return null==n?o:n[t]}}function Gn(t){return function(n){return null==t?o:t[n]}}function Zn(t,n,e,r,o){return o(t,(function(t,o,i){e=r?(r=!1,t):n(e,t,o,i)})),e}function qn(t,n){for(var e,r=-1,i=t.length;++r<i;){var u=n(t[r]);u!==o&&(e=e===o?u:e+u)}return e}function $n(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}function Yn(t){return t?t.slice(0,pe(t)+1).replace(rt,""):t}function Kn(t){return function(n){return t(n)}}function Xn(t,n){return Ln(n,(function(n){return t[n]}))}function Jn(t,n){return t.has(n)}function Qn(t,n){for(var e=-1,r=t.length;++e<r&&Wn(n,t[e],0)>-1;);return e}function te(t,n){for(var e=t.length;e--&&Wn(n,t[e],0)>-1;);return e}var ne=Gn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),ee=Gn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function re(t){return"\\"+an[t]}function oe(t){return tn.test(t)}function ie(t){var n=-1,e=Array(t.size);return t.forEach((function(t,r){e[++n]=[r,t]})),e}function ue(t,n){return function(e){return t(n(e))}}function ae(t,n){for(var e=-1,r=t.length,o=0,i=[];++e<r;){var u=t[e];u!==n&&u!==a||(t[e]=a,i[o++]=e)}return i}function ce(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=t})),e}function fe(t){var n=-1,e=Array(t.size);return t.forEach((function(t){e[++n]=[t,t]})),e}function se(t){return oe(t)?function(t){for(var n=Jt.lastIndex=0;Jt.test(t);)++n;return n}(t):Nn(t)}function le(t){return oe(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function pe(t){for(var n=t.length;n--&&ot.test(t.charAt(n)););return n}var he=Gn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),de=function t(n){var e,r=(n=null==n?pn:de.defaults(pn.Object(),n,de.pick(pn,en))).Array,ot=n.Date,xt=n.Error,wt=n.Function,St=n.Math,jt=n.Object,Et=n.RegExp,At=n.String,Ct=n.TypeError,Ot=r.prototype,It=wt.prototype,Pt=jt.prototype,zt=n["__core-js_shared__"],Lt=It.toString,Tt=Pt.hasOwnProperty,kt=0,Rt=(e=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",Dt=Pt.toString,Nt=Lt.call(jt),Mt=pn._,Bt=Et("^"+Lt.call(Tt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=vn?n.Buffer:o,Vt=n.Symbol,Ft=n.Uint8Array,Ut=Wt?Wt.allocUnsafe:o,Ht=ue(jt.getPrototypeOf,jt),Gt=jt.create,Zt=Pt.propertyIsEnumerable,qt=Ot.splice,$t=Vt?Vt.isConcatSpreadable:o,Yt=Vt?Vt.iterator:o,Jt=Vt?Vt.toStringTag:o,tn=function(){try{var t=fi(jt,"defineProperty");return t({},"",{}),t}catch(t){}}(),an=n.clearTimeout!==pn.clearTimeout&&n.clearTimeout,sn=ot&&ot.now!==pn.Date.now&&ot.now,ln=n.setTimeout!==pn.setTimeout&&n.setTimeout,hn=St.ceil,dn=St.floor,gn=jt.getOwnPropertySymbols,yn=Wt?Wt.isBuffer:o,Nn=n.isFinite,Gn=Ot.join,ve=ue(jt.keys,jt),ge=St.max,ye=St.min,_e=ot.now,me=n.parseInt,be=St.random,xe=Ot.reverse,we=fi(n,"DataView"),Se=fi(n,"Map"),je=fi(n,"Promise"),Ee=fi(n,"Set"),Ae=fi(n,"WeakMap"),Ce=fi(jt,"create"),Oe=Ae&&new Ae,Ie={},Pe=Ni(we),ze=Ni(Se),Le=Ni(je),Te=Ni(Ee),ke=Ni(Ae),Re=Vt?Vt.prototype:o,De=Re?Re.valueOf:o,Ne=Re?Re.toString:o;function Me(t){if(ta(t)&&!Uu(t)&&!(t instanceof Fe)){if(t instanceof Ve)return t;if(Tt.call(t,"__wrapped__"))return Mi(t)}return new Ve(t)}var Be=function(){function t(){}return function(n){if(!Qu(n))return{};if(Gt)return Gt(n);t.prototype=n;var e=new t;return t.prototype=o,e}}();function We(){}function Ve(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=o}function Fe(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Ue(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function He(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ge(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Ze(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new Ge;++n<e;)this.add(t[n])}function qe(t){var n=this.__data__=new He(t);this.size=n.size}function $e(t,n){var e=Uu(t),r=!e&&Fu(t),o=!e&&!r&&qu(t),i=!e&&!r&&!o&&ca(t),u=e||r||o||i,a=u?$n(t.length,At):[],c=a.length;for(var f in t)!n&&!Tt.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||gi(f,c))||a.push(f);return a}function Ye(t){var n=t.length;return n?t[Gr(0,n-1)]:o}function Ke(t,n){return Li(Co(t),ir(n,0,t.length))}function Xe(t){return Li(Co(t))}function Je(t,n,e){(e!==o&&!Bu(t[n],e)||e===o&&!(n in t))&&rr(t,n,e)}function Qe(t,n,e){var r=t[n];Tt.call(t,n)&&Bu(r,e)&&(e!==o||n in t)||rr(t,n,e)}function tr(t,n){for(var e=t.length;e--;)if(Bu(t[e][0],n))return e;return-1}function nr(t,n,e,r){return sr(t,(function(t,o,i){n(r,t,e(t),i)})),r}function er(t,n){return t&&Oo(n,Pa(n),t)}function rr(t,n,e){"__proto__"==n&&tn?tn(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}function or(t,n){for(var e=-1,i=n.length,u=r(i),a=null==t;++e<i;)u[e]=a?o:Ea(t,n[e]);return u}function ir(t,n,e){return t==t&&(e!==o&&(t=t<=e?t:e),n!==o&&(t=t>=n?t:n)),t}function ur(t,n,e,r,i,u){var a,c=1&n,f=2&n,s=4&n;if(e&&(a=i?e(t,r,i,u):e(t)),a!==o)return a;if(!Qu(t))return t;var l=Uu(t);if(l){if(a=function(t){var n=t.length,e=new t.constructor(n);return n&&"string"==typeof t[0]&&Tt.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!c)return Co(t,a)}else{var p=pi(t),h=p==b||p==x;if(qu(t))return xo(t,c);if(p==j||p==v||h&&!i){if(a=f||h?{}:di(t),!c)return f?function(t,n){return Oo(t,li(t),n)}(t,function(t,n){return t&&Oo(n,za(n),t)}(a,t)):function(t,n){return Oo(t,si(t),n)}(t,er(a,t))}else{if(!un[p])return i?t:{};a=function(t,n,e){var r,o=t.constructor;switch(n){case z:return wo(t);case y:case _:return new o(+t);case L:return function(t,n){var e=n?wo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case T:case k:case R:case D:case N:case M:case B:case W:case V:return So(t,e);case w:return new o;case S:case O:return new o(t);case A:return function(t){var n=new t.constructor(t.source,pt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case C:return new o;case I:return r=t,De?jt(De.call(r)):{}}}(t,p,c)}}u||(u=new qe);var d=u.get(t);if(d)return d;u.set(t,a),ia(t)?t.forEach((function(r){a.add(ur(r,n,e,r,t,u))})):na(t)&&t.forEach((function(r,o){a.set(o,ur(r,n,e,o,t,u))}));var g=l?o:(s?f?ei:ni:f?za:Pa)(t);return An(g||t,(function(r,o){g&&(r=t[o=r]),Qe(a,o,ur(r,n,e,o,t,u))})),a}function ar(t,n,e){var r=e.length;if(null==t)return!r;for(t=jt(t);r--;){var i=e[r],u=n[i],a=t[i];if(a===o&&!(i in t)||!u(a))return!1}return!0}function cr(t,n,e){if("function"!=typeof t)throw new Ct(i);return Oi((function(){t.apply(o,e)}),n)}function fr(t,n,e,r){var o=-1,i=Pn,u=!0,a=t.length,c=[],f=n.length;if(!a)return c;e&&(n=Ln(n,Kn(e))),r?(i=zn,u=!1):n.length>=200&&(i=Jn,u=!1,n=new Ze(n));t:for(;++o<a;){var s=t[o],l=null==e?s:e(s);if(s=r||0!==s?s:0,u&&l==l){for(var p=f;p--;)if(n[p]===l)continue t;c.push(s)}else i(n,l,r)||c.push(s)}return c}Me.templateSettings={escape:Y,evaluate:K,interpolate:X,variable:"",imports:{_:Me}},Me.prototype=We.prototype,Me.prototype.constructor=Me,Ve.prototype=Be(We.prototype),Ve.prototype.constructor=Ve,Fe.prototype=Be(We.prototype),Fe.prototype.constructor=Fe,Ue.prototype.clear=function(){this.__data__=Ce?Ce(null):{},this.size=0},Ue.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},Ue.prototype.get=function(t){var n=this.__data__;if(Ce){var e=n[t];return e===u?o:e}return Tt.call(n,t)?n[t]:o},Ue.prototype.has=function(t){var n=this.__data__;return Ce?n[t]!==o:Tt.call(n,t)},Ue.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Ce&&n===o?u:n,this},He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(t){var n=this.__data__,e=tr(n,t);return!(e<0||(e==n.length-1?n.pop():qt.call(n,e,1),--this.size,0))},He.prototype.get=function(t){var n=this.__data__,e=tr(n,t);return e<0?o:n[e][1]},He.prototype.has=function(t){return tr(this.__data__,t)>-1},He.prototype.set=function(t,n){var e=this.__data__,r=tr(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this},Ge.prototype.clear=function(){this.size=0,this.__data__={hash:new Ue,map:new(Se||He),string:new Ue}},Ge.prototype.delete=function(t){var n=ai(this,t).delete(t);return this.size-=n?1:0,n},Ge.prototype.get=function(t){return ai(this,t).get(t)},Ge.prototype.has=function(t){return ai(this,t).has(t)},Ge.prototype.set=function(t,n){var e=ai(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this},Ze.prototype.add=Ze.prototype.push=function(t){return this.__data__.set(t,u),this},Ze.prototype.has=function(t){return this.__data__.has(t)},qe.prototype.clear=function(){this.__data__=new He,this.size=0},qe.prototype.delete=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e},qe.prototype.get=function(t){return this.__data__.get(t)},qe.prototype.has=function(t){return this.__data__.has(t)},qe.prototype.set=function(t,n){var e=this.__data__;if(e instanceof He){var r=e.__data__;if(!Se||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ge(r)}return e.set(t,n),this.size=e.size,this};var sr=zo(_r),lr=zo(mr,!0);function pr(t,n){var e=!0;return sr(t,(function(t,r,o){return e=!!n(t,r,o)})),e}function hr(t,n,e){for(var r=-1,i=t.length;++r<i;){var u=t[r],a=n(u);if(null!=a&&(c===o?a==a&&!aa(a):e(a,c)))var c=a,f=u}return f}function dr(t,n){var e=[];return sr(t,(function(t,r,o){n(t,r,o)&&e.push(t)})),e}function vr(t,n,e,r,o){var i=-1,u=t.length;for(e||(e=vi),o||(o=[]);++i<u;){var a=t[i];n>0&&e(a)?n>1?vr(a,n-1,e,r,o):Tn(o,a):r||(o[o.length]=a)}return o}var gr=Lo(),yr=Lo(!0);function _r(t,n){return t&&gr(t,n,Pa)}function mr(t,n){return t&&yr(t,n,Pa)}function br(t,n){return In(n,(function(n){return Ku(t[n])}))}function xr(t,n){for(var e=0,r=(n=yo(n,t)).length;null!=t&&e<r;)t=t[Di(n[e++])];return e&&e==r?t:o}function wr(t,n,e){var r=n(t);return Uu(t)?r:Tn(r,e(t))}function Sr(t){return null==t?t===o?"[object Undefined]":"[object Null]":Jt&&Jt in jt(t)?function(t){var n=Tt.call(t,Jt),e=t[Jt];try{t[Jt]=o;var r=!0}catch(t){}var i=Dt.call(t);return r&&(n?t[Jt]=e:delete t[Jt]),i}(t):function(t){return Dt.call(t)}(t)}function jr(t,n){return t>n}function Er(t,n){return null!=t&&Tt.call(t,n)}function Ar(t,n){return null!=t&&n in jt(t)}function Cr(t,n,e){for(var i=e?zn:Pn,u=t[0].length,a=t.length,c=a,f=r(a),s=1/0,l=[];c--;){var p=t[c];c&&n&&(p=Ln(p,Kn(n))),s=ye(p.length,s),f[c]=!e&&(n||u>=120&&p.length>=120)?new Ze(c&&p):o}p=t[0];var h=-1,d=f[0];t:for(;++h<u&&l.length<s;){var v=p[h],g=n?n(v):v;if(v=e||0!==v?v:0,!(d?Jn(d,g):i(l,g,e))){for(c=a;--c;){var y=f[c];if(!(y?Jn(y,g):i(t[c],g,e)))continue t}d&&d.push(g),l.push(v)}}return l}function Or(t,n,e){var r=null==(t=Ei(t,n=yo(n,t)))?t:t[Di(Yi(n))];return null==r?o:jn(r,t,e)}function Ir(t){return ta(t)&&Sr(t)==v}function Pr(t,n,e,r,i){return t===n||(null==t||null==n||!ta(t)&&!ta(n)?t!=t&&n!=n:function(t,n,e,r,i,u){var a=Uu(t),c=Uu(n),f=a?g:pi(t),s=c?g:pi(n),l=(f=f==v?j:f)==j,p=(s=s==v?j:s)==j,h=f==s;if(h&&qu(t)){if(!qu(n))return!1;a=!0,l=!1}if(h&&!l)return u||(u=new qe),a||ca(t)?Qo(t,n,e,r,i,u):function(t,n,e,r,o,i,u){switch(e){case L:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case z:return!(t.byteLength!=n.byteLength||!i(new Ft(t),new Ft(n)));case y:case _:case S:return Bu(+t,+n);case m:return t.name==n.name&&t.message==n.message;case A:case O:return t==n+"";case w:var a=ie;case C:var c=1&r;if(a||(a=ce),t.size!=n.size&&!c)return!1;var f=u.get(t);if(f)return f==n;r|=2,u.set(t,n);var s=Qo(a(t),a(n),r,o,i,u);return u.delete(t),s;case I:if(De)return De.call(t)==De.call(n)}return!1}(t,n,f,e,r,i,u);if(!(1&e)){var d=l&&Tt.call(t,"__wrapped__"),b=p&&Tt.call(n,"__wrapped__");if(d||b){var x=d?t.value():t,E=b?n.value():n;return u||(u=new qe),i(x,E,e,r,u)}}return!!h&&(u||(u=new qe),function(t,n,e,r,i,u){var a=1&e,c=ni(t),f=c.length;if(f!=ni(n).length&&!a)return!1;for(var s=f;s--;){var l=c[s];if(!(a?l in n:Tt.call(n,l)))return!1}var p=u.get(t),h=u.get(n);if(p&&h)return p==n&&h==t;var d=!0;u.set(t,n),u.set(n,t);for(var v=a;++s<f;){var g=t[l=c[s]],y=n[l];if(r)var _=a?r(y,g,l,n,t,u):r(g,y,l,t,n,u);if(!(_===o?g===y||i(g,y,e,r,u):_)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var m=t.constructor,b=n.constructor;m==b||!("constructor"in t)||!("constructor"in n)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return u.delete(t),u.delete(n),d}(t,n,e,r,i,u))}(t,n,e,r,Pr,i))}function zr(t,n,e,r){var i=e.length,u=i,a=!r;if(null==t)return!u;for(t=jt(t);i--;){var c=e[i];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<u;){var f=(c=e[i])[0],s=t[f],l=c[1];if(a&&c[2]){if(s===o&&!(f in t))return!1}else{var p=new qe;if(r)var h=r(s,l,f,t,n,p);if(!(h===o?Pr(l,s,3,r,p):h))return!1}}return!0}function Lr(t){return!(!Qu(t)||(n=t,Rt&&Rt in n))&&(Ku(t)?Bt:vt).test(Ni(t));var n}function Tr(t){return"function"==typeof t?t:null==t?ec:"object"==typeof t?Uu(t)?Mr(t[0],t[1]):Nr(t):lc(t)}function kr(t){if(!xi(t))return ve(t);var n=[];for(var e in jt(t))Tt.call(t,e)&&"constructor"!=e&&n.push(e);return n}function Rr(t,n){return t<n}function Dr(t,n){var e=-1,o=Gu(t)?r(t.length):[];return sr(t,(function(t,r,i){o[++e]=n(t,r,i)})),o}function Nr(t){var n=ci(t);return 1==n.length&&n[0][2]?Si(n[0][0],n[0][1]):function(e){return e===t||zr(e,t,n)}}function Mr(t,n){return _i(t)&&wi(n)?Si(Di(t),n):function(e){var r=Ea(e,t);return r===o&&r===n?Aa(e,t):Pr(n,r,3)}}function Br(t,n,e,r,i){t!==n&&gr(n,(function(u,a){if(i||(i=new qe),Qu(u))!function(t,n,e,r,i,u,a){var c=Ai(t,e),f=Ai(n,e),s=a.get(f);if(s)Je(t,e,s);else{var l=u?u(c,f,e+"",t,n,a):o,p=l===o;if(p){var h=Uu(f),d=!h&&qu(f),v=!h&&!d&&ca(f);l=f,h||d||v?Uu(c)?l=c:Zu(c)?l=Co(c):d?(p=!1,l=xo(f,!0)):v?(p=!1,l=So(f,!0)):l=[]:ra(f)||Fu(f)?(l=c,Fu(c)?l=ga(c):Qu(c)&&!Ku(c)||(l=di(f))):p=!1}p&&(a.set(f,l),i(l,f,r,u,a),a.delete(f)),Je(t,e,l)}}(t,n,a,e,Br,r,i);else{var c=r?r(Ai(t,a),u,a+"",t,n,i):o;c===o&&(c=u),Je(t,a,c)}}),za)}function Wr(t,n){var e=t.length;if(e)return gi(n+=n<0?e:0,e)?t[n]:o}function Vr(t,n,e){n=n.length?Ln(n,(function(t){return Uu(t)?function(n){return xr(n,1===t.length?t[0]:t)}:t})):[ec];var r=-1;n=Ln(n,Kn(ui()));var o=Dr(t,(function(t,e,o){var i=Ln(n,(function(n){return n(t)}));return{criteria:i,index:++r,value:t}}));return function(t){var n=t.length;for(t.sort((function(t,n){return function(t,n,e){for(var r=-1,o=t.criteria,i=n.criteria,u=o.length,a=e.length;++r<u;){var c=jo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return t.index-n.index}(t,n,e)}));n--;)t[n]=t[n].value;return t}(o)}function Fr(t,n,e){for(var r=-1,o=n.length,i={};++r<o;){var u=n[r],a=xr(t,u);e(a,u)&&Kr(i,yo(u,t),a)}return i}function Ur(t,n,e,r){var o=r?Vn:Wn,i=-1,u=n.length,a=t;for(t===n&&(n=Co(n)),e&&(a=Ln(t,Kn(e)));++i<u;)for(var c=0,f=n[i],s=e?e(f):f;(c=o(a,s,c,r))>-1;)a!==t&&qt.call(a,c,1),qt.call(t,c,1);return t}function Hr(t,n){for(var e=t?n.length:0,r=e-1;e--;){var o=n[e];if(e==r||o!==i){var i=o;gi(o)?qt.call(t,o,1):co(t,o)}}return t}function Gr(t,n){return t+dn(be()*(n-t+1))}function Zr(t,n){var e="";if(!t||n<1||n>l)return e;do{n%2&&(e+=t),(n=dn(n/2))&&(t+=t)}while(n);return e}function qr(t,n){return Ii(ji(t,n,ec),t+"")}function $r(t){return Ye(Ba(t))}function Yr(t,n){var e=Ba(t);return Li(e,ir(n,0,e.length))}function Kr(t,n,e,r){if(!Qu(t))return t;for(var i=-1,u=(n=yo(n,t)).length,a=u-1,c=t;null!=c&&++i<u;){var f=Di(n[i]),s=e;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(i!=a){var l=c[f];(s=r?r(l,f,c):o)===o&&(s=Qu(l)?l:gi(n[i+1])?[]:{})}Qe(c,f,s),c=c[f]}return t}var Xr=Oe?function(t,n){return Oe.set(t,n),t}:ec,Jr=tn?function(t,n){return tn(t,"toString",{configurable:!0,enumerable:!1,value:Qa(n),writable:!0})}:ec;function Qr(t){return Li(Ba(t))}function to(t,n,e){var o=-1,i=t.length;n<0&&(n=-n>i?0:i+n),(e=e>i?i:e)<0&&(e+=i),i=n>e?0:e-n>>>0,n>>>=0;for(var u=r(i);++o<i;)u[o]=t[o+n];return u}function no(t,n){var e;return sr(t,(function(t,r,o){return!(e=n(t,r,o))})),!!e}function eo(t,n,e){var r=0,o=null==t?r:t.length;if("number"==typeof n&&n==n&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=t[i];null!==u&&!aa(u)&&(e?u<=n:u<n)?r=i+1:o=i}return o}return ro(t,n,ec,e)}function ro(t,n,e,r){var i=0,u=null==t?0:t.length;if(0===u)return 0;for(var a=(n=e(n))!=n,c=null===n,f=aa(n),s=n===o;i<u;){var l=dn((i+u)/2),p=e(t[l]),h=p!==o,d=null===p,v=p==p,g=aa(p);if(a)var y=r||v;else y=s?v&&(r||h):c?v&&h&&(r||!d):f?v&&h&&!d&&(r||!g):!d&&!g&&(r?p<=n:p<n);y?i=l+1:u=l}return ye(u,4294967294)}function oo(t,n){for(var e=-1,r=t.length,o=0,i=[];++e<r;){var u=t[e],a=n?n(u):u;if(!e||!Bu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function io(t){return"number"==typeof t?t:aa(t)?p:+t}function uo(t){if("string"==typeof t)return t;if(Uu(t))return Ln(t,uo)+"";if(aa(t))return Ne?Ne.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function ao(t,n,e){var r=-1,o=Pn,i=t.length,u=!0,a=[],c=a;if(e)u=!1,o=zn;else if(i>=200){var f=n?null:qo(t);if(f)return ce(f);u=!1,o=Jn,c=new Ze}else c=n?[]:a;t:for(;++r<i;){var s=t[r],l=n?n(s):s;if(s=e||0!==s?s:0,u&&l==l){for(var p=c.length;p--;)if(c[p]===l)continue t;n&&c.push(l),a.push(s)}else o(c,l,e)||(c!==a&&c.push(l),a.push(s))}return a}function co(t,n){return null==(t=Ei(t,n=yo(n,t)))||delete t[Di(Yi(n))]}function fo(t,n,e,r){return Kr(t,n,e(xr(t,n)),r)}function so(t,n,e,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&n(t[i],i,t););return e?to(t,r?0:i,r?i+1:o):to(t,r?i+1:0,r?o:i)}function lo(t,n){var e=t;return e instanceof Fe&&(e=e.value()),kn(n,(function(t,n){return n.func.apply(n.thisArg,Tn([t],n.args))}),e)}function po(t,n,e){var o=t.length;if(o<2)return o?ao(t[0]):[];for(var i=-1,u=r(o);++i<o;)for(var a=t[i],c=-1;++c<o;)c!=i&&(u[i]=fr(u[i]||a,t[c],n,e));return ao(vr(u,1),n,e)}function ho(t,n,e){for(var r=-1,i=t.length,u=n.length,a={};++r<i;){var c=r<u?n[r]:o;e(a,t[r],c)}return a}function vo(t){return Zu(t)?t:[]}function go(t){return"function"==typeof t?t:ec}function yo(t,n){return Uu(t)?t:_i(t,n)?[t]:Ri(ya(t))}var _o=qr;function mo(t,n,e){var r=t.length;return e=e===o?r:e,!n&&e>=r?t:to(t,n,e)}var bo=an||function(t){return pn.clearTimeout(t)};function xo(t,n){if(n)return t.slice();var e=t.length,r=Ut?Ut(e):new t.constructor(e);return t.copy(r),r}function wo(t){var n=new t.constructor(t.byteLength);return new Ft(n).set(new Ft(t)),n}function So(t,n){var e=n?wo(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}function jo(t,n){if(t!==n){var e=t!==o,r=null===t,i=t==t,u=aa(t),a=n!==o,c=null===n,f=n==n,s=aa(n);if(!c&&!s&&!u&&t>n||u&&a&&f&&!c&&!s||r&&a&&f||!e&&f||!i)return 1;if(!r&&!u&&!s&&t<n||s&&e&&i&&!r&&!u||c&&e&&i||!a&&i||!f)return-1}return 0}function Eo(t,n,e,o){for(var i=-1,u=t.length,a=e.length,c=-1,f=n.length,s=ge(u-a,0),l=r(f+s),p=!o;++c<f;)l[c]=n[c];for(;++i<a;)(p||i<u)&&(l[e[i]]=t[i]);for(;s--;)l[c++]=t[i++];return l}function Ao(t,n,e,o){for(var i=-1,u=t.length,a=-1,c=e.length,f=-1,s=n.length,l=ge(u-c,0),p=r(l+s),h=!o;++i<l;)p[i]=t[i];for(var d=i;++f<s;)p[d+f]=n[f];for(;++a<c;)(h||i<u)&&(p[d+e[a]]=t[i++]);return p}function Co(t,n){var e=-1,o=t.length;for(n||(n=r(o));++e<o;)n[e]=t[e];return n}function Oo(t,n,e,r){var i=!e;e||(e={});for(var u=-1,a=n.length;++u<a;){var c=n[u],f=r?r(e[c],t[c],c,e,t):o;f===o&&(f=t[c]),i?rr(e,c,f):Qe(e,c,f)}return e}function Io(t,n){return function(e,r){var o=Uu(e)?En:nr,i=n?n():{};return o(e,t,ui(r,2),i)}}function Po(t){return qr((function(n,e){var r=-1,i=e.length,u=i>1?e[i-1]:o,a=i>2?e[2]:o;for(u=t.length>3&&"function"==typeof u?(i--,u):o,a&&yi(e[0],e[1],a)&&(u=i<3?o:u,i=1),n=jt(n);++r<i;){var c=e[r];c&&t(n,c,r,u)}return n}))}function zo(t,n){return function(e,r){if(null==e)return e;if(!Gu(e))return t(e,r);for(var o=e.length,i=n?o:-1,u=jt(e);(n?i--:++i<o)&&!1!==r(u[i],i,u););return e}}function Lo(t){return function(n,e,r){for(var o=-1,i=jt(n),u=r(n),a=u.length;a--;){var c=u[t?a:++o];if(!1===e(i[c],c,i))break}return n}}function To(t){return function(n){var e=oe(n=ya(n))?le(n):o,r=e?e[0]:n.charAt(0),i=e?mo(e,1).join(""):n.slice(1);return r[t]()+i}}function ko(t){return function(n){return kn(Ka(Fa(n).replace(Kt,"")),t,"")}}function Ro(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var e=Be(t.prototype),r=t.apply(e,n);return Qu(r)?r:e}}function Do(t){return function(n,e,r){var i=jt(n);if(!Gu(n)){var u=ui(e,3);n=Pa(n),e=function(t){return u(i[t],t,i)}}var a=t(n,e,r);return a>-1?i[u?n[a]:a]:o}}function No(t){return ti((function(n){var e=n.length,r=e,u=Ve.prototype.thru;for(t&&n.reverse();r--;){var a=n[r];if("function"!=typeof a)throw new Ct(i);if(u&&!c&&"wrapper"==oi(a))var c=new Ve([],!0)}for(r=c?r:e;++r<e;){var f=oi(a=n[r]),s="wrapper"==f?ri(a):o;c=s&&mi(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[oi(s[0])].apply(c,s[3]):1==a.length&&mi(a)?c[f]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&Uu(r))return c.plant(r).value();for(var o=0,i=e?n[o].apply(this,t):r;++o<e;)i=n[o].call(this,i);return i}}))}function Mo(t,n,e,i,u,a,c,s,l,p){var h=n&f,d=1&n,v=2&n,g=24&n,y=512&n,_=v?o:Ro(t);return function f(){for(var m=arguments.length,b=r(m),x=m;x--;)b[x]=arguments[x];if(g)var w=ii(f),S=function(t,n){for(var e=t.length,r=0;e--;)t[e]===n&&++r;return r}(b,w);if(i&&(b=Eo(b,i,u,g)),a&&(b=Ao(b,a,c,g)),m-=S,g&&m<p){var j=ae(b,w);return Go(t,n,Mo,f.placeholder,e,b,j,s,l,p-m)}var E=d?e:this,A=v?E[t]:t;return m=b.length,s?b=function(t,n){for(var e=t.length,r=ye(n.length,e),i=Co(t);r--;){var u=n[r];t[r]=gi(u,e)?i[u]:o}return t}(b,s):y&&m>1&&b.reverse(),h&&l<m&&(b.length=l),this&&this!==pn&&this instanceof f&&(A=_||Ro(A)),A.apply(E,b)}}function Bo(t,n){return function(e,r){return function(t,n,e,r){return _r(t,(function(t,o,i){n(r,e(t),o,i)})),r}(e,t,n(r),{})}}function Wo(t,n){return function(e,r){var i;if(e===o&&r===o)return n;if(e!==o&&(i=e),r!==o){if(i===o)return r;"string"==typeof e||"string"==typeof r?(e=uo(e),r=uo(r)):(e=io(e),r=io(r)),i=t(e,r)}return i}}function Vo(t){return ti((function(n){return n=Ln(n,Kn(ui())),qr((function(e){var r=this;return t(n,(function(t){return jn(t,r,e)}))}))}))}function Fo(t,n){var e=(n=n===o?" ":uo(n)).length;if(e<2)return e?Zr(n,t):n;var r=Zr(n,hn(t/se(n)));return oe(n)?mo(le(r),0,t).join(""):r.slice(0,t)}function Uo(t){return function(n,e,i){return i&&"number"!=typeof i&&yi(n,e,i)&&(e=i=o),n=pa(n),e===o?(e=n,n=0):e=pa(e),function(t,n,e,o){for(var i=-1,u=ge(hn((n-t)/(e||1)),0),a=r(u);u--;)a[o?u:++i]=t,t+=e;return a}(n,e,i=i===o?n<e?1:-1:pa(i),t)}}function Ho(t){return function(n,e){return"string"==typeof n&&"string"==typeof e||(n=va(n),e=va(e)),t(n,e)}}function Go(t,n,e,r,i,u,a,f,s,l){var p=8&n;n|=p?c:64,4&(n&=~(p?64:c))||(n&=-4);var h=[t,n,i,p?u:o,p?a:o,p?o:u,p?o:a,f,s,l],d=e.apply(o,h);return mi(t)&&Ci(d,h),d.placeholder=r,Pi(d,t,n)}function Zo(t){var n=St[t];return function(t,e){if(t=va(t),(e=null==e?0:ye(ha(e),292))&&Nn(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(n(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return n(t)}}var qo=Ee&&1/ce(new Ee([,-0]))[1]==s?function(t){return new Ee(t)}:ac;function $o(t){return function(n){var e=pi(n);return e==w?ie(n):e==C?fe(n):function(t,n){return Ln(n,(function(n){return[n,t[n]]}))}(n,t(n))}}function Yo(t,n,e,u,s,l,p,h){var d=2&n;if(!d&&"function"!=typeof t)throw new Ct(i);var v=u?u.length:0;if(v||(n&=-97,u=s=o),p=p===o?p:ge(ha(p),0),h=h===o?h:ha(h),v-=s?s.length:0,64&n){var g=u,y=s;u=s=o}var _=d?o:ri(t),m=[t,n,e,u,s,g,y,l,p,h];if(_&&function(t,n){var e=t[1],r=n[1],o=e|r,i=o<131,u=r==f&&8==e||r==f&&256==e&&t[7].length<=n[8]||384==r&&n[7].length<=n[8]&&8==e;if(!i&&!u)return t;1&r&&(t[2]=n[2],o|=1&e?0:4);var c=n[3];if(c){var s=t[3];t[3]=s?Eo(s,c,n[4]):c,t[4]=s?ae(t[3],a):n[4]}(c=n[5])&&(s=t[5],t[5]=s?Ao(s,c,n[6]):c,t[6]=s?ae(t[5],a):n[6]),(c=n[7])&&(t[7]=c),r&f&&(t[8]=null==t[8]?n[8]:ye(t[8],n[8])),null==t[9]&&(t[9]=n[9]),t[0]=n[0],t[1]=o}(m,_),t=m[0],n=m[1],e=m[2],u=m[3],s=m[4],!(h=m[9]=m[9]===o?d?0:t.length:ge(m[9]-v,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||16==n?function(t,n,e){var i=Ro(t);return function u(){for(var a=arguments.length,c=r(a),f=a,s=ii(u);f--;)c[f]=arguments[f];var l=a<3&&c[0]!==s&&c[a-1]!==s?[]:ae(c,s);return(a-=l.length)<e?Go(t,n,Mo,u.placeholder,o,c,l,o,o,e-a):jn(this&&this!==pn&&this instanceof u?i:t,this,c)}}(t,n,h):n!=c&&33!=n||s.length?Mo.apply(o,m):function(t,n,e,o){var i=1&n,u=Ro(t);return function n(){for(var a=-1,c=arguments.length,f=-1,s=o.length,l=r(s+c),p=this&&this!==pn&&this instanceof n?u:t;++f<s;)l[f]=o[f];for(;c--;)l[f++]=arguments[++a];return jn(p,i?e:this,l)}}(t,n,e,u);else var b=function(t,n,e){var r=1&n,o=Ro(t);return function n(){return(this&&this!==pn&&this instanceof n?o:t).apply(r?e:this,arguments)}}(t,n,e);return Pi((_?Xr:Ci)(b,m),t,n)}function Ko(t,n,e,r){return t===o||Bu(t,Pt[e])&&!Tt.call(r,e)?n:t}function Xo(t,n,e,r,i,u){return Qu(t)&&Qu(n)&&(u.set(n,t),Br(t,n,o,Xo,u),u.delete(n)),t}function Jo(t){return ra(t)?o:t}function Qo(t,n,e,r,i,u){var a=1&e,c=t.length,f=n.length;if(c!=f&&!(a&&f>c))return!1;var s=u.get(t),l=u.get(n);if(s&&l)return s==n&&l==t;var p=-1,h=!0,d=2&e?new Ze:o;for(u.set(t,n),u.set(n,t);++p<c;){var v=t[p],g=n[p];if(r)var y=a?r(g,v,p,n,t,u):r(v,g,p,t,n,u);if(y!==o){if(y)continue;h=!1;break}if(d){if(!Dn(n,(function(t,n){if(!Jn(d,n)&&(v===t||i(v,t,e,r,u)))return d.push(n)}))){h=!1;break}}else if(v!==g&&!i(v,g,e,r,u)){h=!1;break}}return u.delete(t),u.delete(n),h}function ti(t){return Ii(ji(t,o,Hi),t+"")}function ni(t){return wr(t,Pa,si)}function ei(t){return wr(t,za,li)}var ri=Oe?function(t){return Oe.get(t)}:ac;function oi(t){for(var n=t.name+"",e=Ie[n],r=Tt.call(Ie,n)?e.length:0;r--;){var o=e[r],i=o.func;if(null==i||i==t)return o.name}return n}function ii(t){return(Tt.call(Me,"placeholder")?Me:t).placeholder}function ui(){var t=Me.iteratee||rc;return t=t===rc?Tr:t,arguments.length?t(arguments[0],arguments[1]):t}function ai(t,n){var e,r,o=t.__data__;return("string"==(r=typeof(e=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof n?"string":"hash"]:o.map}function ci(t){for(var n=Pa(t),e=n.length;e--;){var r=n[e],o=t[r];n[e]=[r,o,wi(o)]}return n}function fi(t,n){var e=function(t,n){return null==t?o:t[n]}(t,n);return Lr(e)?e:o}var si=gn?function(t){return null==t?[]:(t=jt(t),In(gn(t),(function(n){return Zt.call(t,n)})))}:dc,li=gn?function(t){for(var n=[];t;)Tn(n,si(t)),t=Ht(t);return n}:dc,pi=Sr;function hi(t,n,e){for(var r=-1,o=(n=yo(n,t)).length,i=!1;++r<o;){var u=Di(n[r]);if(!(i=null!=t&&e(t,u)))break;t=t[u]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Ju(o)&&gi(u,o)&&(Uu(t)||Fu(t))}function di(t){return"function"!=typeof t.constructor||xi(t)?{}:Be(Ht(t))}function vi(t){return Uu(t)||Fu(t)||!!($t&&t&&t[$t])}function gi(t,n){var e=typeof t;return!!(n=null==n?l:n)&&("number"==e||"symbol"!=e&&yt.test(t))&&t>-1&&t%1==0&&t<n}function yi(t,n,e){if(!Qu(e))return!1;var r=typeof n;return!!("number"==r?Gu(e)&&gi(n,e.length):"string"==r&&n in e)&&Bu(e[n],t)}function _i(t,n){if(Uu(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!aa(t))||Q.test(t)||!J.test(t)||null!=n&&t in jt(n)}function mi(t){var n=oi(t),e=Me[n];if("function"!=typeof e||!(n in Fe.prototype))return!1;if(t===e)return!0;var r=ri(e);return!!r&&t===r[0]}(we&&pi(new we(new ArrayBuffer(1)))!=L||Se&&pi(new Se)!=w||je&&pi(je.resolve())!=E||Ee&&pi(new Ee)!=C||Ae&&pi(new Ae)!=P)&&(pi=function(t){var n=Sr(t),e=n==j?t.constructor:o,r=e?Ni(e):"";if(r)switch(r){case Pe:return L;case ze:return w;case Le:return E;case Te:return C;case ke:return P}return n});var bi=zt?Ku:vc;function xi(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Pt)}function wi(t){return t==t&&!Qu(t)}function Si(t,n){return function(e){return null!=e&&e[t]===n&&(n!==o||t in jt(e))}}function ji(t,n,e){return n=ge(n===o?t.length-1:n,0),function(){for(var o=arguments,i=-1,u=ge(o.length-n,0),a=r(u);++i<u;)a[i]=o[n+i];i=-1;for(var c=r(n+1);++i<n;)c[i]=o[i];return c[n]=e(a),jn(t,this,c)}}function Ei(t,n){return n.length<2?t:xr(t,to(n,0,-1))}function Ai(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Ci=zi(Xr),Oi=ln||function(t,n){return pn.setTimeout(t,n)},Ii=zi(Jr);function Pi(t,n,e){var r=n+"";return Ii(t,function(t,n){var e=n.length;if(!e)return t;var r=e-1;return n[r]=(e>1?"& ":"")+n[r],n=n.join(e>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+n+"] */\n")}(r,function(t,n){return An(d,(function(e){var r="_."+e[0];n&e[1]&&!Pn(t,r)&&t.push(r)})),t.sort()}(function(t){var n=t.match(ut);return n?n[1].split(at):[]}(r),e)))}function zi(t){var n=0,e=0;return function(){var r=_e(),i=16-(r-e);if(e=r,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(o,arguments)}}function Li(t,n){var e=-1,r=t.length,i=r-1;for(n=n===o?r:n;++e<n;){var u=Gr(e,i),a=t[u];t[u]=t[e],t[e]=a}return t.length=n,t}var Ti,ki,Ri=(Ti=Tu((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(tt,(function(t,e,r,o){n.push(r?o.replace(st,"$1"):e||t)})),n}),(function(t){return 500===ki.size&&ki.clear(),t})),ki=Ti.cache,Ti);function Di(t){if("string"==typeof t||aa(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function Ni(t){if(null!=t){try{return Lt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Mi(t){if(t instanceof Fe)return t.clone();var n=new Ve(t.__wrapped__,t.__chain__);return n.__actions__=Co(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Bi=qr((function(t,n){return Zu(t)?fr(t,vr(n,1,Zu,!0)):[]})),Wi=qr((function(t,n){var e=Yi(n);return Zu(e)&&(e=o),Zu(t)?fr(t,vr(n,1,Zu,!0),ui(e,2)):[]})),Vi=qr((function(t,n){var e=Yi(n);return Zu(e)&&(e=o),Zu(t)?fr(t,vr(n,1,Zu,!0),o,e):[]}));function Fi(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:ha(e);return o<0&&(o=ge(r+o,0)),Bn(t,ui(n,3),o)}function Ui(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return e!==o&&(i=ha(e),i=e<0?ge(r+i,0):ye(i,r-1)),Bn(t,ui(n,3),i,!0)}function Hi(t){return null!=t&&t.length?vr(t,1):[]}function Gi(t){return t&&t.length?t[0]:o}var Zi=qr((function(t){var n=Ln(t,vo);return n.length&&n[0]===t[0]?Cr(n):[]})),qi=qr((function(t){var n=Yi(t),e=Ln(t,vo);return n===Yi(e)?n=o:e.pop(),e.length&&e[0]===t[0]?Cr(e,ui(n,2)):[]})),$i=qr((function(t){var n=Yi(t),e=Ln(t,vo);return(n="function"==typeof n?n:o)&&e.pop(),e.length&&e[0]===t[0]?Cr(e,o,n):[]}));function Yi(t){var n=null==t?0:t.length;return n?t[n-1]:o}var Ki=qr(Xi);function Xi(t,n){return t&&t.length&&n&&n.length?Ur(t,n):t}var Ji=ti((function(t,n){var e=null==t?0:t.length,r=or(t,n);return Hr(t,Ln(n,(function(t){return gi(t,e)?+t:t})).sort(jo)),r}));function Qi(t){return null==t?t:xe.call(t)}var tu=qr((function(t){return ao(vr(t,1,Zu,!0))})),nu=qr((function(t){var n=Yi(t);return Zu(n)&&(n=o),ao(vr(t,1,Zu,!0),ui(n,2))})),eu=qr((function(t){var n=Yi(t);return n="function"==typeof n?n:o,ao(vr(t,1,Zu,!0),o,n)}));function ru(t){if(!t||!t.length)return[];var n=0;return t=In(t,(function(t){if(Zu(t))return n=ge(t.length,n),!0})),$n(n,(function(n){return Ln(t,Hn(n))}))}function ou(t,n){if(!t||!t.length)return[];var e=ru(t);return null==n?e:Ln(e,(function(t){return jn(n,o,t)}))}var iu=qr((function(t,n){return Zu(t)?fr(t,n):[]})),uu=qr((function(t){return po(In(t,Zu))})),au=qr((function(t){var n=Yi(t);return Zu(n)&&(n=o),po(In(t,Zu),ui(n,2))})),cu=qr((function(t){var n=Yi(t);return n="function"==typeof n?n:o,po(In(t,Zu),o,n)})),fu=qr(ru),su=qr((function(t){var n=t.length,e=n>1?t[n-1]:o;return e="function"==typeof e?(t.pop(),e):o,ou(t,e)}));function lu(t){var n=Me(t);return n.__chain__=!0,n}function pu(t,n){return n(t)}var hu=ti((function(t){var n=t.length,e=n?t[0]:0,r=this.__wrapped__,i=function(n){return or(n,t)};return!(n>1||this.__actions__.length)&&r instanceof Fe&&gi(e)?((r=r.slice(e,+e+(n?1:0))).__actions__.push({func:pu,args:[i],thisArg:o}),new Ve(r,this.__chain__).thru((function(t){return n&&!t.length&&t.push(o),t}))):this.thru(i)})),du=Io((function(t,n,e){Tt.call(t,e)?++t[e]:rr(t,e,1)})),vu=Do(Fi),gu=Do(Ui);function yu(t,n){return(Uu(t)?An:sr)(t,ui(n,3))}function _u(t,n){return(Uu(t)?Cn:lr)(t,ui(n,3))}var mu=Io((function(t,n,e){Tt.call(t,e)?t[e].push(n):rr(t,e,[n])})),bu=qr((function(t,n,e){var o=-1,i="function"==typeof n,u=Gu(t)?r(t.length):[];return sr(t,(function(t){u[++o]=i?jn(n,t,e):Or(t,n,e)})),u})),xu=Io((function(t,n,e){rr(t,e,n)}));function wu(t,n){return(Uu(t)?Ln:Dr)(t,ui(n,3))}var Su=Io((function(t,n,e){t[e?0:1].push(n)}),(function(){return[[],[]]})),ju=qr((function(t,n){if(null==t)return[];var e=n.length;return e>1&&yi(t,n[0],n[1])?n=[]:e>2&&yi(n[0],n[1],n[2])&&(n=[n[0]]),Vr(t,vr(n,1),[])})),Eu=sn||function(){return pn.Date.now()};function Au(t,n,e){return n=e?o:n,n=t&&null==n?t.length:n,Yo(t,f,o,o,o,o,n)}function Cu(t,n){var e;if("function"!=typeof n)throw new Ct(i);return t=ha(t),function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=o),e}}var Ou=qr((function(t,n,e){var r=1;if(e.length){var o=ae(e,ii(Ou));r|=c}return Yo(t,r,n,e,o)})),Iu=qr((function(t,n,e){var r=3;if(e.length){var o=ae(e,ii(Iu));r|=c}return Yo(n,r,t,e,o)}));function Pu(t,n,e){var r,u,a,c,f,s,l=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Ct(i);function v(n){var e=r,i=u;return r=u=o,l=n,c=t.apply(i,e)}function g(t){var e=t-s;return s===o||e>=n||e<0||h&&t-l>=a}function y(){var t=Eu();if(g(t))return _(t);f=Oi(y,function(t){var e=n-(t-s);return h?ye(e,a-(t-l)):e}(t))}function _(t){return f=o,d&&r?v(t):(r=u=o,c)}function m(){var t=Eu(),e=g(t);if(r=arguments,u=this,s=t,e){if(f===o)return function(t){return l=t,f=Oi(y,n),p?v(t):c}(s);if(h)return bo(f),f=Oi(y,n),v(s)}return f===o&&(f=Oi(y,n)),c}return n=va(n)||0,Qu(e)&&(p=!!e.leading,a=(h="maxWait"in e)?ge(va(e.maxWait)||0,n):a,d="trailing"in e?!!e.trailing:d),m.cancel=function(){f!==o&&bo(f),l=0,r=s=u=f=o},m.flush=function(){return f===o?c:_(Eu())},m}var zu=qr((function(t,n){return cr(t,1,n)})),Lu=qr((function(t,n,e){return cr(t,va(n)||0,e)}));function Tu(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ct(i);var e=function(){var r=arguments,o=n?n.apply(this,r):r[0],i=e.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return e.cache=i.set(o,u)||i,u};return e.cache=new(Tu.Cache||Ge),e}function ku(t){if("function"!=typeof t)throw new Ct(i);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Tu.Cache=Ge;var Ru=_o((function(t,n){var e=(n=1==n.length&&Uu(n[0])?Ln(n[0],Kn(ui())):Ln(vr(n,1),Kn(ui()))).length;return qr((function(r){for(var o=-1,i=ye(r.length,e);++o<i;)r[o]=n[o].call(this,r[o]);return jn(t,this,r)}))})),Du=qr((function(t,n){var e=ae(n,ii(Du));return Yo(t,c,o,n,e)})),Nu=qr((function(t,n){var e=ae(n,ii(Nu));return Yo(t,64,o,n,e)})),Mu=ti((function(t,n){return Yo(t,256,o,o,o,n)}));function Bu(t,n){return t===n||t!=t&&n!=n}var Wu=Ho(jr),Vu=Ho((function(t,n){return t>=n})),Fu=Ir(function(){return arguments}())?Ir:function(t){return ta(t)&&Tt.call(t,"callee")&&!Zt.call(t,"callee")},Uu=r.isArray,Hu=_n?Kn(_n):function(t){return ta(t)&&Sr(t)==z};function Gu(t){return null!=t&&Ju(t.length)&&!Ku(t)}function Zu(t){return ta(t)&&Gu(t)}var qu=yn||vc,$u=mn?Kn(mn):function(t){return ta(t)&&Sr(t)==_};function Yu(t){if(!ta(t))return!1;var n=Sr(t);return n==m||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Ku(t){if(!Qu(t))return!1;var n=Sr(t);return n==b||n==x||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Xu(t){return"number"==typeof t&&t==ha(t)}function Ju(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function Qu(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ta(t){return null!=t&&"object"==typeof t}var na=bn?Kn(bn):function(t){return ta(t)&&pi(t)==w};function ea(t){return"number"==typeof t||ta(t)&&Sr(t)==S}function ra(t){if(!ta(t)||Sr(t)!=j)return!1;var n=Ht(t);if(null===n)return!0;var e=Tt.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&Lt.call(e)==Nt}var oa=xn?Kn(xn):function(t){return ta(t)&&Sr(t)==A},ia=wn?Kn(wn):function(t){return ta(t)&&pi(t)==C};function ua(t){return"string"==typeof t||!Uu(t)&&ta(t)&&Sr(t)==O}function aa(t){return"symbol"==typeof t||ta(t)&&Sr(t)==I}var ca=Sn?Kn(Sn):function(t){return ta(t)&&Ju(t.length)&&!!on[Sr(t)]},fa=Ho(Rr),sa=Ho((function(t,n){return t<=n}));function la(t){if(!t)return[];if(Gu(t))return ua(t)?le(t):Co(t);if(Yt&&t[Yt])return function(t){for(var n,e=[];!(n=t.next()).done;)e.push(n.value);return e}(t[Yt]());var n=pi(t);return(n==w?ie:n==C?ce:Ba)(t)}function pa(t){return t?(t=va(t))===s||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ha(t){var n=pa(t),e=n%1;return n==n?e?n-e:n:0}function da(t){return t?ir(ha(t),0,h):0}function va(t){if("number"==typeof t)return t;if(aa(t))return p;if(Qu(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Qu(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=Yn(t);var e=dt.test(t);return e||gt.test(t)?fn(t.slice(2),e?2:8):ht.test(t)?p:+t}function ga(t){return Oo(t,za(t))}function ya(t){return null==t?"":uo(t)}var _a=Po((function(t,n){if(xi(n)||Gu(n))Oo(n,Pa(n),t);else for(var e in n)Tt.call(n,e)&&Qe(t,e,n[e])})),ma=Po((function(t,n){Oo(n,za(n),t)})),ba=Po((function(t,n,e,r){Oo(n,za(n),t,r)})),xa=Po((function(t,n,e,r){Oo(n,Pa(n),t,r)})),wa=ti(or),Sa=qr((function(t,n){t=jt(t);var e=-1,r=n.length,i=r>2?n[2]:o;for(i&&yi(n[0],n[1],i)&&(r=1);++e<r;)for(var u=n[e],a=za(u),c=-1,f=a.length;++c<f;){var s=a[c],l=t[s];(l===o||Bu(l,Pt[s])&&!Tt.call(t,s))&&(t[s]=u[s])}return t})),ja=qr((function(t){return t.push(o,Xo),jn(Ta,o,t)}));function Ea(t,n,e){var r=null==t?o:xr(t,n);return r===o?e:r}function Aa(t,n){return null!=t&&hi(t,n,Ar)}var Ca=Bo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Dt.call(n)),t[n]=e}),Qa(ec)),Oa=Bo((function(t,n,e){null!=n&&"function"!=typeof n.toString&&(n=Dt.call(n)),Tt.call(t,n)?t[n].push(e):t[n]=[e]}),ui),Ia=qr(Or);function Pa(t){return Gu(t)?$e(t):kr(t)}function za(t){return Gu(t)?$e(t,!0):function(t){if(!Qu(t))return function(t){var n=[];if(null!=t)for(var e in jt(t))n.push(e);return n}(t);var n=xi(t),e=[];for(var r in t)("constructor"!=r||!n&&Tt.call(t,r))&&e.push(r);return e}(t)}var La=Po((function(t,n,e){Br(t,n,e)})),Ta=Po((function(t,n,e,r){Br(t,n,e,r)})),ka=ti((function(t,n){var e={};if(null==t)return e;var r=!1;n=Ln(n,(function(n){return n=yo(n,t),r||(r=n.length>1),n})),Oo(t,ei(t),e),r&&(e=ur(e,7,Jo));for(var o=n.length;o--;)co(e,n[o]);return e})),Ra=ti((function(t,n){return null==t?{}:function(t,n){return Fr(t,n,(function(n,e){return Aa(t,e)}))}(t,n)}));function Da(t,n){if(null==t)return{};var e=Ln(ei(t),(function(t){return[t]}));return n=ui(n),Fr(t,e,(function(t,e){return n(t,e[0])}))}var Na=$o(Pa),Ma=$o(za);function Ba(t){return null==t?[]:Xn(t,Pa(t))}var Wa=ko((function(t,n,e){return n=n.toLowerCase(),t+(e?Va(n):n)}));function Va(t){return Ya(ya(t).toLowerCase())}function Fa(t){return(t=ya(t))&&t.replace(_t,ne).replace(Xt,"")}var Ua=ko((function(t,n,e){return t+(e?"-":"")+n.toLowerCase()})),Ha=ko((function(t,n,e){return t+(e?" ":"")+n.toLowerCase()})),Ga=To("toLowerCase"),Za=ko((function(t,n,e){return t+(e?"_":"")+n.toLowerCase()})),qa=ko((function(t,n,e){return t+(e?" ":"")+Ya(n)})),$a=ko((function(t,n,e){return t+(e?" ":"")+n.toUpperCase()})),Ya=To("toUpperCase");function Ka(t,n,e){return t=ya(t),(n=e?o:n)===o?function(t){return nn.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(n)||[]}var Xa=qr((function(t,n){try{return jn(t,o,n)}catch(t){return Yu(t)?t:new xt(t)}})),Ja=ti((function(t,n){return An(n,(function(n){n=Di(n),rr(t,n,Ou(t[n],t))})),t}));function Qa(t){return function(){return t}}var tc=No(),nc=No(!0);function ec(t){return t}function rc(t){return Tr("function"==typeof t?t:ur(t,1))}var oc=qr((function(t,n){return function(e){return Or(e,t,n)}})),ic=qr((function(t,n){return function(e){return Or(t,e,n)}}));function uc(t,n,e){var r=Pa(n),o=br(n,r);null!=e||Qu(n)&&(o.length||!r.length)||(e=n,n=t,t=this,o=br(n,Pa(n)));var i=!(Qu(e)&&"chain"in e&&!e.chain),u=Ku(t);return An(o,(function(e){var r=n[e];t[e]=r,u&&(t.prototype[e]=function(){var n=this.__chain__;if(i||n){var e=t(this.__wrapped__);return(e.__actions__=Co(this.__actions__)).push({func:r,args:arguments,thisArg:t}),e.__chain__=n,e}return r.apply(t,Tn([this.value()],arguments))})})),t}function ac(){}var cc=Vo(Ln),fc=Vo(On),sc=Vo(Dn);function lc(t){return _i(t)?Hn(Di(t)):function(t){return function(n){return xr(n,t)}}(t)}var pc=Uo(),hc=Uo(!0);function dc(){return[]}function vc(){return!1}var gc,yc=Wo((function(t,n){return t+n}),0),_c=Zo("ceil"),mc=Wo((function(t,n){return t/n}),1),bc=Zo("floor"),xc=Wo((function(t,n){return t*n}),1),wc=Zo("round"),Sc=Wo((function(t,n){return t-n}),0);return Me.after=function(t,n){if("function"!=typeof n)throw new Ct(i);return t=ha(t),function(){if(--t<1)return n.apply(this,arguments)}},Me.ary=Au,Me.assign=_a,Me.assignIn=ma,Me.assignInWith=ba,Me.assignWith=xa,Me.at=wa,Me.before=Cu,Me.bind=Ou,Me.bindAll=Ja,Me.bindKey=Iu,Me.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Uu(t)?t:[t]},Me.chain=lu,Me.chunk=function(t,n,e){n=(e?yi(t,n,e):n===o)?1:ge(ha(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var u=0,a=0,c=r(hn(i/n));u<i;)c[a++]=to(t,u,u+=n);return c},Me.compact=function(t){for(var n=-1,e=null==t?0:t.length,r=0,o=[];++n<e;){var i=t[n];i&&(o[r++]=i)}return o},Me.concat=function(){var t=arguments.length;if(!t)return[];for(var n=r(t-1),e=arguments[0],o=t;o--;)n[o-1]=arguments[o];return Tn(Uu(e)?Co(e):[e],vr(n,1))},Me.cond=function(t){var n=null==t?0:t.length,e=ui();return t=n?Ln(t,(function(t){if("function"!=typeof t[1])throw new Ct(i);return[e(t[0]),t[1]]})):[],qr((function(e){for(var r=-1;++r<n;){var o=t[r];if(jn(o[0],this,e))return jn(o[1],this,e)}}))},Me.conforms=function(t){return function(t){var n=Pa(t);return function(e){return ar(e,t,n)}}(ur(t,1))},Me.constant=Qa,Me.countBy=du,Me.create=function(t,n){var e=Be(t);return null==n?e:er(e,n)},Me.curry=function t(n,e,r){var i=Yo(n,8,o,o,o,o,o,e=r?o:e);return i.placeholder=t.placeholder,i},Me.curryRight=function t(n,e,r){var i=Yo(n,16,o,o,o,o,o,e=r?o:e);return i.placeholder=t.placeholder,i},Me.debounce=Pu,Me.defaults=Sa,Me.defaultsDeep=ja,Me.defer=zu,Me.delay=Lu,Me.difference=Bi,Me.differenceBy=Wi,Me.differenceWith=Vi,Me.drop=function(t,n,e){var r=null==t?0:t.length;return r?to(t,(n=e||n===o?1:ha(n))<0?0:n,r):[]},Me.dropRight=function(t,n,e){var r=null==t?0:t.length;return r?to(t,0,(n=r-(n=e||n===o?1:ha(n)))<0?0:n):[]},Me.dropRightWhile=function(t,n){return t&&t.length?so(t,ui(n,3),!0,!0):[]},Me.dropWhile=function(t,n){return t&&t.length?so(t,ui(n,3),!0):[]},Me.fill=function(t,n,e,r){var i=null==t?0:t.length;return i?(e&&"number"!=typeof e&&yi(t,n,e)&&(e=0,r=i),function(t,n,e,r){var i=t.length;for((e=ha(e))<0&&(e=-e>i?0:i+e),(r=r===o||r>i?i:ha(r))<0&&(r+=i),r=e>r?0:da(r);e<r;)t[e++]=n;return t}(t,n,e,r)):[]},Me.filter=function(t,n){return(Uu(t)?In:dr)(t,ui(n,3))},Me.flatMap=function(t,n){return vr(wu(t,n),1)},Me.flatMapDeep=function(t,n){return vr(wu(t,n),s)},Me.flatMapDepth=function(t,n,e){return e=e===o?1:ha(e),vr(wu(t,n),e)},Me.flatten=Hi,Me.flattenDeep=function(t){return null!=t&&t.length?vr(t,s):[]},Me.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===o?1:ha(n)):[]},Me.flip=function(t){return Yo(t,512)},Me.flow=tc,Me.flowRight=nc,Me.fromPairs=function(t){for(var n=-1,e=null==t?0:t.length,r={};++n<e;){var o=t[n];r[o[0]]=o[1]}return r},Me.functions=function(t){return null==t?[]:br(t,Pa(t))},Me.functionsIn=function(t){return null==t?[]:br(t,za(t))},Me.groupBy=mu,Me.initial=function(t){return null!=t&&t.length?to(t,0,-1):[]},Me.intersection=Zi,Me.intersectionBy=qi,Me.intersectionWith=$i,Me.invert=Ca,Me.invertBy=Oa,Me.invokeMap=bu,Me.iteratee=rc,Me.keyBy=xu,Me.keys=Pa,Me.keysIn=za,Me.map=wu,Me.mapKeys=function(t,n){var e={};return n=ui(n,3),_r(t,(function(t,r,o){rr(e,n(t,r,o),t)})),e},Me.mapValues=function(t,n){var e={};return n=ui(n,3),_r(t,(function(t,r,o){rr(e,r,n(t,r,o))})),e},Me.matches=function(t){return Nr(ur(t,1))},Me.matchesProperty=function(t,n){return Mr(t,ur(n,1))},Me.memoize=Tu,Me.merge=La,Me.mergeWith=Ta,Me.method=oc,Me.methodOf=ic,Me.mixin=uc,Me.negate=ku,Me.nthArg=function(t){return t=ha(t),qr((function(n){return Wr(n,t)}))},Me.omit=ka,Me.omitBy=function(t,n){return Da(t,ku(ui(n)))},Me.once=function(t){return Cu(2,t)},Me.orderBy=function(t,n,e,r){return null==t?[]:(Uu(n)||(n=null==n?[]:[n]),Uu(e=r?o:e)||(e=null==e?[]:[e]),Vr(t,n,e))},Me.over=cc,Me.overArgs=Ru,Me.overEvery=fc,Me.overSome=sc,Me.partial=Du,Me.partialRight=Nu,Me.partition=Su,Me.pick=Ra,Me.pickBy=Da,Me.property=lc,Me.propertyOf=function(t){return function(n){return null==t?o:xr(t,n)}},Me.pull=Ki,Me.pullAll=Xi,Me.pullAllBy=function(t,n,e){return t&&t.length&&n&&n.length?Ur(t,n,ui(e,2)):t},Me.pullAllWith=function(t,n,e){return t&&t.length&&n&&n.length?Ur(t,n,o,e):t},Me.pullAt=Ji,Me.range=pc,Me.rangeRight=hc,Me.rearg=Mu,Me.reject=function(t,n){return(Uu(t)?In:dr)(t,ku(ui(n,3)))},Me.remove=function(t,n){var e=[];if(!t||!t.length)return e;var r=-1,o=[],i=t.length;for(n=ui(n,3);++r<i;){var u=t[r];n(u,r,t)&&(e.push(u),o.push(r))}return Hr(t,o),e},Me.rest=function(t,n){if("function"!=typeof t)throw new Ct(i);return qr(t,n=n===o?n:ha(n))},Me.reverse=Qi,Me.sampleSize=function(t,n,e){return n=(e?yi(t,n,e):n===o)?1:ha(n),(Uu(t)?Ke:Yr)(t,n)},Me.set=function(t,n,e){return null==t?t:Kr(t,n,e)},Me.setWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:Kr(t,n,e,r)},Me.shuffle=function(t){return(Uu(t)?Xe:Qr)(t)},Me.slice=function(t,n,e){var r=null==t?0:t.length;return r?(e&&"number"!=typeof e&&yi(t,n,e)?(n=0,e=r):(n=null==n?0:ha(n),e=e===o?r:ha(e)),to(t,n,e)):[]},Me.sortBy=ju,Me.sortedUniq=function(t){return t&&t.length?oo(t):[]},Me.sortedUniqBy=function(t,n){return t&&t.length?oo(t,ui(n,2)):[]},Me.split=function(t,n,e){return e&&"number"!=typeof e&&yi(t,n,e)&&(n=e=o),(e=e===o?h:e>>>0)?(t=ya(t))&&("string"==typeof n||null!=n&&!oa(n))&&!(n=uo(n))&&oe(t)?mo(le(t),0,e):t.split(n,e):[]},Me.spread=function(t,n){if("function"!=typeof t)throw new Ct(i);return n=null==n?0:ge(ha(n),0),qr((function(e){var r=e[n],o=mo(e,0,n);return r&&Tn(o,r),jn(t,this,o)}))},Me.tail=function(t){var n=null==t?0:t.length;return n?to(t,1,n):[]},Me.take=function(t,n,e){return t&&t.length?to(t,0,(n=e||n===o?1:ha(n))<0?0:n):[]},Me.takeRight=function(t,n,e){var r=null==t?0:t.length;return r?to(t,(n=r-(n=e||n===o?1:ha(n)))<0?0:n,r):[]},Me.takeRightWhile=function(t,n){return t&&t.length?so(t,ui(n,3),!1,!0):[]},Me.takeWhile=function(t,n){return t&&t.length?so(t,ui(n,3)):[]},Me.tap=function(t,n){return n(t),t},Me.throttle=function(t,n,e){var r=!0,o=!0;if("function"!=typeof t)throw new Ct(i);return Qu(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),Pu(t,n,{leading:r,maxWait:n,trailing:o})},Me.thru=pu,Me.toArray=la,Me.toPairs=Na,Me.toPairsIn=Ma,Me.toPath=function(t){return Uu(t)?Ln(t,Di):aa(t)?[t]:Co(Ri(ya(t)))},Me.toPlainObject=ga,Me.transform=function(t,n,e){var r=Uu(t),o=r||qu(t)||ca(t);if(n=ui(n,4),null==e){var i=t&&t.constructor;e=o?r?new i:[]:Qu(t)&&Ku(i)?Be(Ht(t)):{}}return(o?An:_r)(t,(function(t,r,o){return n(e,t,r,o)})),e},Me.unary=function(t){return Au(t,1)},Me.union=tu,Me.unionBy=nu,Me.unionWith=eu,Me.uniq=function(t){return t&&t.length?ao(t):[]},Me.uniqBy=function(t,n){return t&&t.length?ao(t,ui(n,2)):[]},Me.uniqWith=function(t,n){return n="function"==typeof n?n:o,t&&t.length?ao(t,o,n):[]},Me.unset=function(t,n){return null==t||co(t,n)},Me.unzip=ru,Me.unzipWith=ou,Me.update=function(t,n,e){return null==t?t:fo(t,n,go(e))},Me.updateWith=function(t,n,e,r){return r="function"==typeof r?r:o,null==t?t:fo(t,n,go(e),r)},Me.values=Ba,Me.valuesIn=function(t){return null==t?[]:Xn(t,za(t))},Me.without=iu,Me.words=Ka,Me.wrap=function(t,n){return Du(go(n),t)},Me.xor=uu,Me.xorBy=au,Me.xorWith=cu,Me.zip=fu,Me.zipObject=function(t,n){return ho(t||[],n||[],Qe)},Me.zipObjectDeep=function(t,n){return ho(t||[],n||[],Kr)},Me.zipWith=su,Me.entries=Na,Me.entriesIn=Ma,Me.extend=ma,Me.extendWith=ba,uc(Me,Me),Me.add=yc,Me.attempt=Xa,Me.camelCase=Wa,Me.capitalize=Va,Me.ceil=_c,Me.clamp=function(t,n,e){return e===o&&(e=n,n=o),e!==o&&(e=(e=va(e))==e?e:0),n!==o&&(n=(n=va(n))==n?n:0),ir(va(t),n,e)},Me.clone=function(t){return ur(t,4)},Me.cloneDeep=function(t){return ur(t,5)},Me.cloneDeepWith=function(t,n){return ur(t,5,n="function"==typeof n?n:o)},Me.cloneWith=function(t,n){return ur(t,4,n="function"==typeof n?n:o)},Me.conformsTo=function(t,n){return null==n||ar(t,n,Pa(n))},Me.deburr=Fa,Me.defaultTo=function(t,n){return null==t||t!=t?n:t},Me.divide=mc,Me.endsWith=function(t,n,e){t=ya(t),n=uo(n);var r=t.length,i=e=e===o?r:ir(ha(e),0,r);return(e-=n.length)>=0&&t.slice(e,i)==n},Me.eq=Bu,Me.escape=function(t){return(t=ya(t))&&$.test(t)?t.replace(Z,ee):t},Me.escapeRegExp=function(t){return(t=ya(t))&&et.test(t)?t.replace(nt,"\\$&"):t},Me.every=function(t,n,e){var r=Uu(t)?On:pr;return e&&yi(t,n,e)&&(n=o),r(t,ui(n,3))},Me.find=vu,Me.findIndex=Fi,Me.findKey=function(t,n){return Mn(t,ui(n,3),_r)},Me.findLast=gu,Me.findLastIndex=Ui,Me.findLastKey=function(t,n){return Mn(t,ui(n,3),mr)},Me.floor=bc,Me.forEach=yu,Me.forEachRight=_u,Me.forIn=function(t,n){return null==t?t:gr(t,ui(n,3),za)},Me.forInRight=function(t,n){return null==t?t:yr(t,ui(n,3),za)},Me.forOwn=function(t,n){return t&&_r(t,ui(n,3))},Me.forOwnRight=function(t,n){return t&&mr(t,ui(n,3))},Me.get=Ea,Me.gt=Wu,Me.gte=Vu,Me.has=function(t,n){return null!=t&&hi(t,n,Er)},Me.hasIn=Aa,Me.head=Gi,Me.identity=ec,Me.includes=function(t,n,e,r){t=Gu(t)?t:Ba(t),e=e&&!r?ha(e):0;var o=t.length;return e<0&&(e=ge(o+e,0)),ua(t)?e<=o&&t.indexOf(n,e)>-1:!!o&&Wn(t,n,e)>-1},Me.indexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var o=null==e?0:ha(e);return o<0&&(o=ge(r+o,0)),Wn(t,n,o)},Me.inRange=function(t,n,e){return n=pa(n),e===o?(e=n,n=0):e=pa(e),function(t,n,e){return t>=ye(n,e)&&t<ge(n,e)}(t=va(t),n,e)},Me.invoke=Ia,Me.isArguments=Fu,Me.isArray=Uu,Me.isArrayBuffer=Hu,Me.isArrayLike=Gu,Me.isArrayLikeObject=Zu,Me.isBoolean=function(t){return!0===t||!1===t||ta(t)&&Sr(t)==y},Me.isBuffer=qu,Me.isDate=$u,Me.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Me.isEmpty=function(t){if(null==t)return!0;if(Gu(t)&&(Uu(t)||"string"==typeof t||"function"==typeof t.splice||qu(t)||ca(t)||Fu(t)))return!t.length;var n=pi(t);if(n==w||n==C)return!t.size;if(xi(t))return!kr(t).length;for(var e in t)if(Tt.call(t,e))return!1;return!0},Me.isEqual=function(t,n){return Pr(t,n)},Me.isEqualWith=function(t,n,e){var r=(e="function"==typeof e?e:o)?e(t,n):o;return r===o?Pr(t,n,o,e):!!r},Me.isError=Yu,Me.isFinite=function(t){return"number"==typeof t&&Nn(t)},Me.isFunction=Ku,Me.isInteger=Xu,Me.isLength=Ju,Me.isMap=na,Me.isMatch=function(t,n){return t===n||zr(t,n,ci(n))},Me.isMatchWith=function(t,n,e){return e="function"==typeof e?e:o,zr(t,n,ci(n),e)},Me.isNaN=function(t){return ea(t)&&t!=+t},Me.isNative=function(t){if(bi(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(t)},Me.isNil=function(t){return null==t},Me.isNull=function(t){return null===t},Me.isNumber=ea,Me.isObject=Qu,Me.isObjectLike=ta,Me.isPlainObject=ra,Me.isRegExp=oa,Me.isSafeInteger=function(t){return Xu(t)&&t>=-9007199254740991&&t<=l},Me.isSet=ia,Me.isString=ua,Me.isSymbol=aa,Me.isTypedArray=ca,Me.isUndefined=function(t){return t===o},Me.isWeakMap=function(t){return ta(t)&&pi(t)==P},Me.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==Sr(t)},Me.join=function(t,n){return null==t?"":Gn.call(t,n)},Me.kebabCase=Ua,Me.last=Yi,Me.lastIndexOf=function(t,n,e){var r=null==t?0:t.length;if(!r)return-1;var i=r;return e!==o&&(i=(i=ha(e))<0?ge(r+i,0):ye(i,r-1)),n==n?function(t,n,e){for(var r=e+1;r--;)if(t[r]===n)return r;return r}(t,n,i):Bn(t,Fn,i,!0)},Me.lowerCase=Ha,Me.lowerFirst=Ga,Me.lt=fa,Me.lte=sa,Me.max=function(t){return t&&t.length?hr(t,ec,jr):o},Me.maxBy=function(t,n){return t&&t.length?hr(t,ui(n,2),jr):o},Me.mean=function(t){return Un(t,ec)},Me.meanBy=function(t,n){return Un(t,ui(n,2))},Me.min=function(t){return t&&t.length?hr(t,ec,Rr):o},Me.minBy=function(t,n){return t&&t.length?hr(t,ui(n,2),Rr):o},Me.stubArray=dc,Me.stubFalse=vc,Me.stubObject=function(){return{}},Me.stubString=function(){return""},Me.stubTrue=function(){return!0},Me.multiply=xc,Me.nth=function(t,n){return t&&t.length?Wr(t,ha(n)):o},Me.noConflict=function(){return pn._===this&&(pn._=Mt),this},Me.noop=ac,Me.now=Eu,Me.pad=function(t,n,e){t=ya(t);var r=(n=ha(n))?se(t):0;if(!n||r>=n)return t;var o=(n-r)/2;return Fo(dn(o),e)+t+Fo(hn(o),e)},Me.padEnd=function(t,n,e){t=ya(t);var r=(n=ha(n))?se(t):0;return n&&r<n?t+Fo(n-r,e):t},Me.padStart=function(t,n,e){t=ya(t);var r=(n=ha(n))?se(t):0;return n&&r<n?Fo(n-r,e)+t:t},Me.parseInt=function(t,n,e){return e||null==n?n=0:n&&(n=+n),me(ya(t).replace(rt,""),n||0)},Me.random=function(t,n,e){if(e&&"boolean"!=typeof e&&yi(t,n,e)&&(n=e=o),e===o&&("boolean"==typeof n?(e=n,n=o):"boolean"==typeof t&&(e=t,t=o)),t===o&&n===o?(t=0,n=1):(t=pa(t),n===o?(n=t,t=0):n=pa(n)),t>n){var r=t;t=n,n=r}if(e||t%1||n%1){var i=be();return ye(t+i*(n-t+cn("1e-"+((i+"").length-1))),n)}return Gr(t,n)},Me.reduce=function(t,n,e){var r=Uu(t)?kn:Zn,o=arguments.length<3;return r(t,ui(n,4),e,o,sr)},Me.reduceRight=function(t,n,e){var r=Uu(t)?Rn:Zn,o=arguments.length<3;return r(t,ui(n,4),e,o,lr)},Me.repeat=function(t,n,e){return n=(e?yi(t,n,e):n===o)?1:ha(n),Zr(ya(t),n)},Me.replace=function(){var t=arguments,n=ya(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Me.result=function(t,n,e){var r=-1,i=(n=yo(n,t)).length;for(i||(i=1,t=o);++r<i;){var u=null==t?o:t[Di(n[r])];u===o&&(r=i,u=e),t=Ku(u)?u.call(t):u}return t},Me.round=wc,Me.runInContext=t,Me.sample=function(t){return(Uu(t)?Ye:$r)(t)},Me.size=function(t){if(null==t)return 0;if(Gu(t))return ua(t)?se(t):t.length;var n=pi(t);return n==w||n==C?t.size:kr(t).length},Me.snakeCase=Za,Me.some=function(t,n,e){var r=Uu(t)?Dn:no;return e&&yi(t,n,e)&&(n=o),r(t,ui(n,3))},Me.sortedIndex=function(t,n){return eo(t,n)},Me.sortedIndexBy=function(t,n,e){return ro(t,n,ui(e,2))},Me.sortedIndexOf=function(t,n){var e=null==t?0:t.length;if(e){var r=eo(t,n);if(r<e&&Bu(t[r],n))return r}return-1},Me.sortedLastIndex=function(t,n){return eo(t,n,!0)},Me.sortedLastIndexBy=function(t,n,e){return ro(t,n,ui(e,2),!0)},Me.sortedLastIndexOf=function(t,n){if(null!=t&&t.length){var e=eo(t,n,!0)-1;if(Bu(t[e],n))return e}return-1},Me.startCase=qa,Me.startsWith=function(t,n,e){return t=ya(t),e=null==e?0:ir(ha(e),0,t.length),n=uo(n),t.slice(e,e+n.length)==n},Me.subtract=Sc,Me.sum=function(t){return t&&t.length?qn(t,ec):0},Me.sumBy=function(t,n){return t&&t.length?qn(t,ui(n,2)):0},Me.template=function(t,n,e){var r=Me.templateSettings;e&&yi(t,n,e)&&(n=o),t=ya(t),n=ba({},n,r,Ko);var i,u,a=ba({},n.imports,r.imports,Ko),c=Pa(a),f=Xn(a,c),s=0,l=n.interpolate||mt,p="__p += '",h=Et((n.escape||mt).source+"|"+l.source+"|"+(l===X?lt:mt).source+"|"+(n.evaluate||mt).source+"|$","g"),d="//# sourceURL="+(Tt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rn+"]")+"\n";t.replace(h,(function(n,e,r,o,a,c){return r||(r=o),p+=t.slice(s,c).replace(bt,re),e&&(i=!0,p+="' +\n__e("+e+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+n.length,n})),p+="';\n";var v=Tt.call(n,"variable")&&n.variable;if(v){if(ft.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(u?p.replace(F,""):p).replace(U,"$1").replace(H,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Xa((function(){return wt(c,d+"return "+p).apply(o,f)}));if(g.source=p,Yu(g))throw g;return g},Me.times=function(t,n){if((t=ha(t))<1||t>l)return[];var e=h,r=ye(t,h);n=ui(n),t-=h;for(var o=$n(r,n);++e<t;)n(e);return o},Me.toFinite=pa,Me.toInteger=ha,Me.toLength=da,Me.toLower=function(t){return ya(t).toLowerCase()},Me.toNumber=va,Me.toSafeInteger=function(t){return t?ir(ha(t),-9007199254740991,l):0===t?t:0},Me.toString=ya,Me.toUpper=function(t){return ya(t).toUpperCase()},Me.trim=function(t,n,e){if((t=ya(t))&&(e||n===o))return Yn(t);if(!t||!(n=uo(n)))return t;var r=le(t),i=le(n);return mo(r,Qn(r,i),te(r,i)+1).join("")},Me.trimEnd=function(t,n,e){if((t=ya(t))&&(e||n===o))return t.slice(0,pe(t)+1);if(!t||!(n=uo(n)))return t;var r=le(t);return mo(r,0,te(r,le(n))+1).join("")},Me.trimStart=function(t,n,e){if((t=ya(t))&&(e||n===o))return t.replace(rt,"");if(!t||!(n=uo(n)))return t;var r=le(t);return mo(r,Qn(r,le(n))).join("")},Me.truncate=function(t,n){var e=30,r="...";if(Qu(n)){var i="separator"in n?n.separator:i;e="length"in n?ha(n.length):e,r="omission"in n?uo(n.omission):r}var u=(t=ya(t)).length;if(oe(t)){var a=le(t);u=a.length}if(e>=u)return t;var c=e-se(r);if(c<1)return r;var f=a?mo(a,0,c).join(""):t.slice(0,c);if(i===o)return f+r;if(a&&(c+=f.length-c),oa(i)){if(t.slice(c).search(i)){var s,l=f;for(i.global||(i=Et(i.source,ya(pt.exec(i))+"g")),i.lastIndex=0;s=i.exec(l);)var p=s.index;f=f.slice(0,p===o?c:p)}}else if(t.indexOf(uo(i),c)!=c){var h=f.lastIndexOf(i);h>-1&&(f=f.slice(0,h))}return f+r},Me.unescape=function(t){return(t=ya(t))&&q.test(t)?t.replace(G,he):t},Me.uniqueId=function(t){var n=++kt;return ya(t)+n},Me.upperCase=$a,Me.upperFirst=Ya,Me.each=yu,Me.eachRight=_u,Me.first=Gi,uc(Me,(gc={},_r(Me,(function(t,n){Tt.call(Me.prototype,n)||(gc[n]=t)})),gc),{chain:!1}),Me.VERSION="4.17.21",An(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Me[t].placeholder=Me})),An(["drop","take"],(function(t,n){Fe.prototype[t]=function(e){e=e===o?1:ge(ha(e),0);var r=this.__filtered__&&!n?new Fe(this):this.clone();return r.__filtered__?r.__takeCount__=ye(e,r.__takeCount__):r.__views__.push({size:ye(e,h),type:t+(r.__dir__<0?"Right":"")}),r},Fe.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}})),An(["filter","map","takeWhile"],(function(t,n){var e=n+1,r=1==e||3==e;Fe.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:ui(t,3),type:e}),n.__filtered__=n.__filtered__||r,n}})),An(["head","last"],(function(t,n){var e="take"+(n?"Right":"");Fe.prototype[t]=function(){return this[e](1).value()[0]}})),An(["initial","tail"],(function(t,n){var e="drop"+(n?"":"Right");Fe.prototype[t]=function(){return this.__filtered__?new Fe(this):this[e](1)}})),Fe.prototype.compact=function(){return this.filter(ec)},Fe.prototype.find=function(t){return this.filter(t).head()},Fe.prototype.findLast=function(t){return this.reverse().find(t)},Fe.prototype.invokeMap=qr((function(t,n){return"function"==typeof t?new Fe(this):this.map((function(e){return Or(e,t,n)}))})),Fe.prototype.reject=function(t){return this.filter(ku(ui(t)))},Fe.prototype.slice=function(t,n){t=ha(t);var e=this;return e.__filtered__&&(t>0||n<0)?new Fe(e):(t<0?e=e.takeRight(-t):t&&(e=e.drop(t)),n!==o&&(e=(n=ha(n))<0?e.dropRight(-n):e.take(n-t)),e)},Fe.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Fe.prototype.toArray=function(){return this.take(h)},_r(Fe.prototype,(function(t,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),i=Me[r?"take"+("last"==n?"Right":""):n],u=r||/^find/.test(n);i&&(Me.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof Fe,f=a[0],s=c||Uu(n),l=function(t){var n=i.apply(Me,Tn([t],a));return r&&p?n[0]:n};s&&e&&"function"==typeof f&&1!=f.length&&(c=s=!1);var p=this.__chain__,h=!!this.__actions__.length,d=u&&!p,v=c&&!h;if(!u&&s){n=v?n:new Fe(this);var g=t.apply(n,a);return g.__actions__.push({func:pu,args:[l],thisArg:o}),new Ve(g,p)}return d&&v?t.apply(this,a):(g=this.thru(l),d?r?g.value()[0]:g.value():g)})})),An(["pop","push","shift","sort","splice","unshift"],(function(t){var n=Ot[t],e=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Me.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return n.apply(Uu(o)?o:[],t)}return this[e]((function(e){return n.apply(Uu(e)?e:[],t)}))}})),_r(Fe.prototype,(function(t,n){var e=Me[n];if(e){var r=e.name+"";Tt.call(Ie,r)||(Ie[r]=[]),Ie[r].push({name:n,func:e})}})),Ie[Mo(o,2).name]=[{name:"wrapper",func:o}],Fe.prototype.clone=function(){var t=new Fe(this.__wrapped__);return t.__actions__=Co(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Co(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Co(this.__views__),t},Fe.prototype.reverse=function(){if(this.__filtered__){var t=new Fe(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Fe.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,e=Uu(t),r=n<0,o=e?t.length:0,i=function(t,n,e){for(var r=-1,o=e.length;++r<o;){var i=e[r],u=i.size;switch(i.type){case"drop":t+=u;break;case"dropRight":n-=u;break;case"take":n=ye(n,t+u);break;case"takeRight":t=ge(t,n-u)}}return{start:t,end:n}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,f=r?a:u-1,s=this.__iteratees__,l=s.length,p=0,h=ye(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return lo(t,this.__actions__);var d=[];t:for(;c--&&p<h;){for(var v=-1,g=t[f+=n];++v<l;){var y=s[v],_=y.iteratee,m=y.type,b=_(g);if(2==m)g=b;else if(!b){if(1==m)continue t;break t}}d[p++]=g}return d},Me.prototype.at=hu,Me.prototype.chain=function(){return lu(this)},Me.prototype.commit=function(){return new Ve(this.value(),this.__chain__)},Me.prototype.next=function(){this.__values__===o&&(this.__values__=la(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Me.prototype.plant=function(t){for(var n,e=this;e instanceof We;){var r=Mi(e);r.__index__=0,r.__values__=o,n?i.__wrapped__=r:n=r;var i=r;e=e.__wrapped__}return i.__wrapped__=t,n},Me.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Fe){var n=t;return this.__actions__.length&&(n=new Fe(this)),(n=n.reverse()).__actions__.push({func:pu,args:[Qi],thisArg:o}),new Ve(n,this.__chain__)}return this.thru(Qi)},Me.prototype.toJSON=Me.prototype.valueOf=Me.prototype.value=function(){return lo(this.__wrapped__,this.__actions__)},Me.prototype.first=Me.prototype.head,Yt&&(Me.prototype[Yt]=function(){return this}),Me}();pn._=de,(r=function(){return de}.call(n,e,n,t))===o||(t.exports=r)}.call(this)}},n={};function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t,n=(t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)},function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e,"WEB_COMPONENT_TAG_NAME",{get:function(){return e._WEB_COMPONENT_TAG_NAME},set:function(t){t&&"string"==typeof t&&(e._WEB_COMPONENT_TAG_NAME=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CANVAS_SIZE",{get:function(){return e._CANVAS_SIZE},set:function(t){t&&(null==t?void 0:t.width)&&(null==t?void 0:t.height)?e._CANVAS_SIZE=t:console.warn("CANVAS_SIZE denied")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LAYERS",{get:function(){return e._LAYERS},set:function(t){t&&(null==t?void 0:t.length)&&(e._LAYERS=t)},enumerable:!1,configurable:!0}),e}((function(){}));r._CANVAS_SIZE={width:300,height:150},r._WEB_COMPONENT_TAG_NAME="canvas-editor-engine",r._LAYERS=[{name:"low",index:1},{name:"normal",index:2},{name:"high",index:3}];const o=r,i=function(){function t(){}return t.getTemplate=function(t,n){var e={tag:"div"};n&&Object.keys(n).forEach((function(t){n[t]&&(e[t]=n[t])}));var r=document.createElement(e.tag);return e&&Object.keys(e).forEach((function(t){e[t]&&"tag"!==t&&(r[t]=e[t])})),t&&(r.innerHTML=t),r},t.getStyle=function(t){if(0==!!t)return null;var n=document.createElement("style");return n.type="text/css",n.appendChild(document.createTextNode(t)),n},t}(),u=function(){function t(){}return Object.defineProperty(t,"components",{get:function(){return t.getMethods("components")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"services",{get:function(){return t.getMethods("services")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"planed",{get:function(){return t.getMethods("planed")},enumerable:!1,configurable:!0}),t.getMethods=function(n){return{add:function(e){t._add(n,e)},get:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];t._get.apply(t,n)}}},t._add=function(n,e){t.log[n].push(e)},t._get=function(n,e){return t.log[n].find((function(t){return t.info.name===e}))},t.log={components:[],services:[],planed:[]},t}(),a=function(){function t(){}return t.getLayerIndex=function(n){var e=o.LAYERS.find((function(t){return t.name===n}));return t.multiplier*e.index},t.multiplier=1e3,t}();var c=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return c(n,t),n.getComponent=function(){var t=n.getTemplate(n.template),e=n.getStyle(n.css);return n.canvas=t.getElementsByTagName("canvas")[0],n.canvas.width=o.CANVAS_SIZE.width,n.canvas.height=o.CANVAS_SIZE.height,n.ctx=n.canvas.getContext("2d",{willReadFrequently:!0}),n.eventListener=t.querySelector("#event-listener"),n.eventListener.style.width=o.CANVAS_SIZE.width+"px",n.eventListener.style.height=o.CANVAS_SIZE.height+"px",{canvasTemplate:t,canvasStyle:e}},n.getCanvasSelector=function(){return"#sc-canvas"},Object.defineProperty(n,"cursorStyle",{set:function(t){t?(n._cursorStyle.before=n._cursorStyle.current,n._cursorStyle.current=t,n.eventListener.style.cursor=t):n.eventListener.style.cursor="default"},enumerable:!1,configurable:!0}),n.getCursorPosition=function(t){var e=n.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}},n.subscribe=function(t,e){n.subscriptions[t].push(e)},n.simulateSubscriptions=function(){Object.keys(n.subscriptions).forEach((function(t){var e=n.subscriptions[t];e.length&&n.eventListener.addEventListener(t,(function(t){var r=n.getCursorPosition(t);e.forEach((function(n){n(t,r)}))}))}))},n.template='\n <div id="event-listener"></div>\n <canvas id="sc-canvas"></canvas>\n ',n.css="\n #event-listener {\n position: absolute;\n z-index: ".concat(a.getLayerIndex("normal"),";\n }\n "),n.subscriptions={click:[],mousemove:[],mousedown:[],mouseup:[]},n._cursorStyle={before:null,current:"default"},u.components.add({info:{name:"canvas",description:"canvas component"},prototype:n}),n}(i),s=function(){function t(){}return t.add=function(n){return t.registry.find((function(t){return t.id===n.id}))?(console.warn("Tool has been previously registered!"),!1):(t.registry.push(n),!0)},t.setActive=function(n){var e,r,o;if((null===(e=t.active)||void 0===e?void 0:e.id)===n)return console.warn("Tool is already active");(null===(r=t.active)||void 0===r?void 0:r.offAction)&&t.active.offAction();var i=t.registry.find((function(t){return t.id===n}));i?(t.active=i,(null===(o=t.active)||void 0===o?void 0:o.onAction)&&t.active.onAction()):console.warn("Tool has not previously been registered with this identifier")},t.offActive=function(n){if(n){if(t.active.id!==n)return console.warn('ID active tool is not "'.concat(n,'"'));t.off()}else t.off()},t.off=function(){var n;(null===(n=t.active)||void 0===n?void 0:n.offAction)&&t.active.offAction(),t.before=t.active,t.active=null,f.cursorStyle="default"},t.before=null,t.active=null,t.registry=[],t}();var l=function(){function t(){}return t.byteRGBToHEX=function(n){var e=n[0],r=n[1],o=n[2];return t.rgbToHex(e,r,o)},t.rgbToHex=function(n,e,r){return"#".concat(t.componentToHEX(n)).concat(t.componentToHEX(e)).concat(t.componentToHEX(r))},t.hexToRgb=function(t){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null},t.componentToHEX=function(t){var n=t.toString(16);return 1==n.length?"0"+n:n},t}(),p=e(543),h=function(){function t(t){this.ctx=t}return t.prototype.setImageSize=function(t){this.imageSize=t},t.prototype.copy=function(t){var n=(null==t?void 0:t.width)?t.width:o.CANVAS_SIZE.width,e=(null==t?void 0:t.height)?t.height:o.CANVAS_SIZE.height;return this.ctx.getImageData(t.x,t.y,n,e)},t.prototype.copyExtendedModel=function(t){var n=(null==t?void 0:t.width)?t.width:o.CANVAS_SIZE.width,e=(null==t?void 0:t.height)?t.height:o.CANVAS_SIZE.height,r=this.ctx.getImageData(t.x,t.y,n,e);return this.clearEmptyPixels(r)},t.prototype.update=function(t,n){this.ctx.clearRect(0,0,o.CANVAS_SIZE.width,o.CANVAS_SIZE.height),this.ctx.putImageData(t,n.x,n.y)},t.prototype.clearEmptyPixels=function(t){var n=this.getRowRGBABuff(t),e=this.getRGBAMatrix(n,{width:t.width,height:t.height}),r={width:t.width,height:t.height},o=this.getSizeOfSparseMatrix(e,r),i=n.filter((function(t){return!!t[3]})),u=i.flat(),a=document.createElement("canvas").getContext("2d").createImageData(o.width,o.height);return u.forEach((function(t,n){return a.data[n]=u[n]})),console.log("cleared",i),{imageData:a,size:o}},t.prototype.getSizeOfSparseMatrix=function(t,n){for(var e,r,o,i,u=0,a=t.entries();u<a.length;u++){for(var c=a[u],f=c[0],s=0,l=c[1].entries();s<l.length;s++){var p=l[s],h=p[0];if(0!==p[1][3]){e=h,r=f;break}}if(void 0!==e&&void 0!==r)break}for(var d=0,v=t.reverse().entries();d<v.length;d++){for(var g=v[d],y=(f=g[0],0),_=g[1].reverse().entries();y<_.length;y++){var m=_[y];if(h=m[0],0!==m[1][3]){o=h,i=f;break}}if(void 0!==o&&void 0!==i)break}var b,x;return{width:(x=n.width,x-(e+o)),height:(b=n.height,b-(r+i))}},t.prototype.getBuffCollection=function(t){var n=this.getRowRGBABuff(t),e=n.map(l.byteRGBToHEX);return{rowRGBABuff:n,hexBuff:e,buff:this.getBuff(e)}},t.prototype.getBuff=function(t){var n=this,e=(0,p.range)(0,this.imageSize.height).map((function(t){return n.imageSize.width*t})),r=[],o=0;return t.forEach((function(t,n){var i;n>=e[o+1]&&o++,null!==(i=r[o])&&void 0!==i||(r[o]=[]),r[o].push(t)})),r},t.prototype.getRGBAMatrix=function(t,n){var e={width:n.width||this.imageSize.width,height:n.height||this.imageSize.height},r=(0,p.range)(0,e.height).map((function(t){return e.width*t})),o=[],i=0;return t.forEach((function(t,n){var e;n>=r[i+1]&&i++,null!==(e=o[i])&&void 0!==e||(o[i]=[]),o[i].push(t)})),o},t.prototype.getRowRGBABuff=function(t){var n=[],e=0,r=0;return t.data.forEach((function(t){var o;e>=4&&(e=0,r++),e++,null!==(o=n[r])&&void 0!==o||(n[r]=[]),n[r].push(t)})),n},t}();const d=function(){function t(){}return t.current=function(){var t=b.store.historyState.historyLines;return t[t.length-1]},t.prev=function(){var t=b.store.historyState.historyLines;return t[t.length-2]},t.undo=function(n){var e=t.current(),r=t.prev();(null==e?void 0:e.stateValue)&&(t.cache.unshift(e),b.store.historyState.reduce("UNDO"),(null==r?void 0:r.stateValue)&&t.updateCanvas(n,r.stateValue))},t.redo=function(n){var e=t.cache.shift();(null==e?void 0:e.stateValue)&&(b.store.historyState.reduce("REDO",e),t.updateCanvas(n,e.stateValue))},t.clearCache=function(){t.cache=[]},t.recovery=function(n){b.store.historyState.reduce("SET_HISTORY",{historyLines:n.state.history}),t.cache=n.state.cache},t.updateCanvas=function(t,n){new h(t).update(n.tempImageData,n.position)},t.cache=[],t}();var v=function(){function t(){this.default={historyLines:[]},this._historyLines=this.default.historyLines,this.reset()}return Object.defineProperty(t.prototype,"historyLines",{get:function(){return this._historyLines},enumerable:!1,configurable:!0}),t.prototype.reduce=function(t,n){var e=new g(this);switch(t){case"SET_HISTORY":e.setHistoryLines(n),d.clearCache();break;case"UPDATE_HISTORY":e.updateHistoryLines(n),d.clearCache();break;case"REDO":e.updateHistoryLines(n);break;case"UNDO":e.popHistoryLines()}},t.prototype.emerge=function(t){this._emergeCompleteIt=t},t.prototype.reset=function(){this.reduce("SET_HISTORY",this.default)},t}(),g=function(){function t(t){this.state=t}return t.prototype.setHistoryLines=function(t){var n=!1;(null==t?void 0:t.historyLines)&&(this.state._historyLines=t.historyLines,n=!0),n&&this.state._emergeCompleteIt&&this.state._emergeCompleteIt(this.state._historyLines)},t.prototype.updateHistoryLines=function(t){var n=!1;(null==t?void 0:t.view)&&(this.state._historyLines.push(t),n=!0),n&&this.state._emergeCompleteIt&&this.state._emergeCompleteIt(this.state._historyLines)},t.prototype.popHistoryLines=function(){this.state._historyLines.pop(),this.state._emergeCompleteIt&&this.state._emergeCompleteIt(this.state._historyLines)},t}(),y=function(){function t(){this.default={position:{x:0,y:0},size:{width:0,height:0},tempImageData:null},this._position=this.default.position,this._size=this.default.size,this._tempImageData=this.default.tempImageData,this.reset()}return Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tempImageData",{get:function(){return this._tempImageData},enumerable:!1,configurable:!0}),t.prototype.reduce=function(t,n){var e=!1;(null==t?void 0:t.position)&&(this._position=t.position),(null==t?void 0:t.size)&&(this._size=t.size),(null==t?void 0:t.tempImageData)&&(this._tempImageData=t.tempImageData,e=!0),e&&this.addToHistory("".concat(n||"reduce image"))},t.prototype.reset=function(){this.reduce(this.default,"reset to default")},t.prototype.getEntry=function(){return{position:this._position,size:this._size,imageData:this._tempImageData}},t.prototype.addToHistory=function(t){var n={position:this._position,size:this._size,tempImageData:this._tempImageData};b.store.historyState.reduce("UPDATE_HISTORY",{view:t,stateName:"image",stateValue:n})},t}(),_=function(){function t(t,n){this.imageState=t,this.historyState=n}return t.prototype.reset=function(){this.imageState.reset(),this.historyState.reset()},t}(),m=function(){function t(){}return t.subscribe=function(n,e){"history"===n&&t.store.historyState.emerge(e)},t}();m.store=new _(new y,new v);const b=m,x=function(){function t(){}return t.setup=function(){S.additionStyle="crop"},t.crop=function(n){var e;if(0!=!!(null===(e=S.excretionsCoords)||void 0===e?void 0:e.length)){var r=new h(n),i=t.options,u=r.copyExtendedModel(i),a=u.imageData,c=u.size,f={x:o.CANVAS_SIZE.width/2-c.width/2,y:o.CANVAS_SIZE.height/2-c.height/2};r.update(a,f),b.store.imageState.reduce({tempImageData:a,position:f,size:{width:c.width,height:c.height}},"Use crop")}},t.viewCropButton=function(){var t=S.excretionWrap.querySelectorAll(".crop-button");t[t.length-1].classList.add("crop-button--view")},Object.defineProperty(t,"options",{get:function(){var t=S.excretionsCoords.length-1,n=S.excretionsCoords[t],e=Math.abs(n.start.x-n.end.x),r=Math.abs(n.start.y-n.end.y);return{x:n.start.x,y:n.start.y,width:e,height:r}},enumerable:!1,configurable:!0}),t}();var w=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const S=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return w(n,t),Object.defineProperty(n,"additionStyle",{get:function(){return n._additionStyle},set:function(t){n._additionStyle=t,n.applyExcretionStyle()},enumerable:!1,configurable:!0}),n.applyExcretionStyle=function(){"crop"===n._additionStyle?n.determineCropStyle():n.determineDefaultStyle()},n.determineCropStyle=function(){n._excretions.forEach((function(t){0!=!!t&&(t.classList.contains("excretion_crop")||(t.classList.add("excretion_crop"),x.viewCropButton()))}))},n.determineDefaultStyle=function(){n._excretions.forEach((function(t){0!=!!t&&(t.classList=n._excretionDefaultStyle)}))},n.getComponent=function(){var t=n.getTemplate(n.template,{className:"excretions-wrap"}),e=n.getStyle(n.css);return n.excretionWrap=t,n.emmit(),{excretionsTemplate:t,excretionsStyle:e}},Object.defineProperty(n,"excretionState",{set:function(t){switch(n._excretionState=t,n.applyExcretionStyle(),t){case"abandoned":default:f.cursorStyle="default";break;case"create":f.cursorStyle="crosshair";break;case"add":f.cursorStyle="copy";break;case"remove":f.cursorStyle="alias"}},enumerable:!1,configurable:!0}),n.setToolState=function(t){switch(n._excretionToolState=t,t){case"abandoned":default:n.excretionState="abandoned",n._excretionActivity="abandoned";break;case"taken":n.excretionState="create"}},n.clearExcretionsCoords=function(){console.log("clear!"),n._excretions.forEach((function(t){return t.remove()})),n._excretions=[],n.excretionsCoords=[]},n.getTempCoords=function(){var t=n._tempCoords[0],e=n._tempCoords[1],r=Object.assign(t,e);return n._tempCoords=[],r},n.endExcretion=function(){var t=n.getTempCoords();n.excretionsCoords.push(t),n._excretionActivity="end",console.log("ExcretionsComponent.excretionsCoords",n.excretionsCoords)},n.emmit=function(){f.subscribe("mousedown",(function(t,e){if("abandoned"!==n._excretionToolState){var r=n._excretionState;if("create"===r){var o={className:n._excretionDefaultStyle[0]},i=n.getTemplate(n.templateExcretion,o);n.clearExcretionsCoords();var u={start:e};i.style.left="".concat(u.start.x,"px"),i.style.top="".concat(u.start.y,"px");var a=n.excretionWrap.appendChild(i);n._excretions.push(a),n._tempCoords.push(u)}"add"===r&&(u={start:e},n._tempCoords.push(u)),n.applyExcretionStyle(),n._excretionActivity="active"}})),f.subscribe("mousemove",(function(t,e){if("abandoned"!==n._excretionToolState){var r=n._excretionActivity;if(t.altKey&&"abandoned"!==n._excretionState&&(n._excretionState="add"),"abandoned"!==r&&"active"===r){var o=n._excretions.length-1,i=n._excretions[o],u=+i.style.left.split("px")[0],a=+i.style.top.split("px")[0],c=Math.abs(e.x-u),f=Math.abs(e.y-a);i.style.width=c+"px",i.style.height=f+"px";var s=e.x>u&&e.y>a,l=e.x<u&&e.y>a,p=e.x<u&&e.y<a,h=e.x>u&&e.y<a;s?i.style.transform="translateX(0px) translateY(0px)":l?i.style.transform="translateX(-".concat(c,"px) translateY(0px)"):p?i.style.transform="translateX(-".concat(c,"px) translateY(-").concat(f,"px)"):h&&(i.style.transform="translateX(0px) translateY(-".concat(f,"px)"))}}})),f.subscribe("mouseup",(function(t,e){if("abandoned"!==n._excretionToolState){var r=n._excretionState;if("abandoned"!==r&&("create"===r||"add"===r)){var o={end:e};n._tempCoords.push(o),n.endExcretion()}}}))},n.template="",n.templateExcretion='\n <button type="button" class="crop-button">\n <svg fill="#ffffff" viewBox="0 0 1920 1920" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M426.667 0h106.666v1386.67H1920v106.66H426.667V0zM320 426.667H0v106.666h320V426.667zm320 0v106.666h746.67V1280h106.66V426.667H640zM1493.33 1600h-106.66v320h106.66v-320z"></path> </g></svg>\n </button>\n ',n._excretionDefaultStyle=["excretion"],n.css="\n .excretion {\n display: flex;\n position: absolute;\n background-image: linear-gradient(90deg, silver 50%, transparent 50%), linear-gradient(90deg, silver 50%, transparent 50%), linear-gradient(0deg, silver 50%, transparent 50%), linear-gradient(0deg, silver 50%, transparent 50%);\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n background-size: 8px 1px, 8px 1px, 1px 8px, 1px 8px;\n background-position: left top, right bottom, left bottom, right top;\n animation: border-dance 1s infinite linear;\n z-index: ".concat(a.getLayerIndex("low"),";\n }\n\n .excretion_crop {\n box-shadow: 0px 0px 0px calc(100vw + 100vh) #50505070;\n }\n\n .crop-button {\n display: none;\n justify-content: center;\n align-items: center;\n position: absolute;\n padding: 5px;\n right: -35px;\n top: 0;\n background: #232222;\n border: 1px solid #ffffff50;\n border-radius: 4px;\n width: 30px;\n height: 30px;\n cursor: pointer;\n z-index: ").concat(a.getLayerIndex("high"),";\n }\n\n .crop-button--view {\n display: flex;\n }\n\n @keyframes border-dance {\n 0% {\n background-position: left top, right bottom, left bottom, right top;\n }\n 100% {\n background-position: left 8px top, right 8px bottom, left bottom 8px, right top 8px;\n }\n }\n "),n._excretions=[],n._excretionState="abandoned",n._excretionActivity="abandoned",n._excretionToolState="abandoned",n._tempCoords=[],n.excretionsCoords=[],n._additionStyle="default",n.tool={id:1,name:"excretion",onAction:function(){return n.setToolState("taken")},offAction:function(){return n.setToolState("abandoned")},support:function(){n.clearExcretionsCoords(),n.additionStyle="default"}},s.add(n.tool),u.components.add({info:{name:"excretion",description:"excretion component"},prototype:n}),n}(i);var j=function(){function t(){this.stack=[]}return t.prototype.generate=function(){return this.Guid4},Object.defineProperty(t.prototype,"finite",{get:function(){var t,n=this.stack[null===(t=this.stack)||void 0===t?void 0:t.length];if(n)return n;throw new Error("Guid4 not generate")},enumerable:!1,configurable:!0}),t.prototype.generateWithFactor=function(t){var n=this.getFactor(this.guid4);t.use("withError").run(n)},t.prototype.getFactor=function(t){var n=this;return function(e){t=n.Guid4,n.stack.includes(t)||(e.current=e.max,n.stack.push(t))}},Object.defineProperty(t.prototype,"attempt",{get:function(){return new E({current:1,max:5},{message:"[Fatal Error] Guid4 module cannot generate unique guid4"})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Guid4",{get:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,this.formating)},enumerable:!1,configurable:!0}),t.prototype.formating=function(t){var n=16*Math.random()|0;return("x"==t?n:3&n|8).toString(16)},t}(),E=function(){function t(t,n){this._attempt=t,n&&(this._error=n)}return t.prototype.use=function(t){void 0===t&&(t="default");var n=this;switch(t){case"default":return{run:function(t){n.defaultRun(t)}};case"withError":return{run:function(t){n.withErrorRun(t)}}}},t.prototype.defaultRun=function(t){for(var n=this._attempt.current<=this._attempt.max;n;)t(this._attempt),this._attempt.current++},t.prototype.withErrorRun=function(t){for(var n=this._attempt.current<=this._attempt.max,e=this._attempt.current===this._attempt.max,r=this._error.message;n;)this.throwError(e,r),t(this._attempt),this._attempt.current++},t.prototype.throwError=function(t,n){if(t)throw new Error(n)},t}(),A=function(){return A=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},A.apply(this,arguments)};const C=function(){function t(){}return t.subcribe=function(n){var e=A({id:(new j).generate()},n);t.eventList.push(e)},t.dispatch=function(n,e){t.eventList.find((function(t){return t.name===n})).action(e)},t.applyEvents=function(n){var e;null===(e=t.eventList)||void 0===e||e.forEach((function(t){n.addEventListener(t.name,t.action)}))},t.eventList=[],t}();var O=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return O(n,t),n.getComponent=function(){var t=n.getTemplate(n.template,{className:"loading-wrapper"}),e=n.getStyle(n.css);return n.loading=t,n.subscribeLoadingStart(),n.subscribeLoadingEnd(),{loadingTemplate:t,loadingStyle:e}},n.hide=function(){n.loading.style.display="none"},n.view=function(){n.loading.style.display="flex"},n.subscribeLoadingStart=function(){var t={name:"loading-start",action:function(){return n.view()}};C.subcribe(t)},n.subscribeLoadingEnd=function(){var t={name:"loading-end",action:function(){return n.hide()}};C.subcribe(t)},n.template='\n <span class="loader"></span>\n ',n.css='\n .loading-wrapper {\n display: none; \n justify-content: center;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n background: #ffffff30;\n }\n\n .loader {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n position: relative;\n animation: rotate 1s linear infinite\n }\n .loader::before , .loader::after {\n content: "";\n box-sizing: border-box;\n position: absolute;\n inset: 0px;\n border-radius: 50%;\n border: 5px solid #FFF;\n animation: prixClipFix 2s linear infinite ;\n }\n .loader::after{\n inset: 8px;\n transform: rotate3d(90, 90, 0, 180deg );\n border-color: #FF3D00;\n }\n\n @keyframes rotate {\n 0% {transform: rotate(0deg)}\n 100% {transform: rotate(360deg)}\n }\n\n @keyframes prixClipFix {\n 0% {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}\n 50% {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}\n 75%, 100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}\n }\n ',u.components.add({info:{name:"loading",description:"loading component"},prototype:n}),n}(i);var P=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return P(n,t),Object.defineProperty(n,"pipetteColor",{get:function(){return n._pipetteColor},set:function(t){n._pipetteColor=t,n._pipetteColorElement.style.borderColor=n._pipetteColor},enumerable:!1,configurable:!0}),n.getComponent=function(){var t=n.getTemplate(n.template,{className:"pipette"}),e=n.getStyle(n.css);return n.pipette=t,n._pipetteColorElement=t.querySelector(".pipette_color"),n.emmit(),{pipetteTemplate:t,pipetteStyle:e}},n.setState=function(t){switch(n._pipetteState=t,t){case"abandoned":default:return n.hide();case"taken":case"selected-color":return n.show()}},n.emmit=function(){f.subscribe("mousemove",(function(t,e){var r=n._pipetteState;if("taken"===r||"selected-color"===r){var o=e.x,i=e.y;n.pipette.style.left="".concat(o+10,"px"),n.pipette.style.top="".concat(i+10,"px")}})),f.subscribe("click",(function(t,e){var r=n._pipetteState;"taken"!==r&&"selected-color"!==r||(console.log("pipetteState",r),"taken"===r&&(n.setColorFromChoosenPixel(e),n.setState("selected-color")),"selected-color"===r&&n.setColorFromChoosenPixel(e))}))},n.setColorFromChoosenPixel=function(t){var e=t.x,r=t.y,o=f.ctx.getImageData(e,r,1,1).data,i=l.rgbToHex(o[0],o[1],o[2]);n.pipetteColor=i},n.show=function(){n.pipette.style.display="flex",f.cursorStyle="default"},n.hide=function(){n.pipette.style.display="none",f.cursorStyle="default"},n.template='\n <div class="pipette_border-out">\n <div class="pipette_color">\n <div class="pipette_border-in">\n <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M17 12C17 14.7614 14.7614 17 12 17M17 12C17 9.23858 14.7614 7 12 7M17 12H19M12 17C9.23858 17 7 14.7614 7 12M12 17V19M7 12C7 9.23858 9.23858 7 12 7M7 12H5M12 7V5M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z" stroke="#d9d9d9" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>\n </div> \n </div>\n </div>\n ',n.css="\n .pipette {\n position: absolute;\n display: none;\n justify-content: center;\n align-items: center;\n width: 48px;\n height: 48px;\n }\n\n .pipette_border-out {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 100px;\n border: solid 2px #d9d9d9;\n width: 44px;\n height: 44px;\n }\n\n .pipette_border-in {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 100px;\n border: solid 1px #d9d9d9;\n width: 32px;\n height: 32px;\n }\n\n .pipette_color {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 34px;\n height: 34px;\n border-radius: 100px;\n border-color: blue;\n border-style: solid;\n border-width: 5px;\n }\n ",n._pipetteState="abandoned",n.tool={id:0,name:"pipette",onAction:function(){return n.setState("taken")},offAction:function(){return n.setState("abandoned")}},s.add(n.tool),u.components.add({info:{name:"pipette",description:"pipette component"},prototype:n}),n}(i);var L=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const T=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return L(n,t),n.getComponent=function(t){var e=n.getTemplate(n.template,{className:"slot-wrapper"}),r=n.getStyle(n.css);return n.slot=e.querySelector("slot"),n.slot.name=t,{slotTemplate:e,slotStyle:r}},n.template='\n <slot class="slot"></slot>\n ',n.css="",u.components.add({info:{name:"slot",description:"slot component"},prototype:n}),n}(i);var k=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),R=function(){function t(){var t=document.createElement("div");t.className="wc-editor",t.style.position="relative",t.style.display="flex",t.style.overflow="hidden";var n=document.createElement("div");n.className="styles-wrap";var e=document.createElement("div");e.className="editor-wrap",e.style.position="relative",e.style.display="flex",e.style.overflow="hidden";var r=document.createElement("div");r.className="tools-wrap",r.style.position="relative",r.style.display="flex",t.appendChild(n),t.appendChild(e),t.appendChild(r),this.baseElement=t,this.stylesWrapElement=n,this.editorWrapElement=e,this.toolsWrapElement=r,this._baseStyle()}return Object.defineProperty(t.prototype,"base",{get:function(){return this._methods(this.baseElement)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"editorWrap",{get:function(){return this._methods(this.editorWrapElement)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stylesWrap",{get:function(){return this._methods(this.stylesWrapElement)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolsWrap",{get:function(){return this._methods(this.toolsWrapElement)},enumerable:!1,configurable:!0}),t.prototype._methods=function(t){var n=this;return{add:function(e,r){return n._add(t,e,r)}}},t.prototype._add=function(t,n,e){var r=t.appendChild(n);return e&&this.stylesWrapElement.appendChild(e),r},t.prototype._baseStyle=function(){var t=document.createElement("style");t.innerHTML="\n * {\n user-select: none;\n }\n ",this.stylesWrapElement.appendChild(t)},t}();const D=function(t){function n(){var n=t.call(this)||this,e=n.attachShadow({mode:"open"}),r=new R,o=f.getComponent(),i=o.canvasTemplate,u=o.canvasStyle,a=r.editorWrap.add(i,u),c=z.getComponent(),s=c.pipetteTemplate,l=c.pipetteStyle;r.editorWrap.add(s,l);var p=T.getComponent("tools"),h=p.slotTemplate,d=p.slotStyle;r.toolsWrap.add(h,d);var v=S.getComponent(),g=v.excretionsTemplate,y=v.excretionsStyle;r.editorWrap.add(g,y);var _=I.getComponent(),m=_.loadingTemplate,b=_.loadingStyle;return r.editorWrap.add(m,b),e.appendChild(r.baseElement),f.simulateSubscriptions(),C.applyEvents(r.baseElement),n.addEventListener("initial",(function(){n.dispatchEvent(new CustomEvent("get-editor-element",{detail:{editorElement:a,canvasSelector:f.getCanvasSelector()}}))})),n}return k(n,t),n}(HTMLElement);var N=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();const M=function(t){function n(n,e){var r=t.call(this,n)||this;return r.filterList=["pixel"],r.options=e,r}return N(n,t),n.prototype.on=function(t,n){var e=this;return new Promise((function(r){var o=e.options,i=e.copy(o),u=e[t](i,n);return e.update(u,o),r({imageData:u,position:{x:o.x,y:o.y},size:{width:u.width,height:u.height},quality:n.quality})}))},n.prototype.pixel=function(t,n){var e=n.quality;console.log("quality",e);var r=this.getQualityProcessedRemainder(t,+e),o={width:r.width,height:r.height};console.log("imageSize",o),this.setImageSize(o);var i=this.getBuffCollection(r),u=i.rowRGBABuff,a=i.buff,c=this.getQualityBuff(a,+e),f=c.qualityBuff,s=c.rangeCommit,p=this.getMostCommonQuanlityBuff(f,s).flat();if(u.length>=p.length){var h=p.map((function(t,n){var e=l.hexToRgb(t);return[e.r,e.g,e.b,u[n][3]]}));h.flat().forEach((function(t,n){r.data[n]=t}))}return r},n.prototype.getQualityProcessedRemainder=function(t,n){var e=this.getRowRGBABuff(t),r=this.getRGBAMatrix(e,{width:t.width,height:t.height}),o=n-t.width%n,i=n-t.height%n,u=(0,p.range)(0,o),a=(0,p.range)(0,i),c={width:t.width+o,height:t.height+i},f=r[0].length-1;r.forEach((function(t,n){var e=t[f];u.forEach((function(){return r[n].push(e)}))}));var s=r.length-1,l=r[s];a.forEach((function(){return r.push(l)}));var h=r.flat(2),d=document.createElement("canvas").getContext("2d").createImageData(c.width,c.height);return h.forEach((function(t,n){return d.data[n]=h[n]})),d},n.prototype.getQualityBuff=function(t,n){var e=Math.floor(this.imageSize.width/n),r=Math.floor(this.imageSize.height/n),o=[],i=[],u=0,a=0,c=n,f=0,s=n;return(0,p.range)(0,r).forEach((function(r){(0,p.range)(0,e).forEach((function(e){var r,l,h=(0,p.range)(f,s),d=(0,p.range)(a,c),v=[],g=[];h.forEach((function(n){d.forEach((function(e){v.push(t[n][e]),g.push({y:n,x:e})}))})),a+=n,c+=n,null!==(r=i[u])&&void 0!==r||(i[u]=g),null!==(l=o[u])&&void 0!==l||(o[u]=v),u++})),a=0,c=n,f+=n,s+=n})),{qualityBuff:o,rangeCommit:i}},n.prototype.getMostCommonQuanlityBuff=function(t,n){var e=this,r=[];return t.map((function(t){var n=e.getMostCommonElement(t);return t.map((function(){return n}))})).forEach((function(t,e){t.forEach((function(t,o){var i,u,a,c=n[e][o],f=c.x,s=c.y;null!==(i=r[s])&&void 0!==i||(r[s]=[]),null!==(u=(a=r[s])[f])&&void 0!==u||(a[f]=t)}))})),r},n.prototype.getMostCommonElement=function(t){var n=t.sort((function(n,e){return t.filter((function(t){return t===n})).length-t.filter((function(t){return t===e})).length}));return n[n.length-1]},n}(h);!function(){function t(){}t.drawImage=function(n,e,r){t.imageProcessor=new B(e,n),t.imageProcessor.draw(r).then((function(){var t={x:0,y:0},e=new h(n).copy(t);b.store.imageState.reduce({tempImageData:e,position:t,size:o.CANVAS_SIZE},"Loaded image")}))},t.drawProject=function(n,e){var r=e.state.current.imageData,o=e.state.current.position,i=e.state.current.size;t.imageProcessor=new W(e,n),t.imageProcessor.draw(),b.store.imageState.reduce({tempImageData:r,position:o,size:i},"Loaded project")},t.drawSmoothImage=function(n,e,r){var o=t.getFilterArgs(n,e);if(C.dispatch("loading-start"),!t.imageProcessor)throw new Error("No valid ImageProcessor instance found");t.imageProcessor.vague(o,r).then(t.updateImageStateAfterVague).finally((function(){return C.dispatch("loading-end")}))},t.updateImageStateAfterVague=function(t){var n=t.imageData,e=t.position,r=t.size,o=t.quality;b.store.imageState.reduce({tempImageData:n,position:e,size:r},"[Filter Vague] quality: ".concat(o))},t.getFilterArgs=function(t,n){var e,r,o,i=b.store.imageState;return t?(o={x:i.position.x,y:i.position.y},i.size.width&&i.size.height&&(o.width=i.size.width,o.height=i.size.height)):(o={x:n.position.x,y:n.position.y},"initial"!==n.size&&(null===(e=n.size)||void 0===e?void 0:e.width)&&(null===(r=n.size)||void 0===r?void 0:r.height)&&(o.width=n.size.width,o.height=n.size.height)),o}}();var B=function(){function t(t,n){this.img=new Image,this.img.src=t,this.ctx=n}return t.prototype.draw=function(t){var n=this,e=this,r=this.img;return new Promise((function(i,u){try{r.addEventListener("load",(function(){var u,a,c,f=[t.position.x,t.position.y];"initial"!==t.size&&(f=(null===(a=t.size)||void 0===a?void 0:a.width)&&(null===(c=t.size)||void 0===c?void 0:c.height)?f.concat([t.size.width,t.size.height]):f.concat([o.CANVAS_SIZE.width,o.CANVAS_SIZE.height])),(u=n.ctx).drawImage.apply(u,function(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}([r],f,!1)),n.ctx.save(),i(e)}))}catch(t){u(t)}}))},t.prototype.vague=function(t,n){return new M(this.ctx,t).on("pixel",n)},t}(),W=function(){function t(t,n){this.project=t,this.ctx=n}return t.prototype.draw=function(t){var n=this,e=this.project.state.current,r=e.imageData,o=e.position;return new Promise((function(t,e){try{new h(n.ctx).update(r,o),n.ctx.save(),t(n)}catch(t){e(t)}}))},t.prototype.vague=function(t,n){return new M(this.ctx,t).on("pixel",n)},t}();!function(){function t(){}t.getDataUrl=function(){return f.canvas.toDataURL()},t.download=function(n){var e=document.createElement("a");e.download="".concat(n||"image",".png"),e.href=t.getDataUrl(),e.click()}}();var V=function(){function t(t){this.projects=[],this.file=t,this.projects=this.load()}return t.prototype.load=function(){var t=JSON.parse(this.file),n=function(t){var n,e;(null==t?void 0:t.current)?(n=Object.values(null==t?void 0:t.current.imageData.data),e=null==t?void 0:t.current.size):(null==t?void 0:t.state)&&(n=Object.values(null==t?void 0:t.state.tempImageData.data),e=null==t?void 0:t.state.size);var r=new ImageData(e.width,e.height);return n.forEach((function(t,n){r.data[n]=t})),r};return t.map((function(t){return t.state.current.imageData=n({current:t.state.current}),t.state.history=t.state.history.map((function(t){return t.stateValue.tempImageData=n({state:t.stateValue}),t})),t.state.cache=t.state.cache.map((function(t){return t.stateValue.tempImageData=n({state:t.stateValue}),t})),t}))},t.prototype.saveProjects=function(t){this.file.save(JSON.stringify(t))},t.prototype.getProjects=function(){return this.projects},t.prototype.getProject=function(t){return this.projects.find((function(n){return n.id===t}))},t.prototype.saveProject=function(t){var n=this.projects.findIndex((function(n){return n.id===t.id}));-1!==n?this.projects[n]=t:this.projects.push(t),this.saveProjects(this.projects)},t.prototype.removeProject=function(t){var n=this.projects.findIndex((function(n){return n.id===t}));-1!==n&&(this.projects.splice(n,1),this.saveProjects(this.projects))},t.prototype.updateProject=function(t){var n=this.projects.findIndex((function(n){return n.id===t.id}));-1!==n&&(this.projects[n]=t,this.saveProjects(this.projects))},t}(),F=function(){function t(){this.projectsKey="cee-projects"}return t.prototype.getProjectsFromLocalStorage=function(){var t=localStorage.getItem(this.projectsKey);return t?JSON.parse(t):[]},t.prototype.getProjectFromLocalStorage=function(t){return this.getProjectsFromLocalStorage().find((function(n){return n.id===t}))},t.prototype.saveProjectsToLocalStorage=function(t){localStorage.setItem(this.projectsKey,JSON.stringify(t))},t.prototype.saveProjectToLocalStorage=function(t){var n=this.getProjectsFromLocalStorage();n.push(t),localStorage.setItem(this.projectsKey,JSON.stringify(n))},t.prototype.removeProjectFromLocalStorage=function(t){var n=this.getProjectsFromLocalStorage(),e=n.findIndex((function(n){return n.id===t}));n.splice(e,1),localStorage.setItem(this.projectsKey,JSON.stringify(n))},t.prototype.updateProjectInLocalStorage=function(t){var n=this.getProjectsFromLocalStorage(),e=n.findIndex((function(n){return n.id===t.id}));n[e]=t,localStorage.setItem(this.projectsKey,JSON.stringify(n))},t.prototype.getProjects=function(){return this.getProjectsFromLocalStorage()},t.prototype.getProject=function(t){return this.getProjectFromLocalStorage(t)},t.prototype.saveProjects=function(t){this.saveProjectsToLocalStorage(t)},t.prototype.saveProject=function(t){this.saveProjectToLocalStorage(t)},t.prototype.removeProject=function(t){this.removeProjectFromLocalStorage(t)},t.prototype.updateProject=function(t){this.updateProjectInLocalStorage(t)},t}(),U=function(){function t(){}return t.setSerializer=function(n){t._serializer=n},t.prototype.getProjects=function(){return t._serializer.getProjects()},t.prototype.getProject=function(n){return t._serializer.getProject(n)},t.prototype.saveProject=function(n){return t._serializer.saveProject(n)},t.prototype.saveProjects=function(n){return t._serializer.saveProjects(n)},t.prototype.removeProject=function(n){return t._serializer.removeProject(n)},t.prototype.updateProject=function(n){return t._serializer.updateProject(n)},t}();!function(){function t(){}t.on=function(n){var e=t._modules.find((function(t){return t.name===n}));if(!e)throw new Error("Module ".concat(n," not found"));return{getSerializerInstance:function(n){return new t._serializer(n)},instance:e.instance}},t._addModule=function(n,e){t._modules.push({name:n,instance:e})},t._modules=[],t._serializer=V,t._addModule("LocalStorage",new F),t._addModule("File",new U)}();var H=function(){this.id=null,this.name=null,this.description=null,this.state=null,this.createdAt=new Date(Date.now()).toString(),this.updatedAt=new Date(Date.now()).toString()};!function(){function t(){}Object.defineProperty(t,"project",{get:function(){return this._project},enumerable:!1,configurable:!0}),t.refreshProject=function(){t._project=new H},t.updateProject=function(n){Object.keys(n).forEach((function(e){t._project[e]=n[e]}))},t.pull=function(t,n){var e=new H,r={cache:d.cache,history:b.store.historyState.historyLines,current:b.store.imageState.getEntry()};e.id=(new j).generate(),e.description=n||"New Project",e.name=t||"New Project",e.state=r,this._project=e},t._project=new H}();var G=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Z=function(){function t(t){o.WEB_COMPONENT_TAG_NAME=t}return t.prototype.getInitial=function(){return{tag:o.WEB_COMPONENT_TAG_NAME,component:D}},t}();(function(t){function n(n){return t.call(this,n)||this}G(n,t),n.prototype.init=function(){var t=window.customElements,n=this.getInitial(),e=n.tag,r=n.component;t.define(e,r)}})(Z),function(t){function n(n){return t.call(this,n)||this}G(n,t),n.prototype.getContext2D=function(){return f.ctx},n.prototype.getCanvas=function(){return f.canvas}}(Z)})()})();
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Lodash <https://lodash.com/>
4
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
+ * Released under MIT license <https://lodash.com/license>
6
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,8 @@
9
9
  ],
10
10
  "scripts": {
11
11
  "test": "node test/test.js",
12
- "build": "tsc",
12
+ "build-ts": "tsc",
13
+ "build": "npx webpack",
13
14
  "realise": "npm version patch && npm publish"
14
15
  },
15
16
  "keywords": [
@@ -22,9 +23,14 @@
22
23
  "devDependencies": {
23
24
  "@types/lodash": "^4.17.10",
24
25
  "@types/node": "^22.7.4",
25
- "typescript": "^5.6.2"
26
+ "ts-loader": "^9.5.1",
27
+ "typescript": "^5.7.2",
28
+ "webpack": "^5.97.1",
29
+ "webpack-cli": "^5.1.4"
26
30
  },
27
31
  "dependencies": {
28
- "lodash": "^4.17.21"
32
+ "lodash": "^4.17.21",
33
+ "typescript-declaration-webpack-plugin": "^0.3.0",
34
+ "webpack-plugin-typescript-declaration-bundler": "^1.0.4"
29
35
  }
30
36
  }
@@ -1,21 +0,0 @@
1
- import { TSubscribeAction, TSubscriptionTypes } from "../types/canvas";
2
- import { ICursorPosition, TCursorStyleName } from "../types/cursor";
3
- import ComponentService from "../services/component.service";
4
- export default class CanvasComponent extends ComponentService {
5
- private static template;
6
- private static css;
7
- static eventListener: HTMLDivElement;
8
- static canvas: HTMLCanvasElement;
9
- static ctx: CanvasRenderingContext2D | null;
10
- private static subscriptions;
11
- private static _cursorStyle;
12
- static getComponent(): {
13
- canvasTemplate: HTMLElement;
14
- canvasStyle: HTMLStyleElement;
15
- };
16
- static getCanvasSelector(): string;
17
- static set cursorStyle(styleName: TCursorStyleName | undefined | null);
18
- static getCursorPosition(event: MouseEvent): ICursorPosition;
19
- static subscribe(eventName: TSubscriptionTypes, action: TSubscribeAction): void;
20
- static simulateSubscriptions(): void;
21
- }
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_1 = require("../config");
4
- const component_service_1 = require("../services/component.service");
5
- const logger_service_1 = require("../services/logger.service");
6
- const tool_layers_service_1 = require("../services/tool-layers.service");
7
- class CanvasComponent extends component_service_1.default {
8
- static template = `
9
- <div id="event-listener"></div>
10
- <canvas id="sc-canvas"></canvas>
11
- `;
12
- static css = `
13
- #event-listener {
14
- position: absolute;
15
- z-index: ${tool_layers_service_1.default.getLayerIndex('normal')};
16
- }
17
- `;
18
- static eventListener;
19
- static canvas;
20
- static ctx;
21
- static subscriptions = {
22
- click: [],
23
- mousemove: [],
24
- mousedown: [],
25
- mouseup: [],
26
- };
27
- static _cursorStyle = {
28
- before: null,
29
- current: 'default',
30
- };
31
- static {
32
- logger_service_1.default.components.add({
33
- info: {
34
- name: 'canvas',
35
- description: 'canvas component',
36
- },
37
- prototype: CanvasComponent,
38
- });
39
- }
40
- ;
41
- static getComponent() {
42
- const canvasTemplate = CanvasComponent.getTemplate(CanvasComponent.template);
43
- const canvasStyle = CanvasComponent.getStyle(CanvasComponent.css);
44
- CanvasComponent.canvas = canvasTemplate.getElementsByTagName('canvas')[0];
45
- CanvasComponent.canvas.width = config_1.default.CANVAS_SIZE.width;
46
- CanvasComponent.canvas.height = config_1.default.CANVAS_SIZE.height;
47
- CanvasComponent.ctx = CanvasComponent.canvas.getContext("2d", { willReadFrequently: true });
48
- CanvasComponent.eventListener = canvasTemplate.querySelector('#event-listener');
49
- CanvasComponent.eventListener.style.width = config_1.default.CANVAS_SIZE.width + 'px';
50
- CanvasComponent.eventListener.style.height = config_1.default.CANVAS_SIZE.height + 'px';
51
- return { canvasTemplate, canvasStyle };
52
- }
53
- static getCanvasSelector() {
54
- return '#sc-canvas';
55
- }
56
- static set cursorStyle(styleName) {
57
- if (!!styleName) {
58
- CanvasComponent._cursorStyle.before = CanvasComponent._cursorStyle.current;
59
- CanvasComponent._cursorStyle.current = styleName;
60
- CanvasComponent.eventListener.style.cursor = styleName;
61
- }
62
- else {
63
- CanvasComponent.eventListener.style.cursor = 'default';
64
- }
65
- }
66
- static getCursorPosition(event) {
67
- const rect = CanvasComponent.canvas.getBoundingClientRect();
68
- const x = event.clientX - rect.left;
69
- const y = event.clientY - rect.top;
70
- return { x, y };
71
- }
72
- static subscribe(eventName, action) {
73
- CanvasComponent.subscriptions[eventName].push(action);
74
- }
75
- static simulateSubscriptions() {
76
- const eventNames = Object.keys(CanvasComponent.subscriptions);
77
- eventNames.forEach((eventName) => {
78
- const actionsList = CanvasComponent.subscriptions[eventName];
79
- if (!!actionsList.length) {
80
- CanvasComponent.eventListener.addEventListener(eventName, (event) => {
81
- const cursorPosition = CanvasComponent.getCursorPosition(event);
82
- actionsList.forEach((action) => {
83
- action(event, cursorPosition);
84
- });
85
- });
86
- }
87
- });
88
- }
89
- }
90
- exports.default = CanvasComponent;
@@ -1,32 +0,0 @@
1
- import ComponentService from "../services/component.service";
2
- import type { IExcretionsCoords, TExcretionStyle, TExcretionToolState } from "../types/excretion";
3
- export default class ExcretionsComponent extends ComponentService {
4
- private static template;
5
- private static templateExcretion;
6
- private static _excretionDefaultStyle;
7
- private static css;
8
- static excretionWrap: HTMLElement;
9
- private static _excretions;
10
- private static _excretionState;
11
- private static _excretionActivity;
12
- private static _excretionToolState;
13
- private static _tempCoords;
14
- static excretionsCoords: IExcretionsCoords[];
15
- private static _additionStyle;
16
- static get additionStyle(): TExcretionStyle;
17
- static set additionStyle(value: TExcretionStyle);
18
- private static applyExcretionStyle;
19
- private static determineCropStyle;
20
- private static determineDefaultStyle;
21
- private static tool;
22
- static getComponent(): {
23
- excretionsTemplate: HTMLElement;
24
- excretionsStyle: HTMLStyleElement;
25
- };
26
- private static set excretionState(value);
27
- static setToolState(toolState: TExcretionToolState): void;
28
- static clearExcretionsCoords(): void;
29
- private static getTempCoords;
30
- private static endExcretion;
31
- private static emmit;
32
- }