@zsviczian/excalidraw 0.10.0-textfix-6 → 0.10.0-textfix-10

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see excalidraw.production.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={200:(e,t,n)=>{var r="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function f(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(r);function v(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function y(e){return d=e,l=setTimeout(k,t),u?v(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function k(){var e=m();if(w(e))return _(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function _(e){return l=void 0,f&&i?v(e):(i=o=void 0,s)}function E(){var e=m(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return y(c);if(h)return l=setTimeout(k,t),v(c)}return void 0===l&&(l=setTimeout(k,t)),s}return t=x(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(x(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:_(m())},E}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(r);return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:i,maxWait:t,trailing:o})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,d=64,u=128,h=256,p=1/0,g=9007199254740991,m=NaN,f=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],x="[object Arguments]",v="[object Array]",y="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",C="[object Number]",j="[object Object]",I="[object Promise]",M="[object RegExp]",T="[object Set]",O="[object String]",L="[object Symbol]",A="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",N="[object Float64Array]",R="[object Int8Array]",H="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",W="[object Uint32Array]",K=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Z.source),$=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,xe=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Me="\\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",Te="['’]",Oe="[\\ud800-\\udfff]",Le="["+Me+"]",Ae="["+Ee+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Ce+"]",Ne="[^\\ud800-\\udfff"+Me+Pe+Se+Ce+je+"]",Re="\\ud83c[\\udffb-\\udfff]",He="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+je+"]",Ve="(?:"+ze+"|"+Ne+")",We="(?:"+Ue+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ae+"|"+Re+")"+"?",Ze="[\\ufe0e\\ufe0f]?",qe=Ze+Ye+("(?:\\u200d(?:"+[He,Be,Fe].join("|")+")"+Ze+Ye+")*"),Xe="(?:"+[De,Be,Fe].join("|")+")"+qe,$e="(?:"+[He+Ae+"?",Ae,Be,Fe,Oe].join("|")+")",Je=RegExp(Te,"g"),Qe=RegExp(Ae,"g"),et=RegExp(Re+"(?="+Re+")|"+$e+qe,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ke+"(?="+[Le,Ue,"$"].join("|")+")",We+"+"+Ge+"(?="+[Le,Ue+Ve,"$"].join("|")+")",Ue+"?"+Ve+"+"+Ke,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ee+Ie+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],ot=-1,at={};at[z]=at[N]=at[R]=at[H]=at[B]=at[F]=at[U]=at[V]=at[W]=!0,at[x]=at[v]=at[P]=at[y]=at[D]=at[w]=at[k]=at[_]=at[S]=at[C]=at[j]=at[M]=at[T]=at[O]=at[A]=!1;var st={};st[x]=st[v]=st[P]=st[D]=st[y]=st[w]=st[z]=st[N]=st[R]=st[H]=st[B]=st[S]=st[C]=st[j]=st[M]=st[T]=st[O]=st[L]=st[F]=st[U]=st[V]=st[W]=!0,st[k]=st[_]=st[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,ft=mt&&mt.exports===gt,bt=ft&&ut.process,xt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),vt=xt&&xt.isArrayBuffer,yt=xt&&xt.isDate,wt=xt&&xt.isMap,kt=xt&&xt.isRegExp,_t=xt&&xt.isSet,Et=xt&&xt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function zt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Nt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rt=Kt("length");function Ht(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Bt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Vt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Vt(e){return e!=e}function Wt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:m}function Kt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Yt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Zt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Jt(e,t){return At(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({À:"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"}),on=Gt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Rt(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fn=Gt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,se=t.Date,Ee=t.Error,Se=t.Function,Ce=t.Math,je=t.Object,Ie=t.RegExp,Me=t.String,Te=t.TypeError,Oe=r.prototype,Le=Se.prototype,Ae=je.prototype,Pe=t["__core-js_shared__"],De=Le.toString,ze=Ae.hasOwnProperty,Ne=0,Re=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",He=Ae.toString,Be=De.call(je),Fe=pt._,Ue=Ie("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ft?t.Buffer:i,We=t.Symbol,Ke=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:i,Ye=cn(je.getPrototypeOf,je),Ze=je.create,qe=Ae.propertyIsEnumerable,Xe=Oe.splice,$e=We?We.isConcatSpreadable:i,et=We?We.iterator:i,nt=We?We.toStringTag:i,lt=function(){try{var e=go(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=se&&se.now!==pt.Date.now&&se.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Ce.ceil,bt=Ce.floor,xt=je.getOwnPropertySymbols,Rt=Ve?Ve.isBuffer:i,Gt=t.isFinite,xn=Oe.join,vn=cn(je.keys,je),yn=Ce.max,wn=Ce.min,kn=se.now,_n=t.parseInt,En=Ce.random,Sn=Oe.reverse,Cn=go(t,"DataView"),jn=go(t,"Map"),In=go(t,"Promise"),Mn=go(t,"Set"),Tn=go(t,"WeakMap"),On=go(je,"create"),Ln=Tn&&new Tn,An={},Pn=Fo(Cn),Dn=Fo(jn),zn=Fo(In),Nn=Fo(Mn),Rn=Fo(Tn),Hn=We?We.prototype:i,Bn=Hn?Hn.valueOf:i,Fn=Hn?Hn.toString:i;function Un(e){if(is(e)&&!Ya(e)&&!(e instanceof Gn)){if(e instanceof Kn)return e;if(ze.call(e,"__wrapped__"))return Uo(e)}return new Kn(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Wn(){}function Kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Zn(e);this.size=t.size}function Jn(e,t){var n=Ya(e),r=!n&&Ga(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&hs(e),a=n||r||i||o,s=a?qt(e.length,Me):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,l))||s.push(c);return s}function Qn(e){var t=e.length;return t?e[Xr(0,t-1)]:i}function er(e,t){return Ro(Oi(e),cr(t,0,e.length))}function tr(e){return Ro(Oi(e))}function nr(e,t,n){(n!==i&&!Va(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Va(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Va(e[n][0],t))return n;return-1}function or(e,t,n,r){return gr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,Ps(t),e)}function sr(e,t,n){"__proto__"==t&&lt?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Ms(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function dr(e,t,n,r,o,a){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var u=Ya(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oi(e,s)}else{var h=bo(e),p=h==_||h==E;if($a(e))return Si(e,l);if(h==j||h==x||p&&!o){if(s=c||p?{}:vo(e),!l)return c?function(e,t){return Li(e,fo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[h])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Ci(e);case y:case w:return new r(+e);case D:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case N:case R:case H:case B:case F:case U:case V:case W:return ji(e,n);case S:case T:return new r;case C:case O:return new r(e);case M:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return i=e,Bn?je(Bn.call(i)):{}}var i}(e,h,l)}}a||(a=new $n);var g=a.get(e);if(g)return g;a.set(e,s),cs(e)?e.forEach((function(r){s.add(dr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,dr(r,t,n,i,e,a))}));var m=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,dr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new Te(o);return Po((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=At(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Qt,a=!1,t=new Xn(t));e:for(;++i<s;){var d=e[i],u=null==n?d:n(d);if(d=r||0!==d?d:0,a&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else o(t,u,r)||l.push(d)}return l}Un.templateSettings={escape:J,evaluate:Q,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Wn.prototype,Un.prototype.constructor=Un,Kn.prototype=Vn(Wn.prototype),Kn.prototype.constructor=Kn,Gn.prototype=Vn(Wn.prototype),Gn.prototype.constructor=Gn,Yn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Yn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yn.prototype.get=function(e){var t=this.__data__;if(On){var n=t[e];return n===a?i:n}return ze.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:ze.call(t,e)},Yn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=On&&t===i?a:t,this},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},Zn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Zn.prototype.has=function(e){return ir(this.__data__,e)>-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(jn||Zn),string:new Yn}},qn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return ho(this,e).get(e)},qn.prototype.has=function(e){return ho(this,e).has(e)},qn.prototype.set=function(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Zn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(kr),mr=Di(_r,!0);function fr(e,t){var n=!0;return gr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function br(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!us(s):n(s,l)))var l=s,c=a}return c}function xr(e,t){var n=[];return gr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?vr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var yr=zi(),wr=zi(!0);function kr(e,t){return e&&yr(e,t,Ps)}function _r(e,t){return e&&wr(e,t,Ps)}function Er(e,t){return Tt(t,(function(t){return es(e[t])}))}function Sr(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&n<r;)e=e[Bo(t[n++])];return n&&n==r?e:i}function Cr(e,t,n){var r=t(e);return Ya(e)?r:Pt(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=He.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return He.call(e)}(e)}function Ir(e,t){return e>t}function Mr(e,t){return null!=e&&ze.call(e,t)}function Tr(e,t){return null!=e&&t in je(e)}function Or(e,t,n){for(var o=n?Lt:Ot,a=e[0].length,s=e.length,l=s,c=r(s),d=1/0,u=[];l--;){var h=e[l];l&&t&&(h=At(h,$t(t))),d=wn(h.length,d),c[l]=!n&&(t||a>=120&&h.length>=120)?new Xn(l&&h):i}h=e[0];var p=-1,g=c[0];e:for(;++p<a&&u.length<d;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(g?Qt(g,f):o(u,f,n))){for(l=s;--l;){var b=c[l];if(!(b?Qt(b,f):o(e[l],f,n)))continue e}g&&g.push(f),u.push(m)}}return u}function Lr(e,t,n){var r=null==(e=To(e,t=wi(t,e)))?e:e[Bo(Qo(t))];return null==r?i:St(r,e,n)}function Ar(e){return is(e)&&jr(e)==x}function Pr(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ya(e),l=Ya(t),c=s?v:bo(e),d=l?v:bo(t),u=(c=c==x?j:c)==j,h=(d=d==x?j:d)==j,p=c==d;if(p&&$a(e)){if(!$a(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new $n),s||hs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ke(e),new Ke(t)));case y:case w:case C:return Va(+e,+t);case k:return e.name==t.name&&e.message==t.message;case M:case O:return e==t+"";case S:var s=ln;case T:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=ro(s(e),s(t),r,i,o,a);return a.delete(e),d;case L:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),m=h&&ze.call(t,"__wrapped__");if(g||m){var f=g?e.value():e,b=m?t.value():t;return a||(a=new $n),o(f,b,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,o,a){var s=1&n,l=oo(e),c=l.length,d=oo(t).length;if(c!=d&&!s)return!1;var u=c;for(;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var f=s;for(;++u<c;){var b=e[h=l[u]],x=t[h];if(r)var v=s?r(x,b,h,t,e,a):r(b,x,h,e,t,a);if(!(v===i?b===x||o(b,x,n,r,a):v)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new $n;if(r)var p=r(d,u,c,e,t,h);if(!(p===i?Pr(u,d,3,r,h):p))return!1}}return!0}function zr(e){return!(!rs(e)||(t=e,Re&&Re in t))&&(es(e)?Ue:xe).test(Fo(e));var t}function Nr(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ya(e)?Vr(e[0],e[1]):Ur(e):ml(e)}function Rr(e){if(!Co(e))return vn(e);var t=[];for(var n in je(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Hr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=Co(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,i=qa(e)?r(e.length):[];return gr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Ur(e){var t=po(e);return 1==t.length&&t[0][2]?Io(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Vr(e,t){return _o(e)&&jo(t)?Io(Bo(e),t):function(n){var r=Ms(n,e);return r===i&&r===t?Ts(n,e):Pr(t,r,3)}}function Wr(e,t,n,r,o){e!==t&&yr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),c=Lo(t,n),d=s.get(c);if(d)return void nr(e,n,d);var u=a?a(l,c,n+"",e,t,s):i,h=u===i;if(h){var p=Ya(c),g=!p&&$a(c),m=!p&&!g&&hs(c);u=c,p||g||m?Ya(l)?u=l:Xa(l)?u=Oi(l):g?(h=!1,u=Si(c,!0)):m?(h=!1,u=ji(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=ys(l):rs(l)&&!es(l)||(u=vo(c))):h=!1}h&&(s.set(c,u),o(u,c,r,a,s),s.delete(c));nr(e,n,u)}(e,t,s,n,Wr,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Kr(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:i}function Gr(e,t,n){t=t.length?At(t,(function(e){return Ya(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=At(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ii(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Sr(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Zr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=At(e,$t(n)));++o<a;)for(var l=0,c=t[o],d=n?n(c):c;(l=i(s,d,l,r))>-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Xe.call(e,i,1):pi(e,i)}}return e}function Xr(e,t){return e+bt(En()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=bt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Mo(e,t,al),e+"")}function Qr(e){return Qn(Vs(e))}function ei(e,t){var n=Vs(e);return Ro(n,cr(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Bo(t[o]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=l[c];(d=r?r(u,c,l):i)===i&&(d=rs(u)?u:wo(t[o+1])?[]:{})}rr(l,c,d),l=l[c]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Ro(Vs(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return gr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=us(t),d=t===i;o<a;){var u=bt((o+a)/2),h=n(e[u]),p=h!==i,g=null===h,m=h==h,f=us(h);if(s)var b=r||m;else b=d?m&&(r||p):l?m&&p&&(r||!g):c?m&&p&&!g&&(r||!f):!g&&!f&&(r?h<=t:h<t);b?o=u+1:a=u}return wn(a,4294967294)}function ci(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Va(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?m:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return At(e,ui)+"";if(us(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var c=t?null:$i(e);if(c)return un(c);a=!1,i=Qt,l=new Xn}else l=t?[]:s;e:for(;++r<o;){var d=e[r],u=t?t(d):d;if(d=n||0!==d?d:0,a&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else i(l,u,n)||(l!==s&&l.push(u),s.push(d))}return s}function pi(e,t){return null==(e=To(e,t=wi(t,e)))||delete e[Bo(Qo(t))]}function gi(e,t,n,r){return ti(e,t,n(Sr(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),n)}function bi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return hi(vr(a,1),t,n)}function xi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function vi(e){return Xa(e)?e:[]}function yi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:_o(e,t)?[e]:Ho(ws(e))}var ki=Jr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function ji(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,l=null===t,c=t==t,d=us(t);if(!l&&!d&&!a&&e>t||a&&s&&c&&!l&&!d||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!d&&e<t||d&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Mi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,d=yn(a-s,0),u=r(c+d),h=!i;++l<c;)u[l]=t[l];for(;++o<s;)(h||o<a)&&(u[n[o]]=e[o]);for(;d--;)u[l++]=e[o++];return u}function Ti(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,d=t.length,u=yn(a-l,0),h=r(u+d),p=!i;++o<u;)h[o]=e[o];for(var g=o;++c<d;)h[g+c]=t[c];for(;++s<l;)(p||o<a)&&(h[g+n[s]]=e[o++]);return h}function Oi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?sr(n,l,c):rr(n,l,c)}return n}function Ai(e,t){return function(n,r){var i=Ya(n)?Ct:or,o=t?t():{};return i(n,e,uo(r,2),o)}}function Pi(e){return Jr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function zi(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=sn(t=ws(t))?gn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Ri(e){return function(t){return Dt(el(Gs(t).replace(Je,"")),e,"")}}function Hi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Vn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Bi(e){return function(t,n,r){var o=je(t);if(!qa(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Fi(e){return io((function(t){var n=t.length,r=n,a=Kn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Te(o);if(a&&!l&&"wrapper"==lo(s))var l=new Kn([],!0)}for(r=l?r:n;++r<n;){var c=lo(s=t[r]),d="wrapper"==c?so(s):i;l=d&&Eo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Eo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ya(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ui(e,t,n,o,a,s,l,c,d,h){var p=t&u,g=1&t,m=2&t,f=24&t,b=512&t,x=m?i:Hi(e);return function i(){for(var u=arguments.length,v=r(u),y=u;y--;)v[y]=arguments[y];if(f)var w=co(i),k=nn(v,w);if(o&&(v=Mi(v,o,a,f)),s&&(v=Ti(v,s,l,f)),u-=k,f&&u<h){var _=dn(v,w);return qi(e,t,Ui,i.placeholder,n,v,_,c,d,h-u)}var E=g?n:this,S=m?E[e]:e;return u=v.length,c?v=Oo(v,c):b&&u>1&&v.reverse(),p&&d<u&&(v.length=d),this&&this!==pt&&this instanceof i&&(S=x||Hi(S)),S.apply(E,v)}}function Vi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Wi(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=di(n),r=di(r)),o=e(n,r)}return o}}function Ki(e){return io((function(t){return t=At(t,$t(uo())),Jr((function(n){var r=this;return e(t,(function(e){return St(e,r,n)}))}))}))}function Gi(e,t){var n=(t=t===i?" ":ui(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return sn(t)?_i(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n,i){for(var o=-1,a=yn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:fs(o),e)}}function Zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=vs(t),n=vs(n)),e(t,n)}}function qi(e,t,n,r,o,a,s,l,u,h){var p=8&t;t|=p?c:d,4&(t&=~(p?d:c))||(t&=-4);var g=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,u,h],m=n.apply(i,g);return Eo(e)&&Ao(m,g),m.placeholder=r,zo(m,e,t)}function Xi(e){var t=Ce[e];return function(e,n){if(e=vs(e),(n=null==n?0:wn(bs(n),292))&&Gt(e)){var r=(ws(e)+"e").split("e");return+((r=(ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Mn&&1/un(new Mn([,-0]))[1]==p?function(e){return new Mn(e)}:ul;function Ji(e){return function(t){var n=bo(t);return n==S?ln(t):n==T?hn(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Qi(e,t,n,a,p,g,m,f){var b=2&t;if(!b&&"function"!=typeof e)throw new Te(o);var x=a?a.length:0;if(x||(t&=-97,a=p=i),m=m===i?m:yn(bs(m),0),f=f===i?f:bs(f),x-=p?p.length:0,t&d){var v=a,y=p;a=p=i}var w=b?i:so(e),k=[e,t,n,a,p,v,y,g,m,f];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==u&&8==n||r==u&&n==h&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Mi(c,l,t[4]):l,e[4]=c?dn(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Ti(c,l,t[6]):l,e[6]=c?dn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&u&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(f=k[9]=k[9]===i?b?0:e.length:yn(k[9]-x,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=Hi(e);return function a(){for(var s=arguments.length,l=r(s),c=s,d=co(a);c--;)l[c]=arguments[c];var u=s<3&&l[0]!==d&&l[s-1]!==d?[]:dn(l,d);return(s-=u.length)<n?qi(e,t,Ui,a.placeholder,i,l,u,i,i,n-s):St(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,f):t!=c&&33!=t||p.length?Ui.apply(i,k):function(e,t,n,i){var o=1&t,a=Hi(e);return function t(){for(var s=-1,l=arguments.length,c=-1,d=i.length,u=r(d+l),h=this&&this!==pt&&this instanceof t?a:e;++c<d;)u[c]=i[c];for(;l--;)u[c++]=arguments[++s];return St(h,o?n:this,u)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=Hi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return zo((w?ni:Ao)(_,k),e,t)}function eo(e,t,n,r){return e===i||Va(e,Ae[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Wr(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&n?new Xn:i;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],f=t[h];if(r)var b=s?r(f,m,h,t,e,a):r(m,f,h,e,t,a);if(b!==i){if(b)continue;p=!1;break}if(g){if(!Nt(t,(function(e,t){if(!Qt(g,t)&&(m===e||o(m,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(m!==f&&!o(m,f,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(Mo(e,i,Zo),e+"")}function oo(e){return Cr(e,Ps,mo)}function ao(e){return Cr(e,Ds,fo)}var so=Ln?function(e){return Ln.get(e)}:ul;function lo(e){for(var t=e.name+"",n=An[t],r=ze.call(An,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function uo(){var e=Un.iteratee||sl;return e=e===sl?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function go(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return zr(n)?n:i}var mo=xt?function(e){return null==e?[]:(e=je(e),Tt(xt(e),(function(t){return qe.call(e,t)})))}:xl,fo=xt?function(e){for(var t=[];e;)Pt(t,mo(e)),e=Ye(e);return t}:xl,bo=jr;function xo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Bo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&wo(a,i)&&(Ya(e)||Ga(e))}function vo(e){return"function"!=typeof e.constructor||Co(e)?{}:Vn(Ye(e))}function yo(e){return Ya(e)||Ga(e)||!!($e&&e&&e[$e])}function wo(e,t){var n=typeof e;return!!(t=null==t?g:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wo(t,n.length):"string"==r&&t in n)&&Va(n[t],e)}function _o(e,t){if(Ya(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function Eo(e){var t=lo(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(Cn&&bo(new Cn(new ArrayBuffer(1)))!=D||jn&&bo(new jn)!=S||In&&bo(In.resolve())!=I||Mn&&bo(new Mn)!=T||Tn&&bo(new Tn)!=A)&&(bo=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return S;case zn:return I;case Nn:return T;case Rn:return A}return t});var So=Pe?es:vl;function Co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function jo(e){return e==e&&!rs(e)}function Io(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function Mo(e,t,n){return t=yn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=yn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),St(e,this,l)}}function To(e,t){return t.length<2?e:Sr(e,oi(t,0,-1))}function Oo(e,t){for(var n=e.length,r=wn(t.length,n),o=Oi(e);r--;){var a=t[r];e[r]=wo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=No(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},Do=No(ri);function zo(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ro(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=Xr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ho=function(e){var t=Na(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Bo(e){if("string"==typeof e||us(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Uo(e){if(e instanceof Gn)return e.clone();var t=new Kn(e.__wrapped__,e.__chain__);return t.__actions__=Oi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vo=Jr((function(e,t){return Xa(e)?pr(e,vr(t,1,Xa,!0)):[]})),Wo=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),uo(n,2)):[]})),Ko=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),i,n):[]}));function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Bt(e,uo(t,3),i)}function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=bs(n),o=n<0?yn(r+o,0):wn(o,r-1)),Bt(e,uo(t,3),o,!0)}function Zo(e){return(null==e?0:e.length)?vr(e,1):[]}function qo(e){return e&&e.length?e[0]:i}var Xo=Jr((function(e){var t=At(e,vi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Jr((function(e){var t=Qo(e),n=At(e,vi);return t===Qo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Or(n,uo(t,2)):[]})),Jo=Jr((function(e){var t=Qo(e),n=At(e,vi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Or(n,i,t):[]}));function Qo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Jr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Zr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return qr(e,At(t,(function(e){return wo(e,n)?+e:e})).sort(Ii)),r}));function ra(e){return null==e?e:Sn.call(e)}var ia=Jr((function(e){return hi(vr(e,1,Xa,!0))})),oa=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),hi(vr(e,1,Xa,!0),uo(t,2))})),aa=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,hi(vr(e,1,Xa,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,(function(e){if(Xa(e))return t=yn(e.length,t),!0})),qt(t,(function(t){return At(e,Kt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:At(n,(function(e){return St(t,i,e)}))}var ca=Jr((function(e,t){return Xa(e)?pr(e,t):[]})),da=Jr((function(e){return bi(Tt(e,Xa))})),ua=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),bi(Tt(e,Xa),uo(t,2))})),ha=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,bi(Tt(e,Xa),i,t)})),pa=Jr(sa);var ga=Jr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ba=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Kn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var xa=Ai((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var va=Bi(Go),ya=Bi(Yo);function wa(e,t){return(Ya(e)?jt:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?It:mr)(e,uo(t,3))}var _a=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Jr((function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?St(t,e,n):Lr(e,t,n)})),a})),Sa=Ai((function(e,t,n){sr(e,n,t)}));function Ca(e,t){return(Ya(e)?At:Fr)(e,uo(t,3))}var ja=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,vr(t,1),[])})),Ma=ht||function(){return pt.Date.now()};function Ta(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,u,i,i,i,i,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(La));r|=c}return Qi(e,r,t,n,i)})),Aa=Jr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(Aa));r|=c}return Qi(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Te(o);function m(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function f(e){return u=e,c=Po(x,t),h?m(e):l}function b(e){var n=e-d;return d===i||n>=t||n<0||p&&e-u>=s}function x(){var e=Ma();if(b(e))return v(e);c=Po(x,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function v(e){return c=i,g&&r?m(e):(r=a=i,l)}function y(){var e=Ma(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return f(d);if(p)return Ei(c),c=Po(x,t),m(d)}return c===i&&(c=Po(x,t)),l}return t=vs(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?yn(vs(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),y.cancel=function(){c!==i&&Ei(c),u=0,r=d=a=c=i},y.flush=function(){return c===i?l:v(Ma())},y}var Da=Jr((function(e,t){return hr(e,1,t)})),za=Jr((function(e,t,n){return hr(e,vs(t)||0,n)}));function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Na.Cache||qn),n}function Ra(e){if("function"!=typeof e)throw new Te(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=qn;var Ha=ki((function(e,t){var n=(t=1==t.length&&Ya(t[0])?At(t[0],$t(uo())):At(vr(t,1),$t(uo()))).length;return Jr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return St(e,this,r)}))})),Ba=Jr((function(e,t){var n=dn(t,co(Ba));return Qi(e,c,i,t,n)})),Fa=Jr((function(e,t){var n=dn(t,co(Fa));return Qi(e,d,i,t,n)})),Ua=io((function(e,t){return Qi(e,h,i,i,i,t)}));function Va(e,t){return e===t||e!=e&&t!=t}var Wa=Zi(Ir),Ka=Zi((function(e,t){return e>=t})),Ga=Ar(function(){return arguments}())?Ar:function(e){return is(e)&&ze.call(e,"callee")&&!qe.call(e,"callee")},Ya=r.isArray,Za=vt?$t(vt):function(e){return is(e)&&jr(e)==P};function qa(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return is(e)&&qa(e)}var $a=Rt||vl,Ja=yt?$t(yt):function(e){return is(e)&&jr(e)==w};function Qa(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==bs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=wt?$t(wt):function(e){return is(e)&&bo(e)==S};function as(e){return"number"==typeof e||is(e)&&jr(e)==C}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ye(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=kt?$t(kt):function(e){return is(e)&&jr(e)==M};var cs=_t?$t(_t):function(e){return is(e)&&bo(e)==T};function ds(e){return"string"==typeof e||!Ya(e)&&is(e)&&jr(e)==O}function us(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var hs=Et?$t(Et):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Zi(Br),gs=Zi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(qa(e))return ds(e)?gn(e):Oi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=bo(e);return(t==S?ln:t==T?un:Vs)(e)}function fs(e){return e?(e=vs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function xs(e){return e?cr(bs(e),0,f):0}function vs(e){if("number"==typeof e)return e;if(us(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=be.test(e);return n||ve.test(e)?dt(e.slice(2),n?2:8):fe.test(e)?m:+e}function ys(e){return Li(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var ks=Pi((function(e,t){if(Co(t)||qa(t))Li(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),_s=Pi((function(e,t){Li(t,Ds(t),e)})),Es=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Ss=Pi((function(e,t,n,r){Li(t,Ps(t),e,r)})),Cs=io(lr);var js=Jr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Va(u,Ae[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),Is=Jr((function(e){return e.push(i,to),St(Ns,i,e)}));function Ms(e,t,n){var r=null==e?i:Sr(e,t);return r===i?n:r}function Ts(e,t){return null!=e&&xo(e,t,Tr)}var Os=Vi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),e[t]=n}),rl(al)),Ls=Vi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),uo),As=Jr(Lr);function Ps(e){return qa(e)?Jn(e):Rr(e)}function Ds(e){return qa(e)?Jn(e,!0):Hr(e)}var zs=Pi((function(e,t,n){Wr(e,t,n)})),Ns=Pi((function(e,t,n,r){Wr(e,t,n,r)})),Rs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=At(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=dr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var Hs=io((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=At(ao(e),(function(e){return[e]}));return t=uo(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Fs=Ji(Ps),Us=Ji(Ds);function Vs(e){return null==e?[]:Jt(e,Ps(e))}var Ws=Ri((function(e,t,n){return t=t.toLowerCase(),e+(n?Ks(t):t)}));function Ks(e){return Qs(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(we,rn).replace(Qe,"")}var Ys=Ri((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Ri((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),qs=Ni("toLowerCase");var Xs=Ri((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Ri((function(e,t,n){return e+(n?" ":"")+Qs(t)}));var Js=Ri((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Qs=Ni("toUpperCase");function el(e,t,n){return e=ws(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return St(e,i,t)}catch(e){return Qa(e)?e:new Ee(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Bo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Fi(),ol=Fi(!0);function al(e){return e}function sl(e){return Nr("function"==typeof e?e:dr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),cl=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Er(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(t,Ps(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})})),e}function ul(){}var hl=Ki(At),pl=Ki(Mt),gl=Ki(Nt);function ml(e){return _o(e)?Kt(Bo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var fl=Yi(),bl=Yi(!0);function xl(){return[]}function vl(){return!1}var yl=Wi((function(e,t){return e+t}),0),wl=Xi("ceil"),kl=Wi((function(e,t){return e/t}),1),_l=Xi("floor");var El,Sl=Wi((function(e,t){return e*t}),1),Cl=Xi("round"),jl=Wi((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ta,Un.assign=ks,Un.assignIn=_s,Un.assignInWith=Es,Un.assignWith=Ss,Un.at=Cs,Un.before=Oa,Un.bind=La,Un.bindAll=nl,Un.bindKey=Aa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:yn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Pt(Ya(n)?Oi(n):[n],vr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Te(o);return[n(e[0]),e[1]]})):[],Jr((function(n){for(var r=-1;++r<t;){var i=e[r];if(St(i[0],this,n))return St(i[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ps(e);return function(n){return ur(n,e,t)}}(dr(e,1))},Un.constant=rl,Un.countBy=xa,Un.create=function(e,t){var n=Vn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var o=Qi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.curryRight=function e(t,n,r){var o=Qi(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.debounce=Pa,Un.defaults=js,Un.defaultsDeep=Is,Un.defer=Da,Un.delay=za,Un.difference=Vo,Un.differenceBy=Wo,Un.differenceWith=Ko,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:bs(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:bs(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0):[]},Un.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=bs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:bs(r))<0&&(r+=o),r=n>r?0:xs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Ya(e)?Tt:xr)(e,uo(t,3))},Un.flatMap=function(e,t){return vr(Ca(e,t),1)},Un.flatMapDeep=function(e,t){return vr(Ca(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),vr(Ca(e,t),n)},Un.flatten=Zo,Un.flattenDeep=function(e){return(null==e?0:e.length)?vr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?vr(e,t=t===i?1:bs(t)):[]},Un.flip=function(e){return Qi(e,512)},Un.flow=il,Un.flowRight=ol,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Un.functions=function(e){return null==e?[]:Er(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,Ds(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Un.intersection=Xo,Un.intersectionBy=$o,Un.intersectionWith=Jo,Un.invert=Os,Un.invertBy=Ls,Un.invokeMap=Ea,Un.iteratee=sl,Un.keyBy=Sa,Un.keys=Ps,Un.keysIn=Ds,Un.map=Ca,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Un.mapValues=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Un.matches=function(e){return Ur(dr(e,1))},Un.matchesProperty=function(e,t){return Vr(e,dr(t,1))},Un.memoize=Na,Un.merge=zs,Un.mergeWith=Ns,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ra,Un.nthArg=function(e){return e=bs(e),Jr((function(t){return Kr(t,e)}))},Un.omit=Rs,Un.omitBy=function(e,t){return Bs(e,Ra(uo(t)))},Un.once=function(e){return Oa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=r?i:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=hl,Un.overArgs=Ha,Un.overEvery=pl,Un.overSome=gl,Un.partial=Ba,Un.partialRight=Fa,Un.partition=ja,Un.pick=Hs,Un.pickBy=Bs,Un.property=ml,Un.propertyOf=function(e){return function(t){return null==e?i:Sr(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,i,n):e},Un.pullAt=na,Un.range=fl,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Tt:xr)(e,Ra(uo(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=uo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return qr(e,i),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Te(o);return Jr(e,t=t===i?t:bs(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),(Ya(e)?er:ei)(e,t)},Un.set=function(e,t,n){return null==e?e:ti(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Un.shuffle=function(e){return(Ya(e)?tr:ii)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:bs(t),n=n===i?r:bs(n)),oi(e,t,n)):[]},Un.sortBy=Ia,Un.sortedUniq=function(e){return e&&e.length?ci(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?_i(gn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Te(o);return t=null==t?0:yn(bs(t),0),Jr((function(n){var r=n[t],i=_i(n,0,t);return r&&Pt(i,r),St(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:bs(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:bs(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mi(e,uo(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Te(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},Un.thru=fa,Un.toArray=ms,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?At(e,Bo):us(e)?[e]:Oi(Ho(ws(e)))},Un.toPlainObject=ys,Un.transform=function(e,t,n){var r=Ya(e),i=r||$a(e)||hs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Vn(Ye(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return Ta(e,1)},Un.union=ia,Un.unionBy=oa,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?hi(e):[]},Un.uniqBy=function(e,t){return e&&e.length?hi(e,uo(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?hi(e,i,t):[]},Un.unset=function(e,t){return null==e||pi(e,t)},Un.unzip=sa,Un.unzipWith=la,Un.update=function(e,t,n){return null==e?e:gi(e,t,yi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,yi(n),r)},Un.values=Vs,Un.valuesIn=function(e){return null==e?[]:Jt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ba(yi(t),e)},Un.xor=da,Un.xorBy=ua,Un.xorWith=ha,Un.zip=pa,Un.zipObject=function(e,t){return xi(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return xi(e||[],t||[],ti)},Un.zipWith=ga,Un.entries=Fs,Un.entriesIn=Us,Un.extend=_s,Un.extendWith=Es,dl(Un,Un),Un.add=yl,Un.attempt=tl,Un.camelCase=Ws,Un.capitalize=Ks,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vs(n))==n?n:0),t!==i&&(t=(t=vs(t))==t?t:0),cr(vs(e),t,n)},Un.clone=function(e){return dr(e,4)},Un.cloneDeep=function(e){return dr(e,5)},Un.cloneDeepWith=function(e,t){return dr(e,5,t="function"==typeof t?t:i)},Un.cloneWith=function(e,t){return dr(e,4,t="function"==typeof t?t:i)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Ps(t))},Un.deburr=Gs,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kl,Un.endsWith=function(e,t,n){e=ws(e),t=ui(t);var r=e.length,o=n=n===i?r:cr(bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Un.eq=Va,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(q,on):e},Un.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Un.every=function(e,t,n){var r=Ya(e)?Mt:fr;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=va,Un.findIndex=Go,Un.findKey=function(e,t){return Ht(e,uo(t,3),kr)},Un.findLast=ya,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Ht(e,uo(t,3),_r)},Un.floor=_l,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Ds)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ds)},Un.forOwn=function(e,t){return e&&kr(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,uo(t,3))},Un.get=Ms,Un.gt=Wa,Un.gte=Ka,Un.has=function(e,t){return null!=e&&xo(e,t,Mr)},Un.hasIn=Ts,Un.head=qo,Un.identity=al,Un.includes=function(e,t,n,r){e=qa(e)?e:Vs(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ds(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(e=vs(e),t,n)},Un.invoke=As,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Za,Un.isArrayLike=qa,Un.isArrayLikeObject=Xa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==y},Un.isBuffer=$a,Un.isDate=Ja,Un.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Un.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||hs(e)||Ga(e)))return!e.length;var t=bo(e);if(t==S||t==T)return!e.size;if(Co(e))return!Rr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Pr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Pr(e,t,i,n):!!r},Un.isError=Qa,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=es,Un.isInteger=ts,Un.isLength=ns,Un.isMap=os,Un.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(So(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=as,Un.isObject=rs,Un.isObjectLike=is,Un.isPlainObject=ss,Un.isRegExp=ls,Un.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=g},Un.isSet=cs,Un.isString=ds,Un.isSymbol=us,Un.isTypedArray=hs,Un.isUndefined=function(e){return e===i},Un.isWeakMap=function(e){return is(e)&&bo(e)==A},Un.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":xn.call(e,t)},Un.kebabCase=Ys,Un.last=Qo,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=bs(n))<0?yn(r+o,0):wn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Vt,o,!0)},Un.lowerCase=Zs,Un.lowerFirst=qs,Un.lt=ps,Un.lte=gs,Un.max=function(e){return e&&e.length?br(e,al,Ir):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),Ir):i},Un.mean=function(e){return Wt(e,al)},Un.meanBy=function(e,t){return Wt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Br):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Br):i},Un.stubArray=xl,Un.stubFalse=vl,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Sl,Un.nth=function(e,t){return e&&e.length?Kr(e,bs(t)):i},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=ul,Un.now=Ma,Un.pad=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(bt(i),n)+e+Gi(mt(i),n)},Un.padEnd=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?e+Gi(t-r,n):e},Un.padStart=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?Gi(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return wn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Xr(e,t)},Un.reduce=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,mr)},Un.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),$r(ws(e),t)},Un.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Bo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Un.round=Cl,Un.runInContext=e,Un.sample=function(e){return(Ya(e)?Qn:Qr)(e)},Un.size=function(e){if(null==e)return 0;if(qa(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==S||t==T?e.size:Rr(e).length},Un.snakeCase=Xs,Un.some=function(e,t,n){var r=Ya(e)?Nt:ai;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.sortedIndex=function(e,t){return si(e,t)},Un.sortedIndexBy=function(e,t,n){return li(e,t,uo(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Va(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return si(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return li(e,t,uo(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Va(e[n],t))return n}return-1},Un.startCase=$s,Un.startsWith=function(e,t,n){return e=ws(e),n=null==n?0:cr(bs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Un.subtract=jl,Un.sum=function(e){return e&&e.length?Zt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ko(e,t,n)&&(t=i),e=ws(e),t=Es({},t,r,eo);var o,a,s=Es({},t.imports,r.imports,eo),l=Ps(s),c=Jt(s,l),d=0,u=t.interpolate||ke,h="__p += '",p=Ie((t.escape||ke).source+"|"+u.source+"|"+(u===ee?ge:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),g="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(d,l).replace(_e,an),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ee("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(K,""):h).replace(G,"$1").replace(Y,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var f=tl((function(){return Se(l,g+"return "+h).apply(i,c)}));if(f.source=h,Qa(f))throw f;return f},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=f,r=wn(e,f);t=uo(t),e-=f;for(var i=qt(r,t);++n<e;)t(n);return i},Un.toFinite=fs,Un.toInteger=bs,Un.toLength=xs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=vs,Un.toSafeInteger=function(e){return e?cr(bs(e),-9007199254740991,g):0===e?e:0},Un.toString=ws,Un.toUpper=function(e){return ws(e).toUpperCase()},Un.trim=function(e,t,n){if((e=ws(e))&&(n||t===i))return Xt(e);if(!e||!(t=ui(t)))return e;var r=gn(e),o=gn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Un.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,0,tn(r,gn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,en(r,gn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?bs(t.length):n,r="omission"in t?ui(t.omission):r}var a=(e=ws(e)).length;if(sn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),ls(o)){if(e.slice(l).search(o)){var d,u=c;for(o.global||(o=Ie(o.source,ws(me.exec(o))+"g")),o.lastIndex=0;d=o.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Z,fn):e},Un.uniqueId=function(e){var t=++Ne;return ws(e)+t},Un.upperCase=Js,Un.upperFirst=Qs,Un.each=wa,Un.eachRight=ka,Un.first=qo,dl(Un,(El={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(El[t]=e)})),El),{chain:!1}),Un.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:yn(bs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ra(uo(e)))},Gn.prototype.slice=function(e,t){e=bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],d=l||Ya(t),u=function(e){var t=o.apply(Un,Pt([e],s));return r&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new Gn(this);var f=e.apply(t,s);return f.__actions__.push({func:fa,args:[u],thisArg:i}),new Kn(f,h)}return g&&m?e.apply(this,s):(f=this.thru(u),g?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[n]((function(n){return t.apply(Ya(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ui(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ya(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,d=this.__iteratees__,u=d.length,h=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var m=-1,f=e[c+=t];++m<u;){var b=d[m],x=b.iteratee,v=b.type,y=x(f);if(2==v)f=y;else if(!y){if(1==v)continue e;break e}}g[h++]=f}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Kn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Wn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ra],thisArg:i}),new Kn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),c=1;c<arguments.length;c++){for(var d in a=Object(arguments[c]))n.call(a,d)&&(l[d]=a[d]);if(t){s=t(a);for(var u=0;u<s.length;u++)r.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),i=n(4295);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},554:(e,t,n)=>{var r=n(487),i=n(9135);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2789:(e,t,n)=>{var r=n(487),i=n(3729);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5080:(e,t,n)=>{var r=n(487),i=n(4241);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7225:(e,t,n)=>{var r=n(487),i=n(6029);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},778:(e,t,n)=>{var r=n(487),i=n(9609);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4220:(e,t,n)=>{var r=n(487),i=n(2345);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4678:(e,t,n)=>{var r=n(487),i=n(9393);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1292:(e,t,n)=>{var r=n(487),i=n(6578);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},196:(e,t,n)=>{var r=n(487),i=n(9482);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2205:(e,t,n)=>{var r=n(487),i=n(7955);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1310:(e,t,n)=>{var r=n(487),i=n(3195);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3922:(e,t,n)=>{var r=n(487),i=n(2978);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7096:(e,t,n)=>{var r=n(487),i=n(1587);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7117:(e,t,n)=>{var r=n(487),i=n(9478);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1106:(e,t,n)=>{var r=n(487),i=n(7369);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3336:(e,t,n)=>{var r=n(487),i=n(1434);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4406:(e,t,n)=>{var r=n(487),i=n(8923);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6043:(e,t,n)=>{var r=n(487),i=n(5605);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},694:(e,t,n)=>{var r=n(487),i=n(5644);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8328:(e,t,n)=>{var r=n(487),i=n(6843);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8051:(e,t,n)=>{var r=n(487),i=n(8461);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4301:(e,t,n)=>{var r=n(487),i=n(9935);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9966:(e,t,n)=>{var r=n(487),i=n(532);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9295:(e,t,n)=>{var r=n(487),i=n(7589);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9781:(e,t,n)=>{var r=n(487),i=n(8465);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},371:(e,t,n)=>{var r=n(487),i=n(5892);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4623:(e,t,n)=>{var r=n(487),i=n(3874);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1528:(e,t,n)=>{var r=n(487),i=n(2681);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},518:(e,t,n)=>{var r=n(487),i=n(6759);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9757:(e,t,n)=>{var r=n(487),i=n(9650);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5422:(e,t,n)=>{var r=n(487),i=n(2044);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},276:(e,t,n)=>{var r=n(487),i=n(9144);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6781:(e,t,n)=>{var r=n(487),i=n(6626);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},580:(e,t,n)=>{var r=n(487),i=n(6359);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4285:(e,t,n)=>{var r=n(487),i=n(9915);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3313:(e,t,n)=>{var r=n(487),i=n(9310);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8635:(e,t,n)=>{var r=n(487),i=n(6464);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},487:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=s(d),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:d,updater:f(h,t),references:1}),r.push(d)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function f(e,t){var n,r,i;if(t.singleton){var o=m++;n=g||(g=c(t)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var o=l(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=o}}}},788:(e,t,n)=>{var r={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./bn-BD.json":[8525,603],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./si-LK.json":[5497,58],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./ta-IN.json":[3952,395],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-HK.json":[5334,9],"./zh-TW.json":[931,62]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((()=>n.t(i,19)))}i.keys=()=>Object.keys(r),i.id=788,e.exports=i},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(3940),n.b),d=new URL(n(3147),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,'@font-face{font-family:"Virgil";src:url('+h+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]);const g=u},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const s=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]);const s=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const s=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const s=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const s=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+u+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const h=d},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const s=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const s=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const s=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+u+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const h=d},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const s=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const s=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const s=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const s=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);const s=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const s=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const s=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const s=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const s=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const s=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const s=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const s=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const s=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const s=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const s=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const s=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const s=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const s=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const s=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const s=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const s=a},9144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var(--color-primary-chubb);--keybinding-color: var(--color-primary-chubb)}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]);const s=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const s=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList:empty{display:none}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const s=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const s=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(7984),n.b),d=new URL(n(1639),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+h+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-chubb: #625ee0;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-chubb: #726dff;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const g=u},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>o,f:()=>a,qx:()=>s,Iw:()=>l,$e:()=>c,wZ:()=>d,ay:()=>u,oc:()=>h,Oh:()=>p,Ks:()=>g,Vi:()=>m,$C:()=>f,ut:()=>b,C6:()=>x,_D:()=>v,n5:()=>y,rk:()=>w,Hg:()=>k,hs:()=>_,k:()=>E,LO:()=>S,r8:()=>C,pb:()=>j,LL:()=>I,Gj:()=>M,nM:()=>T,Lg:()=>O,HM:()=>L,V4:()=>A,EH:()=>P,ZF:()=>D,UO:()=>z,ah:()=>N,cW:()=>R,kV:()=>H,sS:()=>B,Yx:()=>F,zK:()=>U,ZB:()=>V,qy:()=>W,h6:()=>K,jo:()=>G,$n:()=>Y,hR:()=>Z,Kr:()=>q,tr:()=>X});var r=n(8635),i=n.n(r);const o="Excalidraw",a=10,s=8,l=5,c=1,d=30,u=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},p={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};let g;!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(g||(g={}));const m={TEST:"test",DEVELOPMENT:"development"},f={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},x={LIGHT:"light",DARK:"dark"},v="Segoe UI Emoji",y=20,w=b.Virgil,k="left",_="top",E=20,S={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},C={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},j=window.location.origin,I=500,M=300,T=500,O=5e3,L=100,A=.1,P={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,z={addLibrary:"addLibrary"},N={addLibrary:"addLibrary"},R={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},H=730,B=1e3,F=500,U=2,V=[1,2,3],W=10,K=1440,G=[S.png,S.jpg,S.svg,S.gif],Y=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},X=30},2254:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>qr,default:()=>mp,defaultLang:()=>c,exportToBlob:()=>Eh,exportToCanvas:()=>_h,exportToSvg:()=>Sh,getFreeDrawSvgPath:()=>Fr,getNonDeletedElements:()=>_a,getSceneVersion:()=>ka,isInvisiblySmallElement:()=>Xr,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>td,loadLibraryFromBlob:()=>nd,mutateElement:()=>Yr,newElementWith:()=>Zr,restore:()=>qc,restoreAppState:()=>Zc,restoreElements:()=>Yc,serializeAsJSON:()=>cd});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@zsviczian/excalidraw","i8":"0.10.0-textfix-5"}');"production"!==o.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(a.u2,"@").concat(a.i8,"/dist/"));var s=n(1463),l=n(4451);const c={code:"en",label:"English"},d=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},{code:"kk-KZ",label:"Қазақ тілі"}].concat([c]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>l[e.code]>=85)),u="__test__";"production"===o.Vi.DEVELOPMENT&&d.unshift({code:u,label:"test language"},{code:"".concat(u,".rtl"),label:"‪test language (rtl)‬",rtl:!0});let h=c,p={};const g=async e=>{h=e,document.documentElement.dir=h.rtl?"rtl":"ltr",document.documentElement.lang=h.code,p=e.code.startsWith(u)?{}:await n(788)("./".concat(h.code,".json"))},m=()=>h,f=(e,t)=>{for(let n=0;n<t.length;++n){const r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},b=(e,t)=>{if(h.code.startsWith(u)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"‪[[".concat(n,"]]‬")}const n=e.split(".");let r=f(p,n)||f(s,n);if(void 0===r)throw new Error("Can't find translation for ".concat(e));if(t)for(const e in t)r=r.replace("{{".concat(e,"}}"),String(t[e]));return r};var x=n(4512);const v=()=>(0,x.jsx)("div",{className:"LoadingMessage",children:(0,x.jsx)("span",{children:b("labels.loadingScene")})}),y=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{const t=d.find((t=>t.code===e.langCode))||c;(async()=>{await g(t)})(),n(!1)}),[e.langCode]),t?(0,x.jsx)(v,{}):e.children};function w(e,t,n){if(e&&e.length){const[r,i]=t,o=Math.PI/180*n,a=Math.cos(o),s=Math.sin(o);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-i)*s+r,e[1]=(t-r)*s+(n-i)*a+i}))}}function k(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function _(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const i=[0,0];if(n)for(const t of e)w(t,i,n);const o=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const i=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);i.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(i.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!i.length)return r;let o=[],a=i[0].ymin;for(;o.length||i.length;){if(i.length){let e=-1;for(let t=0;t<i.length&&!(i[t].ymin>a);t++)e=t;i.splice(0,e+1).forEach((e=>{o.push({s:a,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=a))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),o.length>1)for(let e=0;e<o.length;e+=2){const t=e+1;if(t>=o.length)break;const n=o[e].edge,i=o[t].edge;r.push([[Math.round(n.x),a],[Math.round(i.x),a]])}a+=t,o.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)w(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),w(r,t,n)}(o,i,-n)}return o}class E{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class S extends E{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,o=[],a=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k([e,t])&&o.push([[e[0]-a,e[1]+s],[...t]],[[e[0]+a,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(o,t)}}}class C extends E{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const o=r/4;for(const a of e){const e=k(a),s=e/r,l=Math.ceil(s)-1,c=e-l*r,d=(a[0][0]+a[1][0])/2-r/4,u=Math.min(a[0][1],a[1][1]);for(let e=0;e<l;e++){const a=u+c+e*r,s=d-o+2*Math.random()*o,l=a-o+2*Math.random()*o,h=this.helper.ellipse(s,l,i,i,t);n.push(...h.ops)}}return{type:"fillSketch",ops:n}}}class I{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{const o=k(e),a=Math.floor(o/(n+r)),s=(o+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){const o=e*(n+r),a=o+n,c=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)],u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],t))}})),i}}class M{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const i=k(e),o=Math.round(i/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<o;e++){const i=2*e*t,o=2*(e+1)*t,s=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+i*Math.cos(l),a[1]+i*Math.sin(l)],d=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],u=[c[0]+s*Math.cos(l+Math.PI/4),c[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],d[0],d[1],n))}})),r}}const T={};class O{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function A(e,t){return e.type===t}function P(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",i=0,o=n[i];for(;!A(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=L[o.text],r=o.text}else A(o,1)?a=L[r]:(i++,a=L[o.text],r=o.text);if(!(i+a<n.length))throw new Error("Path data ended short");for(let e=i;e<i+a;e++){const t=n[e];if(!A(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof L[r])throw new Error("Bad segment: "+r);{const e={key:r,data:s};t.push(e),i+=a,o=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function D(e){let t=0,n=0,r=0,i=0;const o=[];for(const{key:a,data:s}of e)switch(a){case"M":o.push({key:"M",data:[...s]}),[t,n]=s,[r,i]=s;break;case"m":t+=s[0],n+=s[1],o.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":o.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],o.push({key:"L",data:[t,n]});break;case"C":o.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function z(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,o=0;"C"===n||"S"===n?(e=r+(r-s),o=i+(i-l)):(e=r,o=i),t.push({key:"C",data:[e,o,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[e,o]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=i+(i-l)):(a=r,c=i);const u=r+2*(a-r)/3,h=i+2*(c-i)/3,p=e+2*(a-e)/3,g=o+2*(c-o)/3;t.push({key:"C",data:[u,h,p,g,e,o]}),s=a,l=c,r=e,i=o;break}case"Q":{const[e,n,o,a]=d,c=r+2*(e-r)/3,u=i+2*(n-i)/3,h=o+2*(e-o)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,u,h,p,o,a]}),s=e,l=n,r=o,i=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),o=d[2],a=d[3],s=d[4],l=d[5],c=d[6];if(0===e||0===n)t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c;else if(r!==l||i!==c){R(r,i,l,c,e,n,o,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,i=c}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=c}return t}function N(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function R(e,t,n,r,i,o,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let h=[],p=0,g=0,m=0,f=0;if(c)[p,g,m,f]=c;else{[e,t]=N(e,t,-d),[n,r]=N(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(i*i)+c*c/(o*o);u>1&&(u=Math.sqrt(u),i*=u,o*=u);const h=i*i,b=o*o,x=h*b-h*c*c-b*a*a,v=h*c*c+b*a*a,y=(s===l?-1:1)*Math.sqrt(Math.abs(x/v));m=y*i*c/o+(e+n)/2,f=y*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-f)/o).toFixed(9))),g=Math.asin(parseFloat(((r-f)/o).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>120*Math.PI/180){const e=g,t=n,s=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=R(n=m+i*Math.cos(g),r=f+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,m,f])}b=g-p;const x=Math.cos(p),v=Math.sin(p),y=Math.cos(g),w=Math.sin(g),k=Math.tan(b/4),_=4/3*i*k,E=4/3*o*k,S=[e,t],C=[e+_*v,t-E*x],j=[n+_*w,r-E*y],I=[n,r];if(C[0]=2*S[0]-C[0],C[1]=2*S[1]-C[1],c)return[C,j,I].concat(h);{h=[C,j,I].concat(h);const e=[];for(let t=0;t<h.length;t+=3){const n=N(h[t][0],h[t][1],d),r=N(h[t+1][0],h[t+1][1],d),i=N(h[t+2][0],h[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}const H={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,n){return X(e,t,n)},ellipse:function(e,t,n,r,i){const o=W(n,r,i);return K(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return J(e,t,n,r,i,!0)}};function B(e,t,n,r,i){return{type:"path",ops:J(e,t,n,r,i)}}function F(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...J(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...J(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?B(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function U(e,t,n,r,i){return function(e,t){return F(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function V(e,t){let n=ee(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ee(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function W(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),o=2*Math.PI/i;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-n.curveFitting;return a+=$(a*l,n),s+=$(s*l,n),{increment:o,rx:a,ry:s}}function K(e,t,n,r){const[i,o]=ne(r.increment,e,t,r.rx,r.ry,1,r.increment*X(.1,X(.4,1,n),n),n);let a=te(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=ne(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=te(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function G(e,t,n,r,i,o,a,s,l){const c=e,d=t;let u=Math.abs(n/2),h=Math.abs(r/2);u+=$(.01*u,l),h+=$(.01*h,l);let p=i,g=o;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,f=Math.min(m/2,(g-p)/2),b=re(f,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(f,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...J(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...J(c,d,c+u*Math.cos(g),d+h*Math.sin(g),l)):b.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(p),d+h*Math.sin(p)]})),{type:"path",ops:b}}function Y(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$(e,t),r[0][1]+$(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+$(e,t),r[o][1]+$(e,t)]})}}return{type:"fillPath",ops:n}}function Z(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!T[n])switch(n){case"zigzag":T[n]||(T[n]=new S(t));break;case"cross-hatch":T[n]||(T[n]=new C(t));break;case"dots":T[n]||(T[n]=new j(t));break;case"dashed":T[n]||(T[n]=new I(t));break;case"zigzag-line":T[n]||(T[n]=new M(t));break;default:n="hachure",T[n]||(T[n]=new E(t))}return T[n]}(t,H).fillPolygons(e,t)}function q(e){return e.randomizer||(e.randomizer=new O(e.seed||0)),e.randomizer.next()}function X(e,t,n,r=1){return n.roughness*r*(q(n)*(t-e)+e)}function $(e,t,n=1){return X(-e,e,t,n)}function J(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=Q(e,t,n,r,i,!0,!1);if(a)return s;const l=Q(e,t,n,r,i,!0,!0);return s.concat(l)}function Q(e,t,n,r,i,o,a){const s=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,h=.2+.2*q(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=$(p,i,c),g=$(g,i,c);const m=[],f=()=>$(u,i,c),b=()=>$(d,i,c),x=i.preserveVertices;return o&&(a?m.push({op:"move",data:[e+(x?0:f()),t+(x?0:f())]}):m.push({op:"move",data:[e+(x?0:$(d,i,c)),t+(x?0:$(d,i,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+f(),g+t+(r-t)*h+f(),p+e+2*(n-e)*h+f(),g+t+2*(r-t)*h+f(),n+(x?0:f()),r+(x?0:f())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),g+t+(r-t)*h+b(),p+e+2*(n-e)*h+b(),g+t+2*(r-t)*h+b(),n+(x?0:b()),r+(x?0:b())]}),m}function ee(e,t,n){const r=[];r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]),r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]),i===e.length-1&&r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]);return te(r,null,n)}function te(e,t,n){const r=e.length,i=[];if(r>3){const o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];o[0]=[n[0],n[1]],o[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],o[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],o[3]=[e[t+1][0],e[t+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(e,n),t[1]+$(e,n)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push(...J(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function ne(e,t,n,r,i,o,a,s){const l=[],c=[];if(0===s.roughness){e/=4,c.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let o=0;o<=2*Math.PI;o+=e){const e=[t+r*Math.cos(o),n+i*Math.sin(o)];l.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+i*Math.sin(0)]),c.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const d=$(.5,s)-Math.PI/2;c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const u=2*Math.PI+d-.01;for(let a=d;a<u;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}c.push([$(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),$(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([$(o,s)+t+.98*r*Math.cos(d+a),$(o,s)+n+.98*i*Math.sin(d+a)]),c.push([$(o,s)+t+.9*r*Math.cos(d+.5*a),$(o,s)+n+.9*i*Math.sin(d+.5*a)])}return[c,l]}function re(e,t,n,r,i,o,a,s,l){const c=o+$(.1,l),d=[];d.push([$(s,l)+t+.9*r*Math.cos(c-e),$(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([$(s,l)+t+r*Math.cos(o),$(s,l)+n+i*Math.sin(o)]);return d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),te(d,null,l)}function ie(e,t,n,r,i,o,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let d=[0,0];const u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:$(c[0],s)),a[1]+(h?0:$(c[0],s))]}),d=h?[i,o]:[i+$(c[p],s),o+$(c[p],s)],l.push({op:"bcurveTo",data:[e+$(c[p],s),t+$(c[p],s),n+$(c[p],s),r+$(c[p],s),d[0],d[1]]});return l}function oe(e){return[...e]}function ae(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function se(e,t,n){const r=ae(t,n);if(0===r)return ae(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ae(e,le(t,n,i))}function le(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ce(e,t,n,r){const i=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],o=e[t+3];let a=3*r[0]-2*n[0]-o[0];a*=a;let s=3*r[1]-2*n[1]-o[1];s*=s;let l=3*i[0]-2*o[0]-n[0];l*=l;let c=3*i[1]-2*o[1]-n[1];return c*=c,a<l&&(a=l),s<c&&(s=c),a+s}(e,t)<n){const n=e[t+0];if(i.length){(o=i[i.length-1],a=n,Math.sqrt(ae(o,a)))>1&&i.push(n)}else i.push(n);i.push(e[t+3])}else{const r=.5,o=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=le(o,a,r),d=le(a,s,r),u=le(s,l,r),h=le(c,d,r),p=le(d,u,r),g=le(h,p,r);ce([o,c,h,g],0,n,i),ce([g,p,u,l],0,n,i)}var o,a;return i}function de(e,t){return ue(e,0,e.length,t)}function ue(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;r<n-1;++r){const t=se(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(ue(e,t,c+1,r,o),ue(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function he(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){ce(e,3*n,t,r)}return n&&n>0?ue(r,0,r.length,n):r}const pe="none";class ge{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const o=this._o(i);return this._d("line",[B(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=U(e,t,n,r,o);if(o.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===o.fillStyle?a.push(Y([i],o)):a.push(Z([i],o))}return o.stroke!==pe&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=W(n,r,o),l=K(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=K(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(Z([l.estimatedPoints],o));return o.stroke!==pe&&a.push(l.opset),this._d("ellipse",a,o)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[F(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=G(e,t,n,r,i,o,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const s=G(e,t,n,r,i,o,!0,!1,a);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,o,a){const s=e,l=t;let c=Math.abs(n/2),d=Math.abs(r/2);c+=$(.01*c,a),d+=$(.01*d,a);let u=i,h=o;for(;u<0;)u+=2*Math.PI,h+=2*Math.PI;h-u>2*Math.PI&&(u=0,h=2*Math.PI);const p=(h-u)/a.curveStepCount,g=[];for(let e=u;e<=h;e+=p)g.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return g.push([s+c*Math.cos(h),l+d*Math.sin(h)]),g.push([s,l]),Z([g],a)}(e,t,n,r,i,o,l));return l.stroke!==pe&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=V(e,n);if(n.fill&&n.fill!==pe&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(oe(e[0]),oe(e[1]),oe(e[2]),oe(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const i=[],o=1-t;r.push(oe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(o*n[e+1][0]-o*n[e-1][0])/6,t[1]+(o*n[e+1][1]-o*n[e-1][1])/6],i[2]=[n[e+1][0]+(o*n[e][0]-o*n[e+2][0])/6,n[e+1][1]+(o*n[e][1]-o*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}(e),i=he(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Y([i],n)):r.push(Z([i],n))}return n.stroke!==pe&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=F(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Y([e],n)):r.push(Z([e],n))),n.stroke!==pe&&r.push(i),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==pe,o=n.stroke!==pe,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=z(D(P(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...he(s,t)),s=[]},c=()=>{l(),o.length&&(i.push(o),o=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],o.push(a);break;case"L":l(),o.push([t[0],t[1]]);break;case"C":if(!s.length){const e=o.length?o[o.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),o.push([a[0],a[1]])}if(c(),!n)return i;const d=[];for(const e of i){const t=de(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return i&&("solid"===n.fillStyle?r.push(Y(s,n)):r.push(Z(s,n))),o&&(a?s.forEach((e=>{r.push(F(e,!1,n))})):r.push(function(e,t){const n=z(D(P(e))),r=[];let i=[0,0],o=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:$(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...J(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]];break;case"C":{const[e,n,i,s,l,c]=a;r.push(...ie(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...J(o[0],o[1],i[0],i[1],t)),o=[i[0],i[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:pe};break;case"fillPath":t={d:this.opsToPath(e),stroke:pe,strokeWidth:0,fill:n.fill||pe};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||pe,strokeWidth:n,fill:pe}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(const o of t)switch(o.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,o,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,i,t),r.restore();break}case"fillSketch":this.fillSketch(r,o,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o),o}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o),o}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o),o}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l),l}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const fe="http://www.w3.org/2000/svg";class be{constructor(e,t){this.svg=e,this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(fe,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(fe,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o)}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o)}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const xe={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function ve(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ve(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ye(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ve(e))&&(r&&(r+=" "),r+=t);return r}let we=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const ke=e=>!!e&&"image"===e.type&&!!e.fileId,_e=e=>!!e&&"image"===e.type,Ee=e=>null!=e&&"text"===e.type,Se=e=>null!=e&&Ce(e.type),Ce=e=>"freedraw"===e,je=e=>null!=e&&Ie(e.type),Ie=e=>"arrow"===e||"line"===e,Me=e=>null!=e&&Te(e.type),Te=e=>"arrow"===e,Oe=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId),Le=e=>{var t;return Oe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},Ae=e=>null!==e&&Ee(e)&&null!==e.containerId,Pe=(e,t,n,r,i)=>[(e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r],De=(e,t,n)=>Pe(e[0],e[1],t[0],t[1],n),ze=(e,t,n,r,i,o,a,s)=>{const l=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*c,t+=a*(1-l),n+=a*-c):e.w&&(t+=i*(1-l),n+=i*-c,t+=a*(1+l),n+=a*c),e.n&&e.s?n+=o+s:e.n?(t+=o*c,n+=o*(1-l),t+=s*-c,n+=s*(1+l)):e.s&&(t+=o*-c,n+=o*(1+l),t+=s*c,n+=s*(1-l)),[t,n]},Ne=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},Re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){const[n,r]=[e[0],e[e.length-1]];return Ne(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},He=(e,t,n)=>{const r=e.length;if(r<3)return!1;const i=[Number.MAX_SAFE_INTEGER,n],o=[t,n];let a=0;for(let t=0;t<r;t++){const n=e[t],s=e[(t+1)%r];if(Ue(n,s,o,i)){if(0===Fe(n,o,s))return Be(n,o,s);a++}}return a%2==1},Be=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]),Fe=(e,t,n)=>{const r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},Ue=(e,t,n,r)=>{const i=Fe(e,t,n),o=Fe(e,t,r),a=Fe(n,r,e),s=Fe(n,r,t);return i!==o&&a!==s||(!(0!==i||!Be(e,n,t))||(!(0!==o||!Be(e,r,t))||(!(0!==a||!Be(n,e,r))||!(0!==s||!Be(n,t,r)))))},Ve=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],We=e=>{const t=e.map((e=>e[0])),n=e.map((e=>e[1]));return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Ke=(e,t,n)=>{const r=n.map((t=>t[e])),i=Math.max(...r),o=Math.min(...r),a=i-o,s=0===a?1:t/a;let l=1/0;const c=n.map((t=>t.map(((t,n)=>{if(n!==e)return t;const r=t*s;return l=Math.min(r,l),r}))));if(2===c.length)return c;const d=o-l;return c.map((t=>t.map(((t,n)=>n===e?t+d:t))))},Ge=e=>Se(e)?Xe(e):je(e)?$e(e):[e.x,e.y,e.x+e.width,e.y+e.height],Ye=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Ze=(e,t)=>{let n=[0,0];const{minX:r,minY:i,maxX:o,maxY:a}=e.reduce(((e,r)=>{let{op:i,data:o}=r;if("move"===i)n=o;else if("bcurveTo"===i){const r=[o[0],o[1]],i=[o[2],o[3]],a=[o[4],o[5]],s=n;n=a;const l=(e,t)=>Math.pow(1-e,3)*a[t]+3*e*Math.pow(1-e,2)*i[t]+3*Math.pow(e,2)*(1-e)*r[t]+s[t]*Math.pow(e,3);let c=0;for(;c<=1;){let n=l(c,0),r=l(c,1);t&&([n,r]=t(n,r)),e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),c+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]},qe=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,a]of e)t=Math.min(t,o),n=Math.min(n,a),r=Math.max(r,o),i=Math.max(i,a);return[t,n,r,i]},Xe=e=>{const[t,n,r,i]=qe(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},$e=e=>{let t;if(e.points.length<2||!Tr(e)){const{minX:n,minY:r,maxX:i,maxY:o}=e.points.reduce(((e,t)=>{let[n,r]=t;return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});t=[n+e.x,r+e.y,i+e.x,o+e.y]}else{const n=Tr(e),r=Ye(n[0]),[i,o,a,s]=Ze(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},Je=e=>{let t;const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;if(Se(e)){const[t,n,r,i]=qe(e.points.map((t=>{let[n,r]=t;return Pe(n,r,a-e.x,s-e.y,e.angle)})));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(je(e))t=((e,t,n)=>{if(e.points.length<2||!Tr(e)){const{minX:r,minY:i,maxX:o,maxY:a}=e.points.reduce(((r,i)=>{let[o,a]=i;return[o,a]=Pe(e.x+o,e.y+a,t,n,e.angle),r.minY=Math.min(r.minY,a),r.minX=Math.min(r.minX,o),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,a),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]}const r=Tr(e),i=Ye(r[0]);return Ze(i,((r,i)=>Pe(e.x+r,e.y+i,t,n,e.angle)))})(e,a,s);else if("diamond"===e.type){const[l,c]=Pe(a,r,a,s,e.angle),[d,u]=Pe(a,o,a,s,e.angle),[h,p]=Pe(n,s,a,s,e.angle),[g,m]=Pe(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}else if("ellipse"===e.type){const l=(i-n)/2,c=(o-r)/2,d=Math.cos(e.angle),u=Math.sin(e.angle),h=Math.hypot(l*d,c*u),p=Math.hypot(c*d,l*u);t=[a-h,s-p,a+h,s+p]}else{const[l,c]=Pe(n,r,a,s,e.angle),[d,u]=Pe(n,o,a,s,e.angle),[h,p]=Pe(i,o,a,s,e.angle),[g,m]=Pe(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}return t},Qe=e=>{if(!e.length)return[0,0,0,0];let t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEach((e=>{const[o,a,s,l]=Je(e);t=Math.min(t,o),r=Math.min(r,a),n=Math.max(n,s),i=Math.max(i,l)})),[t,r,n,i]},et=(e,t,n)=>{if(!je(e)&&!Se(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ke(0,t,Ke(1,n,e.points));let i;if(Se(e))i=qe(r);else{const t=xe.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,Lr(e)):t.curve(r,Lr(e)),o=Ye(n);i=Ze(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},tt=(e,t,n)=>{const r=xe.generator(),i="sharp"===n?r.linearPath(t,Lr(e)):r.curve(t,Lr(e)),o=Ye(i),[a,s,l,c]=Ze(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},nt=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i}},rt=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),it=e=>[rt.red[e],rt.pink[e],rt.grape[e],rt.violet[e],rt.indigo[e],rt.blue[e],rt.cyan[e],rt.teal[e],rt.green[e],rt.lime[e],rt.yellow[e],rt.orange[e]],ot={canvasBackground:[rt.white,rt.gray[0],rt.gray[1],...it(0)],elementBackground:["transparent",rt.gray[4],rt.gray[6],...it(6)],elementStroke:[rt.black,rt.gray[8],rt.gray[7],...it(9)]};var at=n(5156);const st=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),lt=/^Win/.test(window.navigator.platform),ct="Equal",dt="Minus",ut="NumpadAdd",ht="NumpadSubtract",pt="Numpad0",gt="BracketRight",mt="BracketLeft",ft="Digit1",bt="Digit2",xt="Quote",vt="Digit0",yt="Slash",wt="KeyC",kt="KeyD",_t="KeyG",Et="KeyF",St="KeyH",Ct="KeyV",jt="KeyX",It="KeyZ",Mt="KeyR",Tt="ArrowDown",Ot="ArrowLeft",Lt="ArrowRight",At="ArrowUp",Pt="Backspace",Dt="Alt",zt=st?"metaKey":"ctrlKey",Nt="Delete",Rt="Enter",Ht="Escape",Bt="?",Ft=" ",Ut="Tab",Vt="a",Wt="d",Kt="e",Gt="g",Yt="l",Zt="o",qt="p",Xt="q",$t="r",Jt="s",Qt="t",en="v",tn="x",nn="y",rn="z",on=e=>e===Ot||e===Lt||e===Tt||e===At,an=e=>e.altKey,sn=e=>e.shiftKey,ln=e=>e.shiftKey;let cn=null;const dn=()=>{if(cn)return cn;const e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),i="".concat(e.getHours()).padStart(2,"0"),o="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(i).concat(o)},un=e=>e.charAt(0).toUpperCase()+e.slice(1),hn=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),pn=e=>{let{fontFamily:t}=e;for(const[e,n]of Object.entries(o.ut))if(n===t)return"".concat(e,", ").concat(o._D);return o._D},gn=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(pn({fontFamily:n}))},mn=(e,t)=>{let n=0,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r=o,clearTimeout(n),n=window.setTimeout((()=>{r=null,e(...o)}),t)};return i.flush=()=>{if(clearTimeout(n),r){const t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},fn=(e,t)=>Math.abs(e-t),bn=e=>{e&&(e.style.cursor="")},xn=(e,t)=>{e&&(e.style.cursor=t)},vn=(e,t)=>{e&&("selection"===t?bn(e):"image"!==t&&(e.style.cursor=o.oc.CROSSHAIR))},yn=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},wn=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),st?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),kn=(e,t)=>{let{clientX:n,clientY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;const c=1/i.value;return{x:(n-i.translation.x-o)*c-s,y:(r-i.translation.y-a)*c-l}},_n=(e,t)=>{let{sceneX:n,sceneY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;return{x:(n+s)*i.value+i.translation.x+o,y:(r+l)*i.value+i.translation.y+a}},En=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),Sn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),Cn=e=>Sn.test(e),jn=e=>{const[t,n]=e;return{x:t,y:n}},In=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},Mn=e=>{const t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===ot.elementBackground[0]},Tn=e=>t=>{(0,at.unstable_batchedUpdates)(e,t)},On=()=>Date.now(),Ln=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),An=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Pn=()=>({theme:o.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:o.rk,currentItemFontSize:o.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:rt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:o.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:An,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(b("labels.untitled"),"-").concat(dn()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:rt.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}),Dn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},zn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=Dn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},Nn=e=>zn(e,"export"),Rn=e=>zn(e,"server");function Hn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Bn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Fn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Un(e,t){return[e[0]*t,e[1]*t]}function Vn(e){return[e[1],-e[0]]}function Wn(e,t){return e[0]*t[0]+e[1]*t[1]}function Kn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Gn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Fn(e,t))}function Yn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Zn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function qn(e,t,n){let r=Math.sin(n),i=Math.cos(n),o=e[0]-t[0],a=e[1]-t[1],s=o*r+a*i;return[o*i-a*r+t[0],s+t[1]]}function Xn(e,t,n){return Bn(e,Un(Fn(t,e),n))}function $n(e,t,n){return Bn(e,Un(t,n))}var{min:Jn,PI:Qn}=Math,er=Qn+1e-4;function tr(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:o=!0,easing:a=(e=>e),start:s={},end:l={},last:c=!1}=t,{cap:d=!0,taper:u=0,easing:h=(e=>e*(2-e))}=s,{cap:p=!0,taper:g=0,easing:m=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let f,b=e[e.length-1].runningLength,x=Math.pow(n*r,2),v=[],y=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Jn(1,t.distance/n),o=Jn(1,1-i);r=Jn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=Hn(n,i,e[e.length-1].pressure,a),_=e[0].vector,E=e[0].point,S=E,C=E,j=S;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:l,distance:c,runningLength:d}=e[t];if(t<e.length-1&&b-d<3)continue;if(i){if(o){let e=Jn(1,c/n),t=Jn(1,1-e);r=Jn(1,w+.275*e*(t-w))}k=Hn(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,I=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,I)),t===e.length-1){let e=Un(Vn(l),k);v.push(Fn(s,e)),y.push(Bn(s,e));continue}let M=e[t+1].vector,T=Wn(l,M);if(T<0){let e=Un(Vn(_),k);for(let t=1/13,n=0;n<=1;n+=t)C=qn(Fn(s,e),s,er*n),v.push(C),j=qn(Bn(s,e),s,er*-n),y.push(j);E=C,S=j;continue}let O=Un(Vn(Xn(M,l,T)),k);C=Fn(s,O),(t<=1||Gn(E,C)>x)&&(v.push(C),E=C),j=Bn(s,O),(t<=1||Gn(S,j)>x)&&(y.push(j),S=j),w=r,_=l}let I=e[0].point.slice(0,2),M=e.length>1?e[e.length-1].point.slice(0,2):Bn(e[0].point,[1,1]),T=[],O=[];if(1===e.length){if(!u&&!g||c){let e=$n(I,Yn(Vn(Fn(I,M))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(qn(e,I,2*er*r));return t}}else{if(!(u||g&&1===e.length))if(d)for(let e=1/13,t=e;t<=1;t+=e){let e=qn(y[0],I,er*t);T.push(e)}else{let e=Fn(v[0],y[0]),t=Un(e,.5),n=Un(e,.51);T.push(Fn(I,t),Fn(I,n),Bn(I,n),Bn(I,t))}let t=Vn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(g||u&&1===e.length)O.push(M);else if(p){let e=$n(M,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(qn(e,M,3*er*n))}else O.push(Bn(M,Un(t,k)),Bn(M,Un(t,.99*k)),Fn(M,Un(t,.99*k)),Fn(M,Un(t,k)))}return v.concat(O,y.reverse(),T)}(function(e,t={}){var n;let{streamline:r=.5,size:i=16,last:o=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),s=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===s.length){let e=s[1];s=s.slice(0,-1);for(let t=1;t<5;t++)s.push(Xn(s[0],e,t/4))}1===s.length&&(s=[...s,[...Bn(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,d=0,u=l[0],h=s.length-1;for(let e=1;e<s.length;e++){let t=o&&e===h?s[e].slice(0,2):Xn(u.point,s[e],a);if(Kn(u.point,t))continue;let n=Zn(t,u.point);if(d+=n,e<h&&!c){if(d<i)continue;c=!0}u={point:t,pressure:s[e][2]>=0?s[e][2]:.5,vector:Yn(Fn(u.point,t)),distance:n,runningLength:d},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}(e,t),t)}const nr=e=>"string"==typeof e;class rr{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){nr(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return nr(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getElementsIncludingDeleted(){return this.elements}getElements(){return this.nonDeletedElements}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){const t=this.getElement(e);return t&&Ea(t)?t:null}getNonDeletedElements(e){const t=[];return e.forEach((e=>{const n=this.getNonDeletedElement(e);null!=n&&t.push(n)})),t}replaceAllElements(e){this.elements=e,this.elementsMap.clear(),e.forEach((e=>{this.elementsMap.set(e.id,e),rr.mapElementToScene(e,this)})),this.nonDeletedElements=_a(this.elements),this.informMutation()}informMutation(){for(const e of Array.from(this.callbacks))e()}addCallback(e){if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw new Error;this.callbacks.delete(e)}}destroy(){rr.sceneMapById.forEach(((e,t)=>{e===this&&rr.sceneMapById.delete(t)})),this.callbacks.clear()}}rr.sceneMapByElement=new WeakMap,rr.sceneMapById=new Map;const ir=rr,or=e=>{let t;e.containerId&&(t=e.width);const n=lr(e.originalText,gn(e),t);Yr(e,{width:n.width,height:n.height,baseline:n.baseline})},ar=(e,t,n)=>{const r=Ln(e);t.forEach((e=>{const t=n.get(e.id),i=br(e);if(i){var o;const a=n.get(i);Yr(r.get(t),{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})}),Yr(r.get(a),{containerId:t})}}))},sr=(e,t)=>{e.forEach((e=>{const n=br(e);if(n){const r=ir.getScene(e).getElement(n);if(r&&r.text){if(!e)return;let n=r.text,i=r.height,a=e.height,s=r.baseline;if("n"!==t&&"s"!==t){let t=0;if(n){t=fr(gn(r));Math.abs(e.width-r.width+2*o.tr)>=t&&(n=pr(r.originalText,gn(r),e.width))}const a=lr(n,gn(r),e.width);i=a.height,s=a.baseline}if(i>e.height-2*o.tr){a=i+2*o.tr;const n=a-e.height,r="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Yr(e,{height:a,y:r})}const l=e.y+a/2-i/2;Yr(r,{text:n,width:e.width-2*o.tr,height:i,x:e.x+o.tr,y:l,baseline:s})}}}))},lr=(e,t,n)=>{e=e.split("\n").map((e=>e||" ")).join("\n");const r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){const e=dr(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(e),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;const i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);const o=i.offsetTop+i.offsetHeight,a=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:a,height:s,baseline:o}},cr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),dr=e=>lr(cr,e,null).height;let ur;const hr=(e,t)=>{ur||(ur=document.createElement("canvas"));const n=ur.getContext("2d");n.font=t;return n.measureText(e).width},pr=(e,t,n)=>{const r=n-2*o.tr,i=[],a=e.split("\n"),s=hr(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])i.push(n[0]);else{let e="",o=0,a=0;for(;a<n.length;){if(hr(n[a],t)>r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=gr.calculate(s,t);o+=l,n[a]=n[a].slice(1),o>=r?(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e),e=s,o=l,o===r&&(e="",o=0)):e+=s}o+s>r?(i.push(e),e="",o=0):(e+=" ",o+=s),a++}else{for(;o<r&&a<n.length;){const s=n[a];if(o=hr(e+s,t),o>=r){i.push(e),o=0,e="";break}a++,e+="".concat(s," ")}o===r&&(e="",o=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e))}})),i.join("\n")},gr=(()=>{const e={},t=(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=hr(t,n);e[n][r]=i}return e[n][r]};return{calculate:t,updateCache:(n,r)=>{const i=n.charCodeAt(0);e[r][i]||(e[r][i]=t(n,r))},clearCacheforFont:t=>{e[t]=[]},getCache:t=>e[t]}})(),mr=e=>lr(cr.split("").join("\n"),e).width+2*o.tr,fr=e=>{const t=gr.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.min(...n)},br=e=>{var t,n;return null==e||null===(t=e.boundElements)||void 0===t||null===(n=t.filter((e=>"text"===e.type))[0])||void 0===n?void 0:n.id},xr="invert(100%) hue-rotate(180deg) saturate(1.25)",vr=Pn(),yr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),wr=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!yr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},kr=e=>[8,8+e],_r=e=>[1.5,6+e],Er=e=>"freedraw"===e.type?12*e.strokeWidth:20,Sr=document.createElement("img");Sr.src="data:".concat(o.LO.svg,",").concat(encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>'));const Cr=document.createElement("img");Cr.src="data:".concat(o.LO.svg,",").concat(encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>'));const jr=(e,t,n,r)=>{switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Tr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Tr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const t=function(e){return Hr.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(t),n.restore();break}case"image":{var i;const t=ke(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==t||t instanceof Promise?((e,t,n)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);const r=Math.min(e.width,e.height),i=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Cr:Sr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,r.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=Cn(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=gn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),o=e.containerId?dr(gn(e)):e.height/i.length,a=e.height-e.baseline,s="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<i.length;e++)n.fillText(i[e],s,(e+1)*o-a);n.restore(),r&&n.canvas.remove()}}n.globalAlpha=1},Ir=new WeakMap,Mr=new WeakMap,Tr=e=>Mr.get(e),Or=e=>Mr.delete(e),Lr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?kr(e.strokeWidth):"dotted"===e.strokeStyle?_r(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t};switch(e.type){case"rectangle":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return Re(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Ar=(e,t)=>{let n=Mr.get(e)||null;if(!n){switch(Ir.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){const r=e.width,i=e.height,o=.25*Math.min(r,i);n=t.path("M ".concat(o," 0 L ").concat(r-o," 0 Q ").concat(r," 0, ").concat(r," ").concat(o," L ").concat(r," ").concat(i-o," Q ").concat(r," ").concat(i,", ").concat(r-o," ").concat(i," L ").concat(o," ").concat(i," Q 0 ").concat(i,", 0 ").concat(i-o," L 0 ").concat(o," Q 0 0, ").concat(o," 0"),Lr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,Lr(e));break;case"diamond":{const[r,i,o,a,s,l,c,d]=(e=>{const t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]})(e);n="round"===e.strokeSharpness?t.path("M ".concat(r+.25*(o-r)," ").concat(i+.25*(a-i)," L ").concat(o-.25*(o-r)," ").concat(a-.25*(a-i)," \n C ").concat(o," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o-.25*(o-s)," ").concat(a+.25*(l-a)," \n L ").concat(s+.25*(o-s)," ").concat(l-.25*(l-a)," \n C ").concat(s," ").concat(l,", ").concat(s," ").concat(l,", ").concat(s-.25*(s-c)," ").concat(l-.25*(l-d)," \n L ").concat(c+.25*(s-c)," ").concat(d+.25*(l-d)," \n C ").concat(c," ").concat(d,", ").concat(c," ").concat(d,", ").concat(c+.25*(r-c)," ").concat(d-.25*(d-i)," \n L ").concat(r-.25*(r-c)," ").concat(i+.25*(d-i)," \n C ").concat(r," ").concat(i,", ").concat(r," ").concat(i,", ").concat(r+.25*(o-r)," ").concat(i+.25*(a-i)),Lr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],Lr(e));break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,Lr(e));break;case"line":case"arrow":{const r=Lr(e),i=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?r.fill?[t.polygon(i,r)]:[t.linearPath(i,r)]:[t.curve(i,r)],"arrow"===e.type){const{startArrowhead:i=null,endArrowhead:o="arrow"}=e,a=(e,n,i,o)=>{const a=((e,t,n,r)=>{const i=Ye(t[0]);if(i.length<1)return null;const o="start"===n?1:i.length-1,a=i[o].data,s=[a[4],a[5]],l=[a[2],a[3]],c=[a[0],a[1]],d=i[o-1];let u=[0,0];"move"===d.op?u=d.data:"bcurveTo"===d.op&&(u=[d.data[4],d.data[5]]);const h=(e,t)=>Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*c[t]+u[t]*Math.pow(e,3),[p,g]="start"===n?u:s,[m,f]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,g-f),x=(p-m)/b,v=(g-f)/b,y={arrow:30,bar:15,dot:15,triangle:15}[r];let w=0;if("arrow"===r){const[t,n]=e.points[e.points.length-1],[r,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];w=Math.hypot(t-r,n-i)}else for(let t=0;t<e.points.length;t++){const[n,r]=e.points[t-1]||[0,0],[i,o]=e.points[t];w+=Math.hypot(i-n,o-r)}const k=Math.min(y,w/2),_=p-x*k,E=g-v*k;if("dot"===r)return[p,g,Math.hypot(E-g,_-p)+e.strokeWidth];const S={arrow:20,bar:90,triangle:25}[r],[C,j]=Pe(_,E,p,g,-S*Math.PI/180),[I,M]=Pe(_,E,p,g,S*Math.PI/180);return[p,g,C,j,I,M]})(e,n,i,o);if(null===a)return[];if("dot"===o){const[n,i,o]=a;return[t.circle(n,i,o,Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){const[n,i,o,s,l,c]=a;return delete r.strokeLineDash,[t.polygon([[n,i],[o,s],[l,c],[n,i]],Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid"}))]}const[s,l,c,d,u,h]=a;if("dotted"===e.strokeStyle){const t=_r(e.strokeWidth-1);r.strokeLineDash=[t[0],t[1]-1]}else delete r.strokeLineDash;return[t.line(c,d,s,l,r),t.line(u,h,s,l,r)]};if(null!==i){const t=a(e,n,"start",i);n.push(...t)}if(null!==o){const t=a(e,n,"end",o);n.push(...t)}}break}case"freedraw":Br(e),n=[];break;case"text":case"image":n=[]}Mr.set(e,n)}},Pr=(e,t)=>{const n=t?t.zoom:vr.zoom,r=Ir.get(e),i=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||i||r.theme!==t.theme){const r=((e,t,n)=>{const r=document.createElement("canvas"),i=r.getContext("2d"),o=Er(e);let a=0,s=0;if(je(e)||Se(e)){const[n,l,c,d]=Ge(e);r.width=fn(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=fn(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?fn(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?fn(e.y,l)*window.devicePixelRatio*t.value:0,i.translate(a,s)}else r.width=e.width*window.devicePixelRatio*t.value+o*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+o*t.value*2;i.save(),i.translate(o*t.value,o*t.value),i.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);const l=xe.canvas(r);return wr(e,n)&&(i.filter=xr),jr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return Ir.set(e,r),r}return r},Dr=(e,t,n,r)=>{const i=e.element,o=Er(i);let[a,s,l,c]=Ge(i);Se(i)&&(a=Math.floor(a),l=Math.ceil(l),s=Math.floor(s),c=Math.ceil(c));const d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio,h=yr(i,r),p="scale"in e.element&&!h?e.element.scale[0]:1,g="scale"in e.element&&!h?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*p,1/window.devicePixelRatio*g),n.translate(d*p,u*g),n.rotate(i.angle*p*g),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},zr=(e,t,n,r)=>{const i=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Ar(e,i),r.isExporting){const t=Pr(e,r);Dr(t,0,n,r)}else{const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),jr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Ar(e,i),r.isExporting){const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),wr(e,r)&&(n.filter="none"),jr(e,t,n,r),n.restore()}else{const t=Pr(e,r);Dr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Nr=(e,t,n)=>{if(void 0===n)return e.draw(t);const r={sets:t.sets,shape:t.shape,options:Object.assign(Object.assign({},t.options),{fixedDecimalPlaceDigits:n})};return e.draw(r)},Rr=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ge(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,m=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{Ar(e,m);const r=Nr(t,Tr(e),o.zK),s=e.opacity/100;1!==s&&(r.setAttribute("stroke-opacity","".concat(s)),r.setAttribute("fill-opacity","".concat(s))),r.setAttribute("stroke-linecap","round"),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(r);break}case"line":case"arrow":{Ar(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),Tr(e).forEach((n=>{const l=Nr(t,n,o.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),"line"===e.type&&Re(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),n.appendChild(r);break}case"freedraw":{Br(e);const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=n.ownerDocument.createElementNS(o.hR,"path");r.setAttribute("stroke","none"),r.setAttribute("fill",e.strokeColor),s.setAttribute("d",Fr(e)),r.appendChild(s),n.appendChild(r);break}case"image":{const t=ke(e)&&r[e.fileId];if(t){const r="image-".concat(t.id);let l=n.querySelector("#".concat(r));if(!l){l=n.ownerDocument.createElementNS(o.hR,"symbol"),l.id=r;const e=n.ownerDocument.createElementNS(o.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),n.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",xr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(c)}break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=e.text.replace(/\r\n?/g,"\n").split("\n"),l=e.height/s.length,c=e.height-e.baseline,d="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,u=Cn(e.text)?"rtl":"ltr",m="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const i=n.ownerDocument.createElementNS(o.hR,"text");i.textContent=s[t],i.setAttribute("x","".concat(d)),i.setAttribute("y","".concat((t+1)*l-c)),i.setAttribute("font-family",pn(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",m),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}n.appendChild(r)}}},Hr=new WeakMap([]);function Br(e){const t=Fr(e),n=new Path2D(t);return Hr.set(e,n),n}function Fr(e){const t=e.simulatePressure?e.points:e.points.length?e.points.map(((t,n)=>{let[r,i]=t;return[r,i,e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";const t=e.length-1;return e.reduce(((e,n,r,i)=>(r===t?e.push(n,Ur(n,i[0]),"L",i[0],"Z"):e.push(n,Ur(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Vr,"$1")}(tr(t,n))}function Ur(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Vr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Wr=new O(Date.now());const Kr=()=>Math.floor(Wr.next()*2**31),Gr=()=>we(),Yr=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!1;const{points:i,fileId:o}=t;void 0!==i&&(t=Object.assign(Object.assign({},We(i)),t));for(const n in t){const i=t[n];if(void 0!==i){if(e[n]===i&&("object"!=typeof i||null===i||"groupIds"===n||"scale"===n))continue;if("scale"===n){const t=e[n],r=i;if(t[0]===r[0]&&t[1]===r[1])continue}else if("points"===n){const t=e[n],r=i;if(t.length===r.length){let e=!1,n=t.length;for(;--n;){const i=t[n],o=r[n];if(i[0]!==o[0]||i[1]!==o[1]){e=!0;break}}if(!e)continue}}e[n]=i,r=!0}}if(!r)return e;var a;(void 0===t.height&&void 0===t.width&&void 0===o&&void 0===i||Or(e),e.version++,e.versionNonce=Kr(),e.updated=On(),n)&&(null===(a=ir.getScene(e))||void 0===a||a.informMutation());return e},Zr=(e,t)=>{let n=!1;for(const r in t){const i=t[r];if(void 0!==i){if(e[r]===i&&("object"!=typeof i||null===i))continue;n=!0}}return n?Object.assign(Object.assign(Object.assign({},e),t),{updated:On(),version:e.version+1,versionNonce:Kr()}):e},qr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Kr(),e.updated=On(),e),Xr=e=>je(e)||Se(e)?e.points.length<2:0===e.width&&0===e.height,$r=(e,t,n)=>{const r=Math.abs(t),i=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(i/r)/o.ay)*o.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(r*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Jr=e=>{const t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){const n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){const n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Qr=(e,t,n)=>{const r=n.filter((t=>t.groupIds.includes(e)));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!1}),editingGroupId:null}):t:Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!0}),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),Object.fromEntries(r.map((e=>[e.id,!0]))))})},ei=(e,t)=>null!=ti(e,t),ti=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),ni=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),ri=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Ta(t,e);if(!r.length)return Object.assign(Object.assign({},n),{editingGroupId:null});for(const i of r){let r=i.groupIds;if(e.editingGroupId){const t=r.indexOf(e.editingGroupId);t>-1&&(r=r.slice(0,t))}if(r.length>0){const e=r[r.length-1];n=Qr(e,n,t)}}return n},ii=(e,t)=>e.groupIds.includes(t),oi=(e,t)=>e.filter((e=>ii(e,t))),ai=(e,t,n)=>{const r=[...e],i=n?r.indexOf(n):-1,o=i>-1?i:r.length;return r.splice(o,0,t),r};var si=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const li=(e,t)=>{var n,r;let{x:i,y:o,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,width:p=0,height:g=0,angle:m=0,groupIds:f=[],strokeSharpness:b,boundElements:x=null}=t,v=si(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements"]);return{id:v.id||Gr(),type:e,x:i,y:o,width:p,height:g,angle:m,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:f,strokeSharpness:b,seed:null!==(n=v.seed)&&void 0!==n?n:Kr(),version:v.version||1,versionNonce:null!==(r=v.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:x,updated:On()}},ci=e=>li(e.type,e),di=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ui=e=>{const t=lr(e.text,gn(e)),n=di(e,t);return Zr(Object.assign(Object.assign({},li("text",e)),{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline,containerId:e.containerId||null,originalText:e.text}),{})},hi=(e,t,n)=>{let{text:r,isDeleted:i,originalText:a}=t;const s=n?((e,t)=>{const n=e.containerId?e.width:null,{width:r,height:i,baseline:a}=lr(t,gn(e),n),{textAlign:s,verticalAlign:l}=e;let c,d;if("center"!==s||"middle"!==l||e.containerId){const[t,n,o,a]=Ge(e),[l,u,h,p]=et(e,r,i),g=(t-l)/2,m=(n-u)/2,f=(o-h)/2,b=(a-p)/2;[c,d]=ze({s:!0,e:"center"===s||"left"===s,w:"center"===s||"right"===s},e.x,e.y,e.angle,g,m,f,b)}else{const t=lr(e.text,gn(e),n),o=di(e,{width:r-t.width,height:i-t.height});c=e.x-o.x,d=e.y-o.y}if(Ae(e)){const t=ir.getScene(e).getElement(e.containerId);let n=t.height,a=t.width;i>n-2*o.tr&&(n=i+2*o.tr),r>a-2*o.tr&&(a=r+2*o.tr),n===t.height&&a===t.width||Yr(t,{height:n,width:a})}return{width:r,height:i,x:Number.isFinite(c)?c:e.x,y:Number.isFinite(d)?d:e.y,baseline:a}})(e,r):void 0;return Zr(e,Object.assign({text:r,originalText:a,isDeleted:null!=i?i:e.isDeleted},s))},pi=e=>Object.assign(Object.assign({},li(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),gi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){const n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(const r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=gi(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=gi(e[n],t+1);return r}return e},mi=(e,t,n,r)=>{let i=gi(n);return i.id=Gr(),i.updated=On(),i.seed=Kr(),i.groupIds=((e,t,n)=>{const r=[...e],i=t?e.indexOf(t):-1,o=i>-1?i:e.length;for(let e=0;e<o;e++)r[e]=n(r[e]);return r})(i.groupIds,e,(e=>(t.has(e)||t.set(e,Gr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},fi={mouse:8,pen:16,touch:28},bi={e:!0,s:!0,n:!0,w:!0},xi={e:!0,s:!0,n:!0,w:!0},vi={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},yi={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},wi=(e,t,n,r,i,o,a)=>{const[s,l]=Pe(e+n/2,t+r/2,i,o,a);return[s-n/2,l-r/2,n,r]},ki=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=fi[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,m=s-o,f=(i+a)/2,b=(o+s)/2,x=4/n.value,v=(c-8)/(2*n.value),y={nw:l.nw?void 0:wi(i-x-h+v,o-x-p+v,d,u,f,b,t),ne:l.ne?void 0:wi(a+x-v,o-x-p+v,d,u,f,b,t),sw:l.sw?void 0:wi(i-x-h+v,s+x-v,d,u,f,b,t),se:l.se?void 0:wi(a+x-v,s+x-v,d,u,f,b,t),rotation:l.rotation?void 0:wi(i+g/2-d/2,o-x-p+v-16/n.value,d,u,f,b,t)},w=5*fi.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=wi(i+g/2-d/2,o-x-p+v,d,u,f,b,t)),l.s||(y.s=wi(i+g/2-d/2,s+x-v,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=wi(i-x-h+v,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=wi(a+x-v,o+m/2-u/2,d,u,f,b,t))),y},_i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){const[,t]=e.points;0===t[0]||0===t[1]?r=yi:t[0]>0&&t[1]<0?r=vi:t[0]>0&&t[1]>0?r=yi:t[0]<0&&t[1]>0?r=vi:t[0]<0&&t[1]<0&&(r=yi)}}else Ee(e)&&(r=xi);return ki(Ge(e),e.angle,t,n,r)},Ei=(e,t)=>[0,0,0,0,t,e,1,0],Si=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Ci=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],ji=(e,t)=>Di(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]],Ii=(e,t)=>Di(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[Mi(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]],Mi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],Ti=(e,t)=>[Oi(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]],Oi=(e,t)=>e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0],Li=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),Ai=e=>{const t=Li(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return Ii(e,n/t)},Pi=e=>{const t=(e=>Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1])))(e);return 0===t||1===t?e:Ii(e,1/t)},Di=e=>"number"==typeof e,zi=(Si(1,1),Si(1,2),Si(1,3),Si(1,4),Si(1,5),Si(1,6),Si(1,7),(e,t,n)=>Ai([0,n,e,t,0,0,0,0])),Ni=(e,t)=>Ai(Ti(t,e)),Ri=(e,t)=>((e,t)=>[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]])(e,t),Hi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Bi=e=>[e[5],e[4]],Fi=(e,t)=>Ai(((e,t)=>[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]])(e,t)),Ui=(e,t)=>Li(Ti(e,t)),Vi=(e,t)=>Oi(e,t),Wi=e=>[0,0,0,0,e[4],e[5],0,0],Ki=(e,t)=>((e,t)=>Di(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]])(Ii(e,Math.sin(t/2)),Math.cos(t/2)),Gi=(e,t)=>Ai(Ii(Ii(e,t),Ci(e))),Yi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Zi(e,t,[n,r])&&Xi(e,[n,r],i)},Zi=(e,t,n)=>{const r=10/t.zoom.value,i=Ee(e)?to:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!Mn(e.backgroundColor)||Mn(e.backgroundColor)&&Le(e);return"line"===e.type?t&&Re(e.points):t||_e(e)})(e)?no:ro;return Qi({element:e,point:n,threshold:r,check:i})},qi=(e,t)=>e.selectedElementIds[t.id],Xi=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);return u>o-n&&u<s+n&&h>a-n&&h<l+n},$i=(e,t)=>{let{x:n,y:r}=t;const i=Ji(e,e.width,e.height);return Qi({element:e,point:[n,r],threshold:i,check:io})},Ji=(e,t,n)=>{const r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Qi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=eo(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(oo(e.element,e.point),e.threshold)&&co(e.element,e.point,e.threshold);case"arrow":case"line":return uo(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},eo=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return oo(e,t);case"diamond":return ao(e,t);case"ellipse":return so(e,t)}},to=(e,t)=>e<0,no=(e,t)=>e<t,ro=(e,t)=>Math.abs(e)<t,io=(e,t)=>0<=e&&e<t,oo=(e,t)=>{const[,n,r,i]=ho(e,t);return Math.max(Vi(n,zi(0,1,-i)),Vi(n,zi(1,0,-r)))},ao=(e,t)=>{const[,n,r,i]=ho(e,t),o=zi(i,r,-i*r);return Vi(n,o)},so=(e,t)=>{const[n,r]=lo(e,t);return-(e=>Math.sign(e[1]))(r)*Vi(n,r)},lo=(e,t)=>{const[,n,r,i]=ho(e,t),[o,a]=Bi(n);let s=.707,l=.707;const c=r,d=i;[0,1,2,3].forEach((e=>{const t=(c*c-d*d)*s**3/c,n=(d*d-c*c)*l**3/d,r=c*s-t,i=d*l-n,u=o-t,h=a-n,p=Math.hypot(i,r),g=Math.hypot(h,u);s=Math.min(1,Math.max(0,(u*p/g+t)/c)),l=Math.min(1,Math.max(0,(h*p/g+n)/d));const m=Math.hypot(l,s);s/=m,l/=m}));const u=Ei(c*s,d*l);var h;return[n,Ri(Ni(n,h=u),h)]},co=(e,t,n)=>{let r,i;if(0===e.angle)r=t[0]-e.x,i=t[1]-e.y;else{const[n,o,a,s]=Ge(e),l=De(t,[n+(a-n)/2,o+(s-o)/2],-e.angle);r=l[0]-e.x,i=l[1]-e.y}let o,[a,s]=e.points;if(Ne(a[0],a[1],r,i)<n||Ne(s[0],s[1],r,i)<n)return!0;for(let t=0;t<e.points.length;t++){const l=[s[0]-a[0],s[1]-a[1]],c=Math.hypot(l[1],l[0]),d=[l[0]/c,l[1]/c],u=[r-a[0],i-a[1]],h=(u[0]*d[0]+u[1]*d[1])/Math.hypot(d[1],d[0]);o=[a[0]+d[0]*h,a[1]+d[1]*h];const p=Ne(o[0],o[1],a[0],a[1]),g=Ne(o[0],o[1],s[0],s[1]);if(o=g<p&&p>c?s:p<g&&g>c?a:o,Math.hypot(i-o[1],r-o[0])<n)return!0;a=s,s=e.points[t+1]}return!1},uo=e=>{const{element:t,threshold:n}=e;if(!Tr(t))return!1;const[r,i,o,a]=ho(e.element,e.point),s=zi(0,1,-a),l=zi(1,0,-o);if(!no(Vi(i,s),n)||!no(Vi(i,l),n))return!1;const[c,d]=Bi(r),u=Tr(t);if(e.check===no){if(u.some((e=>Eo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>So(e,c,d,n)))},ho=(e,t)=>{const n=Hi(t),r=Ge(e),i=go(r),o=Ki(i,e.angle),a=Gi(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(ji(a,Wi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=ji(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},po=e=>{const t=Ge(e),n=go(t),r=Ki(n,e.angle),i=Ci((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Wi(n)));return Ii(i,r)},go=e=>{let[t,n,r,i]=e;return Ei((t+r)/2,(n+i)/2)},mo=(e,t,n)=>{const r=po(e),i=Gi(r,Hi(t)),o=Gi(r,Hi(n)),a=Ni(i,o),s=e.height/e.width,l=e.width/2,c=e.height/2,d=a[2],u=a[3],h=a[1],p=Math.abs(u),g=Math.abs(d);switch(e.type){case"rectangle":case"image":case"text":return h/(l*(g+s*p));case"diamond":return p<g?h/(g*l):h/(p*c);case"ellipse":return h/(l*Math.sqrt(d**2+s**2*u**2))}},fo=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":const n=bo(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return xo(t,vo(o,i))})).concat(n.flatMap((e=>wo(e,i,t))));break;case"ellipse":r=yo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ui(e,n)-Ui(t,n)));return[o[0],o[o.length-1]]},bo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Ei(n,r),Ei(n,-r),Ei(-n,-r),Ei(-n,r)];case"diamond":return[Ei(0,r),Ei(n,0),Ei(0,-r),Ei(-n,0)]}},xo=(e,t)=>{const[n,r]=t;return Vi(n,e)*Vi(r,e)>=0?[]:[Fi(e,Ni(n,r))]},vo=(e,t)=>{const[n,r]=e,i=((e,t)=>{const n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]})(((e,t)=>Pi([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Gi(i,n),Gi(i,r)]},yo=(e,t,n)=>{const r=e.width/2+t,i=e.height/2+t,o=n[2],a=n[3],s=n[1],l=r*r*o*o+i*i*a*a,c=l-s*s;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=-r*r*o*s,h=-i*i*a*s;return[Ei((u+r*i*a*d)/l,(h-r*i*o*d)/l),Ei((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},wo=(e,t,n)=>{if(0===t)return 0===Vi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Bi(e),l=r*r+i*i,c=t*t*l-(r*a+i*s+o)**2;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=a*i*i-s*r*i-r*o,h=s*r*r-a*r*i-i*o;return[Ei((u+i*d)/l,(h-r*d)/l),Ei((u-i*d)/l,(h+r*d)/l)]},ko=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Bi(n),c=0===l?1e-4:l,d=s**2*o**2+c**2*i**2,u=(-s*o**2+a*c*Math.sqrt(Math.max(0,d-i**2*o**2)))/d,h=(-u*s-1)/c,p=-(i**2)*u/(h**2*o**2+u**2*i**2);return Ei(p,(-u*p-1)/h)},_o=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=bo(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ni(n,e)[1];t>a&&(a=t,s=e)})),s},Eo=(e,t,n,r)=>{const i=Ye(e),o=[];let a=!1;for(const e of i)"move"===e.op?(a=!a,a&&o.push([e.data[0],e.data[1]])):"bcurveTo"===e.op&&a&&(o.push([e.data[0],e.data[1]]),o.push([e.data[2],e.data[3]]),o.push([e.data[4],e.data[5]]));if(o.length>=4){if("sharp"===r)return He(o,t,n);const e=he(o,10,5);return He(e,t,n)}return!1},So=(e,t,n,r)=>{const i=Ye(e);let o=[0,0];return i.some(((e,i)=>{let{op:a,data:s}=e;if("move"===a)o=s;else if("bcurveTo"===a){const e=[s[0],s[1]],i=[s[2],s[3]],a=[s[4],s[5]],l=o;o=a;const c=((e,t,n,r,i,o)=>{let[a,s]=i;const l=(i,o)=>Math.pow(1-i,3)*r[o]+3*i*Math.pow(1-i,2)*n[o]+3*Math.pow(i,2)*(1-i)*t[o]+e[o]*Math.pow(i,3);let c=0;for(;c<=1;){const e=l(c,0),t=l(c,1);if(Math.sqrt(Math.pow(e-a,2)+Math.pow(t-s,2))<o)return!0;c+=.01}return!1})(l,e,i,a,[t,n],r);return c}return!1}))};var Co=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const jo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],Io=(e,t,n,r,i,o)=>e.reduce(((e,a)=>{if(e)return e;const s=((e,t,n,r,i,o)=>{if(!t.selectedElementIds[e.id])return!1;const a=_i(e,i,o),{rotation:s}=a,l=Co(a,["rotation"]);if(s&&jo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&jo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),Mo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=ki([o,a,s,l],0,r,i,bi);return Object.keys(c).find((e=>{const r=c[e];return r&&jo(r,t,n)}))||!1},To=["ns","nesw","ew","nwse"],Oo=e=>{const{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1;let i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":i=r?"nesw":"nwse";break;case"ne":case"sw":i=r?"nwse":"nesw";break;case"rotation":return"grab"}return i&&t&&(i=((e,t)=>{const n=To.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=To[(n+r)%To.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Lo{constructor(e,t){this.elementId=e.id,ir.mapElementToScene(this.elementId,t),Lo.normalizePoints(e),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}static getElement(e){var t;const n=null===(t=ir.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}static handleBoxSelection(e,t,n){var r;if(!t.editingLinearElement||"selection"!==(null===(r=t.draggingElement)||void 0===r?void 0:r.type))return!1;const{editingLinearElement:i}=t,{selectedPointsIndices:o,elementId:a}=i,s=Lo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ge(t.draggingElement),h=Lo.getPointsGlobalCoordinates(s).reduce(((t,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=c&&n[1]<=u||e.shiftKey&&null!=o&&o.includes(r))&&t.push(r),t)),[]);n({editingLinearElement:Object.assign(Object.assign({},i),{selectedPointsIndices:h.length?h:null})})}static handlePointDragging(e,t,n,r,i){if(!e.editingLinearElement)return!1;const{editingLinearElement:o}=e,{selectedPointsIndices:a,elementId:s,isDragging:l}=o,c=Lo.getElement(s);if(!c)return!1;const d=c.points[o.pointerDownState.lastClickedPoint];if(a&&d){!1===l&&t({editingLinearElement:Object.assign(Object.assign({},o),{isDragging:!0})});const s=Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(Lo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize):[c.points[t][0]+u,c.points[t][1]+h],isDragging:t===o.pointerDownState.lastClickedPoint})))),Me(c)){const e=[];0===a[0]&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[t]))),e.length&&i(c,e)}return!0}return!1}static handlePointerUp(e,t,n){var r;const{elementId:i,selectedPointsIndices:o,isDragging:a,pointerDownState:s}=t,l=Lo.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){Re(l.points,n.zoom.value)&&Lo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Po(n)?Ko(jn(Lo.getPointAtIndexGlobalCoordinates(l,e)),ir.getScene(l)):null;c[0===e?"startBindingElement":"endBindingElement"]=t}return Object.assign(Object.assign(Object.assign({},t),c),{selectedPointsIndices:a||e.shiftKey?!a&&e.shiftKey&&null!==(r=s.prevSelectedPointsIndices)&&void 0!==r&&r.includes(s.lastClickedPoint)?o&&o.filter((e=>e!==s.lastClickedPoint)):o:null!=o&&o.includes(s.lastClickedPoint)?[s.lastClickedPoint]:o,isDragging:!1,pointerOffset:{x:0,y:0}})}static handlePointerDown(e,t,n,r,i){var o;const a={didAddPoint:!1,hitElement:null};if(!t.editingLinearElement)return a;const{elementId:s}=t.editingLinearElement,l=Lo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Yr(l,{points:[...l.points,Lo.createPointAt(l,i.x,i.y,t.gridSize)]}),r.resumeRecording(),n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[l.points.length-1],lastUncommittedPoint:null,endBindingElement:Ko(i,ir.getScene(l))})}),a.didAddPoint=!0,a;const c=Lo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Po(t)&&Me(l)&&Do(l,e,n)}const[d,u,h,p]=Ge(l),g=(d+h)/2,m=(u+p)/2,f=c>-1&&Pe(l.x+l.points[c][0],l.y+l.points[c][1],g,m,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?Ao([...t.editingLinearElement.selectedPointsIndices||[],c]):[c]:null;return n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:c},selectedPointsIndices:b,pointerOffset:f?{x:i.x-f[0],y:i.y-f[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=Lo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&Lo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=Lo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?Lo.movePoints(s,[{index:s.points.length-1,point:d}]):Lo.addPoints(s,[{point:d}]),Object.assign(Object.assign({},r),{lastUncommittedPoint:s.points[s.points.length-1]})}static getPointGlobalCoordinates(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;let{x:l,y:c}=e;return[l,c]=Pe(l+t[0],c+t[1],a,s,e.angle),[l,c]}static getPointsGlobalCoordinates(e){const[t,n,r,i]=Ge(e),o=(t+r)/2,a=(n+i)/2;return e.points.map((t=>{let{x:n,y:r}=e;return[n,r]=Pe(n+t[0],r+t[1],o,a,e.angle),[n,r]}))}static getPointAtIndexGlobalCoordinates(e,t){const n=t<0?e.points.length+t:t,[r,i,o,a]=Ge(e),s=(r+o)/2,l=(i+a)/2,c=e.points[n],{x:d,y:u}=e;return Pe(d+c[0],u+c[1],s,l,e.angle)}static pointFromAbsoluteCoords(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2,[l,c]=Pe(t[0],t[1],a,s,-e.angle);return[l-e.x,c-e.y]}static getPointIndexUnderCursor(e,t,n,r){const i=this.getPointsGlobalCoordinates(e);let o=i.length;for(;--o>-1;){const e=i[o];if(Ne(n,r,e[0],e[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return o}return-1}static createPointAt(e,t,n,r){const i=Ve(t,n,r),[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(i[0],i[1],c,d,-e.angle);return[u-e.x,h-e.y]}static getNormalizedPoints(e){const{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(((e,t)=>[e[0]-n,e[1]-r])),x:e.x+n,y:e.y+r}}static normalizePoints(e){Yr(e,Lo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=Lo.getElement(n);if(!r||null===t)return!1;const{points:i}=r,o=[];let a=!1,s=-1;const l=i.reduce(((e,n,r)=>{++s,e.push(n);if(t.includes(r)){const t=i[r+1];t||(a=!0),e.push(t?[(n[0]+t[0])/2,(n[1]+t[1])/2]:[n[0],n[1]]),o.push(s+1),++s}return e}),[]);if(Yr(r,{points:l}),a){const e=r.points[r.points.length-1];Lo.movePoints(r,[{index:r.points.length-1,point:[e[0]+30,e[1]+30]}])}return{appState:Object.assign(Object.assign({},e),{editingLinearElement:Object.assign(Object.assign({},e.editingLinearElement),{selectedPointsIndices:o})})}}static deletePoints(e,t){let n=0,r=0;if(t.includes(0)){const i=e.points.find(((e,n)=>!t.includes(n)));i&&(n=i[0],r=i[1])}const i=e.points.reduce(((e,i,o)=>(t.includes(o)||e.push(e.length?[i[0]-n,i[1]-r]:[0,0]),e)),[]);Lo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];Lo._updatePoints(e,n,0,0)}static movePoints(e,t,n){const{points:r}=e;let i=0,o=0;const a=t.find((e=>{let{index:t}=e;return 0===t}));a&&(i=a.point[0]-r[a.index][0],o=a.point[1]-r[a.index][1]);const s=r.map(((e,n)=>{const s=t.find((e=>e.index===n));if(s){if(a)return e;const t=s.point[0]-r[s.index][0],n=s.point[1]-r[s.index][1];return[e[0]+t,e[1]+n]}return i||o?[e[0]-i,e[1]-o]:e}));Lo._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=tt(e,t,e.strokeSharpness||"round"),a=tt(e,e.points,e.strokeSharpness||"round"),s=(o[0]+o[2])/2,l=(o[1]+o[3])/2,c=(a[0]+a[2])/2,d=(a[1]+a[3])/2,u=Pe(n,r,c-s,d-l,e.angle);Yr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Lo.POINT_HANDLE_SIZE=20;const Ao=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Po=e=>e.isBindingEnabled,Do=(e,t,n)=>{const r=new Set,i=new Set;zo(e,t,n,"start",r,i),zo(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));ir.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Yr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},zo=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Fo(e,t,r):"start"!==r&&n.id===t.id)||(Bo(e,t,r),i.add(t.id));else{const t=Wo(e,r);null!=t&&o.add(t)}},No=e=>{e.forEach((e=>{Me(e)?Do(e,Qo(e,"start"),Qo(e,"end")):Oe(e)&&Ro(e)}))},Ro=e=>{ta(e).forEach((t=>{let[n,r]=t;return Do(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Ho=(e,t,n,r)=>{null!=t.startBoundElement&&Bo(e,t.startBoundElement,"start");const i=Ko(r,n);null==i||Fo(e,i,"end")||Bo(e,i,"end")},Bo=(e,t,n)=>{Yr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Go(e,t,n))});Ln(t.boundElements||[]).has(e.id)||Yr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Fo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Uo(e,null==r?void 0:r.elementId,t)},Uo=(e,t,n)=>t===n.id&&e.points.length<3,Vo=e=>{e.forEach((e=>{Me(e)&&Do(e,null,null)}))},Wo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Yr(e,{[n]:null}),r.elementId)},Ko=(e,t)=>Fa(t.getElements(),(t=>Oe(t)&&$i(t,e))),Go=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=Lo.getPointAtIndexGlobalCoordinates(e,i),s=Lo.getPointAtIndexGlobalCoordinates(e,o);return{focus:mo(t,s,a),gap:Math.max(1,eo(t,a))}},Yo=(e,t)=>{var n;const r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((e=>"arrow"===e.type));if(0===r.length)return;const{newSize:i,simultaneouslyUpdated:o}=null!=t?t:{},a=qo(o);ir.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Zo(t,n))return;const r=$o(n,t.startBinding,i),o=$o(n,t.endBinding,i);a.has(t.id)?Yr(t,{startBinding:r,endBinding:o}):(Xo(t,"start",r,e),Xo(t,"end",o,e))}))},Zo=(e,t)=>{var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},qo=e=>new Set((e||[]).map((e=>e.id))),Xo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=ir.getScene(e).getElement(n.elementId);if(null==i)return;const o="start"===t?-1:1,a=-1===o?0:e.points.length-1,s=a-o,l=Lo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ge(e),n=go(t);return Bi(n)}const r=po(e),i=Gi(r,Hi(n)),o=Ci(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=_o(e,t,i);break;case"ellipse":a=ko(e,t,i)}return Bi(Gi(o,a))})(i,n.focus,l);let d;if(0===n.gap)d=c;else{const e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=po(e),o=Gi(i,Hi(t)),a=Gi(i,Hi(n)),s=Ni(o,a),l=Ci(i);return fo(e,s,o,r).map((e=>Bi(Gi(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}Lo.movePoints(e,[{index:a,point:Lo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},$o=(e,t,n)=>{if(null==t||null==n)return t;const{gap:r,focus:i,elementId:o}=t,{width:a,height:s}=n,{width:l,height:c}=e;return{elementId:o,gap:Math.max(1,Math.min(Ji(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Jo=e=>[Qo(e,"start"),Qo(e,"end")].filter((e=>null!=e)),Qo=(e,t)=>Ko(ea(e,t),ir.getScene(e)),ea=(e,t)=>{const n="start"===t?0:-1;return jn(Lo.getPointAtIndexGlobalCoordinates(e,n))},ta=e=>ir.getScene(e).getElements().map((t=>{if(!Me(t))return null;const n=na(t,"start",e),r=na(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),na=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Fo(e,n,t)&&$i(n,ea(e,t)),ra=(e,t,n,r)=>{const i=new Set,o=new Set,a="duplicatesServeAsOld"===r;t.forEach((e=>{const{boundElements:t}=e;if(null!=t&&t.length>0&&(t.forEach((e=>{a&&!n.has(e.id)&&i.add(e.id)})),o.add(n.get(e.id))),Me(e)){if(null!=e.startBinding){const{elementId:t}=e.startBinding;a&&!n.has(t)&&o.add(t)}if(null!=e.endBinding){const{elementId:t}=e.endBinding;a&&!n.has(t)&&o.add(t)}null==e.startBinding&&null==e.endBinding||i.add(n.get(e.id))}})),e.filter((e=>{let{id:t}=e;return i.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:ia(t,n),endBinding:ia(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Yr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},ia=(e,t)=>{var n;if(null==e)return null;const{elementId:r,focus:i,gap:o}=e;return{focus:i,gap:o,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},oa=(e,t)=>{const n=new Set(t.map((e=>e.id))),r=new Set;t.forEach((e=>{var t;Oe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:aa(t,n),endBinding:aa(r,n)})}))},aa=(e,t)=>null==e||t.has(e.elementId)?null:e,sa=e=>e>=2*Math.PI?e-2*Math.PI:e,la=(e,t,n,r)=>{const[i,a,s,l]=Ge(e),c=(i+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);r&&(u+=o.ay/2,u-=u%o.ay),u=sa(u),Yr(e,{angle:u});const h=br(e);if(h){const t=ir.getScene(e).getElement(h);Yr(t,{angle:u})}},ca=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let[p,g]="end"===t?[u-e.x,h-e.y]:[e.x+e.points[1][0]-u,e.y+e.points[1][1]-h];n&&([p,g]=((e,t,n,r)=>{const i=$r(e,...Pe(t,n,0,0,r));return Pe(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[m,f]=ze("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-p)/2,(e.points[1][1]-g)/2);Yr(e,{x:m,y:f,points:[[0,0],[p,g]]})},da=(e,t,n)=>je(e)||Se(e)?{points:Ke(0,t,Ke(1,n,e.points))}:{},ua=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=lr(e.text,gn({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},ha=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let p;switch(t){case"se":p=Math.max((u-o)/(s-o),(h-a)/(l-a));break;case"nw":p=Math.max((s-u)/(s-o),(l-h)/(l-a));break;case"ne":p=Math.max((u-o)/(s-o),(l-h)/(l-a));break;case"sw":p=Math.max((s-u)/(s-o),(h-a)/(l-a))}if(p>0){const r=e.width*p,i=e.height*p,c=ua(e,r,i);if(null===c)return;const[d,u,h,g]=et(e,r,i),m=(o-d)/2,f=(a-u)/2,b=(s-h)/2,x=(l-g)/2,[v,y]=ze(((e,t)=>({n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}))(t,n),e.x,e.y,e.angle,m,f,b,x);Yr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x:v,y})}},pa=(e,t,n,r,i,o,a)=>{const[s,l,c,d]=et(e,e.width,e.height),u=[s,l],h=[c,d],p=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(u,h),g=De([o,a],p,-e.angle),[m,f,b,x]=et(n,n.width,n.height),v=br(n),y=b-m,w=x-f;let k=(h[0]-u[0])/y,_=(h[1]-u[1])/w;r.includes("e")&&(k=(g[0]-u[0])/y),r.includes("s")&&(_=(g[1]-u[1])/w),r.includes("w")&&(k=(h[0]-g[0])/y),r.includes("n")&&(_=(h[1]-g[1])/w);const E=e.width,S=e.height;let C=n.width*k,j=n.height*_;if(i&&(C=2*C-E,j=2*j-S),t){const e=Math.abs(C)/E,t=Math.abs(j)/S;if(1===r.length&&(j*=e,C*=t),2===r.length){const n=Math.max(e,t);C=E*n*Math.sign(C),j=S*n*Math.sign(j)}}const[I,M,T,O]=et(e,C,j),L=T-I,A=O-M;if((L<0||A<0)&&v)return;let P=[...u];if(["n","w","nw"].includes(r)&&(P=[h[0]-Math.abs(L),h[1]-Math.abs(A)]),"ne"===r){const e=[u[0],h[1]];P=[e[0],e[1]-Math.abs(A)]}if("sw"===r){const e=[h[0],u[1]];P=[e[0]-Math.abs(L),e[1]]}t&&(["s","n"].includes(r)&&(P[0]=p[0]-L/2),["e","w"].includes(r)&&(P[1]=p[1]-A/2)),C<0&&(r.includes("e")&&(P[0]-=Math.abs(L)),r.includes("w")&&(P[0]+=Math.abs(L))),j<0&&(r.includes("s")&&(P[1]-=Math.abs(A)),r.includes("n")&&(P[1]+=Math.abs(A))),i&&(P[0]=p[0]-Math.abs(L)/2,P[1]=p[1]-Math.abs(A)/2);const D=e.angle,z=De(P,p,D),N=[P[0]+Math.abs(L)/2,P[1]+Math.abs(A)/2],R=De(N,p,D);P=De(z,R,-D);const H=da(e,C,j),B=[...P];B[0]+=e.x-I,B[1]+=e.y-M;const F=Object.assign({width:Math.abs(C),height:Math.abs(j),x:B[0],y:B[1]},H);"scale"in n&&"scale"in e&&Yr(n,{scale:[(Math.sign(k)||e.scale[0])*e.scale[0],(Math.sign(_)||e.scale[1])*e.scale[1]]});let U=0;if(v){const e=ir.getScene(n).getElement(v);U=mr(gn(e))}F.width>U&&0!==F.height&&Number.isFinite(F.x)&&Number.isFinite(F.y)&&(Yo(n,{newSize:{width:F.width,height:F.height}}),Yr(n,F),sr([n],r))},ga=(e,t,n,r)=>{const[i,o,a,s]=Qe(e);let l,c;switch(t){case"se":l=Math.max((n-i)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[r,a]=t,[s,c]=n;return{x:e.x+(r-i)*(l-1)+r-s,y:e.y+(a-o)*(l-1)+a-c}};break;case"nw":l=Math.max((a-n)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[,,r,i]=t,[,,o,c]=n;return{x:e.x-(a-r)*(l-1)+r-o,y:e.y-(s-i)*(l-1)+i-c}};break;case"ne":l=Math.max((n-i)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[r,,,o]=t,[a,,,c]=n;return{x:e.x+(r-i)*(l-1)+r-a,y:e.y-(s-o)*(l-1)+o-c}};break;case"sw":l=Math.max((a-n)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[,r,i]=t,[,s,c]=n;return{x:e.x-(a-i)*(l-1)+i-c,y:e.y+(r-o)*(l-1)+r-s}}}if(l>0){const t=e.reduce(((t,n)=>{if(!t)return t;const r=n.width*l,i=n.height*l;let o={};if(Ee(n)){const e=ua(n,r,i);if(null===e)return null;o={fontSize:e.size,baseline:e.baseline}}const a=Ge(n),s=da(n,r,i);Yo(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const d=et(Object.assign(Object.assign({},n),s),r,i),{x:u,y:h}=c(n,a,d);return[...t,Object.assign(Object.assign({width:r,height:i,x:u,y:h},s),o)]}),[]);t&&e.forEach(((e,n)=>{Yr(e,t[n])}))}},ma=(e,t,n,r,i,a,s)=>{let l=5*Math.PI/2+Math.atan2(r-s,n-a);i&&(l+=o.ay/2,l-=l%o.ay),t.forEach(((t,n)=>{var r,i;const[o,c,d,u]=Ge(t),h=(o+d)/2,p=(c+u)/2,g=null!==(r=null===(i=e.originalElements.get(t.id))||void 0===i?void 0:i.angle)&&void 0!==r?r:t.angle,[m,f]=Pe(h,p,a,s,l+g-t.angle);Yr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:sa(l+g)});const b=br(t);if(b){const e=ir.getScene(t).getElement(b);Yr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:sa(l+g)})}}))},fa=(e,t,n,r,i,o)=>{let a,s;if(e){const l=e&&t<n,c=e&&t>n,d=r.originalElements.get(i.id);a=l&&d?d.x:i.x+o.x,s=c&&d?d.y:i.y+o.y}else a=i.x+o.x,s=i.y+o.y;Yr(i,{x:a,y:s})},ba=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=$r(t,a,o<r?-s:s)),s<0&&(s=-s)));let u=i<n?n-a:n,h=o<r?r-s:r;c&&(u=n-(a+=a)/2,h=r-(s+=s)/2),0!==a&&0!==s&&Yr(e,{x:u,y:h,width:a,height:s})},xa=e=>e.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"),va=(e,t,n,r,i,o)=>{const{zoom:a,offsetTop:s,offsetLeft:l}=r,c=180*n/Math.PI;let d=(e-2*l)*(a.value-1)/2,u=(t-2*s)*(a.value-1)/2;return e>i&&1!==a.value&&(d=(i-2*l)*(a.value-1)/2),t>o&&1!==a.value&&(u=(o-2*s)*(a.value-1)/2),"translate(".concat(d,"px, ").concat(u,"px) scale(").concat(a.value,") rotate(").concat(c,"deg)")},ya=e=>{let{id:t,appState:n,onChange:r,onSubmit:i,getViewportCoords:a,element:s,canvas:l,excalidrawContainer:c}=e;let d,u=Ee(s)?dr(gn(s)):0;const h=()=>{var e;const r=null===(e=ir.getScene(s))||void 0===e?void 0:e.getElement(t);if(r&&Ee(r)){let e=r.x,t=r.y,s=null!=r&&r.containerId?ir.getScene(r).getElement(r.containerId):null,l=r.width,h=r.height,g=r.width;const m=0===p.scrollHeight?r.height:p.scrollHeight;if(s&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replaceAll('"',"");return pn({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,p);if(n){var i;const e=null===(i=ir.getScene(r))||void 0===i?void 0:i.getElement(r.containerId);if(u=Ee(r)?dr(gn(r)):0,r.height>e.height-2*o.tr){const e=r.height+2*o.tr;d=e,Yr(s,{height:e}),s=Object.assign(Object.assign({},s),{height:e})}p.style.height="".concat(r.height,"px")}if(d||(d=s.height),l=s.width-2*o.tr,h=s.height-2*o.tr,g=l,e=s.x+o.tr,p.scrollHeight>h){const e=Math.min(p.scrollHeight-h,u);return void Yr(s,{height:s.height+e})}if(s.height>d&&p.scrollHeight<h){const e=Math.min(h-p.scrollHeight,u);Yr(s,{height:s.height-e})}else{(p.scrollHeight/u>1||n)&&(t=s.y+s.height/2-p.scrollHeight/2)}}const[f,b]=a(e,t),{textAlign:x,angle:v}=r;p.value=r.originalText||r.text;const y=r.originalText.split("\n"),w=r.containerId?u:r.height/y.length;s||(l=(n.width-f-8)/n.zoom.value-Number(getComputedStyle(null==c?void 0:c.parentNode).marginRight.slice(0,-2)));const k=(n.height-b)/n.zoom.value;Object.assign(p.style,{font:gn(r),lineHeight:"".concat(w,"px"),width:"".concat(g,"px"),height:"".concat(m,"px"),left:"".concat(f,"px"),top:"".concat(b,"px"),transform:va(g,m,v,n,l,k),textAlign:x,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(l,"px"),maxHeight:"".concat(k,"px")})}},p=document.createElement("textarea");p.dir="auto",p.tabIndex=0,p.dataset.type="wysiwyg",p.wrap="off",p.classList.add("excalidraw-wysiwyg");let g="pre",m="normal";Ae(s)&&(g="pre-wrap",m="break-word"),Object.assign(p.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:m,whiteSpace:g,overflowWrap:"break-word"}),h(),r&&(p.oninput=()=>{const e=p.scrollHeight/u;Ae(s)&&e>1&&(p.style.height="auto",p.style.height="".concat(p.scrollHeight,"px")),r(xa(p.value))}),p.onkeydown=e=>{if(e.stopPropagation(),e.key===Ht)e.preventDefault(),k=!0,_();else if(e.key===Rt&&e[zt]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;k=!0,_()}else(e.key===Ut||e[zt]&&(e.code===mt||e.code===gt))&&(e.preventDefault(),e.shiftKey||e.code===mt?v():x(),p.dispatchEvent(new Event("input")))};const f=" ".repeat(4),b=new RegExp("^ {1,".concat(4,"}")),x=()=>{const{selectionStart:e,selectionEnd:t}=p,n=y();let r=p.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(f).concat(n)})),p.value=r,p.selectionStart=e+4,p.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=p,n=y(),r=[];let i=p.value;n.forEach((e=>{const t=i.slice(e,e+4).match(b);if(t){const n=i.slice(0,e),o=i.slice(e+t[0].length);i="".concat(n).concat(o),r.push(e)}})),p.value=i,r.length&&(e>r[r.length-1]?p.selectionStart=Math.max(e-4,r[r.length-1]):p.selectionStart=e,p.selectionEnd=Math.max(p.selectionStart,t-4*r.length))},y=()=>{let{selectionStart:e,selectionEnd:t,value:n}=p;const r=n.slice(0,e).match(/[^\n]*$/)[0].length;e-=r;return n.slice(e,t).split("\n").reduce(((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e)),[]).reverse()},w=e=>{e.preventDefault(),e.stopPropagation()};let k=!1;const _=()=>{var e;E();const t=null===(e=ir.getScene(s))||void 0===e?void 0:e.getElement(s.id);if(!t)return;let n="";if(Ee(t)&&null!=t&&t.containerId){const e=ir.getScene(t).getElement(t.containerId);if(e&&(n=pr(p.value,gn(t),e.width),Ee(t)&&t.containerId)){const n=Number(p.style.height.slice(0,-2));if(p.value){Yr(t,{y:e.y+e.height/2-n/2,height:n,width:Number(p.style.width.slice(0,-2)),x:e.x+o.tr});const r=br(e);r&&r===s.id||Yr(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:s.id})})}else{var r;Yr(e,{boundElements:null===(r=e.boundElements)||void 0===r?void 0:r.filter((e=>"text"!==e.type))})}}}else n=p.value;i({text:xa(n),viaKeyboard:k,originalText:p.value})},E=()=>{I||(I=!0,p.onblur=null,p.oninput=null,p.onkeydown=null,M&&M.disconnect(),window.removeEventListener("resize",h),window.removeEventListener("wheel",w,!0),window.removeEventListener("pointerdown",C),window.removeEventListener("pointerup",S),window.removeEventListener("blur",_),j(),p.remove())},S=e=>{window.removeEventListener("pointerup",S);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&hn(t);setTimeout((()=>{p.onblur=_,t&&n&&(t.onblur=()=>{p.focus()}),n||p.focus()}))},C=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&hn(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!hn(e.target)||t)&&(p.onblur=null,window.addEventListener("pointerup",S),window.addEventListener("blur",_))},j=ir.getScene(s).addCallback((()=>{var e;h();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||p.focus()}));let I=!1;p.select(),S();let M=null;l&&"ResizeObserver"in window?(M=new window.ResizeObserver((()=>{h()})),M.observe(l)):window.addEventListener("resize",h),window.addEventListener("pointerdown",C),window.addEventListener("wheel",w,{passive:!1,capture:!0}),null==c||c.querySelector(".excalidraw-textEditorContainer").appendChild(p)},wa=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Ta(t,e).length||"selection"!==e.elementType)),ka=e=>e.reduce(((e,t)=>e+t.version),0),_a=e=>e.filter((e=>!e.isDeleted)),Ea=e=>!e.isDeleted,Sa=e=>_a(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ca=e=>Sa(e),ja=e=>Sa(e),Ia=(e,t,n)=>{const[r,i]=[e.horizontal,e.vertical].map((e=>null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height));return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Ma=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Ta=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&Ae(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Oa=(e,t)=>t.editingElement?[t.editingElement]:Ta(e,t),La=e=>{let{scenePoint:t,viewportDimensions:n,zoom:r}=e;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},Aa=(e,t,n)=>{if(!(e=(e=>e.filter((e=>!e.isDeleted&&!Xr(e))))(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=Qe(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=_n({sceneX:r,sceneY:i},e),{x:c,y:d}=_n({sceneX:o,sceneY:a},e);return c-s>e.width||d-l>e.height})(t,0,[r,i,o,a])&&([r,i,o,a]=((e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0];return e.forEach((e=>{const[i,o,a,s]=Je(e),l=Ne((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),Je(r)})(e,kn({clientX:t.scrollX,clientY:t.scrollY},t)));return La({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Pa=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e,Da=e=>"image"!==e,za=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Na=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Ra=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ha=e=>"text"===e,Ba=e=>"arrow"===e,Fa=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){const i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Ua=(e,t,n,r)=>{let i=null;for(let o=e.length-1;o>=0;--o){if(e[o].isDeleted)continue;const[a,s,l,c]=Ge(e[o]);if(a<t&&t<l&&s<n&&n<c&&e[o].type!==r){i=e[o];break}}return i},Va=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},Wa=e=>{const t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,30))};n(5422);class Ka extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";super(),this.name=t,this.message=e}}class Ga extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const Ya=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,x.jsx)("div",{className:"Spinner",children:(0,x.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,x.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},Za=i().forwardRef(((e,t)=>{const{id:n}=Zh(),o=i().useRef(null);i().useImperativeHandle(t,(()=>o.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(!0),d=async t=>{var n;const r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t));if(r&&"then"in r)try{l(!0),await r}catch(e){if(!(e instanceof Ga))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,r.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,r.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,x.jsxs)("button",{className:ye("ToolIcon_type_button",a,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:t,onClick:d,ref:o,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,x.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,x.jsx)(Ya,{})]}),e.showAriaLabel&&(0,x.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,x.jsx)(Ya,{})]}),e.children]})}return(0,x.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:e=>{u.current=e.pointerType||null},onPointerUp:()=>{requestAnimationFrame((()=>{u.current=null}))},children:[(0,x.jsx)("input",{className:"ToolIcon_type_radio ".concat(a),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:u.current})},checked:e.checked,ref:o}),(0,x.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Za.defaultProps={visible:!0,className:"",size:"medium"};const qa=e=>e===o.C6.LIGHT?rt.orange[4]:rt.orange[9],Xa=e=>e===o.C6.LIGHT?rt.white:"#1e1e1e",$a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;const{width:n=512,height:r=n,mirror:i,style:o}="number"==typeof t?{width:t}:t;return(0,x.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:ye({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,x.jsx)("path",{fill:"currentColor",d:e}):e})},Ja=$a((0,x.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Qa=$a("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),es=$a("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),ts=$a("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),ns=$a("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),rs=$a("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),is=$a("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),os=$a("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),as=$a("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),ss=$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,x.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0}),ls=$a("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),cs=$a("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),ds=$a("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),us=$a("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),hs=$a("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),ps=$a("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),gs=$a("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),ms=$a("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),fs=($a("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),$a("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),(0,x.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),$a((0,x.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),xs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),_s=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Es=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Ss=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Cs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Is=$a("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),Ms=($a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),$a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),$a("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Ts=$a("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Os=$a("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),Ls=($a("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),$a("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512})),As=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ps=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ds=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),zs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,x.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,x.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),Ns=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Rs=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return $a((0,x.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),Hs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Fs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Us=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Gs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),Zs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,x.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,x.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),qs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),Xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,x.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),$s=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),Js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),Qs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),el=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),tl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),nl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),rl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),il=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)(x.Fragment,{children:(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),ol=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),al=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:"var(--icon-fill-color)"}),{width:448,height:512})})),sl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),ll=$a((0,x.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});let cl=[];const dl=e=>(cl=cl.concat(e),e),ul=(e,t)=>{if(e.editingGroupId){const n=oi(_a(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},hl=dl({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=Lo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=ul(t,n);return{elements:n,appState:Object.assign(Object.assign({},r),{editingLinearElement:null}),commitToHistory:!1}}const s={startBindingElement:null!=r&&r.includes(0)?null:i,endBindingElement:null!=r&&r.includes(a.points.length-1)?null:o};return Lo.deletePoints(a,r),{elements:e,appState:Object.assign(Object.assign({},t),{editingLinearElement:Object.assign(Object.assign(Object.assign({},t.editingLinearElement),s),{selectedPointsIndices:(null==r?void 0:r[0])>0?[r[0]-1]:[0]})}),commitToHistory:!0}}let{elements:n,appState:r}=((e,t)=>({elements:e.map((e=>t.selectedElementIds[e.id]||Ae(e)&&t.selectedElementIds[e.containerId]?Zr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return oa(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=ul(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{elementType:"selection",multiElement:null}),commitToHistory:Ma(_a(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===Pt||e.key===Nt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:is,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),pl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=Ln(Ta(e,t,!0));for(;++o<e.length;)a.get(e[o].id)?(r.length&&(n=n.concat(r),r=[]),n.push(o),i=o+1):e[o].isDeleted&&i===o?(i=o+1,r.push(o)):r=[];return n},gl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=ir.getScene(e).getElement(e.containerId);if(n)return t.indexOf(n)}}else{var r,i;const o=null===(r=e.boundElements)||void 0===r||null===(i=r.find((e=>"arrow"!==e.type)))||void 0===i?void 0:i.id;if(o){if("left"===n)return t.indexOf(e);const r=ir.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},ml=(e,t,n,r)=>{const i=t[n],o=t=>!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId)),a="left"===r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,o,Math.max(0,n-1)):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,o,n+1),s=t[a];if(!s)return-1;if(e.editingGroupId){var l;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(l=gl(s,t,r))&&void 0!==l?l:a;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}var c;if(!s.groupIds.length)return null!==(c=gl(s,t,r))&&void 0!==c?c:a;const d=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],u=oi(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},fl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),bl=(e,t,n)=>{const r=pl(t,e),i=fl(t,r);let o=(e=>{let t=0;return e.reduce(((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n)),[])})(r);return"right"===n&&(o=o.reverse()),o.forEach(((r,i)=>{const o=r[0],a=r[r.length-1],s="left"===n?o:a,l=ml(e,t,s,n);if(-1===l||s===l)return;const c="left"===n?t.slice(0,l):t.slice(0,o),d=t.slice(o,a+1),u="left"===n?t.slice(l,o):t.slice(a+1,l+1),h="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?[...c,...d,...u,...h]:[...c,...u,...d,...h]})),t.map((e=>i[e.id]?qr(e):e))},xl=(e,t,n)=>{const r=pl(e,t),i=fl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;a=e.indexOf(n[0])}else a=0;s=r[r.length-1]}else{if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;s=e.indexOf(n[n.length-1])}else s=e.length-1;a=r[0]}for(let t=a;t<s+1;t++)r.includes(t)||o.push(e[t]);const l=Object.values(i).map((e=>qr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},vl=(e,t)=>bl(t,e,"left"),yl=(e,t)=>bl(t,e,"right"),wl=(e,t)=>xl(e,t,"left"),kl=(e,t)=>xl(e,t,"right"),_l=dl({name:"sendBackward",perform:(e,t)=>({elements:vl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendBackward")," — ").concat(wn("CtrlOrCmd+[")),children:(0,x.jsx)(bs,{theme:n.theme})})}}),El=dl({name:"bringForward",perform:(e,t)=>({elements:yl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.bringForward")," — ").concat(wn("CtrlOrCmd+]")),children:(0,x.jsx)(fs,{theme:n.theme})})}}),Sl=dl({name:"sendToBack",perform:(e,t)=>({elements:wl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>st?e[zt]&&e.altKey&&e.code===mt:e[zt]&&e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendToBack")," — ").concat(wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,x.jsx)(vs,{theme:n.theme})})}}),Cl=dl({name:"bringToFront",perform:(e,t)=>({elements:kl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>st?e[zt]&&e.altKey&&e.code===gt:e[zt]&&e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,x.jsx)(xs,{theme:n.theme})})}}),jl=dl({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:ri(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ee(t)&&t.containerId||(e[t.id]=!0),e)),{})}),_a(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[zt]&&e.key===Vt}),Il=dl({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=Lo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},Ml(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[zt]&&e.key===Wt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:Os,title:"".concat(b("labels.duplicateSelection")," — ").concat(wn("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),Ml=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=mi(t.editingGroupId,n,e,{x:e.x+o.k/2,y:e.y+o.k/2});return a.set(e.id,s.id),i.push(e),r.push(s),s},l=[];let c=0;const d=Ln(Ta(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=ti(t,n);if(r){const t=oi(e,r);l.push(...t,...t.map((e=>s(e)))),c+=t.length;continue}}l.push(n,s(n))}else l.push(n);c++}return ar(l,i,a),ra(l,i,a),{elements:l,appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Ae(t)||(e[t.id]=!0),e)),{})}),_a(l))}},Tl=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,x.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,x.jsxs)("label",{className:ye({active:n===e.value}),title:e.text,children:[(0,x.jsx)("input",{type:"radio",name:i,onChange:()=>r(e.value),checked:n===e.value}),e.icon]},e.text)))})};n(4301);const Ol=e=>{let{children:t,left:n,top:i,onCloseRequest:o,fitInViewport:a=!1}=e;const s=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{if(a&&s.current){const e=s.current,{x:t,y:n,width:r,height:i}=e.getBoundingClientRect(),o=window.innerWidth;t+r>o&&(e.style.left="".concat(o-r,"px"));const a=window.innerHeight;n+i>a&&(e.style.top="".concat(a-i,"px"))}}),[a]),(0,r.useEffect)((()=>{if(o){const e=e=>{var t;null!==(t=s.current)&&void 0!==t&&t.contains(e.target)||(0,at.unstable_batchedUpdates)((()=>o(e)))};return document.addEventListener("pointerdown",e,!1),()=>document.removeEventListener("pointerdown",e,!1)}}),[o]),(0,x.jsx)("div",{className:"popover",style:{top:i,left:n},ref:s,children:t})};n(4220);const Ll=e=>{const t=(new Option).style;return t.color=e,!!t.color},Al=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Pl=e=>{let{colors:t,color:n,onChange:r,onClose:o,label:a,showInput:s=!0,type:l}=e;const c=i().useRef(),d=i().useRef(),u=i().useRef(),h=i().useRef();i().useEffect((()=>{d.current?d.current.focus():h.current?h.current.focus():u.current&&u.current.focus()}),[]);return(0,x.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),onKeyDown:e=>{if(e.key===Ut){const{activeElement:r}=document;var t;if(e.shiftKey){if(r===c.current)null===(t=h.current)||void 0===t||t.focus(),e.preventDefault()}else if(r===h.current){var n;null===(n=c.current)||void 0===n||n.focus(),e.preventDefault()}}else if(on(e.key)){const{activeElement:t}=document,n=m().rtl,r=Array.prototype.indexOf.call(u.current.children,t);if(-1!==r){const t=u.current.children.length-(s?1:0),i=e.key===(n?Ot:Lt)?(r+1)%t:e.key===(n?Lt:Ot)?(t+r-1)%t:e.key===Tt?(r+5)%t:e.key===At?(t+r-5)%t:r;u.current.children[i].focus()}e.preventDefault()}else if(Al.includes(e.key.toLowerCase())&&!hn(e.target)){const t=Al.indexOf(e.key.toLowerCase());u.current.children[t].focus(),e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,x.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,x.jsx)("div",{className:"color-picker-triangle"}),(0,x.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(u.current=e)},tabIndex:0,children:[t.map(((e,t)=>{const i=e.replace("#","");return(0,x.jsxs)("button",{className:"color-picker-swatch",onClick:t=>{t.currentTarget.focus(),r(e)},title:"".concat(b("colors.".concat(i))).concat(Mn(e)?"":" (".concat(e,")")," — ").concat(Al[t].toUpperCase()),"aria-label":b("colors.".concat(i)),"aria-keyshortcuts":Al[t],style:{color:e},ref:r=>{r&&0===t&&(c.current=r),r&&e===n&&(d.current=r)},onFocus:()=>{r(e)},children:[Mn(e)?(0,x.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,x.jsx)("span",{className:"color-picker-keybinding",children:Al[t]})]},e)})),s&&(0,x.jsx)(Dl,{color:n,label:a,onChange:e=>{r(e)},ref:h})]})]})},Dl=i().forwardRef(((e,t)=>{let{color:n,onChange:r,label:o}=e;const[a,s]=i().useState(n),l=i().useRef(null);i().useEffect((()=>{s(n)}),[n]),i().useImperativeHandle(t,(()=>l.current));const c=i().useCallback((e=>{const t=e.toLowerCase(),n=(e=>Mn(e)||Ll(e)?e:Ll("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,x.jsxs)("label",{className:"color-input-container",children:[(0,x.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,x.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),zl=e=>{let{type:t,color:n,onChange:r,label:o,isActive:a,setActive:s}=e;const l=i().useRef(null);return(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"color-picker-control-container",children:[(0,x.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:l}),(0,x.jsx)(Dl,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,x.jsx)(i().Suspense,{fallback:"",children:a?(0,x.jsx)(Ol,{onCloseRequest:e=>e.target!==l.current&&s(!1),children:(0,x.jsx)(Pl,{colors:ot[t],color:n||null,onChange:e=>{r(e)},onClose:()=>{var e;s(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function Nl(e){let{options:t,value:n,label:r,onChange:o,onClose:a}=e;const s=i().useRef(),l=i().useRef(),c=i().useRef(null);i().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,x.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:e=>{const n=t.find((t=>t.keyBinding===e.key.toLowerCase()));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Ut)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(on(e.key)){const{activeElement:n}=document,r=m().rtl,i=Array.prototype.indexOf.call(c.current.children,n);if(-1!==i){const n=t.length;let o=i;switch(e.key){case r?Ot:Lt:case Tt:o=(i+1)%n;break;case r?Lt:Ot:case At:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,x.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,x.jsxs)("button",{className:"picker-option",onClick:t=>{t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:r=>{r&&0===t&&(s.current=r),r&&e.value===n&&(l.current=r)},onFocus:()=>{o(e.value)},children:[e.icon,(0,x.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function Rl(e){var t;let{value:n,label:r,options:o,onChange:a,group:s=""}=e;const[l,c]=i().useState(!1),d=i().useRef(null),u=m().rtl;return(0,x.jsxs)("label",{className:"picker-container",children:[(0,x.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=o.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,x.jsx)(i().Suspense,{fallback:"",children:l?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ol,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,x.jsx)(Nl,{options:o,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,x.jsx)("div",{className:"picker-triangle"})]}):null})]})}const Hl=(e,t,n)=>e.map((e=>{var r;return t.selectedElementIds[e.id]||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e})),Bl=function(e,t,n,r){var i,o;const a=t.editingElement,s=_a(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Ma(s,t)?((e,t,n)=>{const r=Array.from(new Set(Ta(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null})(s,t,n):r)&&void 0!==i?i:null},Fl=(dl({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Hl(e,t,(e=>Da(e.type)?Zr(e,{strokeColor:n.currentItemStrokeColor}):e))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemStrokeColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.stroke")}),(0,x.jsx)(zl,{type:"elementStroke",label:b("labels.stroke"),color:Bl(t,n,(e=>e.strokeColor),n.currentItemStrokeColor),onChange:e=>r({currentItemStrokeColor:e}),isActive:"strokeColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"strokeColorPicker":null})})]})}}),dl({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Hl(e,t,(e=>Zr(e,{backgroundColor:n.currentItemBackgroundColor})))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.background")}),(0,x.jsx)(zl,{type:"elementBackground",label:b("labels.background"),color:Bl(t,n,(e=>e.backgroundColor),n.currentItemBackgroundColor),onChange:e=>r({currentItemBackgroundColor:e}),isActive:"backgroundColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"backgroundColorPicker":null})})]})}}),dl({name:"changeFillStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{fillStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemFillStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fill")}),(0,x.jsx)(Tl,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,x.jsx)(Ds,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,x.jsx)(zs,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,x.jsx)(Ns,{theme:n.theme})}],group:"fill",value:Bl(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),dl({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeWidth:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeWidth:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeWidth")}),(0,x.jsx)(Tl,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:10})}],value:Bl(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),dl({name:"changeSloppiness",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{seed:Kr(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.sloppiness")}),(0,x.jsx)(Tl,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,x.jsx)(Us,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,x.jsx)(Vs,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,x.jsx)(Ws,{theme:n.theme})}],value:Bl(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),dl({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeStyle")}),(0,x.jsx)(Tl,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,x.jsx)(Hs,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,x.jsx)(Bs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,x.jsx)(Fs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),dl({name:"changeOpacity",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{opacity:n}))),appState:Object.assign(Object.assign({},t),{currentItemOpacity:n}),commitToHistory:!0}),PanelComponent:e=>{var t;let{elements:n,appState:r,updateData:i}=e;return(0,x.jsxs)("label",{className:"control-label",children:[b("labels.opacity"),(0,x.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),onWheel:e=>{e.stopPropagation();const t=+e.target.value;e.deltaY<0&&t<100?i(t+10):e.deltaY>0&&t>0&&i(t-10)},value:null!==(t=Bl(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),dl({name:"changeFontSize",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontSize:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontSize:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontSize")}),(0,x.jsx)(Tl,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,x.jsx)(Js,{theme:n.theme})},{value:20,text:b("labels.medium"),icon:(0,x.jsx)(Qs,{theme:n.theme})},{value:28,text:b("labels.large"),icon:(0,x.jsx)(el,{theme:n.theme})},{value:36,text:b("labels.veryLarge"),icon:(0,x.jsx)(tl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.fontSize),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),dl({name:"changeFontFamily",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontFamily:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=[{value:o.ut.Virgil,text:b("labels.handDrawn"),icon:(0,x.jsx)(nl,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,x.jsx)(rl,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,x.jsx)(il,{theme:n.theme})}];return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontFamily")}),(0,x.jsx)(Tl,{group:"font-family",options:i,value:Bl(t,n,(e=>Ee(e)&&e.fontFamily),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),dl({name:"changeTextAlign",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{textAlign:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemTextAlign:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.textAlign")}),(0,x.jsx)(Tl,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,x.jsx)(ol,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,x.jsx)(al,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,x.jsx)(sl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.textAlign),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),dl({name:"changeSharpness",perform:(e,t,n)=>{const r=Oa(_a(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.elementType),o=r.length?r.every(je):Ie(t.elementType);return{elements:Hl(e,t,(e=>Zr(e,{strokeSharpness:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeSharpness:i?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:o?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.edges")}),(0,x.jsx)(Tl,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,x.jsx)(Ks,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,x.jsx)(Gs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeSharpness),Ra(n.elementType)&&(Ie(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),dl({name:"changeArrowhead",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Zr(e,{startArrowhead:r})}if("end"===t){return Zr(e,{endArrowhead:r})}}return e})),appState:Object.assign(Object.assign({},t),{["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=m().rtl;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.arrowheads")}),(0,x.jsxs)("div",{className:"iconSelectList",children:[(0,x.jsx)(Rl,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,x.jsx)(Ys,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,x.jsx)(Zs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,x.jsx)(Xs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,x.jsx)(qs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,x.jsx)(Rl,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,x.jsx)(Ys,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,x.jsx)(Zs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,x.jsx)(Xs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,x.jsx)(qs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}}),e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,x.jsx)(Za,{type:"icon",icon:e.value===o.C6.LIGHT?Ul.MOON:Ul.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===o.C6.DARK?o.C6.LIGHT:o.C6.DARK),"data-testid":"toggle-dark-mode"})}),Ul={SUN:(0,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:(0,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})};n(6781);const Vl=()=>{const e=document.querySelector(".excalidraw-tooltip");if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},Wl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>Vl().classList.remove("excalidraw-tooltip--visible")),[]),(0,x.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:e=>((e,t,n,r)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;const{x:i,bottom:o,top:a,width:s}=e.getBoundingClientRect(),{width:l,height:c}=t.getBoundingClientRect(),d=window.innerWidth,u=i+s/2-l/2,h=u+l>=d?u+l-d:0,p=o+5,g=p+c>=window.innerHeight?o-a+c+10:0;Object.assign(t.style,{top:"".concat(p-g,"px"),left:"".concat(u-h,"px")})})(e.currentTarget,Vl(),n,i),onPointerLeave:()=>Vl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const Kl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,x.jsx)("div",{className:ye("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const Gl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=Yl(t);if(!r)return null;return(0,at.createPortal)((0,x.jsxs)("div",{className:ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===Ht&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,x.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,x.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)},Yl=e=>{const[t,n]=(0,r.useState)(null),i=Gh(),o=(0,r.useRef)(i);o.current=i;const{container:a}=Zh();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i)}),[t,i]),(0,r.useLayoutEffect)((()=>{const t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,r=document.createElement("div");return r.classList.add("excalidraw","excalidraw-modal-container"),r.classList.toggle("excalidraw--mobile",o.current),t&&(r.classList.add("theme--dark"),r.classList.add("theme--dark-background-none")),document.body.appendChild(r),n(r),()=>{document.body.removeChild(r)}}),[a,e]),t},Zl=e=>{const[t,n]=(()=>{const[e,t]=(0,r.useState)(null);return[e,(0,r.useCallback)((e=>t(e)),[])]})(),[i]=(0,r.useState)(document.activeElement),{id:o}=Zh();(0,r.useEffect)((()=>{if(!t)return;const n=a(t);n.length>0&&!1!==e.autofocus&&(n[1]||n[0]).focus();const r=e=>{if(e.key===Ut){const n=a(t),{activeElement:r}=document,i=n.findIndex((e=>e===r));0===i&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i!==n.length-1||e.shiftKey||(n[0].focus(),e.preventDefault())}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}),[t,e.autofocus]);const a=e=>{const t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=()=>{i.focus(),e.onCloseRequest()};return(0,x.jsx)(Gl,{className:ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,x.jsxs)(Kl,{ref:n,children:[(0,x.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,x.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,x.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":b("buttons.close"),children:Gh()?Ts:Ms})]}),(0,x.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var ql=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=ql(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,x.jsxs)(Zl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,x.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,x.jsx)(Za,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,x.jsx)(Za,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},$l=e=>{let{onConfirm:t}=e;const[n,i]=(0,r.useState)(!1),o=()=>{i(!n)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",icon:is,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:Gh(),onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,x.jsx)(Xl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,x.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},Jl=(dl({name:"changeViewBackgroundColor",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.viewBackgroundColor}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{position:"relative"},children:(0,x.jsx)(zl,{label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:e=>n({viewBackgroundColor:e}),isActive:"canvasColorPicker"===t.openPopup,setActive:e=>n({openPopup:e?"canvasColorPicker":null}),"data-testid":"canvas-background-picker"})})}}),dl({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Zr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},Pn()),{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)($l,{onConfirm:t})}}),dl({name:"zoomIn",perform:(e,t)=>{const n=Va(Wa(t.zoom.value+o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:cs,title:"".concat(b("buttons.zoomIn")," — ").concat(wn("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ct||e.code===ut)&&(e[zt]||e.shiftKey)}),dl({name:"zoomOut",perform:(e,t)=>{const n=Va(Wa(t.zoom.value-o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ds,title:"".concat(b("buttons.zoomOut")," — ").concat(wn("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===dt||e.code===ht)&&(e[zt]||e.shiftKey)}),dl({name:"resetZoom",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{zoom:Va(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Wl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,x.jsxs)(Za,{type:"button",className:"reset-zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===vt||e.code===pt)&&(e[zt]||e.shiftKey)}),(e,t,n)=>{const r=_a(e),i=Ta(r,t),a=n&&i.length>0?Qe(i):Qe(r),s=((e,t)=>{const[n,r,i,a]=e,s=i-n,l=t.width/s,c=a-r,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/o.V4)*o.V4;return Math.min(Math.max(h,o.V4),1)})(a,{width:t.width,height:t.height}),l=Va(s,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),[c,d,u,h]=a,p=(c+u)/2,g=(d+h)/2;return{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:{x:p,y:g},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{zoom:l}),commitToHistory:!1}}),Ql=(dl({name:"zoomToSelection",perform:(e,t)=>Jl(e,t,!0),keyTest:e=>e.code===bt&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"zoomToFit",perform:(e,t)=>Jl(e,t,!1),keyTest:e=>e.code===ft&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"toggleTheme",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===o.C6.LIGHT?o.C6.DARK:o.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,x.jsx)(Fl,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===kt}),dl({name:"finalize",perform:(e,t,n,r)=>{var i;let{canvas:o,focusContainer:a}=r;if(t.editingLinearElement){const{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,o=Lo.getElement(n);if(o)return Me(o)&&Do(o,r,i),{elements:o.points.length<2||Xr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Yr(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();const l=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(l){if("freedraw"!==l.type&&"touch"!==t.lastPointerDownWith){const{points:e,lastCommittedPoint:t}=l;t&&e[e.length-1]===t||Yr(l,{points:l.points.slice(0,-1)})}Xr(l)&&(s=s.slice(0,-1));const e=Re(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Yr(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Me(l)&&!e&&l.points.length>1){const[e,n]=Lo.getPointAtIndexGlobalCoordinates(l,-1);Ho(l,t,ir.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&l||bn(o),{elements:s,appState:Object.assign(Object.assign({},t),{elementType:(t.elementLocked||"freedraw"===t.elementType)&&l?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.elementType?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:(e,t)=>e.key===Ht&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Ht||e.key===Rt)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:us,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement})}}));var ec,tc;const nc="undefined"!=typeof process&&null!==(ec={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==ec&&ec.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(tc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==tc&&tc.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const rc=e=>{const{id:t}=Zh(),[n,i]=(0,r.useState)(e.value);return(0,x.jsxs)("div",{className:"ProjectName",children:[(0,x.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,x.jsx)("input",{type:"text",className:"TextInput",onBlur:t=>{(e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}})(t.target);const n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:n,onChange:e=>i(e.target.value)}):(0,x.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},ic=(e,t)=>{if(null!=t&&t.collaborators){const n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}const n=e.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0),r=ot.elementBackground.slice(1),i=ot.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let oc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(oc||(oc={}));const ac=(()=>{const e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]})(),sc=function(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(o,a),e.rotate(s),l&&e.fillRect(t-o,n-a,r,i),e.strokeRect(t-o,n-a,r,i),e.restore()},lc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},cc=(e,t,n,r,i,a,s)=>{if(null===a)return{atLeastOneVisibleElement:!1};const{renderScrollbars:l=!0,renderSelection:c=!0,renderGrid:d=!0,isExporting:u}=s,h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.save(),h.scale(r,r);const p=a.width/r,g=a.height/r;if(u&&"dark"===s.theme&&(h.filter=o.ZF),"string"==typeof s.viewBackgroundColor){("transparent"===s.viewBackgroundColor||5===s.viewBackgroundColor.length||9===s.viewBackgroundColor.length||/(hsla|rgba)\(/.test(s.viewBackgroundColor))&&h.clearRect(0,0,p,g),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,g),h.restore()}else h.clearRect(0,0,p,g);const f=s.zoom.translation.x,b=s.zoom.translation.y;h.save(),h.translate(f,b),h.scale(s.zoom.value,s.zoom.value),d&&t.gridSize&&((e,t,n,r,i,o)=>{e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(let a=n;a<n+i+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+o+2*t);for(let a=r;a<r+o+2*t;a+=t)e.moveTo(n-t,a),e.lineTo(n+i+2*t,a);e.stroke(),e.restore()})(h,t.gridSize,-Math.ceil(f/s.zoom.value/t.gridSize)*t.gridSize+s.scrollX%t.gridSize,-Math.ceil(b/s.zoom.value/t.gridSize)*t.gridSize+s.scrollY%t.gridSize,p/s.zoom.value,g/s.zoom.value);const x=e.filter((e=>mc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(x.forEach((e=>{try{zr(e,i,h,s)}catch(e){console.error(e)}})),t.editingLinearElement){const e=Lo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Lo.getPointsGlobalCoordinates(r).forEach(((r,i)=>{var o,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(o=t.editingLinearElement)&&void 0!==o&&null!==(a=o.selectedPointsIndices)&&void 0!==a&&a.includes(i)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";const{POINT_HANDLE_SIZE:s}=Lo;lc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{zr(n,i,h,s)}catch(e){console.error(e)}if(Po(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{hc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!ei(t,n)&&r.push(rt.black),s.remoteSelectedElementIds[n.id]&&r.push(...s.remoteSelectedElementIds[n.id].map((e=>{const{background:n}=ic(e,t);return n}))),r.length){const[t,i,o,a]=Ge(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=oi(e,t),[i,o,a,s]=Qe(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[rt.black]})};for(const e of ni(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>uc(h,s,e)));const i=Ta(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=rt.white;const e=_i(i[0],s.zoom,"mouse");t.viewModeEnabled||dc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=rt.white;const[t,n,r,o]=Qe(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,sc(h,t-e,n-e,r-t+2*e,o-n+2*e,(t+r)/2,(n+o)/2,0),h.lineWidth=l,h.setLineDash(a);const c=ki([t,n,r,o],0,s.zoom,"mouse",bi);dc(h,s,c,0)}h.restore()}h.restore();for(const e in s.remotePointerViewportCoords){let{x:n,y:r}=s.remotePointerViewportCoords[e];n-=t.offsetLeft,r-=t.offsetTop;const i=9,o=14,a=n<0||n>p-i||r<0||r>g-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,g-o);const{background:l,stroke:c}=ic(e,t);h.save(),h.strokeStyle=c,h.fillStyle=l;const d=s.remotePointerUserStates[e];(a||d===oc.AWAY)&&(h.globalAlpha=.48),s.remotePointerButton&&"down"===s.remotePointerButton[e]&&(h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=3,h.strokeStyle="#ffffff88",h.stroke(),h.closePath(),h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=1,h.strokeStyle=c,h.stroke(),h.closePath()),h.beginPath(),h.moveTo(n,r),h.lineTo(n+1,r+14),h.lineTo(n+4,r+9),h.lineTo(n+9,r+10),h.lineTo(n,r),h.fill(),h.stroke();const u=s.remotePointerUsernames[e];let m="";d===oc.AWAY?m=ac?"⚫️":" (".concat(oc.AWAY,")"):d===oc.IDLE?m=ac?"💤":" (".concat(oc.IDLE,")"):d===oc.ACTIVE&&(m=ac?"🟢":"");const f="".concat(u?"".concat(u," "):"").concat(m);if(!a&&f){const e=n+i,t=r+o,a=4,s=4,d=h.measureText(f),u=d.actualBoundingBoxDescent+d.actualBoundingBoxAscent;h.fillStyle=c,h.fillRect(e-1,t-1,d.width+2*a+2,u+2*s+2),h.fillStyle=l,h.fillRect(e,t,d.width+2*a,u+2*s),h.fillStyle=rt.white,h.fillText(f,e+a,t+s+d.actualBoundingBoxAscent)}h.restore(),h.closePath()}let v;return l&&(v=((e,t,n,r)=>{let{scrollX:i,scrollY:o,zoom:a}=r;if(0===e.length)return{horizontal:null,vertical:null};const[s,l,c,d]=Qe(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,f={top:parseInt(En("sat")),bottom:parseInt(En("sab")),left:parseInt(En("sal")),right:parseInt(En("sar"))},b=m().rtl,x=p/2-i+f.left,v=g/2-o+f.top,y=x+u-f.right,w=v+h-f.bottom,k=Math.min(s,x),_=Math.min(l,v),E=Math.max(c,y),S=Math.max(d,w);return{horizontal:x===k&&y===E?null:{x:Math.max(f.left,4)+(x-k)/(E-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-x)/(E-k)*t-Math.max(8,f.left+f.right),height:6},vertical:v===_&&w===S?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(v-_)/(S-_)*n+Math.max(f.top,4),width:6,height:(w-v)/(S-_)*n-Math.max(8,f.top+f.bottom)}}})(e,p,g,s),h.save(),h.fillStyle="rgba(0,0,0,0.3)",h.strokeStyle="rgba(255,255,255,0.8)",[v.horizontal,v.vertical].forEach((e=>{e&&((e,t,n,r,i,o)=>{e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill(),e.stroke()})(h,e.x,e.y,e.width,e.height,3)})),h.restore()),h.restore(),{atLeastOneVisibleElement:x.length>0,scrollBars:v}},dc=(e,t,n,r)=>{Object.keys(n).forEach((i=>{const o=n[i];void 0!==o&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===i?lc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):sc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},uc=(e,t,n)=>{const{angle:r,elementX1:i,elementY1:o,elementX2:a,elementY2:s,selectionColors:l}=n,c=a-i,d=s-o,u=4/t.zoom.value,h=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;const g=l.length;for(let t=0;t<g;++t)e.strokeStyle=l[t],e.setLineDash([h,p+(h+p)*(g-1)]),e.lineDashOffset=(h+p)*t,sc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},hc=(e,t,n)=>{const r=Array.isArray(n)?gc:pc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},pc=(e,t)=>{const[n,r,i,o]=Ge(t),a=i-n,s=o-r,l=Ji(t,a,s);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;const c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":sc(e,n-c,r-c,a+2*c,s+2*c,n+a/2,r+s/2,t.angle);break;case"diamond":const i=Math.hypot(a,s);((e,t,n,r,i,o)=>{e.save(),e.translate(r,i),e.rotate(o),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()})(e,a+2*(c*i/s),s+2*(c*i/a),n+a/2,r+s/2,t.angle);break;case"ellipse":((e,t,n,r,i,o)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,o,0,2*Math.PI),e.stroke()})(e,a+2*c,s+2*c,n+a/2,r+s/2,t.angle)}},gc=(e,t)=>{const[n,r,i]=t,o=Ji(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)";("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((t=>{const[r,i]=Lo.getPointAtIndexGlobalCoordinates(n,t);lc(e,r,i,o)}))},mc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=kn({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=kn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var fc=Object.defineProperty,bc=(e,t)=>()=>(e&&(t=e(e=0)),t),xc=(e,t)=>{for(var n in(e=>{fc(e,"__esModule",{value:!0})})(e),t)fc(e,n,{get:t[n],enumerable:!0})},vc={};xc(vc,{default:()=>yc});var yc,wc=bc((()=>{yc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let i=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=i||"";let o=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(o,(()=>a(n)),r);r.addEventListener("change",(()=>{o(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),kc={};xc(kc,{default:()=>Ec});var _c,Ec,Sc=bc((()=>{_c=async e=>{let t=await e.getFile();return t.handle=e,t},Ec=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(_c));return e[0].multiple?r:r[0]}})),Cc={};xc(Cc,{default:()=>jc});var jc,Ic=bc((()=>{jc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let i=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(i,(()=>o(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),i(t)})),r.click()})))})),Mc={};xc(Mc,{default:()=>Oc});var Tc,Oc,Lc=bc((()=>{Tc=async(e,t,n=e.name,r)=>{let i=[],o=[];for await(let a of e.values()){let s=`${n}/${a.name}`;"file"===a.kind?o.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push(Tc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Oc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Tc(t,e.recursive,void 0,e.skipDirectory)}})),Ac={};xc(Ac,{default:()=>Pc});var Pc,Dc=bc((()=>{Pc=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),i=new Response(r);return n.releaseLock(),new Blob([await i.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let i=()=>{"function"==typeof o&&o()},o=t.legacySetup&&t.legacySetup(i,(()=>o(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),i()})),n.click(),null}})),zc={};xc(zc,{default:()=>Nc});var Nc,Rc=bc((()=>{Nc=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let i=[];if(t.forEach(((t,n)=>{i[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{i[n].accept[e]=t.extensions||[]}))):e.type&&(i[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:i,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(a),o):"body"in e?(await e.body.pipeTo(a),o):(await a.write(blob),await a.close(),o)}})),Hc=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),Bc=Hc?Promise.resolve().then((()=>(Sc(),kc))):Promise.resolve().then((()=>(wc(),vc)));Hc?Promise.resolve().then((()=>(Lc(),Mc))):Promise.resolve().then((()=>(Ic(),Cc)));var Fc=Hc?Promise.resolve().then((()=>(Rc(),zc))):Promise.resolve().then((()=>(Dc(),Ac)));const Uc=e=>{var t,n,r;const i=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(o.LO[t]),e)),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce(((e,t)=>"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))),[]);return async function(...e){return(await Bc).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=mn(n,500),a=()=>{s(),document.addEventListener(o.Ks.KEYUP,i),document.addEventListener(o.Ks.POINTER_UP,i),i()},s=()=>{var n;if(null!==(n=r.files)&&void 0!==n&&n.length){const n=e.multiple?[...r.files]:r.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(o.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),i.cancel(),window.removeEventListener(o.Ks.FOCUS,a),document.removeEventListener(o.Ks.KEYUP,i),document.removeEventListener(o.Ks.POINTER_UP,i),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Ga))}}})},Vc=(e,t)=>async function(...e){return(await Fc).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),Wc={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Kc=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g;const m={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||Gr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(i=e.strokeStyle)&&void 0!==i?i:"solid",roughness:null!==(o=e.roughness)&&void 0!==o?o:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(s=t.x)&&void 0!==s?s:e.x)&&void 0!==a?a:0,y:null!==(l=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==l?l:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(d=e.seed)&&void 0!==d?d:1,groupIds:null!==(u=e.groupIds)&&void 0!==u?u:[],strokeSharpness:null!==(h=e.strokeSharpness)&&void 0!==h?h:Ie(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((e=>({type:"arrow",id:e}))):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(g=e.updated)&&void 0!==g?g:On()};return Object.assign(Object.assign(Object.assign({},m),Jr(m)),t)},Gc=e=>{var t,n,r,i;switch(e.type){case"text":let a=e.fontSize,s=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");a=parseInt(t,10),i=n,s=Object.keys(o.ut).includes(i)?o.ut[i]:o.rk}return Kc(e,{fontSize:a,fontFamily:s,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||o.Hg,verticalAlign:e.verticalAlign||o.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:null!==(r=e.originalText)&&void 0!==r?r:""});case"freedraw":return Kc(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Kc(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":{const{startArrowhead:t=null,endArrowhead:n=("arrow"===e.type?"arrow":null)}=e;let r=e.x,i=e.y,o=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===o[0][0]&&0===o[0][1]||({points:o,x:r,y:i}=Lo.getNormalizedPoints(e)),Kc(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:o,x:r,y:i})}case"ellipse":case"rectangle":case"diamond":return Kc(e,{})}},Yc=(e,t)=>{const n=t?Ln(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Xr(t)){let r=Gc(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=qr(r,i.version)),e.push(r)}}return e}),[])},Zc=(e,t)=>{e=e||{};const n=Pn(),r={};for(const[i,o]of Object.entries(n)){const n=e[i],a=t?t[i]:void 0;r[i]=void 0!==n?n:void 0!==a?a:o}return Object.assign(Object.assign({},r),{elementType:Wc[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:n.zoom.translation}:e.zoom||n.zoom})},qc=(e,t,n)=>({elements:Yc(null==e?void 0:e.elements,n),appState:Zc(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),Xc=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:Gr(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||Gr(),status:e.status||t,created:e.created||Date.now()}))}return n},$c=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}else if(t="text"in Blob?await e.text():await new Promise((t=>{const n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}})),e.type===o.LO.svg)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}return t},Jc=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},Qc=e=>{const t=Jc(e);return"png"===t||"svg"===t},ed=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},td=async(e,t,n)=>{const r=await $c(e);try{const i=JSON.parse(r);if(!ud(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return qc({elements:ja(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},Nn(i.appState||{})),t?Aa(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},nd=async e=>{const t=await $c(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},rd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new Ka(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),id=async e=>{try{const n=await window.crypto.subtle.digest("SHA-1",await e.arrayBuffer());return t=new Uint8Array(n),Array.from(t).map((e=>"0".concat(e.toString(16)).slice(-2))).join("")}catch(e){return console.error(e),we(40)}var t},od=async e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>{const e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)})),ad=async(e,t)=>{if(e.type===o.LO.svg)return e;const[r,i]=await Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((e=>e.default)),n.e(736).then(n.bind(n,100)).then((e=>e.default))]),a=i({pica:r({features:["js","wasm"]})});if(t.outputType){const{outputType:e}=t;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then((e=>(t.out_blob=e,t)))}}if(!ed(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:o.LO.svg})},ld=(e,t)=>{const n={};for(const r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},cd=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?ja(e):Ca(e),appState:"local"===r?Nn(t):Rn(t),files:"local"===r?ld(e,n):void 0};return JSON.stringify(i,null,2)},dd=async(e,t,n)=>{const r=cd(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await Vc(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Qc(t.fileHandle)?null:t.fileHandle})}},ud=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),hd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),pd=async e=>{let{fileIds:t,files:n,imageCache:r}=e;const i=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!i.has(t)?(i.set(t,!0),e.concat((async()=>{try{if(s.mimeType===o.LO.binary)throw new Error("Only images can be added to ImageCache");const e=hd(s.dataURL),n={image:e,mimeType:s.mimeType};r.set(t,n);const i=await e;r.set(t,Object.assign(Object.assign({},n),{image:i}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:r,updatedFiles:i,erroredFiles:a}},gd=e=>e.filter((e=>ke(e))),md="\x3c!-- svg-source:excalidraw --\x3e",fd=async function(e,t,n,r){let{exportBackground:i,exportPadding:a=o.qy,viewBackgroundColor:s}=r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(e,n)=>{const r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}};const[c,d,u,h]=xd(e,a),{canvas:p,scale:g=1}=l(u,h),m=Pn(),{imageCache:f}=await pd({imageCache:new Map,fileIds:gd(e).map((e=>e.fileId)),files:n});return cc(e,t,null,g,xe.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:m.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:f,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},bd=async(e,t,r)=>{const{exportPadding:i=o.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodeSvgMetadata({text:cd(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=xd(e,i),g=document.createElementNS(o.hR,"svg");if(g.setAttribute("version","1.1"),g.setAttribute("xmlns",o.hR),g.setAttribute("viewBox","0 0 ".concat(h," ").concat(p)),g.setAttribute("width","".concat(h*s)),g.setAttribute("height","".concat(p*s)),t.exportWithDarkMode&&g.setAttribute("filter",o.ZF),g.innerHTML="\n ".concat(md,"\n ").concat(c,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a){const e=g.ownerDocument.createElementNS(o.hR,"rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width","".concat(h)),e.setAttribute("height","".concat(p)),e.setAttribute("fill",a),g.appendChild(e)}return function(e,t,n,r){let{offsetX:i=0,offsetY:o=0,exportWithDarkMode:a=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n&&e.forEach((e=>{if(!e.isDeleted)try{Rr(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,xe.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},xd=(e,t)=>{const[n,r,i,o]=Qe(e);return[n,r,fn(n,i)+2*t,fn(r,o)+t+t]},vd=32,yd=12,wd=256,kd="NOT_SPREADSHEET",_d="VALID_SPREADSHEET",Ed=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Sd=(e,t)=>e.slice(1).every((e=>null!==Ed(e[t]))),Cd=e=>{const t=e[0].length;if(t>2)return{type:kd,reason:"More than 2 columns"};if(1===t){if(!Sd(e,0))return{type:kd,reason:"Value is not numeric"};const t=null===Ed(e[0][0]),n=(t?e.slice(1):e).map((e=>Ed(e[0])));return n.length<2?{type:kd,reason:"Less than two rows"}:{type:_d,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Sd(e,0)?0:1;if(!Sd(e,n))return{type:kd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Ed(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:kd,reason:"Less than 2 rows"}:{type:_d,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Ed(e[n])))}}},jd=ot.elementBackground.slice(2,ot.elementBackground.length),Id={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:ot.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Md=e=>({chartWidth:44*e.values.length+yd,chartHeight:280}),Td=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:vd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Od=(e,t,n,r,i)=>{const o=ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-yd,text:"0",textAlign:"right"}));return[o,ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-wd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Ld=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Md(e);return[pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n-wd-yd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Ad=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Md(e),c=e.title?ui(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{text:e.title,x:t+s/2,y:n-wd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ci(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:ot.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...Td(e,t,n,r,i),...Od(e,t,n,r,i),...Ld(e,t,n,r,i)]},Pd=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*wd;l.push([e,n]),s++}const c=Math.max(...l.map((e=>e[0]))),d=Math.max(...l.map((e=>e[1]))),u=Math.min(...l.map((e=>e[0]))),h=Math.min(...l.map((e=>e[1]))),p=pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+yd+16,y:n-yd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,o)=>{const s=44*o+6,l=-e/r*wd+6;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:yd,height:yd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*wd+6+yd;return pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+s+16+6,y:n-l,startArrowhead:null,endArrowhead:null,height:l,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,l]]}))}));return[...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...m,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)],s=e.values.map(((e,o)=>{const s=e/r*wd;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"rectangle",x:t+44*o+yd,y:n-s-yd,width:vd,height:s}))}));return[...s,...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let Dd="",zd=!1;const Nd="clipboard"in navigator&&"readText"in navigator.clipboard,Rd="clipboard"in navigator&&"writeText"in navigator.clipboard,Hd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Bd=async(e,t,n)=>{const r=Ta(e,t,!0),i={type:o.r8.excalidrawClipboard,elements:r,files:r.reduce(((e,t)=>(ke(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(i);Dd=a;try{zd=!1,await Wd(a)}catch(e){zd=!0,console.error(e)}},Fd=()=>{if(!Dd)return{};try{return JSON.parse(Dd)}catch(e){return console.error(e),{}}},Ud=e=>{const t=(e=>{let t=e.trim().split("\n").map((e=>e.trim().split("\t")));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((e=>e.trim().split(",")))),0===t.length)return{type:kd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:kd,reason:"All rows don't have same number of columns"};const i=Cd(t);if(i.type!==_d){const e=Cd((e=>{const t=[];for(let n=0;n<e[0].length;n++){const r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t})(t));if(e.type===_d)return e}return i})(e);return t.type===_d?{spreadsheet:t.spreadsheet}:null},Vd=async e=>{const t=await(async e=>{try{var t;return(e?null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim():Nd&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(md))return Fd();const n=Ud(t);if(n)return n;const r=Fd();try{const e=JSON.parse(t);return i=e,[o.r8.excalidraw,o.r8.excalidrawClipboard].includes(null==i?void 0:i.type)&&Array.isArray(i.elements)?{elements:e.elements,files:e.files}:r}catch(e){return zd&&r.elements?r:{text:t}}var i},Wd=async e=>{let t=!1;if(Rd)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!Kd(e||" "))throw new Error("couldn't copy")},Kd=e=>{const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),i},Gd=async(e,t,r,i,a)=>{let{exportBackground:s,exportPadding:l=o.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(b("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await bd(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await Vc(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:u});if("clipboard-svg"===e)return void await Wd(n.outerHTML)}const h=await fd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await rd(h);if(h.remove(),"png"===e)return r.exportEmbedScene&&(p=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodePngMetadata({blob:p,metadata:cd(t,r,i,"local")})),await Vc(p,{description:"Export to PNG",name:d,extension:"png",fileHandle:u});if("clipboard"===e)try{await(async e=>{await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])})(p)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}};n(7225);const Yd=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,x.jsxs)("div",{className:ye("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,x.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:Ja}),(0,x.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const Zd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},qd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const Xd=e=>{let{fileName:t,onSave:n}=e;return(0,x.jsxs)(Zd,{className:"ActiveFile",gap:1,align:"center",children:[(0,x.jsxs)("span",{className:"ActiveFile__fileName",children:[Ls,(0,x.jsx)("span",{children:t})]}),(0,x.jsx)(Za,{type:"icon",icon:es,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},$d=(dl({name:"changeProjectName",perform:(e,t,n)=>(nc("change","title"),{appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,x.jsx)(rc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),dl({name:"changeExportScale",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportScale:n}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=_a(t),a=Ma(i,n)?Ta(i,n):i;return(0,x.jsx)(x.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=xd(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,o.qy,e),s="".concat(b("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(i,")");return(0,x.jsx)(Za,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:s,"aria-label":s,id:"export-canvas-scale",checked:e===n.exportScale,onChange:()=>r(e)},e)}))})}}),dl({name:"changeExportBackground",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportBackground:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Yd,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),dl({name:"changeExportEmbedScene",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportEmbedScene:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsxs)(Yd,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,x.jsx)(Wl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,x.jsx)("div",{className:"excalidraw-tooltip-icon",children:ms})})]})}}),dl({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=Qc(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=Jc(a);if(!a||"png"!==(l=s)&&"svg"!==l)throw new Error("fileHandle should exist and should be of type svg or png when resaving");var l;return t=Object.assign(Object.assign({},t),{exportEmbedScene:!0}),await Gd(s,_a(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await dd(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):b("toast.fileSaved"):null})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e[zt]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,x.jsx)(Xd,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),dl({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await dd(e,Object.assign(Object.assign({},t),{fileHandle:null}),r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e.shiftKey&&e[zt],PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ts,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:Gh(),hidden:!Hc,onClick:()=>t(null),"data-testid":"save-as-button"})}}));dl({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await Uc({description:"Excalidraw files"});return td(n,e,t)})(t,e);return{elements:n,appState:r,files:i,commitToHistory:!0}}catch(n){return"AbortError"===(null==n?void 0:n.name)?(console.warn(n),!1):{elements:e,appState:Object.assign(Object.assign({},t),{errorMessage:n.message}),files:r.files,commitToHistory:!1}}},keyTest:e=>e[zt]&&e.key===Zt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ns,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:Gh(),onClick:t,"data-testid":"load-button"})}}),dl({name:"exportWithDarkMode",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportWithDarkMode:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,x.jsx)(Fl,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let Jd="{}";const Qd=dl({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(Jd=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===wt}),eu=dl({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(Jd);return"text"!==(null==(r=n)?void 0:r.type)&&"diamond"!==(null==r?void 0:r.type)&&"rectangle"!==(null==r?void 0:r.type)&&"ellipse"!==(null==r?void 0:r.type)&&"arrow"!==(null==r?void 0:r.type)&&"freedraw"!==(null==r?void 0:r.type)&&"line"!==(null==r?void 0:r.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Zr(e,{backgroundColor:null==n?void 0:n.backgroundColor,strokeWidth:null==n?void 0:n.strokeWidth,strokeColor:null==n?void 0:n.strokeColor,strokeStyle:null==n?void 0:n.strokeStyle,fillStyle:null==n?void 0:n.fillStyle,opacity:null==n?void 0:n.opacity,roughness:null==n?void 0:n.roughness});return Ee(t)&&(Yr(t,{fontSize:(null==n?void 0:n.fontSize)||o.n5,fontFamily:(null==n?void 0:n.fontFamily)||o.rk,textAlign:(null==n?void 0:n.textAlign)||o.Hg}),or(t)),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===Ct}),tu=e=>(0,x.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:ms}),nu=(dl({name:"toggleCanvasMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:hs,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),dl({name:"toggleEditMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{visible:wa(n,_a(t)),type:"button",icon:os,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),dl({name:"toggleFullScreen",perform:()=>(yn()||document.documentElement.requestFullscreen(),yn()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===Et&&!e[zt]}),dl({name:"toggleShortcuts",perform:(e,t,n,r)=>{let{focusContainer:i}=r;return t.showHelpDialog&&i(),{appState:Object.assign(Object.assign({},t),{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(tu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Bt}),(e,t)=>{const n=Ta(_a(e),t,!0);return n.length>=2&&!(e=>{if(e.length>=2){const t=e[0].groupIds;for(const n of t)if(e.reduce(((e,t)=>e&&ii(t,n)),!0))return!0}return!1})(n)}),ru=dl({name:"group",perform:(e,t)=>{const n=Ta(_a(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=ni(t);if(1===r.length){const i=r[0],o=new Set(oi(e,i).map((e=>e.id))),a=new Set(n.map((e=>e.id)));if(new Set([...Array.from(o),...Array.from(a)]).size===o.size)return{appState:t,elements:e,commitToHistory:!1}}const i=Gr(),o=Ln(n),a=e.map((e=>o.get(e.id)?Zr(e,{groupIds:ai(e.groupIds,i,t.editingGroupId)}):e)),s=oi(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!ii(e,i))),...s,...d];return{appState:Qr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>nu(e,t),keyTest:e=>!e.shiftKey&&e[zt]&&e.code===_t,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!nu(t,n),type:"button",icon:(0,x.jsx)(As,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(wn("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Ma(_a(t),n)})}}),iu=dl({name:"ungroup",perform:(e,t)=>{if(0===ni(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=e.map((e=>{const n=((e,t)=>e.filter((e=>!t[e])))(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:Zr(e,{groupIds:n})}));return{appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(n)),elements:n,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[zt]&&e.code===_t,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>ni(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",hidden:0===ni(n).length,icon:(0,x.jsx)(Ps,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(wn("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Ma(_a(t),n)})}});n(2789);const ou=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,x.jsx)("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:i,children:t})},au=(dl({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:e=>{let{appState:t,updateData:n,data:r}=e;const i=null==r?void 0:r.id;if(!i)return null;const o=t.collaborators.get(i);if(!o)return null;const{background:a,stroke:s}=ic(i,t),l=(e=>{if(!e)return"?";const t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();const n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()})(o.username);return(0,x.jsx)(ou,{color:a,border:s,onClick:()=>n(o.pointer),children:l})}}),dl({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Ta(_a(e),t,!0);return i.some((e=>"image"===e.type))?{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((e=>r.library.saveLibrary([{id:Gr(),status:"unpublished",elements:i.map(gi),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),su=e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())},lu=(e,t,n)=>{let{axis:r,position:i}=n;const o=nt(e),[a,s]="x"===r?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return"start"===i?Object.assign(Object.assign({},l),{[r]:t[a]-o[a]}):"end"===i?Object.assign(Object.assign({},l),{[r]:t[s]-o[s]}):Object.assign(Object.assign({},l),{[r]:(t[a]+t[s])/2-(o[a]+o[s])/2})},cu=(e,t)=>Ta(_a(e),t).length>1,du=(e,t,n)=>{const r=((e,t)=>{const n=su(e),r=nt(e);return n.flatMap((e=>{const n=lu(e,r,t);return e.map((e=>Zr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},uu=(dl({name:"alignTop",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===At,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ys,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(wn("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Ma(_a(t),n)})}}),dl({name:"alignBottom",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Tt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ws,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(wn("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Ma(_a(t),n)})}}),dl({name:"alignLeft",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Ot,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ks,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(wn("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Ma(_a(t),n)})}}),dl({name:"alignRight",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Lt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(_s,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(wn("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Ma(_a(t),n)})}}),dl({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(Cs,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Ma(_a(t),n)})}}),dl({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(js,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Ma(_a(t),n)})}}),e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())}),hu=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},pu=(e,t)=>Ta(_a(e),t).length>1,gu=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=hu(e),s=uu(e).map((e=>[e,hu(e)])).sort(((e,t)=>e[1][r]-t[1][r]));let l=0;for(const e of s)l+=e[1][o];const c=(a[o]-l)/(s.length-1);if(c<0){const e=s.findIndex((e=>e[1][n]===a[n])),o=s.findIndex((e=>e[1][i]===a[i])),l=(s[o][1][r]-s[e][1][r])/(s.length-1);let c=s[e][1][r];return s.flatMap(((n,i)=>{let[a,s]=n;const d={x:0,y:0};return i!==e&&i!==o&&(c+=l,d[t.axis]=c-s[r]),a.map((e=>Zr(e,{x:e.x+d.x,y:e.y+d.y})))}))}let d=a[n];return s.flatMap((e=>{let[r,i]=e;const a={x:0,y:0};return a[t.axis]=d-i[n],d+=c,d+=i[o],r.map((e=>Zr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},mu=(dl({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===St,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Es,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(wn("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Ma(_a(t),n)})}}),dl({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===Ct,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Ss,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(wn("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Ma(_a(t),n)})}}),dl({name:"flipHorizontal",perform:(e,t)=>({elements:bu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Ta(_a(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),fu=dl({name:"flipVertical",perform:(e,t)=>({elements:bu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Ta(_a(e),t).length)(e,t)}),bu=(e,t,n)=>{const r=Ta(_a(e),t);if(r.length>1)return e;const i=xu(r,t,n),o=Ln(i);return e.map((e=>o.get(e.id)||e))},xu=(e,t,n)=>(e.forEach((e=>{vu(e,t),"vertical"===n&&yu(e,Math.PI)})),e),vu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=sa(e.angle);let s=0;(je(e)||Se(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Yr(e,{angle:sa(0)});const l=_i(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Yr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)Lo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);Lo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,pa(e,!0,e,c?"nw":"ne",!1,d,u[1]),Yr(e,{width:i,height:o});let h=sa(2*Math.PI-a);h<0&&(h=sa(h+2*Math.PI)),Yr(e,{angle:h}),Yr(e,{x:n+s,y:r}),Yo(e)},yu=(e,t)=>{const n=e.x,r=e.y;let i=sa(e.angle+t);i<0&&(i=sa(2*Math.PI+i)),Yr(e,{angle:i}),Yr(e,{x:n,y:r})},wu=dl({name:"copy",perform:(e,t,n,r)=>(Bd(_a(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),ku=dl({name:"cut",perform:(e,t,n,r)=>(wu.perform(e,t,n,r),hl.perform(e,t,n,r)),contextItemLabel:"labels.cut",keyTest:e=>e[zt]&&e.code===jt}),_u=dl({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard-svg",i.length?i:_a(e),t,r.files,t),{commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsSvg"}),Eu=dl({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard",i.length?i:_a(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyToClipboardAsPng",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}),commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsPng",keyTest:e=>e.code===wt&&e.altKey&&e.shiftKey}),Su=dl({name:"gridMode",perform(e,t){return nc("view","mode","grid"),{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:o.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[zt]&&e.code===xt}),Cu=dl({name:"zenMode",perform(e,t){return nc("view","mode","zen"),{appState:Object.assign(Object.assign({},t),{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.zenModeEnabled,contextItemLabel:"buttons.zenMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===It}),ju=dl({name:"stats",perform(e,t){return{appState:Object.assign(Object.assign({},t),{showStats:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.showStats,contextItemLabel:"stats.title",keyTest:e=>!e[zt]&&e.altKey&&e.code===yt}),Iu=(e,t,n)=>{const r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){const i=n();if(null===i)return{commitToHistory:r};const o=Ln(e),a=i.elements,s=Ln(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Zr(o.get(e.id)||e,e))).concat(l.map((e=>Zr(e,{isDeleted:!0}))));return oa(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}};class Mu{constructor(e,t,n,r){this.actions={},this.renderAction=(e,t)=>{const n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&"PanelComponent"in this.actions[e]&&(!(e in n)||n[e])){const n=this.actions[e],r=n.PanelComponent,i=e=>{this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))};return(0,x.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:i,appProps:this.app.props,data:t})}return null},this.updater=t=>{if(!t||!("then"in t))return e(t);t.then((t=>e(t)))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach((e=>this.registerAction(e)))}handleKeyDown(e){const t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort(((e,t)=>(t.keyPriority||0)-(e.keyPriority||0))).filter((n=>(!(n.name in t)||t[n.name])&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted())));if(0===n.length)return!1;const{viewModeEnabled:r}=this.getAppState();return!(r&&!Object.values(o.EH).includes(n[0].name))&&(e.preventDefault(),this.updater(n[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}executeAction(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}const Tu=class{constructor(e){this.libraryCache=null,this.resetLibrary=async()=>{var e,t;await(null===(e=(t=this.app.props).onLibraryChange)||void 0===e?void 0:e.call(t,[])),this.libraryCache=[]},this.restoreLibraryItem=e=>{const t=_a(Yc(e.elements,null));return t.length?Object.assign(Object.assign({},e),{elements:t}):null},this.loadLibrary=()=>new Promise((async e=>{if(this.libraryCache)return e(JSON.parse(JSON.stringify(this.libraryCache)));try{const t=this.app.libraryItemsFromStorage;if(!t)return e([]);const n=t.reduce(((e,t)=>(this.restoreLibraryItem(t)&&e.push(t),e)),[]);this.libraryCache=JSON.parse(JSON.stringify(n)),e(n)}catch(t){console.error(t),e([])}})),this.saveLibrary=async e=>{const t=this.libraryCache;try{var n,r;const t=JSON.stringify(e);this.libraryCache=JSON.parse(t),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,e))}catch(e){throw this.libraryCache=t,e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await nd(e);if(!n||!n.libraryItems&&!n.library)return;const r=(e,t)=>!e.find((e=>e.elements.length===t.elements.length&&e.elements.every(((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)))),i=await this.loadLibrary(),o=n.libraryItems||n.library||[],a=Xc(o,t),s=[];for(const e of a){const t=this.restoreLibraryItem(e);t&&r(i,t)&&s.push(t)}await this.saveLibrary([...s,...i])}},Ou=e=>{const t=Array.from(e.values());return{x:Au(t,(e=>e.x))/t.length,y:Au(t,(e=>e.y))/t.length}},Lu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Au=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Pu=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Du=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Pu(e),elements:t.reduce(((t,n)=>{if(je(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Object.assign(Object.assign({},n),{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}hydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.parse(t),elements:n.map((e=>{var t;const n=null===(t=this.elementCache.get(e.id))||void 0===t?void 0:t.get(e.versionNonce);if(!n)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return n}))}}dehydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.stringify(t),elements:n.map((e=>{this.elementCache.has(e.id)||this.elementCache.set(e.id,new Map);const t=this.elementCache.get(e.id);return t.has(e.versionNonce)||t.set(e.versionNonce,gi(e)),{id:e.id,versionNonce:e.versionNonce}}))}}getSnapshotForTest(){return{recording:this.recording,stateHistory:this.stateHistory.map((e=>this.hydrateHistoryEntry(e))),redoStack:this.redoStack.map((e=>this.hydrateHistoryEntry(e)))}}clear(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}shouldCreateEntry(e){const{lastEntry:t}=this;if(!t)return!0;if(e.elements.length!==t.elements.length)return!0;for(let n=e.elements.length-1;n>-1;n--){const r=e.elements[n],i=t.elements[n];if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}let n;for(n in e.appState){var r,i;if("editingLinearElement"===n)if((null===(r=e.appState[n])||void 0===r?void 0:r.elementId)===(null===(i=t.appState[n])||void 0===i?void 0:i.elementId))continue;if("selectedElementIds"!==n&&"selectedGroupIds"!==n&&e.appState[n]!==t.appState[n])return!0}return!1}pushEntry(e,t){const n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}clearRedoStack(){this.redoStack.splice(0,this.redoStack.length)}redoOnce(){if(0===this.redoStack.length)return null;const e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}undoOnce(){if(1===this.stateHistory.length)return null;const e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}setCurrentState(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}resumeRecording(){this.recording=!0}record(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}},zu=[{icon:(0,x.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,x.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:en},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:$t},{icon:(0,x.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,x.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Wt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Kt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,x.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:Vt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 6 6",children:(0,x.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[qt,Yt]},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:tn},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:Qt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}];n(1292);const Nu={cut:[wn("CtrlOrCmd+X")],copy:[wn("CtrlOrCmd+C")],paste:[wn("CtrlOrCmd+V")],copyStyles:[wn("CtrlOrCmd+Alt+C")],pasteStyles:[wn("CtrlOrCmd+Alt+V")],selectAll:[wn("CtrlOrCmd+A")],deleteSelectedElements:[wn("Del")],duplicateSelection:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))],sendBackward:[wn("CtrlOrCmd+[")],bringForward:[wn("CtrlOrCmd+]")],sendToBack:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[wn("Shift+Alt+C")],copyAsSvg:[],group:[wn("CtrlOrCmd+G")],ungroup:[wn("CtrlOrCmd+Shift+G")],gridMode:[wn("CtrlOrCmd+'")],zenMode:[wn("Alt+Z")],stats:[wn("Alt+/")],addToLibrary:[],flipHorizontal:[wn("Shift+H")],flipVertical:[wn("Shift+V")],viewMode:[wn("Alt+R")]},Ru=e=>{const t=Nu[e];return t&&t.length>0?t[0]:""},Hu=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a}=e;return(0,x.jsx)(Ol,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,children:(0,x.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,x.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name,s=e.contextItemLabel?b(e.contextItemLabel):"";return(0,x.jsx)("li",{"data-testid":i,onClick:n,children:(0,x.jsxs)("button",{className:ye("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:()=>o.executeAction(e),children:[(0,x.jsx)("div",{className:"context-menu-option__label",children:s}),(0,x.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?Ru(i):""})]})},t)}))})})},Bu=new WeakMap,Fu={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,at.render)((0,x.jsx)(Hu,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=Bu.get(e);t&&((0,at.unmountComponentAtNode)(t),t.remove(),Bu.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState}),(e=>{let t=Bu.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),Bu.set(e,t),t)})(e.container))}},Uu=e=>{var t;let{appState:n,elements:r,renderAction:i,elementType:o}=e;const a=Oa(_a(r),n),s=Boolean(n.editingElement),l=Gh(),c="rtl"===document.documentElement.getAttribute("dir"),d=Pa(o)||a.some((e=>Pa(e.type)&&!Mn(e.backgroundColor))),u=Pa(o)||a.some((e=>Pa(e.type)));let h=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==h){h=null;break}return(0,x.jsxs)("div",{className:"panelColumn",children:[(Da(o)&&"image"!==o&&"image"!==h||a.some((e=>Da(e.type))))&&i("changeStrokeColor"),u&&i("changeBackgroundColor"),d&&i("changeFillStyle"),(za(o)||a.some((e=>za(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Na(o)||a.some((e=>Na(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Ra(o)||a.some((e=>Ra(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeSharpness")}),(Ha(o)||a.some((e=>Ha(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),(Ba(o)||a.some((e=>Ba(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.layers")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.align")}),(0,x.jsxs)("div",{className:"buttonList",children:[c?(0,x.jsxs)(x.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,x.jsxs)(x.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,x.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&!s&&a.length>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.actions")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("duplicateSelection"),i("deleteSelectedElements"),i("group"),i("ungroup")]})]})]})},Vu=e=>{let{canvas:t,elementType:n,setAppState:r,onImageAction:i}=e;return(0,x.jsx)(x.Fragment,{children:zu.map(((e,o)=>{let{value:a,icon:s,key:l}=e;const c=b("toolBar.".concat(a)),d=l&&("string"==typeof l?l:l[0]),u=d?"".concat(un(d)," ").concat(b("helpDialog.or")," ").concat(o+1):"".concat(o+1);return(0,x.jsx)(Za,{className:"Shape",type:"radio",icon:s,checked:n===a,name:"editor-current-shape",title:"".concat(un(c)," — ").concat(u),keyBindingLabel:"".concat(o+1),"aria-label":un(c),"aria-keyshortcuts":u,"data-testid":a,onChange:e=>{let{pointerType:n}=e;r({elementType:a,multiElement:null,selectedElementIds:{}}),vn(t,a),"image"===a&&i({pointerType:n})}},a)}))})},Wu=e=>{let{renderAction:t,zoom:n}=e;return(0,x.jsx)(qd,{gap:1,children:(0,x.jsxs)(Zd,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},Ku=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,x.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const Gu=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(Za,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:Is,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:Gh(),children:n>0&&(0,x.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},Yu=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=Zh(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,x.jsx)(x.Fragment,{children:o&&(0,x.jsx)(Zl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,x.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const Zu="filter"in document.createElement("canvas").getContext("2d"),qu=()=>(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{children:b("canvasError.cannotShowPreview")}),(0,x.jsx)("p",{children:(0,x.jsx)("span",{children:b("canvasError.canvasTooBig")})}),(0,x.jsxs)("em",{children:["(",b("canvasError.canvasTooBigTip"),")"]})]}),Xu=(e,t)=>{(0,at.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,at.render)((0,x.jsx)(qu,{}),t)},$u=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,x.jsx)("button",{className:"ExportDialog-imageExportButton",style:{"--button-color":rt[i][o],"--button-color-darker":rt[i][o+1],"--button-color-darkest":rt[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},Ju=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Ma(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,v=h?Ta(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&fd(v,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>rd(t).then((()=>{Xu(t,e)})))).catch((t=>{console.error(t),Xu(new Ka,e)}))}),[n,i,v,m,a,f]),(0,x.jsxs)("div",{className:"ExportDialog",children:[(0,x.jsx)("div",{className:"ExportDialog__preview",ref:g}),Zu&&s.renderAction("exportWithDarkMode"),(0,x.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,x.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,x.jsx)(Yd,{checked:h,onChange:e=>p(e),children:b("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,x.jsx)(Zd,{gap:2,children:s.renderAction("changeExportScale")}),(0,x.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,x.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Hc&&s.renderAction("changeProjectName")}),(0,x.jsxs)(Zd,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,x.jsx)($u,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(v),children:"PNG"}),(0,x.jsx)($u,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(v),children:"SVG"}),Hd&&(0,x.jsx)($u,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(v),color:"gray",shade:7,children:rs})]})]})},Qu=e=>{let{elements:t,appState:n,files:a,exportPadding:s=o.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,r.useState)(!1),g=i().useCallback((()=>{p(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:ss,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:Gh(),title:b("buttons.exportImage")}),h&&(0,x.jsx)(Zl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,x.jsx)(Ju,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const eh=e=>{let{children:t,side:n,className:r}=e;return(0,x.jsx)("div",{className:ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const th=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{elementType:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if("arrow"===i||"line"===i)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i)return b("hints.freeDraw");if("text"===i)return b("hints.text");if("image"===t.elementType&&t.pendingImageElement)return b("hints.placeImage");const c=Ta(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):_e(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length){if(je(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?b("hints.lineEditor_pointSelected"):b("hints.lineEditor_nothingSelected"):b("hints.lineEditor_info");if(null!=(d=c[0])&&("rectangle"===d.type||"diamond"===d.type||"ellipse"===d.type||"image"===d.type))return b("hints.bindTextToElement")}var d;return 1===c.length&&Ee(c[0])?b("hints.text_selected"):t.editingElement&&Ee(t.editingElement)?b("hints.text_editing"):"selection"!==i||c.length||r?null:b("hints.canvasPanning")})({appState:t,elements:n,isMobile:r});return i?(i=wn(i),(0,x.jsx)("div",{className:"HintViewer",children:(0,x.jsx)("span",{children:i})})):null},nh={CHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,x.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,x.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})},rh=e=>(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:e.checked?nh.CHECKED:nh.UNCHECKED})]});var ih=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const oh=e=>{let{heading:t,children:n}=e,r=ih(e,["heading","children"]);const{id:i}=Zh(),o=(0,x.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:b("headings.".concat(t))});return(0,x.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,x.jsxs)(x.Fragment,{children:[o,n]})}))};n(580);const ah=e=>{let{children:t,className:n,mobile:r}=e;return(0,x.jsx)("div",{className:ye("UserList",n,{UserList_mobile:r}),children:t})},sh=(0,x.jsx)("svg",{viewBox:"0 0 576 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),lh=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(un(b("toolBar.library"))," — 0"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":un(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:sh})]})},ch=e=>{let{appState:t,elements:n,libraryMenu:r,actionManager:o,renderJSONExportDialog:a,renderImageExportDialog:s,setAppState:l,onCollabButtonClick:c,onLockToggle:d,canvas:u,isCollaborating:h,renderCustomFooter:p,viewModeEnabled:g,showThemeBtn:m,onImageAction:f,renderTopRightUI:v}=e;return(0,x.jsxs)(x.Fragment,{children:[!g&&(0,x.jsxs)(eh,{side:"top",className:"App-top-bar",children:[(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"center",children:[(0,x.jsxs)(Zd,{gap:1,className:"App-toolbar-container",children:[(0,x.jsxs)(Kl,{padding:1,className:"App-toolbar",children:[e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Vu,{canvas:u,elementType:t.elementType,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;f({insertOnCanvasDirectly:"mouse"!==t})}})})]}),v&&v(!0,t),(0,x.jsx)(rh,{checked:t.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,x.jsx)(lh,{appState:t,setAppState:l,isMobile:!0})]}),r]})}),(0,x.jsx)(th,{appState:t,elements:n,isMobile:!0})]}),(0,x.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,x.jsxs)(Kl,{padding:0,children:["canvas"===t.openMenu?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,x.jsx)("div",{className:"panelColumn",children:(0,x.jsxs)(qd,{gap:4,children:[g?(0,x.jsxs)(x.Fragment,{children:[a(),s()]}):(0,x.jsxs)(x.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,x.jsx)(Gu,{isCollaborating:h,collaboratorCount:t.collaborators.size,onClick:c}),(0,x.jsx)(Ku,{actionManager:o,appState:t,setAppState:l,showThemeBtn:m})]}),null==p?void 0:p(!0,t),t.collaborators.size>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.collaborators")}),(0,x.jsx)(ah,{mobile:!0,children:Array.from(t.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[t,n]=e;return(0,x.jsx)(i().Fragment,{children:o.renderAction("goToCollaborator",{id:t})},t)}))})]})]})})}):"shape"===t.openMenu&&!g&&wa(t,n)?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,x.jsx)(Uu,{appState:t,elements:n,renderAction:o.renderAction,elementType:t.elementType})}):null,(0,x.jsxs)("footer",{className:"App-toolbar",children:[g?(0,x.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,x.jsxs)("div",{className:"App-toolbar-content",children:[o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(t.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),t.scrolledOutside&&!t.openMenu&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},Aa(n,t)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const dh=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=Pd(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},null),o.appendChild(r),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(r)}}),[e.spreadsheet,e.chartType,e.selected]),(0,x.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,x.jsx)("div",{ref:t})})},uh=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),nc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,x.jsx)(Zl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,x.jsxs)("div",{className:"container",children:[(0,x.jsx)(dh,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,x.jsx)(dh,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const hh=()=>(0,x.jsxs)("div",{className:"HelpDialog--header",children:[(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.documentation")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.blog")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.github")})]}),ph=e=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{children:e.title}),e.children]}),gh=e=>(0,x.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),mh=e=>(0,x.jsx)("div",{style:{width:"49%"},children:e.children}),fh=e=>(0,x.jsxs)("div",{className:"HelpDialog--island",children:[(0,x.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),bh=e=>(0,x.jsx)("div",{className:"HelpDialog--shortcut",children:(0,x.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,x.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,x.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,x.jsxs)(i().Fragment,{children:[(0,x.jsx)(xh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});bh.defaultProps={isOr:!0};const xh=e=>(0,x.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),vh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(Zl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,x.jsx)(hh,{}),(0,x.jsx)(ph,{title:b("helpDialog.shortcuts"),children:(0,x.jsxs)(gh,{children:[(0,x.jsxs)(mh,{children:[(0,x.jsxs)(fh,{caption:b("helpDialog.shapes"),children:[(0,x.jsx)(bh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,x.jsx)(bh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,x.jsx)(bh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,x.jsx)(bh,{label:b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,x.jsx)(bh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,x.jsx)(bh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,x.jsx)(bh,{label:b("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,x.jsx)(bh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,x.jsx)(bh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,x.jsx)(bh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,x.jsx)(bh,{label:b("helpDialog.editSelectedShape"),shortcuts:[wn("Enter"),b("helpDialog.doubleClick")]}),(0,x.jsx)(bh,{label:b("helpDialog.textNewLine"),shortcuts:[wn("Enter"),wn("Shift+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.textFinish"),shortcuts:[wn("Esc"),wn("CtrlOrCmd+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,x.jsx)(bh,{label:b("helpDialog.preventBinding"),shortcuts:[wn("CtrlOrCmd")]})]}),(0,x.jsxs)(fh,{caption:b("helpDialog.view"),children:[(0,x.jsx)(bh,{label:b("buttons.zoomIn"),shortcuts:[wn("CtrlOrCmd++")]}),(0,x.jsx)(bh,{label:b("buttons.zoomOut"),shortcuts:[wn("CtrlOrCmd+-")]}),(0,x.jsx)(bh,{label:b("buttons.resetZoom"),shortcuts:[wn("CtrlOrCmd+0")]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,x.jsx)(bh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,x.jsx)(bh,{label:b("buttons.zenMode"),shortcuts:[wn("Alt+Z")]}),(0,x.jsx)(bh,{label:b("labels.showGrid"),shortcuts:[wn("CtrlOrCmd+'")]}),(0,x.jsx)(bh,{label:b("labels.viewMode"),shortcuts:[wn("Alt+R")]}),(0,x.jsx)(bh,{label:b("labels.toggleTheme"),shortcuts:[wn("Alt+Shift+D")]}),(0,x.jsx)(bh,{label:b("stats.title"),shortcuts:[wn("Alt+/")]})]})]}),(0,x.jsx)(mh,{children:(0,x.jsxs)(fh,{caption:b("helpDialog.editor"),children:[(0,x.jsx)(bh,{label:b("labels.selectAll"),shortcuts:[wn("CtrlOrCmd+A")]}),(0,x.jsx)(bh,{label:b("labels.multiSelect"),shortcuts:[wn("Shift+".concat(b("helpDialog.click")))]}),(0,x.jsx)(bh,{label:b("labels.moveCanvas"),shortcuts:[wn("Space+".concat(b("helpDialog.drag"))),wn("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,x.jsx)(bh,{label:b("labels.cut"),shortcuts:[wn("CtrlOrCmd+X")]}),(0,x.jsx)(bh,{label:b("labels.copy"),shortcuts:[wn("CtrlOrCmd+C")]}),(0,x.jsx)(bh,{label:b("labels.paste"),shortcuts:[wn("CtrlOrCmd+V")]}),(0,x.jsx)(bh,{label:b("labels.copyAsPng"),shortcuts:[wn("Shift+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.copyStyles"),shortcuts:[wn("CtrlOrCmd+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.pasteStyles"),shortcuts:[wn("CtrlOrCmd+Alt+V")]}),(0,x.jsx)(bh,{label:b("labels.delete"),shortcuts:[wn("Del")]}),(0,x.jsx)(bh,{label:b("labels.sendToBack"),shortcuts:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,x.jsx)(bh,{label:b("labels.bringToFront"),shortcuts:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,x.jsx)(bh,{label:b("labels.sendBackward"),shortcuts:[wn("CtrlOrCmd+[")]}),(0,x.jsx)(bh,{label:b("labels.bringForward"),shortcuts:[wn("CtrlOrCmd+]")]}),(0,x.jsx)(bh,{label:b("labels.alignTop"),shortcuts:[wn("CtrlOrCmd+Shift+Up")]}),(0,x.jsx)(bh,{label:b("labels.alignBottom"),shortcuts:[wn("CtrlOrCmd+Shift+Down")]}),(0,x.jsx)(bh,{label:b("labels.alignLeft"),shortcuts:[wn("CtrlOrCmd+Shift+Left")]}),(0,x.jsx)(bh,{label:b("labels.alignRight"),shortcuts:[wn("CtrlOrCmd+Shift+Right")]}),(0,x.jsx)(bh,{label:b("labels.duplicateSelection"),shortcuts:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))]}),(0,x.jsx)(bh,{label:b("buttons.undo"),shortcuts:[wn("CtrlOrCmd+Z")]}),(0,x.jsx)(bh,{label:b("buttons.redo"),shortcuts:lt?[wn("CtrlOrCmd+Y"),wn("CtrlOrCmd+Shift+Z")]:[wn("CtrlOrCmd+Shift+Z")]}),(0,x.jsx)(bh,{label:b("labels.group"),shortcuts:[wn("CtrlOrCmd+G")]}),(0,x.jsx)(bh,{label:b("labels.ungroup"),shortcuts:[wn("CtrlOrCmd+Shift+G")]}),(0,x.jsx)(bh,{label:b("labels.flipHorizontal"),shortcuts:[wn("Shift+H")]}),(0,x.jsx)(bh,{label:b("labels.flipVertical"),shortcuts:[wn("Shift+V")]}),(0,x.jsx)(bh,{label:b("labels.showStroke"),shortcuts:[wn("S")]}),(0,x.jsx)(bh,{label:b("labels.showBackground"),shortcuts:[wn("G")]})]})})]})})]})})};n(5080);const yh=e=>{let{children:t,color:n}=e;return(0,x.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":rt[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":rt[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":rt[n][9]},children:t})},wh=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,x.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,x.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,x.jsxs)(yh,{color:"lime",children:[(0,x.jsx)("div",{className:"Card-icon",children:ls}),(0,x.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,x.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!Hc&&i.renderAction("changeProjectName")]}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction($d)}})]}),s&&(0,x.jsxs)(yh,{color:"pink",children:[(0,x.jsx)("div",{className:"Card-icon",children:Qa}),(0,x.jsx)("h2",{children:b("exportDialog.link_title")}),(0,x.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>s(t,n,r,a)})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},kh=e=>{let{elements:t,appState:n,files:o,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,r.useState)(!1),u=i().useCallback((()=>{d(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{d(!0)},"data-testid":"json-export-button",icon:as,type:"button","aria-label":b("buttons.export"),showAriaLabel:Gh(),title:b("buttons.export")}),c&&(0,x.jsx)(Zl,{onCloseRequest:u,title:b("buttons.export"),children:(0,x.jsx)(wh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},_h=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=qc({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return fd(_a(a),Object.assign(Object.assign({},s),{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:l,viewBackgroundColor:c},((e,t)=>{var n;const r=document.createElement("canvas");if(i){"function"==typeof o&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");const n=Math.max(e,t),a=i/n;return r.width=e*a,r.height=t*a,{canvas:r,scale:a}}const a=(null==o?void 0:o(e,t))||{width:e,height:t};return r.width=a.width,r.height=a.height,{canvas:r,scale:null!==(n=a.scale)&&void 0!==n?n:1}}))},Eh=async e=>{var t;let{mimeType:n=o.LO.png,quality:r}=e;n===o.LO.png&&"number"==typeof r&&console.warn('"quality" will be ignored for "'.concat(o.LO.png,'" mimeType')),"image/jpg"===n&&(n=o.LO.jpg),n!==o.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(o.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const i=await _h(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Sh=async e=>{let{elements:t,appState:n=Pn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=qc({elements:t,appState:n},null,null);return bd(_a(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)};n(9295),n(9781);const Ch=e=>{let{libItem:t,appState:n,index:i,onChange:o,onRemove:a}=e;const s=(0,r.useRef)(null),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Sh({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:rt.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,x.jsxs)("div",{className:"single-library-item",children:[(0,x.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,x.jsx)(Za,{"aria-label":b("buttons.remove"),type:"button",icon:Ms,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:b("buttons.remove")}),(0,x.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,x.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,x.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,x.jsx)("span",{style:{fontWeight:500,color:rt.gray[6]},children:b("publishDialog.itemName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,i)}})]}),(0,x.jsx)("span",{className:"error",children:t.error})]})]})},jh="publish-library-data",Ih=async e=>{const t=128,n=Math.round(8),r=Math.max(Math.round(2),2),i=((e,t)=>{if(!e.length||t<1)return[];let n=0,r=0;const i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i})(e,6),a=document.createElement("canvas");a.width=i[0].length*t+(i[0].length+1)*(2*n)-2*n,a.height=i.length*t+(i.length+1)*(2*n)-2*n;const s=a.getContext("2d");s.fillStyle=rt.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await _h({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(i/6)*(t+2*n),d=i%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=r,s.strokeStyle=rt.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await ad(new File([await rd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Mh=e=>{let{onClose:t,libraryItems:n,appState:i,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,r.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(jh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,m]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{m(n.slice())}),[n]);const f=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},v=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(jh,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,x.jsx)(Zl,{onCloseRequest:v,title:b("publishDialog.title"),className:"publish-library",children:y?(0,x.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=b("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return m(t),void p(!1);const r=await Ih(g),i={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:g},l=JSON.stringify(i,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",d.name),u.append("authorName",d.authorName),u.append("githubHandle",d.githubHandle),u.append("name",d.name),u.append("description",d.description),u.append("twitterHandle",d.twitterHandle),u.append("website",d.website),fetch("".concat("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries","/submit"),{method:"post",body:u}).then((e=>e.ok?e.json().then((e=>{let{url:t}=e;localStorage.removeItem(jh),a({url:t,authorName:d.authorName,items:g})})):e.json().catch((()=>{throw new Error(e.statusText||"something went wrong")})).then((t=>{throw new Error(t.message||e.statusText||"something went wrong")}))),(e=>{console.error(e),s(e),p(!1)})).catch((e=>{console.error(e),s(e),p(!1)}))},children:[(0,x.jsxs)("div",{className:"publish-library-note",children:[b("publishDialog.noteDescription.pre"),(0,x.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteDescription.link")})," ",b("publishDialog.noteDescription.post")]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteGuidelines.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteGuidelines.link")}),b("publishDialog.noteGuidelines.post")]}),(0,x.jsx)("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,x.jsx)("div",{className:"single-library-item-wrapper",children:(0,x.jsx)(Ch,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,m(n)},onRemove:c})},n))})),(0,x.jsx)("div",{className:"selected-library-items",children:e})})(),(0,x.jsxs)("div",{className:"publish-library__fields",children:[(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:f,placeholder:b("publishDialog.placeholder.libraryName")})]}),(0,x.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryDesc")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:f,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.authorName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:f,placeholder:b("publishDialog.placeholder.authorName")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.githubUsername")}),(0,x.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:f,placeholder:b("publishDialog.placeholder.githubHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.twitterUsername")}),(0,x.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:f,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.website")}),(0,x.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:d.website,onChange:f,placeholder:b("publishDialog.placeholder.website")})]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteLicense.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteLicense.link")}),b("publishDialog.noteLicense.post")]})]}),(0,x.jsxs)("div",{className:"publish-library__buttons",children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:v,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,x.jsx)(Za,{type:"submit",title:b("buttons.submit"),"aria-label":b("buttons.submit"),label:b("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,x.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})};n(4406);var Th=n(2891);n(694);const Oh=(0,x.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,x.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),Lh=e=>{let{id:t,elements:n,files:i,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=Gh(),g=a&&(0,x.jsx)("div",{className:"library-unit__adder",children:Oh});return(0,x.jsxs)("div",{className:ye("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,x.jsx)("div",{className:ye("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!n,onClick:n||a?e=>{t&&e.shiftKey?c(t,e):s()}:void 0,onDragStart:e=>{h(!1),e.dataTransfer.setData(o.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,x.jsx)(Yd,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const Ah=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:i,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:m,onPublish:f,resetLibrary:v}=e;const y=(0,r.useCallback)((()=>{const e=g.length?b("alerts.removeItemsFromsLibrary",{count:g.length}):b("alerts.resetLibrary"),t=g.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return(0,x.jsx)(Xl,{onConfirm:()=>{g.length?n():v(),k(!1)},onCancel:()=>{k(!1)},title:t,children:(0,x.jsx)("p",{children:e})})}),[g,n,v]),[w,k]=(0,r.useState)(!1),_=Gh(),E=_?4:6,S=d||window.location.origin+window.location.pathname,C=g.some((e=>{var n;return"published"===(null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.status)})),j=e=>{var t,n,r,i,o;return(0,x.jsx)(qd,{children:(0,x.jsx)(Lh,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:h,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||(()=>{}),id:(null===(i=e.item)||void 0===i?void 0:i.id)||null,selected:!(null===(o=e.item)||void 0===o||!o.id)&&g.includes(e.item.id),onToggle:(e,t)=>{m(e,t)}})},e.key)},I=e=>{const t=e.map((e=>e.id?j({item:e,onClick:()=>a(e.elements),key:e.id}):j({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,Th.chunk)(t,E);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(E-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,x.jsx)(Zd,{align:"center",gap:1,children:e},t))))},M=t.filter((e=>"published"===e.status)),T=[...s.length?[{id:null,elements:s}]:[],...t.filter((e=>"published"!==e.status))];return(0,x.jsxs)("div",{className:"library-menu-items-container",children:[w&&y(),(0,x.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,r=b(e?"buttons.remove":"buttons.resetLibrary");return(0,x.jsxs)("div",{className:"library-actions",children:[(!e||!_)&&(0,x.jsx)(Za,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:ns,onClick:()=>{(async e=>{const t=await Uc({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:ls,onClick:async()=>{(async e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e},n=JSON.stringify(t,null,2);await Vc(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--export",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,x.jsx)(Za,{type:"button",title:r,"aria-label":r,icon:is,onClick:()=>k(!0),className:"library-actions--remove",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!C&&(0,x.jsx)(Wl,{label:b("hints.publishLibrary"),children:(0,x.jsxs)(Za,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:ll,className:"library-actions--publish",onClick:f,children:[!_&&(0,x.jsx)("label",{children:b("buttons.publishLibrary")}),g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,x.jsx)("a",{href:"".concat("https://libraries.excalidraw.com","?target=").concat(window.name||"_blank","&referrer=").concat(S,"&useHash=true&token=").concat(p,"&theme=").concat(l,"&version=").concat(o.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:b("labels.libraries")})]},"library-header"),(0,x.jsxs)(qd,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"separator",children:b("labels.personalLib")}),I(T)]}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),I(M)]})]})]})},Ph=(e,t)=>e.filter((e=>t.includes(e.id))),Dh=e=>{let{onClose:t,onInsertShape:n,pendingElements:i,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const m=(0,r.useRef)(null);((e,t)=>{(0,r.useEffect)((()=>{const n=n=>{e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),()=>{document.removeEventListener("pointerdown",n)}}),[e,t])})(m,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,r.useEffect)((()=>{const e=e=>{e.key===Ht&&t()};return document.addEventListener(o.Ks.KEYDOWN,e),()=>{document.removeEventListener(o.Ks.KEYDOWN,e)}}),[t]);const[f,v]=(0,r.useState)([]),[y,w]=(0,r.useState)("preloading"),[k,_]=(0,r.useState)([]),[E,S]=(0,r.useState)(!1),[C,j]=(0,r.useState)(null),I=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{I.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{v(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(I.current)})),[h]);const M=(0,r.useCallback)((async()=>{const e=await h.loadLibrary(),t=e.filter((e=>!k.includes(e.id)));h.saveLibrary(t).catch((t=>{v(e),l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),_([]),v(t)}),[h,l,k,_]),T=(0,r.useCallback)((()=>{h.resetLibrary(),v([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const t=await h.loadLibrary(),n=[{status:"unpublished",elements:e,id:Gr(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((e=>{v(t),l({errorMessage:b("alerts.errorAddingToLibrary")})})),v(n)}),[a,h,l]),L=(0,r.useCallback)((()=>(0,x.jsxs)(Zl,{onCloseRequest:()=>j(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,x.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:C.authorName})," ",(0,x.jsx)("a",{href:null==C?void 0:C.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,x.jsx)(Za,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>j(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[j,C]),A=(0,r.useCallback)((e=>{S(!1),j({url:e.url,authorName:e.authorName});const t=f.slice();t.forEach((e=>{k.includes(e.id)&&(e.status="published")})),h.saveLibrary(t),v(t)}),[S,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,x.jsxs)(Kl,{padding:1,ref:m,className:"layer-ui__library",children:[E&&(0,x.jsx)(Mh,{onClose:()=>S(!1),libraryItems:Ph(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>_(k.filter((t=>t!==e)))}),C&&L(),"loading"===y?(0,x.jsx)("div",{className:"layer-ui__library-message",children:b("labels.libraryLoadingMessage")}):(0,x.jsx)(Ah,{libraryItems:f,onRemoveFromLibrary:M,onAddToLibrary:O,onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:k,onToggle:(e,t)=>{if(!k.includes(e)){if(t.shiftKey&&P){const t=f.findIndex((e=>e.id===P)),n=f.findIndex((t=>t.id===e));if(-1===t||-1===n)return void _([...k,e]);const r=Ln(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);_(i)}else _([...k,e]);D(e)}else D(null),_(k.filter((t=>t!==e)))},onPublish:()=>S(!0),resetLibrary:T})]})};n(3336),n(276);var zh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Nh=e=>{let{actionManager:t,appState:n,files:i,setAppState:a,canvas:s,elements:l,onCollabButtonClick:c,onLockToggle:d,onInsertElements:u,zenModeEnabled:h,showExitZenModeBtn:p,showThemeBtn:g,toggleZenMode:m,isCollaborating:f,renderTopRightUI:y,renderCustomFooter:w,viewModeEnabled:k,libraryReturnUrl:_,UIOptions:E,focusContainer:S,library:C,id:j,onImageAction:I}=e;const M=Gh(),T=()=>E.canvasActions.export?(0,x.jsx)(kh,{elements:l,appState:n,files:i,actionManager:t,exportOpts:E.canvasActions.export,canvas:s}):null,O=()=>{if(!E.canvasActions.saveAsImage)return null;const e=e=>async t=>{const r=await Gd(e,t,n,i,{exportBackground:n.exportBackground,name:n.name,viewBackgroundColor:n.viewBackgroundColor}).catch(In).catch((e=>{console.error(e),a({errorMessage:e.message})}));n.exportEmbedScene&&r&&Qc(r)&&a({fileHandle:r})};return(0,x.jsx)(Qu,{elements:l,appState:n,files:i,actionManager:t,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},L=()=>(0,x.jsx)("div",{style:{width:".625em"}}),A=(0,r.useCallback)((()=>{!!document.querySelector(".Dialog")||a({isLibraryOpen:!1})}),[a]),P=(0,r.useCallback)((()=>{a({selectedElementIds:{},selectedGroupIds:{}})}),[a]),D=n.isLibraryOpen?(0,x.jsx)(Dh,{pendingElements:Ta(l,n,!0),onClose:A,onInsertShape:u,onAddToLibrary:P,setAppState:a,libraryReturnUrl:_,focusContainer:S,library:C,theme:n.theme,files:i,id:j,appState:n}):null,z=(0,x.jsxs)(x.Fragment,{children:[n.isLoading&&(0,x.jsx)(v,{}),n.errorMessage&&(0,x.jsx)(Yu,{message:n.errorMessage,onClose:()=>a({errorMessage:null})}),n.showHelpDialog&&(0,x.jsx)(vh,{onClose:()=>{a({showHelpDialog:!1})}}),n.pasteDialog.shown&&(0,x.jsx)(uh,{setAppState:a,appState:n,onInsertChart:u,onClose:()=>a({pasteDialog:{shown:!1,data:null}})})]});return M?(0,x.jsxs)(x.Fragment,{children:[z,(0,x.jsx)(ch,{appState:n,elements:l,actionManager:t,libraryMenu:D,renderJSONExportDialog:T,renderImageExportDialog:O,setAppState:a,onCollabButtonClick:c,onLockToggle:d,canvas:s,isCollaborating:f,renderCustomFooter:w,viewModeEnabled:k,showThemeBtn:g,onImageAction:I,renderTopRightUI:y})]}):(0,x.jsxs)("div",{className:ye("layer-ui__wrapper",{"disable-pointerEvents":n.draggingElement||n.resizingElement||n.editingElement&&!Ee(n.editingElement)}),children:[z,(()=>{const e=wa(n,l);return(0,x.jsx)(eh,{side:"top",children:(0,x.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,x.jsxs)(qd,{gap:4,className:ye({"disable-pointerEvents":h}),children:[k?(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsx)(qd,{gap:4,children:(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[T(),O()]})})})}):(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsxs)(qd,{gap:4,children:[(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[t.renderAction("clearCanvas"),(0,x.jsx)(L,{}),t.renderAction("loadScene"),T(),O(),(0,x.jsx)(L,{}),c&&(0,x.jsx)(Gu,{isCollaborating:f,collaboratorCount:n.collaborators.size,onClick:c})]}),(0,x.jsx)(Ku,{actionManager:t,appState:n,setAppState:a,showThemeBtn:g}),n.fileHandle&&(0,x.jsx)(x.Fragment,{children:t.renderAction("saveToActiveFile")})]})})}),e&&(0,x.jsx)(oh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(n.height-(n.fileHandle?248:200),"px")},children:(0,x.jsx)(Uu,{appState:n,elements:l,renderAction:t.renderAction,elementType:n.elementType})})})]}),!k&&(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"start",children:[(0,x.jsxs)(Zd,{gap:1,className:ye("App-toolbar-container",{"zen-mode":h}),children:[(0,x.jsx)(rh,{zenModeEnabled:h,checked:n.elementLocked,onChange:d,title:b("toolBar.lock")}),(0,x.jsxs)(Kl,{padding:1,className:ye("App-toolbar",{"zen-mode":h}),children:[(0,x.jsx)(th,{appState:n,elements:l,isMobile:M}),e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Vu,{canvas:s,elementType:n.elementType,setAppState:a,onImageAction:e=>{let{pointerType:t}=e;I({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,x.jsx)(lh,{appState:n,setAppState:a})]}),D]})}),(0,x.jsxs)("div",{className:ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":h}),children:[(0,x.jsx)(ah,{children:n.collaborators.size>0&&Array.from(n.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[n,r]=e;return(0,x.jsx)(Wl,{label:r.username||"Unknown user",children:t.renderAction("goToCollaborator",{id:n})},n)}))}),null==y?void 0:y(M,n)]})]})})})(),(0,x.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":h}),children:(0,x.jsx)(qd,{gap:2,children:(0,x.jsxs)(oh,{heading:"canvasActions",children:[(0,x.jsx)(Kl,{padding:1,children:(0,x.jsx)(Wu,{renderAction:t.renderAction,zoom:n.zoom})}),!k&&(0,x.jsxs)("div",{className:ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:[t.renderAction("undo",{size:"small"}),t.renderAction("redo",{size:"small"})]})]})})}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:null==w?void 0:w(!1,n)}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":h}),children:t.renderAction("toggleShortcuts")}),(0,x.jsx)("button",{className:ye("disable-zen-mode",{"disable-zen-mode--visible":p}),onClick:m,children:b("buttons.exitZenMode")})]}),n.scrolledOutside&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{a(Object.assign({},Aa(l,n)))},children:b("buttons.scrollBackToContent")})]})},Rh=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return zh(e,["suggestedBindings","startBoundElement"])},r=n(e.appState),i=n(t.appState),o=Object.keys(r);return e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&o.every((e=>r[e]===i[e]))},Hh=i().memo(Nh,Rh);n(1528);const Bh=e=>{var t;const n=Gh(),r=Qe(e.elements),i=Oa(e.elements,e.appState),o=Qe(i);return n&&e.appState.openMenu?null:(0,x.jsx)("div",{className:"Stats",children:(0,x.jsxs)(Kl,{padding:2,children:[(0,x.jsx)("div",{className:"close",onClick:e.onClose,children:Ms}),(0,x.jsx)("h3",{children:b("stats.title")}),(0,x.jsx)("table",{children:(0,x.jsxs)("tbody",{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.scene")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:e.elements.length})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.element")})}),i.length>1&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.selected")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"x"}),(0,x.jsx)("td",{children:Math.round(o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"y"}),(0,x.jsx)("td",{children:Math.round(o[1])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.angle")}),(0,x.jsx)("td",{children:"".concat(Math.round(180*i[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})};n(9757);const Fh=e=>{let{message:t,clearToast:n}=e;const i=(0,r.useRef)(0),a=(0,r.useCallback)((()=>i.current=window.setTimeout((()=>n()),o.Lg)),[n]);return(0,r.useEffect)((()=>(a(),()=>clearTimeout(i.current))),[a,t]),(0,x.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==i?void 0:i.current),onMouseLeave:a,children:(0,x.jsx)("p",{className:"Toast__message",children:t})})},Uh=dl({name:"viewMode",perform(e,t){return nc("view","mode","view"),{appState:Object.assign(Object.assign({},t),{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.viewModeEnabled,contextItemLabel:"labels.viewMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===Mt});var Vh=n(200),Wh=n.n(Vh);const Kh=i().createContext(!1),Gh=()=>(0,r.useContext)(Kh),Yh=i().createContext({container:null,id:null}),Zh=()=>(0,r.useContext)(Yh);let qh=!1,Xh=0,$h=0,Jh=0,Qh=!1,ep=!1,tp=!1,np={horizontal:null,vertical:null},rp=0,ip=!1,op=null;const ap={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class sp extends i().Component{constructor(e){super(e),lp.call(this);const t=Pn(),{excalidrawRef:n,viewModeEnabled:r=!1,zenModeEnabled:i=!1,gridModeEnabled:a=!1,theme:s=t.theme,name:l=t.name}=e;if(this.state=Object.assign(Object.assign(Object.assign(Object.assign({},t),{theme:s,isLoading:!0}),this.getCanvasOffsets()),{viewModeEnabled:r,zenModeEnabled:i,gridSize:a?o.k:null,name:l,width:window.innerWidth,height:window.innerHeight}),this.id=we(),n){var c;const e="current"in n&&(null===(c=n.current)||void 0===c?void 0:c.readyPromise)||(()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n})(),t={ready:!0,readyPromise:e,updateScene:this.updateScene,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,refresh:this.refresh,importLibrary:this.importLibraryFromUrl,setToastMessage:this.setToastMessage,id:this.id};"function"==typeof n?n(t):n.current=t,e.resolve(t)}var d;this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.scene=new ir,this.library=new Tu(this),this.history=new Du,this.actionManager=new Mu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(cl),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Iu(e,t,(()=>d.undoOnce())),keyTest:e=>e[zt]&&e.key.toLowerCase()===rn&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ps,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",perform:(t,n)=>Iu(t,n,(()=>e.redoOnce())),keyTest:e=>e[zt]&&e.shiftKey&&e.key.toLowerCase()===rn||lt&&e.ctrlKey&&!e.shiftKey&&e.key===nn,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:gs,"aria-label":b("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1}))(this.history))}renderCanvas(){const e=window.devicePixelRatio,{width:t,height:n,viewModeEnabled:r}=this.state,i=t*e,a=n*e;return r?(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:o.oc.GRAB},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:b("labels.drawingCanvas")}):(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:b("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,{onCollabButtonClick:i,renderTopRightUI:o,renderFooter:a,renderCustomStats:s}=this.props;return(0,x.jsx)("div",{className:ye("excalidraw excalidraw-container",{"excalidraw--view-mode":r,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,x.jsx)(Yh.Provider,{value:this.excalidrawContainerValue,children:(0,x.jsxs)(Kh.Provider,{value:this.isMobile,children:[(0,x.jsx)(Hh,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:i,onLockToggle:this.toggleLock,onInsertElements:e=>this.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null}),zenModeEnabled:n,toggleZenMode:this.toggleZenMode,langCode:m().code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:o,renderCustomFooter:a,viewModeEnabled:r,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&n,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,x.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,x.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,x.jsx)(Bh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:s}),null!==this.state.toastMessage&&(0,x.jsx)(Fh,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,x.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===o.Vi.TEST||"production"===o.Vi.DEVELOPMENT){this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:function(){return n.setState(...arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})}if(this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current)this.resizeObserver=new ResizeObserver((()=>{const{width:e,height:t}=this.excalidrawContainerRef.current.getBoundingClientRect();this.isMobile=e<o.kV||t<o.Yx&&e<o.sS,this.updateDOMRect()})),null===(t=this.resizeObserver)||void 0===t||t.observe(this.excalidrawContainerRef.current);else if(window.matchMedia){const e=window.matchMedia("(max-width: ".concat(o.kV,"px), (max-height: ").concat(o.Yx,"px) and (max-width: ").concat(o.sS,"px)")),t=()=>this.isMobile=e.matches;e.addListener(t),this.detachIsMobileMqHandler=()=>e.removeListener(t)}new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene)}componentWillUnmount(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),clearTimeout(rp),rp=0}removeEventListeners(){var e,t;document.removeEventListener(o.Ks.POINTER_UP,this.removePointer),document.removeEventListener(o.Ks.COPY,this.onCopy),document.removeEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(o.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(o.Ks.SCROLL,this.onScroll),document.removeEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(o.Ks.KEYUP,this.onKeyUp),window.removeEventListener(o.Ks.RESIZE,this.onResize,!1),window.removeEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(o.Ks.BLUR,this.onBlur,!1),window.removeEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.removeEventListener(o.Ks.DROP,this.disableEvent,!1),document.removeEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),null===(t=this.detachIsMobileMqHandler)||void 0===t||t.call(this)}addEventListeners(){var e,t;this.removeEventListeners(),document.addEventListener(o.Ks.POINTER_UP,this.removePointer),document.addEventListener(o.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(o.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(o.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=(e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;const{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e))return t;t=t.parentElement}return document})(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(o.Ks.SCROLL,this.onScroll)),window.addEventListener(o.Ks.RESIZE,this.onResize,!1),window.addEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(o.Ks.BLUR,this.onBlur,!1),window.addEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.addEventListener(o.Ks.DROP,this.disableEvent,!1))}componentDidUpdate(e,t){var n;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?o.k:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((()=>{this.actionManager.executeAction(Ql)}));const{multiElement:r}=t;t.elementType!==this.state.elementType&&null!=r&&Po(this.state)&&Me(r)&&Ho(r,this.state,this.scene,jn(Lo.getPointAtIndexGlobalCoordinates(r,-1)));const i={},a={},s={},l={},c={};this.state.collaborators.forEach(((e,t)=>{if(e.selectedElementIds)for(const n of Object.keys(e.selectedElementIds))n in s||(s[n]=[]),s[n].push(t);e.pointer&&(e.username&&(l[t]=e.username),e.userState&&(c[t]=e.userState),a[t]=_n({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!_e(e)||!this.state.pendingImageElement||e.id!==this.state.pendingImageElement.id)&&(!this.state.editingElement||"text"!==this.state.editingElement.type||e.id!==this.state.editingElement.id))),{atLeastOneVisibleElement:u,scrollBars:h}=cc(d,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:a,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile});h&&(np=h);const p=!Ee(this.state.editingElement)&&(!u&&d.length>0);var g,m;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(m=this.props).onChange)||void 0===g||g.call(m,this.scene.getElementsIncludingDeleted(),this.state,this.files))}static resetTapTwice(){qh=!1}addTextFromPaste(e){const{x:t,y:n}=kn({clientX:$h,clientY:Jh},this.state),r=ui({x:t,y:n,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:o.hs});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}selectShapeTool(e){var t;Qh||vn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}handleTextWysiwyg(e,t){var n=this;let{isExistingElement:r=!1}=t;const i=function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n.scene.replaceAllElements([...n.scene.getElementsIncludingDeleted().map((n=>n.id===e.id&&Ee(n)?hi(n,{text:t,isDeleted:i,originalText:r},o):n))])};ya({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=_n({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:Tn((t=>{i(t,t,!1,!e.containerId),Ea(e)&&Yo(e)})),onSubmit:Tn((t=>{let{text:n,viaKeyboard:o,originalText:a}=t;const s=!n.trim();if(i(n,a,s,!0),!s&&o){const t=e.containerId?e.containerId:e.id;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[t]:!0})})))}s&&oa(this.scene.getElements(),[e]),s&&!r||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&vn(this.canvas,this.state.elementType),this.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current}),this.deselectElements(),i(e.text,e.originalText)}deselectElements(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}getTextElementAtPosition(e,t){const n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ee(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e];const i=r[r.length-1];return Yi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((e=>!(Ee(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return qi(t,e)?Xi(e,o,i):Zi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==op&&op(e)}updateGestureOnPointerDown(e){ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===ap.pointers.size&&(ap.lastCenter=Ou(ap.pointers),ap.initialScale=this.state.zoom.value,ap.initialDistance=Lu(Array.from(ap.pointers.values())))}initialPointerDownState(e){const t=kn(e,this.state),n=Ta(this.scene.getElements(),this.state),[r,i,o,a]=Qe(n);return{origin:t,withCmdOrCtrl:e[zt],originInGrid:jn(Ve(t.x,t.y,this.state.gridSize)),scrollbars:Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Object.assign({},t),originalElements:this.scene.getElements().reduce(((e,t)=>(e.set(t.id,gi(t)),e)),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+r)/2,y:(a+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(e,t){if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;tp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=Tn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=Tn((()=>{tp=!1,vn(this.canvas,this.state.elementType),op=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,n),window.removeEventListener(o.Ks.POINTER_UP,r)}));return op=r,window.addEventListener(o.Ks.POINTER_MOVE,n),window.addEventListener(o.Ks.POINTER_UP,r),!0}isASelectedElement(e){return null!=e&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;const n=10/this.state.zoom.value,[r,i,o,a]=Qe(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return Tn((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return Tn((t=>{t.key===Dt&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return Tn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=jn(((e,t,n)=>{const[r,i]=Qe(e);return[t-r,n-i]})(Ta(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const i=kn(t,this.state),[a,s]=Ve(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.elementType||"line"===this.state.elementType)&&Ne(i.x,i.y,e.origin.x,e.origin.y)<o.f)return;if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(Lo.handlePointDragging(this.state,(e=>this.setState(e)),i.x,i.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}if((e.hit.allHitElements.some((e=>this.isASelectedElement(e)))||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!this.state.editingLinearElement||!t.shiftKey)&&(!this.state.editingLinearElement||(null===(n=this.state.editingLinearElement)||void 0===n?void 0:n.elementId)!==(null===(r=e.hit.element)||void 0===r?void 0:r.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;const n=Ta(this.scene.getElements(),this.state);if(n.length>0&&!e.withCmdOrCtrl){const[r,o]=Ve(i.x-e.drag.offset.x,i.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],l=t.shiftKey;if(function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;const[s,l]=Qe(t),c={x:n-s,y:r-l};t.forEach((n=>{if(fa(i,o,a,e,n,c),!n.groupIds.length){const t=br(n);if(t){const r=ir.getScene(n).getElement(t);fa(i,o,a,e,r,c)}}Yo(n,{simultaneouslyUpdated:t})}))}(e,n,r,o,l,a,s),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],i=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Ta(l,this.state,!0).map((e=>e.id));for(const d of l)if(c.includes(d.id)||d.id===(null==s?void 0:s.id)&&e.hit.wasAddedToSelection){const s=mi(this.state.editingGroupId,i,d),[l,c]=Ve(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Yr(s,{x:s.x+(l-r),y:s.y+(c-o)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];ar(t,n,a),ra(d,n,a,"duplicatesServeAsOld"),this.scene.replaceAllElements(d)}return}}const l=this.state.draggingElement;if(l){if("freedraw"===l.type){const e=l.points,n=i.x-l.x,r=i.y-l.y,o=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Yr(l,{points:[...e,[n,r]],pressures:o})}else if(je(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,o=s-l.y;ln(t)&&2===n.length&&({width:r,height:o}=$r(this.state.elementType,r,o)),1===n.length?Yr(l,{points:[...n,[r,o]]}):n.length>1&&Yr(l,{points:[...n.slice(0,-1),[r,o]]}),Me(l)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[i],this.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeDragNewGenericElement(e,t);if("selection"===this.state.elementType){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Ma(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>ri(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)Lo.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ge(t);return e.filter((e=>{const[t,a,s,l]=Je(e);return"selection"!==e.type&&!Ae(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>ri(Object.assign(Object.assign({},n),{selectedElementIds:Object.assign(Object.assign(Object.assign({},n.selectedElementIds),t.reduce(((e,t)=>(e[t.id]=!0,e)),{})),e.hit.element?{[e.hit.element.id]:!t.length}:null)}),this.scene.getElements())))}}}}))}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){const n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){const n=e.clientY,r=n-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return Tn((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,elementType:a,elementLocked:s,isResizing:l,isRotating:c}=this.state;var d,u;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Ee(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(d=e.hit)||void 0===d||null===(u=d.element)||void 0===u?void 0:u.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=Lo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(Ql);if(op=null,window.removeEventListener(o.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(o.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(o.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(o.Ks.KEYUP,e.eventListeners.onKeyUp),this.state.pendingImageElement&&this.setState({pendingImageElement:null}),"freedraw"===(null==n?void 0:n.type)){const e=kn(t,this.state),r=n.points;let i=e.x-n.x,o=e.y-n.y;i===r[0][0]&&o===r[0][1]&&(o+=1e-4,i+=1e-4);const a=n.simulatePressure?[]:[...n.pressures,t.pressure];return Yr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(Ql)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(Ql)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(Ql)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=kn(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Po(this.state)&&Me(n)&&Ho(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),s?this.setState((e=>({draggingElement:null,selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))):(bn(this.canvas),this.setState((e=>({draggingElement:null,elementType:"selection",selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Yr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a&&n&&Xr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Yr(n,Jr(n)),r&&this.history.resumeRecording(),r&&Xr(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(h&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[h.id])if(ei(this.state,h)){const e=h.groupIds.flatMap((e=>oi(this.scene.getElements(),e))).map((e=>({[e.id]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{});this.setState((t=>({selectedGroupIds:Object.assign(Object.assign({},t.selectedElementIds),h.groupIds.map((e=>({[e]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),e)})))}else this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!0})})));else this.setState((e=>Object.assign({},ri(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Yi(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a||Ma(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(Po(this.state)?No:Vo)(Ta(this.scene.getElements(),this.state)),s||"freedraw"===a?this.setState({draggingElement:null,suggestedBindings:[]}):(bn(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}))}maybeSuggestBindingForAll(e){const t=(e=>{const t=new Set(e.map((e=>{let{id:t}=e;return t})));return e.flatMap((e=>Me(e)?Jo(e).filter((e=>!t.has(e.id))):Oe(e)?ta(e).filter((e=>!t.has(e[0].id))):[]))})(e);this.setState({suggestedBindings:t})}clearSelection(e){this.setState((t=>({selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&ii(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Ua(this.scene.getElementsIncludingDeleted().filter((e=>!Ee(e))),e,t);if(a){const r=a.x+a.width/2,i=a.y+a.height/2;if(Math.hypot(e-r,t-i)<o.wZ){const{x:e,y:t}=_n({sceneX:r,sceneY:i},n);return{viewportX:e,viewportY:t,elementCenterX:r,elementCenterY:i}}}}getCanvasOffsets(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){const e=this.excalidrawContainerRef.current,{left:t,top:n}=e.getBoundingClientRect();return{offsetLeft:t,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){const e=d.find((e=>e.code===this.props.langCode))||c;await g(e),this.setAppState({})}}sp.defaultProps={UIOptions:o.cW};var lp=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=i().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=()=>{var e;this.props.autoFocus&&(null===(e=this.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=()=>this.scene.getElementsIncludingDeleted(),this.getSceneElements=()=>this.scene.getElements(),this.syncActionResult=Tn((e=>{if(this.unmounted||!1===e)return;let t=null;if(e.elements&&(e.elements.forEach((e=>{var n;(null===(n=this.state.editingElement)||void 0===n?void 0:n.id)===e.id&&this.state.editingElement!==e&&Ea(e)&&(t=e)})),this.scene.replaceAllElements(e.elements),e.commitToHistory&&this.history.resumeRecording()),e.files&&(this.files=e.replaceFiles?e.files:Object.assign(Object.assign({},this.files),e.files),this.addNewImagesToImageCache()),e.appState||t){var n,r,i,a,s,l;e.commitToHistory&&this.history.resumeRecording();let c=(null==e||null===(n=e.appState)||void 0===n?void 0:n.viewModeEnabled)||!1,d=(null==e||null===(r=e.appState)||void 0===r?void 0:r.zenModeEnabled)||!1,u=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||o.C6.LIGHT,p=null!==(s=null==e||null===(l=e.appState)||void 0===l?void 0:l.name)&&void 0!==s?s:this.state.name;void 0!==this.props.viewModeEnabled&&(c=this.props.viewModeEnabled),void 0!==this.props.zenModeEnabled&&(d=this.props.zenModeEnabled),void 0!==this.props.gridModeEnabled&&(u=this.props.gridModeEnabled?o.k:null),void 0!==this.props.theme&&(h=this.props.theme),void 0!==this.props.name&&(p=this.props.name),this.setState((n=>{var r;return Object.assign(e.appState||{},{editingElement:t||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:d,gridSize:u,theme:h,name:p})}),(()=>{e.syncHistory&&this.history.setCurrentState(this.state,this.scene.getElementsIncludingDeleted())}))}})),this.onBlur=Tn((()=>{Qh=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ee(e)&&Or(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(o.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(o.ah.addLibrary),window.history.replaceState({},o.iC,"#".concat(e.toString()))}else if(window.location.search.includes(o.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(o.UO.addLibrary),window.history.replaceState({},o.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i=JSON.parse(await r.text());if(!(e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version))(i))throw new Error;(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:(i.libraryItems||i.library||[]).length})))&&(await this.library.importLibrary(r,"published"),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0}))}catch(e){window.alert(b("alerts.errorLoadingLibrary")),console.error(e)}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=Tn((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},Pn()),{isLoading:(null==e||!e.resetLoadingState)&&t.isLoading,theme:this.state.theme}))),this.resetHistory()})),this.initializeScene=async()=>{var e;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer((async e=>{if(!e.files.length)return;const t=e.files[0],n=await t.getFile();n.handle=t,td(n,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))})),this.state.isLoading||this.setState({isLoading:!0});let t=null;try{var n;t=await this.props.initialData||null,null!==(n=t)&&void 0!==n&&n.libraryItems&&(this.libraryItemsFromStorage=Xc(t.libraryItems,"unpublished"))}catch(e){console.error(e),t={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const r=qc(t,null,null);r.appState=Object.assign(Object.assign({},r.appState),{elementType:"image"===r.appState.elementType?"selection":r.appState.elementType,isLoading:!1}),null!==(e=t)&&void 0!==e&&e.scrollToContent&&(r.appState=Object.assign(Object.assign({},r.appState),Aa(r.elements,Object.assign(Object.assign({},r.appState),{width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})))),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},r),{commitToHistory:!0}));const i=new URLSearchParams(window.location.hash.slice(1)).get(o.ah.addLibrary)||new URLSearchParams(window.location.search).get(o.UO.addLibrary);i&&await this.importLibraryFromUrl(i)},this.onResize=Tn((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>Or(e))),this.setState({})})),this.onScroll=mn((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),o.HM),this.onCut=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.copyAll(),this.actionManager.executeAction(hl)},this.copyAll=()=>{Bd(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(!qh)return qh=!0,clearTimeout(Xh),void(Xh=window.setTimeout(sp.resetTapTwice,o.Gj));if(qh&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),qh=!1,clearTimeout(Xh)}e.preventDefault(),2===e.touches.length&&this.setState({selectedElementIds:{}})},this.onTapEnd=e=>{e.touches.length>0&&this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds})},this.pasteFromClipboard=Tn((async e=>{var t,n;const r=document.activeElement;if(!(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(r)))return;const i=document.elementFromPoint($h,Jh);if(e&&(!(i instanceof HTMLCanvasElement)||hn(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await Vd(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=sd(e))}if(ed(o)){const{x:e,y:t}=kn({clientX:$h,clientY:Jh},this.state),n=this.createImageElement({sceneX:e,sceneY:t});return this.insertImageElement(n,o),this.initializeImageDimensions(n),void this.setState({selectedElementIds:{[n.id]:!0}})}if(this.props.onPaste)try{if(!1===await this.props.onPaste(a,e))return}catch(e){console.error(e)}a.errorMessage?this.setState({errorMessage:a.errorMessage}):a.spreadsheet?this.setState({pasteDialog:{data:a.spreadsheet,shown:!0}}):a.elements?this.addElementsFromPasteOrLibrary({elements:a.elements,files:a.files||null,position:"cursor"}):a.text&&this.addTextFromPaste(a.text),this.selectShapeTool("selection"),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=Yc(e.elements,null),[n,r,i,o]=Qe(t),a=fn(n,i)/2,s=fn(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?$h:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?Jh:this.state.height/2+this.state.offsetTop,{x:d,y:u}=kn({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[m,f]=Ve(h,p,this.state.gridSize),b=new Map,x=t.map((e=>{const t=mi(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));ar(x,t,b);const v=[...this.scene.getElementsIncludingDeleted(),...x];ra(v,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(v),this.history.resumeRecording(),this.setState(ri(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:x.reduce(((e,t)=>(Ee(t)&&!t.containerId&&(e[t.id]=!0),e)),{}),selectedGroupIds:{}}),this.scene.getElements()),(()=>{e.files&&this.addNewImagesToImageCache()})),this.selectShapeTool("selection")},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{"touch"===e.pointerType&&rp&&(clearTimeout(rp),rp=0,ip=!1),ap.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Cu)},this.toggleStats=()=>{this.state.showStats||nc("dialog","stats"),this.actionManager.executeAction(ju)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},Aa(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=()=>{this.setState({toastMessage:null})},this.setToastMessage=e=>{this.setState({toastMessage:e})},this.restoreFileFromShare=async()=>{try{const e=await caches.open("web-share-target"),t=await e.match("shared-file");if(t){const n=await t.blob();this.loadFileToCanvas(n),await e.delete("shared-file"),window.history.replaceState(null,o.iC,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}},this.addFiles=Tn((e=>{const t=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map);this.files=Object.assign(Object.assign({},this.files),Object.fromEntries(t)),this.scene.getElements().forEach((e=>{ke(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),Or(e),qr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=Tn((e=>{e.commitToHistory&&this.history.resumeRecording(),e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(e.elements),e.collaborators&&this.setState({collaborators:e.collaborators})})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=Tn((e=>{$h=e.clientX,Jh=e.clientY})),this.onKeyDown=Tn((e=>{var t;if(("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){const r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(hn(e.target)&&e.key!==Ht||on(e.key)&&(t=e.target,t instanceof HTMLElement&&"wysiwyg"===t.dataset.type||t instanceof HTMLBRElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)))&&(e.key===Bt&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[zt]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===vt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),on(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=this.scene.getElements().filter((e=>this.state.selectedElementIds[e.id]));let r=0,i=0;e.key===Ot?r=-t:e.key===Lt?r=t:e.key===At?i=-t:e.key===Tt&&(i=t),n.forEach((e=>{Yr(e,{x:e.x+r,y:e.y+i}),Yo(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Rt){const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)}));else if(1===t.length&&!je(t[0])){const n=t[0];return this.startTextEditing({sceneX:n.x+n.width/2,sceneY:n.y+n.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===this.state.draggingElement){const t=(e=>{const t=zu.find(((t,n)=>e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))));return(null==t?void 0:t.value)||null})(e.key);t?this.selectShapeTool(t):e.key===Xt&&this.toggleLock()}if(e.key===Ft&&0===ap.pointers.size&&(Qh=!0,xn(this.canvas,o.oc.GRABBING)),e.key===Gt||e.key===Jt){const t=Ta(this.scene.getElements(),this.state);if("selection"===this.state.elementType&&!t.length)return;e.key===Gt&&(Pa(this.state.elementType)||t.some((e=>Pa(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Jt&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=Tn((e=>{if(e.key===Ft&&(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):"selection"===this.state.elementType?bn(this.canvas):(vn(this.canvas,this.state.elementType),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Qh=!1),e[zt]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),on(e.key)){const e=Ta(this.scene.getElements(),this.state);Po(this.state)?No(e):Vo(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=Tn((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),ap.initialScale=this.state.zoom.value})),this.onGestureChange=Tn((e=>{if(e.preventDefault(),2===ap.pointers.size)return;const t=ap.initialScale;t&&this.setState((n=>{let{zoom:r,offsetLeft:i,offsetTop:o}=n;return{zoom:Va(Wa(t*e.scale),r,{left:i,top:o},{x:$h,y:Jh})}}))})),this.onGestureEnd=Tn((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),ap.initialScale=null})),this.startTextEditing=e=>{var t;let{sceneX:n,sceneY:r,shouldBind:i,insertAtParentCenter:a=!0}=e,s=a&&this.getTextWysiwygSnappedToCenterPosition(n,r,this.state,this.canvas,window.devicePixelRatio);const l=i||s?Ua(this.scene.getElements(),n,r,"text"):null;let c=this.getTextElementAtPosition(n,r);if(l){const e=br(l);e&&(c=this.scene.getElement(e))}if(!c&&l){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=mr(gn(e)),i=(d=gn(e),dr(d)+2*o.tr),a=Math.max(l.height,i),c=Math.max(l.width,t);Yr(l,{height:a,width:c}),n=l.x+c/2,r=l.y+a/2,s&&(s=this.getTextWysiwygSnappedToCenterPosition(n,r,this.state,this.canvas,window.devicePixelRatio))}var d;const u=c||ui({x:s?s.elementCenterX:n,y:s?s.elementCenterY:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:"",fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:s?"center":this.state.currentItemTextAlign,verticalAlign:s?"middle":o.hs,containerId:null!==(t=null==l?void 0:l.id)&&void 0!==t?t:void 0});this.setState({editingElement:u}),c?s&&"center"===u.textAlign||Yr(u,{verticalAlign:o.hs}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),u]),s||Yr(u,{y:u.y-u.baseline/2})),this.setState({editingElement:u}),this.handleTextWysiwyg(u,{isExistingElement:!!c})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.elementType)return;const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)})));bn(this.canvas);let{x:n,y:r}=kn(e,this.state);if(ni(this.state).length>0){const e=this.getElementAtPosition(n,r),t=e&&((e,t)=>e.groupIds.find((e=>t[e])))(e,this.state.selectedGroupIds);if(t)return void this.setState((n=>ri(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(bn(this.canvas),!e[zt]&&!this.state.viewModeEnabled){const t=Ta(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Le(e)&&(n=e.x+e.width/2,r=e.y+e.height/2)}this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey})}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),ap.pointers.has(e.pointerId)&&ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=ap.initialScale;if(2===ap.pointers.size&&ap.lastCenter&&t&&ap.initialDistance){const e=Ou(ap.pointers),n=e.x-ap.lastCenter.x,r=e.y-ap.lastCenter.y;ap.lastCenter=e;const i=Lu(Array.from(ap.pointers.values()))/ap.initialDistance;this.setState((o=>{let{zoom:a,scrollX:s,scrollY:l,offsetLeft:c,offsetTop:d}=o;return{scrollX:s+n/a.value,scrollY:l+r/a.value,zoom:Va(Wa(t*i),a,{left:c,top:d},e),shouldCacheIgnoreZoom:!0}})),this.resetShouldCacheIgnoreZoomDebounced()}else ap.lastCenter=ap.initialDistance=ap.initialScale=null;if(Qh||ep||tp)return;const n=Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?bn(this.canvas):vn(this.canvas,this.state.elementType));const r=kn(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Lo.handlePointerMove(e,i,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(r):this.setState({suggestedBindings:[]})}if(Te(this.state.elementType)){const{draggingElement:e}=this.state;Me(e)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:r,lastCommittedPoint:s}=e,l=r[r.length-1];return vn(this.canvas,this.state.elementType),void(l===s?Ne(i-t,a-n,l[0],l[1])>=o.qx?Yr(e,{points:[...r,[i-t,a-n]]}):xn(this.canvas,o.oc.POINTER):r.length>2&&s&&Ne(i-t,a-n,s[0],s[1])<o.qx?(xn(this.canvas,o.oc.POINTER),Yr(e,{points:r.slice(0,-1)})):(Re(r,this.state.zoom.value)&&xn(this.canvas,o.oc.POINTER),Yr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.elementType&&"text"!==this.state.elementType)return;const s=this.scene.getElements(),l=Ta(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=Mo(Qe(l),i,a,this.state.zoom,e.pointerType);if(t)return void xn(this.canvas,Oo({transformHandleType:t}))}}else{const t=Io(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void xn(this.canvas,Oo(t))}const c=this.getElementAtPosition(r.x,r.y);if("text"===this.state.elementType)xn(this.canvas,Ee(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)xn(this.canvas,o.oc.GRAB);else if(n)xn(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=Lo.getElement(this.state.editingLinearElement.elementId);e&&Zi(e,this.state,[r.x,r.y])?xn(this.canvas,o.oc.MOVE):xn(this.canvas,o.oc.AUTO)}else e[zt]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)?xn(this.canvas,o.oc.AUTO):xn(this.canvas,o.oc.MOVE)},this.handleTouchMove=e=>{ip=!0},this.handleCanvasPointerDown=e=>{const t=document.getSelection();if(null!=t&&t.anchorNode&&t.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),this.maybeCleanupAfterMissingPointerUp(e),ep)return;if(this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(this.updateGestureOnPointerDown(e),ap.pointers.size>1)return;const n=this.initialPointerDownState(e);if(this.handleDraggingScrollBar(e,n))return;if(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,n))return;if("text"===this.state.elementType)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.elementType||"line"===this.state.elementType)this.handleLinearElementOnPointerDown(e,this.state.elementType,n);else if("image"===this.state.elementType){if(xn(this.canvas,o.oc.CROSSHAIR),!this.state.pendingImageElement)return;this.setState({draggingElement:this.state.pendingImageElement,editingElement:this.state.pendingImageElement,pendingImageElement:null,multiElement:null});const{x:t,y:n}=kn(e,this.state);Yr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.elementType?this.handleFreeDrawElementOnPointerDown(e,this.state.elementType,n):this.createGenericElementOnPointerDown(this.state.elementType,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);op=i,this.state.viewModeEnabled||(window.addEventListener(o.Ks.POINTER_MOVE,r),window.addEventListener(o.Ks.POINTER_UP,i),window.addEventListener(o.Ks.KEYDOWN,a),window.addEventListener(o.Ks.KEYUP,s),n.eventListeners.onMove=r,n.eventListeners.onUp=i,n.eventListeners.onKeyUp=s,n.eventListeners.onKeyDown=a)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(ip=!1,rp?ip=!0:rp=window.setTimeout((()=>{rp=0,ip||this.handleCanvasContextMenu(e)}),o.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==ap.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&Qh||this.state.viewModeEnabled))return!1;ep=!0;let t=!1;const n=/Linux/.test(window.navigator.platform);xn(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=Tn((e=>{const a=r-e.clientX,s=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(o.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(o.Ks.PASTE,e),window.removeEventListener(o.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(o.Ks.PASTE,e),window.addEventListener(o.Ks.POINTER_UP,n)}this.setState({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-s/this.state.zoom.value})})),s=Tn(op=()=>{op=null,ep=!1,Qh||(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):vn(this.canvas,this.state.elementType)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,a),window.removeEventListener(o.Ks.POINTER_UP,s),window.removeEventListener(o.Ks.BLUR,s)});return window.addEventListener(o.Ks.BLUR,s),window.addEventListener(o.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(o.Ks.POINTER_UP,s),!0},this.clearSelectionIfNotUsingSelection=()=>{"selection"!==this.state.elementType&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.elementType){const r=this.scene.getElements(),i=Ta(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=Mo(Qe(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=Io(r,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType);null!=n&&(this.setState({resizingElement:n.element}),t.resize.handleType=n.transformHandleType)}if(t.resize.handleType)xn(this.canvas,Oo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=jn(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ge(t[0]):Qe(t),l=(i+a)/2,c=(o+s)/2,d=1===t.length?t[0].angle:0;switch([n,r]=Pe(n,r,l,c,-d),e){case"n":return Pe(n-(i+a)/2,r-o,0,0,d);case"s":return Pe(n-(i+a)/2,r-s,0,0,d);case"w":return Pe(n-i,r-(o+s)/2,0,0,d);case"e":return Pe(n-a,r-(o+s)/2,0,0,d);case"nw":return Pe(n-i,r-o,0,0,d);case"ne":return Pe(n-a,r-o,0,0,d);case"sw":return Pe(n-i,r-s,0,0,d);case"se":return Pe(n-a,r-s,0,0,d);default:return[0,0]}})(t.resize.handleType,i,t.origin.x,t.origin.y)),1===i.length&&je(i[0])&&2===i[0].points.length&&(t.resize.arrowDirection=((e,t)=>{const[,[n,r]]=t.points;return"nw"===e&&(n<0||r<0)||"ne"===e&&n>=0||"sw"===e&&n<=0||"se"===e&&(n>0||r>0)?"end":"origin"})(t.resize.handleType,i[0]));else{var n;if(this.state.editingLinearElement){const n=Lo.handlePointerDown(e,this.state,(e=>this.setState(e)),this.history,t.origin);if(n.hitElement&&(t.hit.element=n.hitElement),n.didAddPoint)return!0}t.hit.element=null!==(n=t.hit.element)&&void 0!==n?n:this.getElementAtPosition(t.origin.x,t.origin.y),t.hit.element&&(t.hit.hasHitElementInside=Zi(t.hit.element,this.state,[t.origin.x,t.origin.y])),t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);const r=t.hit.element,i=t.hit.allHitElements.some((e=>this.isASelectedElement(e)));if(null!==r&&i||e.shiftKey||t.hit.hasHitCommonBoundingBoxOfSelectedElements||this.clearSelection(r),this.state.editingLinearElement)this.setState({selectedElementIds:{[this.state.editingLinearElement.elementId]:!0}});else if(null!=r){if(e[zt])return this.state.selectedElementIds[r.id]||(t.hit.wasAddedToSelection=!0),this.setState((e=>{return Object.assign(Object.assign({},(t=e,n=r,Object.assign(Object.assign({},t),{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[n.id]:!0}}))),{previousSelectedElementIds:this.state.selectedElementIds});var t,n})),!1;this.state.selectedElementIds[r.id]||(this.state.editingGroupId&&!ii(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[r.id]:!0})}),this.scene.getElements()))),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1},this.handleTextOnPointerDown=(e,t)=>{if(Ee(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Le(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),bn(this.canvas),this.state.elementLocked||this.setState({elementType:"selection"})},this.handleFreeDrawElementOnPointerDown=(e,t,n)=>{const[r,i]=Ve(n.origin.x,n.origin.y,null),o=(a={type:t,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Object.assign(Object.assign({},li(a.type,a)),{points:a.points||[],pressures:[],simulatePressure:a.simulatePressure,lastCommittedPoint:null}));var a;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[o.id]:!1})})));const s=o.simulatePressure?o.pressures:[...o.pressures,e.pressure];Yr(o,{points:[[0,0]],pressures:s});const l=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),o]),this.setState({draggingElement:o,editingElement:o,startBoundElement:l,suggestedBindings:[]})},this.createImageElement=e=>{let{sceneX:t,sceneY:n}=e;const[r,i]=Ve(t,n,this.state.gridSize);var o;return o={type:"image",x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness},Object.assign(Object.assign({},li("image",o)),{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=(e,t,n)=>{if(this.state.multiElement){const{multiElement:e}=this.state;if("line"===e.type&&Re(e.points,this.state.zoom.value))return Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(Ql);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&Ne(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(Ql);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),xn(this.canvas,o.oc.POINTER)}else{const[e,r]=Ve(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=pi({type:t,x:e,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness,startArrowhead:a,endArrowhead:s});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Yr(l,{points:[...l.points,[0,0]]});const c=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),l]),this.setState({draggingElement:l,editingElement:l,startBoundElement:c,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=(e,t)=>{const[n,r]=Ve(t.origin.x,t.origin.y,this.state.gridSize),i=ci({type:e,x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness});"selection"===i.type?this.setState({selectionElement:i,draggingElement:i}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!ed(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(xn(this.canvas,"wait"),l===o.LO.svg)try{i=sd(await(async e=>{const t=(new DOMParser).parseFromString(e,o.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(r=n)?void 0:r.nodeName.toLowerCase()))throw new Error(b("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),n.outerHTML;var r})(await i.text()),i.name)}catch(e){throw console.warn(e),new Error(b("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,i))||id(i));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(b("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{i=await ad(i,{maxWidthOrHeight:o.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(i.size>o.$n)throw new Error(b("errors.fileTooBig",{maxSize:"".concat(Math.trunc(o.$n/1024/1024),"MB")}))}if(s){var u;const e=null===(u=this.files[c])||void 0===u?void 0:u.dataURL,t=e&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return new File([o],t,{type:i})}(e);this.setImagePreviewCursor(t||i)}const h=(null===(r=this.files[c])||void 0===r?void 0:r.dataURL)||await od(i),p=Yr(a,{fileId:c},!1);return new Promise((async(e,t)=>{try{var n,r;this.files=Object.assign(Object.assign({},this.files),{[c]:{mimeType:l,id:c,dataURL:h,created:Date.now()}});const t=this.imageCache.get(c);t||(this.addNewImagesToImageCache(),await this.updateImageCache([p])),(null==t?void 0:t.image)instanceof Promise&&await t.image,(null===(n=this.state.pendingImageElement)||void 0===n?void 0:n.id)!==p.id&&(null===(r=this.state.draggingElement)||void 0===r?void 0:r.id)!==p.id&&this.initializeImageDimensions(p,!0),e(p)}catch(e){console.error(e),t(new Error(b("errors.imageInsertError")))}finally{s||bn(this.canvas)}}))},this.insertImageElement=async(e,t,n)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),e]);try{await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){Yr(e,{isDeleted:!0}),this.actionManager.executeAction(Ql),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await ad(e,{maxWidthOrHeight:96});let n=await od(t);if(e.type===o.LO.svg){const e=await hd(n);let t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));const i=document.createElement("canvas");i.height=t,i.width=r;i.getContext("2d").drawImage(e,0,0,r,t),n=i.toDataURL(o.LO.svg)}this.state.pendingImageElement&&xn(this.canvas,"url(".concat(n,") 4 4, auto"))},this.onImageAction=async function(){let{insertOnCanvasDirectly:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1};try{const n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,{x:i,y:o}=kn({clientX:n,clientY:r},e.state),a=await Uc({description:"Image",extensions:["jpg","png","svg","gif"]}),s=e.createImageElement({sceneX:i,sceneY:o});t?(e.insertImageElement(s,a),e.initializeImageDimensions(s),e.setState({selectedElementIds:{[s.id]:!0}},(()=>{e.actionManager.executeAction(Ql)}))):e.setState({pendingImageElement:s},(()=>{e.insertImageElement(s,a,!0)}))}catch(t){"AbortError"!==t.name?console.error(t):console.warn(t),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(()=>{e.actionManager.executeAction(Ql)}))}},this.initializeImageDimensions=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ke(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!i||i instanceof Promise){if(t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=100/e.state.zoom.value;Yr(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(r||t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=Math.max(e.state.height-120,160),r=Math.min(n,Math.floor(.5*e.state.height)/e.state.zoom.value),o=Math.min(i.naturalHeight,r),a=o*(i.naturalWidth/i.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-o/2;Yr(t,{x:s,y:l,width:a,height:o})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await pd({imageCache:e.imageCache,fileIds:t.map((e=>e.fileId)),files:n});if(r.size||i.size)for(const e of t)r.has(e.fileId)&&Or(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Zr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gd(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const r=t.filter((t=>!t.isDeleted&&!e.imageCache.has(t.fileId)));if(r.length){const{updatedFiles:t}=await e.updateImageCache(r,n);t.size&&e.scene.informMutation()}},this.scheduleImageRefresh=Wh()((()=>{this.addNewImagesToImageCache()}),o.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[zt])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Ko(e,this.scene);this.setState({suggestedBindings:null!=t?[t]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=(e,t,n)=>{if(!t.length)return;const r=t.reduce(((t,r)=>{const i=Ko(r,this.scene);return null==i||Uo(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,r;null!==e?(this.canvas=e,this.rc=xe.canvas(this.canvas),this.canvas.addEventListener(o.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(o.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(o.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(o.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(o.Ks.TOUCH_START,this.onTapStart),null===(r=this.canvas)||void 0===r||r.removeEventListener(o.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files[0];if(ed(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(Hc)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await td(t,this.state,this.scene.getElementsIncludingDeleted());return void this.syncActionResult(Object.assign(Object.assign({},n),{appState:Object.assign(Object.assign({},n.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))}catch(e){if("EncodingError"!==e.name)throw e}const{x:n,y:r}=kn(e,this.state),i=this.createImageElement({sceneX:n,sceneY:r});return this.insertImageElement(i,t),this.initializeImageDimensions(i),void this.setState({selectedElementIds:{[i.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const r=e.dataTransfer.getData(o.LO.excalidrawlib);if(""!==r)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(r),position:e,files:null});const i=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if((null==i?void 0:i.type)===o.LO.excalidrawlib||null!=i&&null!==(n=i.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(i).then((()=>{this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0})})).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else{if(this.setState({isLoading:!0}),Hc)try{const t=e.dataTransfer.items[0];i.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(i)}},this.loadFileToCanvas=e=>{td(e,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=e=>{e.preventDefault();const{x:t,y:n}=kn(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0}),i=r?"element":"canvas",o=this.excalidrawContainerRef.current,{top:a,left:s}=o.getBoundingClientRect(),l=e.clientX-s,c=e.clientY-a;r&&!this.state.selectedElementIds[r.id]?this.setState({selectedElementIds:{[r.id]:!0}},(()=>{this._openContextMenu({top:c,left:l},i)})):this._openContextMenu({top:c,left:l},i)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type)ba(n,this.state.elementType,e.origin.x,e.origin.y,r.x,r.y,fn(e.origin.x,r.x),fn(e.origin.y,r.y),sn(t),an(t));else{var i;const[o,a]=Ve(r.x,r.y,this.state.gridSize),s=ke(n)&&(null===(i=this.imageCache.get(n.fileId))||void 0===i?void 0:i.image),l=!s||s instanceof Promise?null:s.width/s.height;ba(n,this.state.elementType,e.originInGrid.x,e.originInGrid.y,o,a,fn(e.originInGrid.x,o),fn(e.originInGrid.y,a),_e(n)?!sn(t):sn(t),an(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Ta(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=Ve(i.x-e.resize.offset.x,i.y-e.resize.offset.y,this.state.gridSize);return!!((e,t,n,r,i,o,a,s,l,c,d)=>{if(1===n.length){const[c]=n;return"rotation"===t?(la(c,s,l,i),Yo(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ee(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&pa(e.originalElements.get(c.id),a,c,t,o,s,l):(ha(c,t,o,s,l),Yo(c)):ca(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return ma(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return ga(n,t,s,l),sr(n,t),!0}return!1})(e,r,n,e.resize.arrowDirection,ln(t),an(t),1===n.length&&_e(n[0])?!sn(t):sn(t),o,a,e.resize.center.x,e.resize.center.y)&&(this.maybeSuggestBindingForAll(n),!0)},this._openContextMenu=(e,t)=>{let{left:n,top:r}=e;const i=ru.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=mu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=fu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l="separator",c=this.scene.getElements(),d=[];if(Hd&&c.length>0&&d.push(Eu),Rd&&c.length>0&&d.push(_u),"canvas"===t){const e=[...d,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju];this.state.viewModeEnabled?Fu.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&navigator.clipboard&&l,Hd&&c.length>0&&Eu,Rd&&c.length>0&&_u,(Hd&&c.length>0||Rd&&c.length>0)&&l,jl,l,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current})}else"element"===t&&(this.state.viewModeEnabled?Fu.push({options:[navigator.clipboard&&wu,...d],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&ku,this.isMobile&&navigator.clipboard&&wu,this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&l,...d,l,Qd,eu,l,i&&ru,o&&iu,(i||o)&&l,au,l,_l,El,Sl,Cl,l,a&&mu,s&&fu,(a||s)&&l,Il,hl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}))},this.handleWheel=Tn((e=>{if(e.preventDefault(),ep)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:r,previousSelectedElementIds:i}=this.state;if(e.metaKey||e.ctrlKey){const e=Math.sign(n),t=10;let a=Math.abs(n);a>t&&(a=t),a*=e,0!==Object.keys(i).length&&setTimeout((()=>{this.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);let s=this.state.zoom.value-a/100;return s+=Math.log10(Math.max(1,this.state.zoom.value))*-e,s=Math.round(s*o.V4*100)/(100*o.V4),this.setState((e=>{let{zoom:t,offsetLeft:n,offsetTop:o}=e;return{zoom:Va(Wa(s),t,{left:n,top:o},{x:$h,y:Jh}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(r).length?r:i,shouldCacheIgnoreZoom:!0}})),void this.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?this.setState((e=>{let{zoom:r,scrollX:i}=e;return{scrollX:i-(n||t)/r.value}})):this.setState((e=>{let{zoom:r,scrollX:i,scrollY:o}=e;return{scrollX:i-t/r.value,scrollY:o-n/r.value}}))})),this.savePointer=(e,t,n)=>{var r,i;if(!e||!t)return;const o=kn({clientX:e,clientY:t},this.state);isNaN(o.x)||isNaN(o.y),null===(r=(i=this.props).onPointerUpdate)||void 0===r||r.call(i,{pointer:o,button:n,pointersMap:ap.pointers})},this.resetShouldCacheIgnoreZoomDebounced=mn((()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=e=>{var t;if(null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current){const t=this.excalidrawContainerRef.current,{width:n,height:r,left:i,top:o}=t.getBoundingClientRect(),{width:a,height:s,offsetTop:l,offsetLeft:c}=this.state;if(n===a&&r===s&&i===c&&o===l)return void(e&&e());this.setState({width:n,height:r,offsetLeft:i,offsetTop:o},(()=>{e&&e()}))}},this.refresh=()=>{this.setState(Object.assign({},this.getCanvasOffsets()))}};"production"!==o.Vi.TEST&&"production"!==o.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app.scene.getElementsIncludingDeleted()},set(e){return this.app.scene.replaceAllElements(e)}}}));const cp=sp;n(4285),n(3313);var dp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const up=e=>{var t;const{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p=c.code,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,onPaste:_,detectScroll:E=!0,handleKeyboardGlobally:S=!1,onLibraryChange:C,autoFocus:j=!1,generateIdForFile:I}=e,M=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,T={canvasActions:Object.assign(Object.assign({},o.cW.canvasActions),M)};var O,L;null!=M&&M.export&&(T.canvasActions.export.saveFileToDisk=null!==(O=null===(L=M.export)||void 0===L?void 0:L.saveFileToDisk)&&void 0!==O?O:o.cW.canvasActions.export.saveFileToDisk);return(0,r.useEffect)((()=>{const e=e=>{"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),()=>{document.removeEventListener("touchmove",e)}}),[]),(0,x.jsx)(y,{langCode:p,children:(0,x.jsx)(cp,{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,UIOptions:T,onPaste:_,detectScroll:E,handleKeyboardGlobally:S,onLibraryChange:C,autoFocus:j,generateIdForFile:I})})},hp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=dp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=dp(t,["initialData","UIOptions"]),l=Object.keys(r),c=Object.keys(a);if(l.length!==c.length)return!1;const d=l.every((e=>{if("canvasActions"===e){Object.keys(r.canvasActions).every((e=>{var t,n,i,o;return"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=a&&null!==(n=a.canvasActions)&&void 0!==n&&n.export?r.canvasActions.export.saveFileToDisk===a.canvasActions.export.saveFileToDisk:(null==r||null===(i=r.canvasActions)||void 0===i?void 0:i[e])===(null==a||null===(o=a.canvasActions)||void 0===o?void 0:o[e])}))}return!0})),u=Object.keys(e),h=Object.keys(t);return d&&u.length===h.length&&u.every((e=>i[e]===s[e]))},pp=(0,r.forwardRef)(((e,t)=>(0,x.jsx)(up,Object.assign(Object.assign({},e),{excalidrawRef:t})))),gp=i().memo(pp,hp);n(8336);const mp=gp},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current file","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')},4451:e=>{"use strict";e.exports=JSON.parse('{"ar-SA":86,"bg-BG":59,"bn-BD":0,"ca-ES":78,"cs-CZ":25,"da-DK":17,"de-DE":100,"el-GR":88,"en":100,"es-ES":88,"fa-IR":66,"fi-FI":100,"fr-FR":100,"he-IL":84,"hi-IN":58,"hu-HU":52,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":82,"kk-KZ":24,"ko-KR":58,"lv-LV":100,"my-MM":49,"nb-NO":100,"nl-NL":93,"nn-NO":87,"oc-FR":99,"pa-IN":84,"pl-PL":97,"pt-BR":99,"pt-PT":87,"ro-RO":100,"ru-RU":86,"si-LK":9,"sk-SK":99,"sv-SE":99,"ta-IN":98,"tr-TR":78,"uk-UA":85,"zh-CN":92,"zh-HK":29,"zh-TW":100}')}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);l.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(i,o),i},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"i18n-zh-HK-json",43:"i18n-de-DE-json",58:"i18n-si-LK-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",395:"i18n-ta-IN-json",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",499:"image",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",603:"i18n-bn-BD-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"f82802143c7042511410",43:"e676479528793fb9755f",58:"c5e207625d8f7a06eb15",60:"fc3ee48a144b19bcca0d",62:"79c634b00f4602a2d9a6",137:"c6208f4ec6ec8d61df2f",149:"73605e7eed8d224609aa",164:"7aaa4a5ea8484b941af2",196:"be44386cc68047e2da24",213:"17f1500f11b6e08b677b",242:"6d186d192f0024208fe2",246:"a8b16b7360f5df195438",262:"dfc95883bf533087b673",280:"319132bcecbfaf90ef79",304:"a13fbd80677ff3f0122c",317:"2996f978aa8d44a1bc72",351:"93b7462bd1d0fe76d2b5",364:"f470b9806c21d127df35",381:"ad09ed1c16a3d2b6d4b8",384:"eb8b237a2970da7034ad",387:"1244df10086a058f2d41",395:"f20bc85c68e334566d53",401:"0261a2d60b0803cc8354",465:"1cd7244d3b42597e1555",472:"bb5e3af1d7bb005f0c7d",491:"43b313d6c7c52122220b",499:"87e58979d258cd38208c",526:"cef06f766f46d7ab798a",558:"6fcb7979cd290e0e51d9",565:"ad1cdc3ba675116187a4",583:"4798e5a14cecdddbfb50",603:"87d5cd14de43ad6ec162",617:"85af69d03d5a188d4d3e",649:"654dee98c29976300a26",661:"dbaf9c47430503d4a710",698:"4b274bae10479b585716",710:"84150b1f61e3d7a0afcf",736:"8698157b56eb5e0ee549",752:"b48f7b508a0884880f63",852:"2df7909ca92201d653d7",869:"cd5378c60549c20232c7",899:"bfb22930b5a31d1f92ee",920:"074a3f14a8e56d66eeb7",933:"07d3a348a9723eeb51a3"}[e]+".js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},o="Excalidraw:",l.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+n){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+n),a.src=e),i[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{l.b=document.baseURI||self.location.href;var e={388:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=l.p+l.u(t),a=new Error;l.l(o,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,s]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)s(l)}for(t&&t(n);c<o.length;c++)i=o[c],l.o(e,i)&&e[i]&&e[i][0](),e[o[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(2254)})()}));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={200:(e,t,n)=>{var r="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function f(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(r);function v(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function y(e){return d=e,l=setTimeout(k,t),u?v(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function k(){var e=m();if(w(e))return _(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function _(e){return l=void 0,f&&i?v(e):(i=o=void 0,s)}function E(){var e=m(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return y(c);if(h)return l=setTimeout(k,t),v(c)}return void 0===l&&(l=setTimeout(k,t)),s}return t=x(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(x(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:_(m())},E}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(r);return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:i,maxWait:t,trailing:o})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,d=64,u=128,h=256,p=1/0,g=9007199254740991,m=NaN,f=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],x="[object Arguments]",v="[object Array]",y="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",C="[object Number]",j="[object Object]",I="[object Promise]",M="[object RegExp]",T="[object Set]",O="[object String]",L="[object Symbol]",A="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",N="[object Float64Array]",R="[object Int8Array]",H="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",K=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Z.source),$=RegExp(q.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,xe=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Me="\\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",Te="['’]",Oe="[\\ud800-\\udfff]",Le="["+Me+"]",Ae="["+Ee+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Ce+"]",Ne="[^\\ud800-\\udfff"+Me+Pe+Se+Ce+je+"]",Re="\\ud83c[\\udffb-\\udfff]",He="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+je+"]",We="(?:"+ze+"|"+Ne+")",Ve="(?:"+Ue+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ae+"|"+Re+")"+"?",Ze="[\\ufe0e\\ufe0f]?",qe=Ze+Ye+("(?:\\u200d(?:"+[He,Be,Fe].join("|")+")"+Ze+Ye+")*"),Xe="(?:"+[De,Be,Fe].join("|")+")"+qe,$e="(?:"+[He+Ae+"?",Ae,Be,Fe,Oe].join("|")+")",Je=RegExp(Te,"g"),Qe=RegExp(Ae,"g"),et=RegExp(Re+"(?="+Re+")|"+$e+qe,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ke+"(?="+[Le,Ue,"$"].join("|")+")",Ve+"+"+Ge+"(?="+[Le,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+Ke,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ee+Ie+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],ot=-1,at={};at[z]=at[N]=at[R]=at[H]=at[B]=at[F]=at[U]=at[W]=at[V]=!0,at[x]=at[v]=at[P]=at[y]=at[D]=at[w]=at[k]=at[_]=at[S]=at[C]=at[j]=at[M]=at[T]=at[O]=at[A]=!1;var st={};st[x]=st[v]=st[P]=st[D]=st[y]=st[w]=st[z]=st[N]=st[R]=st[H]=st[B]=st[S]=st[C]=st[j]=st[M]=st[T]=st[O]=st[L]=st[F]=st[U]=st[W]=st[V]=!0,st[k]=st[_]=st[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,ft=mt&&mt.exports===gt,bt=ft&&ut.process,xt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),vt=xt&&xt.isArrayBuffer,yt=xt&&xt.isDate,wt=xt&&xt.isMap,kt=xt&&xt.isRegExp,_t=xt&&xt.isSet,Et=xt&&xt.isTypedArray;function St(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function zt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Nt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rt=Kt("length");function Ht(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Bt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Wt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Wt(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:m}function Kt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Yt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Zt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Jt(e,t){return At(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({À:"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"}),on=Gt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Rt(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fn=Gt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,se=t.Date,Ee=t.Error,Se=t.Function,Ce=t.Math,je=t.Object,Ie=t.RegExp,Me=t.String,Te=t.TypeError,Oe=r.prototype,Le=Se.prototype,Ae=je.prototype,Pe=t["__core-js_shared__"],De=Le.toString,ze=Ae.hasOwnProperty,Ne=0,Re=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",He=Ae.toString,Be=De.call(je),Fe=pt._,Ue=Ie("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=ft?t.Buffer:i,Ve=t.Symbol,Ke=t.Uint8Array,Ge=We?We.allocUnsafe:i,Ye=cn(je.getPrototypeOf,je),Ze=je.create,qe=Ae.propertyIsEnumerable,Xe=Oe.splice,$e=Ve?Ve.isConcatSpreadable:i,et=Ve?Ve.iterator:i,nt=Ve?Ve.toStringTag:i,lt=function(){try{var e=go(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=se&&se.now!==pt.Date.now&&se.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Ce.ceil,bt=Ce.floor,xt=je.getOwnPropertySymbols,Rt=We?We.isBuffer:i,Gt=t.isFinite,xn=Oe.join,vn=cn(je.keys,je),yn=Ce.max,wn=Ce.min,kn=se.now,_n=t.parseInt,En=Ce.random,Sn=Oe.reverse,Cn=go(t,"DataView"),jn=go(t,"Map"),In=go(t,"Promise"),Mn=go(t,"Set"),Tn=go(t,"WeakMap"),On=go(je,"create"),Ln=Tn&&new Tn,An={},Pn=Fo(Cn),Dn=Fo(jn),zn=Fo(In),Nn=Fo(Mn),Rn=Fo(Tn),Hn=Ve?Ve.prototype:i,Bn=Hn?Hn.valueOf:i,Fn=Hn?Hn.toString:i;function Un(e){if(is(e)&&!Ya(e)&&!(e instanceof Gn)){if(e instanceof Kn)return e;if(ze.call(e,"__wrapped__"))return Uo(e)}return new Kn(e)}var Wn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Vn(){}function Kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Zn(e);this.size=t.size}function Jn(e,t){var n=Ya(e),r=!n&&Ga(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&hs(e),a=n||r||i||o,s=a?qt(e.length,Me):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,l))||s.push(c);return s}function Qn(e){var t=e.length;return t?e[Xr(0,t-1)]:i}function er(e,t){return Ro(Oi(e),cr(t,0,e.length))}function tr(e){return Ro(Oi(e))}function nr(e,t,n){(n!==i&&!Wa(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Wa(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Wa(e[n][0],t))return n;return-1}function or(e,t,n,r){return gr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,Ps(t),e)}function sr(e,t,n){"__proto__"==t&&lt?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Ms(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function dr(e,t,n,r,o,a){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var u=Ya(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oi(e,s)}else{var h=bo(e),p=h==_||h==E;if($a(e))return Si(e,l);if(h==j||h==x||p&&!o){if(s=c||p?{}:vo(e),!l)return c?function(e,t){return Li(e,fo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[h])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Ci(e);case y:case w:return new r(+e);case D:return function(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case N:case R:case H:case B:case F:case U:case W:case V:return ji(e,n);case S:case T:return new r;case C:case O:return new r(e);case M:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return i=e,Bn?je(Bn.call(i)):{}}var i}(e,h,l)}}a||(a=new $n);var g=a.get(e);if(g)return g;a.set(e,s),cs(e)?e.forEach((function(r){s.add(dr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,dr(r,t,n,i,e,a))}));var m=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,dr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new Te(o);return Po((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=At(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Qt,a=!1,t=new Xn(t));e:for(;++i<s;){var d=e[i],u=null==n?d:n(d);if(d=r||0!==d?d:0,a&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else o(t,u,r)||l.push(d)}return l}Un.templateSettings={escape:J,evaluate:Q,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Vn.prototype,Un.prototype.constructor=Un,Kn.prototype=Wn(Vn.prototype),Kn.prototype.constructor=Kn,Gn.prototype=Wn(Vn.prototype),Gn.prototype.constructor=Gn,Yn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Yn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yn.prototype.get=function(e){var t=this.__data__;if(On){var n=t[e];return n===a?i:n}return ze.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:ze.call(t,e)},Yn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=On&&t===i?a:t,this},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},Zn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Zn.prototype.has=function(e){return ir(this.__data__,e)>-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(jn||Zn),string:new Yn}},qn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return ho(this,e).get(e)},qn.prototype.has=function(e){return ho(this,e).has(e)},qn.prototype.set=function(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Zn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(kr),mr=Di(_r,!0);function fr(e,t){var n=!0;return gr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function br(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!us(s):n(s,l)))var l=s,c=a}return c}function xr(e,t){var n=[];return gr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?vr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var yr=zi(),wr=zi(!0);function kr(e,t){return e&&yr(e,t,Ps)}function _r(e,t){return e&&wr(e,t,Ps)}function Er(e,t){return Tt(t,(function(t){return es(e[t])}))}function Sr(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&n<r;)e=e[Bo(t[n++])];return n&&n==r?e:i}function Cr(e,t,n){var r=t(e);return Ya(e)?r:Pt(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=He.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return He.call(e)}(e)}function Ir(e,t){return e>t}function Mr(e,t){return null!=e&&ze.call(e,t)}function Tr(e,t){return null!=e&&t in je(e)}function Or(e,t,n){for(var o=n?Lt:Ot,a=e[0].length,s=e.length,l=s,c=r(s),d=1/0,u=[];l--;){var h=e[l];l&&t&&(h=At(h,$t(t))),d=wn(h.length,d),c[l]=!n&&(t||a>=120&&h.length>=120)?new Xn(l&&h):i}h=e[0];var p=-1,g=c[0];e:for(;++p<a&&u.length<d;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(g?Qt(g,f):o(u,f,n))){for(l=s;--l;){var b=c[l];if(!(b?Qt(b,f):o(e[l],f,n)))continue e}g&&g.push(f),u.push(m)}}return u}function Lr(e,t,n){var r=null==(e=To(e,t=wi(t,e)))?e:e[Bo(Qo(t))];return null==r?i:St(r,e,n)}function Ar(e){return is(e)&&jr(e)==x}function Pr(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ya(e),l=Ya(t),c=s?v:bo(e),d=l?v:bo(t),u=(c=c==x?j:c)==j,h=(d=d==x?j:d)==j,p=c==d;if(p&&$a(e)){if(!$a(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new $n),s||hs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ke(e),new Ke(t)));case y:case w:case C:return Wa(+e,+t);case k:return e.name==t.name&&e.message==t.message;case M:case O:return e==t+"";case S:var s=ln;case T:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=ro(s(e),s(t),r,i,o,a);return a.delete(e),d;case L:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),m=h&&ze.call(t,"__wrapped__");if(g||m){var f=g?e.value():e,b=m?t.value():t;return a||(a=new $n),o(f,b,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,o,a){var s=1&n,l=oo(e),c=l.length,d=oo(t).length;if(c!=d&&!s)return!1;var u=c;for(;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var f=s;for(;++u<c;){var b=e[h=l[u]],x=t[h];if(r)var v=s?r(x,b,h,t,e,a):r(b,x,h,e,t,a);if(!(v===i?b===x||o(b,x,n,r,a):v)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new $n;if(r)var p=r(d,u,c,e,t,h);if(!(p===i?Pr(u,d,3,r,h):p))return!1}}return!0}function zr(e){return!(!rs(e)||(t=e,Re&&Re in t))&&(es(e)?Ue:xe).test(Fo(e));var t}function Nr(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ya(e)?Wr(e[0],e[1]):Ur(e):ml(e)}function Rr(e){if(!Co(e))return vn(e);var t=[];for(var n in je(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Hr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=Co(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,i=qa(e)?r(e.length):[];return gr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Ur(e){var t=po(e);return 1==t.length&&t[0][2]?Io(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Wr(e,t){return _o(e)&&jo(t)?Io(Bo(e),t):function(n){var r=Ms(n,e);return r===i&&r===t?Ts(n,e):Pr(t,r,3)}}function Vr(e,t,n,r,o){e!==t&&yr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),c=Lo(t,n),d=s.get(c);if(d)return void nr(e,n,d);var u=a?a(l,c,n+"",e,t,s):i,h=u===i;if(h){var p=Ya(c),g=!p&&$a(c),m=!p&&!g&&hs(c);u=c,p||g||m?Ya(l)?u=l:Xa(l)?u=Oi(l):g?(h=!1,u=Si(c,!0)):m?(h=!1,u=ji(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=ys(l):rs(l)&&!es(l)||(u=vo(c))):h=!1}h&&(s.set(c,u),o(u,c,r,a,s),s.delete(c));nr(e,n,u)}(e,t,s,n,Vr,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Kr(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:i}function Gr(e,t,n){t=t.length?At(t,(function(e){return Ya(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=At(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ii(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Sr(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Zr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=At(e,$t(n)));++o<a;)for(var l=0,c=t[o],d=n?n(c):c;(l=i(s,d,l,r))>-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Xe.call(e,i,1):pi(e,i)}}return e}function Xr(e,t){return e+bt(En()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=bt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Mo(e,t,al),e+"")}function Qr(e){return Qn(Ws(e))}function ei(e,t){var n=Ws(e);return Ro(n,cr(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Bo(t[o]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=l[c];(d=r?r(u,c,l):i)===i&&(d=rs(u)?u:wo(t[o+1])?[]:{})}rr(l,c,d),l=l[c]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Ro(Ws(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return gr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=us(t),d=t===i;o<a;){var u=bt((o+a)/2),h=n(e[u]),p=h!==i,g=null===h,m=h==h,f=us(h);if(s)var b=r||m;else b=d?m&&(r||p):l?m&&p&&(r||!g):c?m&&p&&!g&&(r||!f):!g&&!f&&(r?h<=t:h<t);b?o=u+1:a=u}return wn(a,4294967294)}function ci(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Wa(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?m:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return At(e,ui)+"";if(us(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var c=t?null:$i(e);if(c)return un(c);a=!1,i=Qt,l=new Xn}else l=t?[]:s;e:for(;++r<o;){var d=e[r],u=t?t(d):d;if(d=n||0!==d?d:0,a&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else i(l,u,n)||(l!==s&&l.push(u),s.push(d))}return s}function pi(e,t){return null==(e=To(e,t=wi(t,e)))||delete e[Bo(Qo(t))]}function gi(e,t,n,r){return ti(e,t,n(Sr(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),n)}function bi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return hi(vr(a,1),t,n)}function xi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function vi(e){return Xa(e)?e:[]}function yi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:_o(e,t)?[e]:Ho(ws(e))}var ki=Jr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Ci(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function ji(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,l=null===t,c=t==t,d=us(t);if(!l&&!d&&!a&&e>t||a&&s&&c&&!l&&!d||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!d&&e<t||d&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Mi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,d=yn(a-s,0),u=r(c+d),h=!i;++l<c;)u[l]=t[l];for(;++o<s;)(h||o<a)&&(u[n[o]]=e[o]);for(;d--;)u[l++]=e[o++];return u}function Ti(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,d=t.length,u=yn(a-l,0),h=r(u+d),p=!i;++o<u;)h[o]=e[o];for(var g=o;++c<d;)h[g+c]=t[c];for(;++s<l;)(p||o<a)&&(h[g+n[s]]=e[o++]);return h}function Oi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?sr(n,l,c):rr(n,l,c)}return n}function Ai(e,t){return function(n,r){var i=Ya(n)?Ct:or,o=t?t():{};return i(n,e,uo(r,2),o)}}function Pi(e){return Jr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function zi(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=sn(t=ws(t))?gn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Ri(e){return function(t){return Dt(el(Gs(t).replace(Je,"")),e,"")}}function Hi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Wn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Bi(e){return function(t,n,r){var o=je(t);if(!qa(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Fi(e){return io((function(t){var n=t.length,r=n,a=Kn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Te(o);if(a&&!l&&"wrapper"==lo(s))var l=new Kn([],!0)}for(r=l?r:n;++r<n;){var c=lo(s=t[r]),d="wrapper"==c?so(s):i;l=d&&Eo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Eo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ya(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ui(e,t,n,o,a,s,l,c,d,h){var p=t&u,g=1&t,m=2&t,f=24&t,b=512&t,x=m?i:Hi(e);return function i(){for(var u=arguments.length,v=r(u),y=u;y--;)v[y]=arguments[y];if(f)var w=co(i),k=nn(v,w);if(o&&(v=Mi(v,o,a,f)),s&&(v=Ti(v,s,l,f)),u-=k,f&&u<h){var _=dn(v,w);return qi(e,t,Ui,i.placeholder,n,v,_,c,d,h-u)}var E=g?n:this,S=m?E[e]:e;return u=v.length,c?v=Oo(v,c):b&&u>1&&v.reverse(),p&&d<u&&(v.length=d),this&&this!==pt&&this instanceof i&&(S=x||Hi(S)),S.apply(E,v)}}function Wi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Vi(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=di(n),r=di(r)),o=e(n,r)}return o}}function Ki(e){return io((function(t){return t=At(t,$t(uo())),Jr((function(n){var r=this;return e(t,(function(e){return St(e,r,n)}))}))}))}function Gi(e,t){var n=(t=t===i?" ":ui(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return sn(t)?_i(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n,i){for(var o=-1,a=yn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:fs(o),e)}}function Zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=vs(t),n=vs(n)),e(t,n)}}function qi(e,t,n,r,o,a,s,l,u,h){var p=8&t;t|=p?c:d,4&(t&=~(p?d:c))||(t&=-4);var g=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,u,h],m=n.apply(i,g);return Eo(e)&&Ao(m,g),m.placeholder=r,zo(m,e,t)}function Xi(e){var t=Ce[e];return function(e,n){if(e=vs(e),(n=null==n?0:wn(bs(n),292))&&Gt(e)){var r=(ws(e)+"e").split("e");return+((r=(ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Mn&&1/un(new Mn([,-0]))[1]==p?function(e){return new Mn(e)}:ul;function Ji(e){return function(t){var n=bo(t);return n==S?ln(t):n==T?hn(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Qi(e,t,n,a,p,g,m,f){var b=2&t;if(!b&&"function"!=typeof e)throw new Te(o);var x=a?a.length:0;if(x||(t&=-97,a=p=i),m=m===i?m:yn(bs(m),0),f=f===i?f:bs(f),x-=p?p.length:0,t&d){var v=a,y=p;a=p=i}var w=b?i:so(e),k=[e,t,n,a,p,v,y,g,m,f];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==u&&8==n||r==u&&n==h&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Mi(c,l,t[4]):l,e[4]=c?dn(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Ti(c,l,t[6]):l,e[6]=c?dn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&u&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(f=k[9]=k[9]===i?b?0:e.length:yn(k[9]-x,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=Hi(e);return function a(){for(var s=arguments.length,l=r(s),c=s,d=co(a);c--;)l[c]=arguments[c];var u=s<3&&l[0]!==d&&l[s-1]!==d?[]:dn(l,d);return(s-=u.length)<n?qi(e,t,Ui,a.placeholder,i,l,u,i,i,n-s):St(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,f):t!=c&&33!=t||p.length?Ui.apply(i,k):function(e,t,n,i){var o=1&t,a=Hi(e);return function t(){for(var s=-1,l=arguments.length,c=-1,d=i.length,u=r(d+l),h=this&&this!==pt&&this instanceof t?a:e;++c<d;)u[c]=i[c];for(;l--;)u[c++]=arguments[++s];return St(h,o?n:this,u)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=Hi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return zo((w?ni:Ao)(_,k),e,t)}function eo(e,t,n,r){return e===i||Wa(e,Ae[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Vr(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&n?new Xn:i;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],f=t[h];if(r)var b=s?r(f,m,h,t,e,a):r(m,f,h,e,t,a);if(b!==i){if(b)continue;p=!1;break}if(g){if(!Nt(t,(function(e,t){if(!Qt(g,t)&&(m===e||o(m,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(m!==f&&!o(m,f,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(Mo(e,i,Zo),e+"")}function oo(e){return Cr(e,Ps,mo)}function ao(e){return Cr(e,Ds,fo)}var so=Ln?function(e){return Ln.get(e)}:ul;function lo(e){for(var t=e.name+"",n=An[t],r=ze.call(An,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function uo(){var e=Un.iteratee||sl;return e=e===sl?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function go(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return zr(n)?n:i}var mo=xt?function(e){return null==e?[]:(e=je(e),Tt(xt(e),(function(t){return qe.call(e,t)})))}:xl,fo=xt?function(e){for(var t=[];e;)Pt(t,mo(e)),e=Ye(e);return t}:xl,bo=jr;function xo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Bo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&wo(a,i)&&(Ya(e)||Ga(e))}function vo(e){return"function"!=typeof e.constructor||Co(e)?{}:Wn(Ye(e))}function yo(e){return Ya(e)||Ga(e)||!!($e&&e&&e[$e])}function wo(e,t){var n=typeof e;return!!(t=null==t?g:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wo(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function _o(e,t){if(Ya(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function Eo(e){var t=lo(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(Cn&&bo(new Cn(new ArrayBuffer(1)))!=D||jn&&bo(new jn)!=S||In&&bo(In.resolve())!=I||Mn&&bo(new Mn)!=T||Tn&&bo(new Tn)!=A)&&(bo=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return S;case zn:return I;case Nn:return T;case Rn:return A}return t});var So=Pe?es:vl;function Co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function jo(e){return e==e&&!rs(e)}function Io(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function Mo(e,t,n){return t=yn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=yn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),St(e,this,l)}}function To(e,t){return t.length<2?e:Sr(e,oi(t,0,-1))}function Oo(e,t){for(var n=e.length,r=wn(t.length,n),o=Oi(e);r--;){var a=t[r];e[r]=wo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=No(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},Do=No(ri);function zo(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ro(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=Xr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ho=function(e){var t=Na(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Bo(e){if("string"==typeof e||us(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Uo(e){if(e instanceof Gn)return e.clone();var t=new Kn(e.__wrapped__,e.__chain__);return t.__actions__=Oi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Wo=Jr((function(e,t){return Xa(e)?pr(e,vr(t,1,Xa,!0)):[]})),Vo=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),uo(n,2)):[]})),Ko=Jr((function(e,t){var n=Qo(t);return Xa(n)&&(n=i),Xa(e)?pr(e,vr(t,1,Xa,!0),i,n):[]}));function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Bt(e,uo(t,3),i)}function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=bs(n),o=n<0?yn(r+o,0):wn(o,r-1)),Bt(e,uo(t,3),o,!0)}function Zo(e){return(null==e?0:e.length)?vr(e,1):[]}function qo(e){return e&&e.length?e[0]:i}var Xo=Jr((function(e){var t=At(e,vi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Jr((function(e){var t=Qo(e),n=At(e,vi);return t===Qo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Or(n,uo(t,2)):[]})),Jo=Jr((function(e){var t=Qo(e),n=At(e,vi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Or(n,i,t):[]}));function Qo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Jr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Zr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return qr(e,At(t,(function(e){return wo(e,n)?+e:e})).sort(Ii)),r}));function ra(e){return null==e?e:Sn.call(e)}var ia=Jr((function(e){return hi(vr(e,1,Xa,!0))})),oa=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),hi(vr(e,1,Xa,!0),uo(t,2))})),aa=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,hi(vr(e,1,Xa,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,(function(e){if(Xa(e))return t=yn(e.length,t),!0})),qt(t,(function(t){return At(e,Kt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:At(n,(function(e){return St(t,i,e)}))}var ca=Jr((function(e,t){return Xa(e)?pr(e,t):[]})),da=Jr((function(e){return bi(Tt(e,Xa))})),ua=Jr((function(e){var t=Qo(e);return Xa(t)&&(t=i),bi(Tt(e,Xa),uo(t,2))})),ha=Jr((function(e){var t=Qo(e);return t="function"==typeof t?t:i,bi(Tt(e,Xa),i,t)})),pa=Jr(sa);var ga=Jr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ba=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Kn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var xa=Ai((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var va=Bi(Go),ya=Bi(Yo);function wa(e,t){return(Ya(e)?jt:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?It:mr)(e,uo(t,3))}var _a=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Jr((function(e,t,n){var i=-1,o="function"==typeof t,a=qa(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?St(t,e,n):Lr(e,t,n)})),a})),Sa=Ai((function(e,t,n){sr(e,n,t)}));function Ca(e,t){return(Ya(e)?At:Fr)(e,uo(t,3))}var ja=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,vr(t,1),[])})),Ma=ht||function(){return pt.Date.now()};function Ta(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,u,i,i,i,i,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(La));r|=c}return Qi(e,r,t,n,i)})),Aa=Jr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(Aa));r|=c}return Qi(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Te(o);function m(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function f(e){return u=e,c=Po(x,t),h?m(e):l}function b(e){var n=e-d;return d===i||n>=t||n<0||p&&e-u>=s}function x(){var e=Ma();if(b(e))return v(e);c=Po(x,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function v(e){return c=i,g&&r?m(e):(r=a=i,l)}function y(){var e=Ma(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return f(d);if(p)return Ei(c),c=Po(x,t),m(d)}return c===i&&(c=Po(x,t)),l}return t=vs(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?yn(vs(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),y.cancel=function(){c!==i&&Ei(c),u=0,r=d=a=c=i},y.flush=function(){return c===i?l:v(Ma())},y}var Da=Jr((function(e,t){return hr(e,1,t)})),za=Jr((function(e,t,n){return hr(e,vs(t)||0,n)}));function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Na.Cache||qn),n}function Ra(e){if("function"!=typeof e)throw new Te(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=qn;var Ha=ki((function(e,t){var n=(t=1==t.length&&Ya(t[0])?At(t[0],$t(uo())):At(vr(t,1),$t(uo()))).length;return Jr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return St(e,this,r)}))})),Ba=Jr((function(e,t){var n=dn(t,co(Ba));return Qi(e,c,i,t,n)})),Fa=Jr((function(e,t){var n=dn(t,co(Fa));return Qi(e,d,i,t,n)})),Ua=io((function(e,t){return Qi(e,h,i,i,i,t)}));function Wa(e,t){return e===t||e!=e&&t!=t}var Va=Zi(Ir),Ka=Zi((function(e,t){return e>=t})),Ga=Ar(function(){return arguments}())?Ar:function(e){return is(e)&&ze.call(e,"callee")&&!qe.call(e,"callee")},Ya=r.isArray,Za=vt?$t(vt):function(e){return is(e)&&jr(e)==P};function qa(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return is(e)&&qa(e)}var $a=Rt||vl,Ja=yt?$t(yt):function(e){return is(e)&&jr(e)==w};function Qa(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==bs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=wt?$t(wt):function(e){return is(e)&&bo(e)==S};function as(e){return"number"==typeof e||is(e)&&jr(e)==C}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ye(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=kt?$t(kt):function(e){return is(e)&&jr(e)==M};var cs=_t?$t(_t):function(e){return is(e)&&bo(e)==T};function ds(e){return"string"==typeof e||!Ya(e)&&is(e)&&jr(e)==O}function us(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var hs=Et?$t(Et):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Zi(Br),gs=Zi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(qa(e))return ds(e)?gn(e):Oi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=bo(e);return(t==S?ln:t==T?un:Ws)(e)}function fs(e){return e?(e=vs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function xs(e){return e?cr(bs(e),0,f):0}function vs(e){if("number"==typeof e)return e;if(us(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=be.test(e);return n||ve.test(e)?dt(e.slice(2),n?2:8):fe.test(e)?m:+e}function ys(e){return Li(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var ks=Pi((function(e,t){if(Co(t)||qa(t))Li(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),_s=Pi((function(e,t){Li(t,Ds(t),e)})),Es=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Ss=Pi((function(e,t,n,r){Li(t,Ps(t),e,r)})),Cs=io(lr);var js=Jr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Wa(u,Ae[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),Is=Jr((function(e){return e.push(i,to),St(Ns,i,e)}));function Ms(e,t,n){var r=null==e?i:Sr(e,t);return r===i?n:r}function Ts(e,t){return null!=e&&xo(e,t,Tr)}var Os=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),e[t]=n}),rl(al)),Ls=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),uo),As=Jr(Lr);function Ps(e){return qa(e)?Jn(e):Rr(e)}function Ds(e){return qa(e)?Jn(e,!0):Hr(e)}var zs=Pi((function(e,t,n){Vr(e,t,n)})),Ns=Pi((function(e,t,n,r){Vr(e,t,n,r)})),Rs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=At(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=dr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var Hs=io((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=At(ao(e),(function(e){return[e]}));return t=uo(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Fs=Ji(Ps),Us=Ji(Ds);function Ws(e){return null==e?[]:Jt(e,Ps(e))}var Vs=Ri((function(e,t,n){return t=t.toLowerCase(),e+(n?Ks(t):t)}));function Ks(e){return Qs(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(we,rn).replace(Qe,"")}var Ys=Ri((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Ri((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),qs=Ni("toLowerCase");var Xs=Ri((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Ri((function(e,t,n){return e+(n?" ":"")+Qs(t)}));var Js=Ri((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Qs=Ni("toUpperCase");function el(e,t,n){return e=ws(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return St(e,i,t)}catch(e){return Qa(e)?e:new Ee(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Bo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Fi(),ol=Fi(!0);function al(e){return e}function sl(e){return Nr("function"==typeof e?e:dr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),cl=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Er(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(t,Ps(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})})),e}function ul(){}var hl=Ki(At),pl=Ki(Mt),gl=Ki(Nt);function ml(e){return _o(e)?Kt(Bo(e)):function(e){return function(t){return Sr(t,e)}}(e)}var fl=Yi(),bl=Yi(!0);function xl(){return[]}function vl(){return!1}var yl=Vi((function(e,t){return e+t}),0),wl=Xi("ceil"),kl=Vi((function(e,t){return e/t}),1),_l=Xi("floor");var El,Sl=Vi((function(e,t){return e*t}),1),Cl=Xi("round"),jl=Vi((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Te(o);return e=bs(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ta,Un.assign=ks,Un.assignIn=_s,Un.assignInWith=Es,Un.assignWith=Ss,Un.at=Cs,Un.before=Oa,Un.bind=La,Un.bindAll=nl,Un.bindKey=Aa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:yn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Pt(Ya(n)?Oi(n):[n],vr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Te(o);return[n(e[0]),e[1]]})):[],Jr((function(n){for(var r=-1;++r<t;){var i=e[r];if(St(i[0],this,n))return St(i[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ps(e);return function(n){return ur(n,e,t)}}(dr(e,1))},Un.constant=rl,Un.countBy=xa,Un.create=function(e,t){var n=Wn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var o=Qi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.curryRight=function e(t,n,r){var o=Qi(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.debounce=Pa,Un.defaults=js,Un.defaultsDeep=Is,Un.defer=Da,Un.delay=za,Un.difference=Wo,Un.differenceBy=Vo,Un.differenceWith=Ko,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:bs(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:bs(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0):[]},Un.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=bs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:bs(r))<0&&(r+=o),r=n>r?0:xs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Ya(e)?Tt:xr)(e,uo(t,3))},Un.flatMap=function(e,t){return vr(Ca(e,t),1)},Un.flatMapDeep=function(e,t){return vr(Ca(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),vr(Ca(e,t),n)},Un.flatten=Zo,Un.flattenDeep=function(e){return(null==e?0:e.length)?vr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?vr(e,t=t===i?1:bs(t)):[]},Un.flip=function(e){return Qi(e,512)},Un.flow=il,Un.flowRight=ol,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Un.functions=function(e){return null==e?[]:Er(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,Ds(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Un.intersection=Xo,Un.intersectionBy=$o,Un.intersectionWith=Jo,Un.invert=Os,Un.invertBy=Ls,Un.invokeMap=Ea,Un.iteratee=sl,Un.keyBy=Sa,Un.keys=Ps,Un.keysIn=Ds,Un.map=Ca,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Un.mapValues=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Un.matches=function(e){return Ur(dr(e,1))},Un.matchesProperty=function(e,t){return Wr(e,dr(t,1))},Un.memoize=Na,Un.merge=zs,Un.mergeWith=Ns,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ra,Un.nthArg=function(e){return e=bs(e),Jr((function(t){return Kr(t,e)}))},Un.omit=Rs,Un.omitBy=function(e,t){return Bs(e,Ra(uo(t)))},Un.once=function(e){return Oa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=r?i:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=hl,Un.overArgs=Ha,Un.overEvery=pl,Un.overSome=gl,Un.partial=Ba,Un.partialRight=Fa,Un.partition=ja,Un.pick=Hs,Un.pickBy=Bs,Un.property=ml,Un.propertyOf=function(e){return function(t){return null==e?i:Sr(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,i,n):e},Un.pullAt=na,Un.range=fl,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Tt:xr)(e,Ra(uo(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=uo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return qr(e,i),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Te(o);return Jr(e,t=t===i?t:bs(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),(Ya(e)?er:ei)(e,t)},Un.set=function(e,t,n){return null==e?e:ti(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Un.shuffle=function(e){return(Ya(e)?tr:ii)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:bs(t),n=n===i?r:bs(n)),oi(e,t,n)):[]},Un.sortBy=Ia,Un.sortedUniq=function(e){return e&&e.length?ci(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?_i(gn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Te(o);return t=null==t?0:yn(bs(t),0),Jr((function(n){var r=n[t],i=_i(n,0,t);return r&&Pt(i,r),St(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:bs(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:bs(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mi(e,uo(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Te(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},Un.thru=fa,Un.toArray=ms,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?At(e,Bo):us(e)?[e]:Oi(Ho(ws(e)))},Un.toPlainObject=ys,Un.transform=function(e,t,n){var r=Ya(e),i=r||$a(e)||hs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Wn(Ye(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return Ta(e,1)},Un.union=ia,Un.unionBy=oa,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?hi(e):[]},Un.uniqBy=function(e,t){return e&&e.length?hi(e,uo(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?hi(e,i,t):[]},Un.unset=function(e,t){return null==e||pi(e,t)},Un.unzip=sa,Un.unzipWith=la,Un.update=function(e,t,n){return null==e?e:gi(e,t,yi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,yi(n),r)},Un.values=Ws,Un.valuesIn=function(e){return null==e?[]:Jt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ba(yi(t),e)},Un.xor=da,Un.xorBy=ua,Un.xorWith=ha,Un.zip=pa,Un.zipObject=function(e,t){return xi(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return xi(e||[],t||[],ti)},Un.zipWith=ga,Un.entries=Fs,Un.entriesIn=Us,Un.extend=_s,Un.extendWith=Es,dl(Un,Un),Un.add=yl,Un.attempt=tl,Un.camelCase=Vs,Un.capitalize=Ks,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=vs(n))==n?n:0),t!==i&&(t=(t=vs(t))==t?t:0),cr(vs(e),t,n)},Un.clone=function(e){return dr(e,4)},Un.cloneDeep=function(e){return dr(e,5)},Un.cloneDeepWith=function(e,t){return dr(e,5,t="function"==typeof t?t:i)},Un.cloneWith=function(e,t){return dr(e,4,t="function"==typeof t?t:i)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Ps(t))},Un.deburr=Gs,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kl,Un.endsWith=function(e,t,n){e=ws(e),t=ui(t);var r=e.length,o=n=n===i?r:cr(bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Un.eq=Wa,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(q,on):e},Un.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Un.every=function(e,t,n){var r=Ya(e)?Mt:fr;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=va,Un.findIndex=Go,Un.findKey=function(e,t){return Ht(e,uo(t,3),kr)},Un.findLast=ya,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Ht(e,uo(t,3),_r)},Un.floor=_l,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Ds)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ds)},Un.forOwn=function(e,t){return e&&kr(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,uo(t,3))},Un.get=Ms,Un.gt=Va,Un.gte=Ka,Un.has=function(e,t){return null!=e&&xo(e,t,Mr)},Un.hasIn=Ts,Un.head=qo,Un.identity=al,Un.includes=function(e,t,n,r){e=qa(e)?e:Ws(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ds(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(e=vs(e),t,n)},Un.invoke=As,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Za,Un.isArrayLike=qa,Un.isArrayLikeObject=Xa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==y},Un.isBuffer=$a,Un.isDate=Ja,Un.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Un.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||hs(e)||Ga(e)))return!e.length;var t=bo(e);if(t==S||t==T)return!e.size;if(Co(e))return!Rr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Pr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Pr(e,t,i,n):!!r},Un.isError=Qa,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=es,Un.isInteger=ts,Un.isLength=ns,Un.isMap=os,Un.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(So(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=as,Un.isObject=rs,Un.isObjectLike=is,Un.isPlainObject=ss,Un.isRegExp=ls,Un.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=g},Un.isSet=cs,Un.isString=ds,Un.isSymbol=us,Un.isTypedArray=hs,Un.isUndefined=function(e){return e===i},Un.isWeakMap=function(e){return is(e)&&bo(e)==A},Un.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":xn.call(e,t)},Un.kebabCase=Ys,Un.last=Qo,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=bs(n))<0?yn(r+o,0):wn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Wt,o,!0)},Un.lowerCase=Zs,Un.lowerFirst=qs,Un.lt=ps,Un.lte=gs,Un.max=function(e){return e&&e.length?br(e,al,Ir):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),Ir):i},Un.mean=function(e){return Vt(e,al)},Un.meanBy=function(e,t){return Vt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Br):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Br):i},Un.stubArray=xl,Un.stubFalse=vl,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Sl,Un.nth=function(e,t){return e&&e.length?Kr(e,bs(t)):i},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=ul,Un.now=Ma,Un.pad=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(bt(i),n)+e+Gi(mt(i),n)},Un.padEnd=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?e+Gi(t-r,n):e},Un.padStart=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?Gi(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return wn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Xr(e,t)},Un.reduce=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,mr)},Un.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),$r(ws(e),t)},Un.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Bo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Un.round=Cl,Un.runInContext=e,Un.sample=function(e){return(Ya(e)?Qn:Qr)(e)},Un.size=function(e){if(null==e)return 0;if(qa(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==S||t==T?e.size:Rr(e).length},Un.snakeCase=Xs,Un.some=function(e,t,n){var r=Ya(e)?Nt:ai;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.sortedIndex=function(e,t){return si(e,t)},Un.sortedIndexBy=function(e,t,n){return li(e,t,uo(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Wa(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return si(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return li(e,t,uo(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Wa(e[n],t))return n}return-1},Un.startCase=$s,Un.startsWith=function(e,t,n){return e=ws(e),n=null==n?0:cr(bs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Un.subtract=jl,Un.sum=function(e){return e&&e.length?Zt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ko(e,t,n)&&(t=i),e=ws(e),t=Es({},t,r,eo);var o,a,s=Es({},t.imports,r.imports,eo),l=Ps(s),c=Jt(s,l),d=0,u=t.interpolate||ke,h="__p += '",p=Ie((t.escape||ke).source+"|"+u.source+"|"+(u===ee?ge:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),g="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(d,l).replace(_e,an),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ee("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(K,""):h).replace(G,"$1").replace(Y,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var f=tl((function(){return Se(l,g+"return "+h).apply(i,c)}));if(f.source=h,Qa(f))throw f;return f},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=f,r=wn(e,f);t=uo(t),e-=f;for(var i=qt(r,t);++n<e;)t(n);return i},Un.toFinite=fs,Un.toInteger=bs,Un.toLength=xs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=vs,Un.toSafeInteger=function(e){return e?cr(bs(e),-9007199254740991,g):0===e?e:0},Un.toString=ws,Un.toUpper=function(e){return ws(e).toUpperCase()},Un.trim=function(e,t,n){if((e=ws(e))&&(n||t===i))return Xt(e);if(!e||!(t=ui(t)))return e;var r=gn(e),o=gn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Un.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,0,tn(r,gn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,en(r,gn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?bs(t.length):n,r="omission"in t?ui(t.omission):r}var a=(e=ws(e)).length;if(sn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),ls(o)){if(e.slice(l).search(o)){var d,u=c;for(o.global||(o=Ie(o.source,ws(me.exec(o))+"g")),o.lastIndex=0;d=o.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Z,fn):e},Un.uniqueId=function(e){var t=++Ne;return ws(e)+t},Un.upperCase=Js,Un.upperFirst=Qs,Un.each=wa,Un.eachRight=ka,Un.first=qo,dl(Un,(El={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(El[t]=e)})),El),{chain:!1}),Un.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:yn(bs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ra(uo(e)))},Gn.prototype.slice=function(e,t){e=bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],d=l||Ya(t),u=function(e){var t=o.apply(Un,Pt([e],s));return r&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new Gn(this);var f=e.apply(t,s);return f.__actions__.push({func:fa,args:[u],thisArg:i}),new Kn(f,h)}return g&&m?e.apply(this,s):(f=this.thru(u),g?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[n]((function(n){return t.apply(Ya(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ui(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ya(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,d=this.__iteratees__,u=d.length,h=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var m=-1,f=e[c+=t];++m<u;){var b=d[m],x=b.iteratee,v=b.type,y=x(f);if(2==v)f=y;else if(!y){if(1==v)continue e;break e}}g[h++]=f}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Kn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Vn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ra],thisArg:i}),new Kn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),c=1;c<arguments.length;c++){for(var d in a=Object(arguments[c]))n.call(a,d)&&(l[d]=a[d]);if(t){s=t(a);for(var u=0;u<s.length;u++)r.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),i=n(4295);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},554:(e,t,n)=>{var r=n(487),i=n(9135);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2789:(e,t,n)=>{var r=n(487),i=n(3729);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5080:(e,t,n)=>{var r=n(487),i=n(4241);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7225:(e,t,n)=>{var r=n(487),i=n(6029);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},778:(e,t,n)=>{var r=n(487),i=n(9609);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4220:(e,t,n)=>{var r=n(487),i=n(2345);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4678:(e,t,n)=>{var r=n(487),i=n(9393);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1292:(e,t,n)=>{var r=n(487),i=n(6578);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},196:(e,t,n)=>{var r=n(487),i=n(9482);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2205:(e,t,n)=>{var r=n(487),i=n(7955);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1310:(e,t,n)=>{var r=n(487),i=n(3195);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3922:(e,t,n)=>{var r=n(487),i=n(2978);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7096:(e,t,n)=>{var r=n(487),i=n(1587);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7117:(e,t,n)=>{var r=n(487),i=n(9478);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1106:(e,t,n)=>{var r=n(487),i=n(7369);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3336:(e,t,n)=>{var r=n(487),i=n(1434);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4406:(e,t,n)=>{var r=n(487),i=n(8923);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6043:(e,t,n)=>{var r=n(487),i=n(5605);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},694:(e,t,n)=>{var r=n(487),i=n(5644);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8328:(e,t,n)=>{var r=n(487),i=n(6843);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8051:(e,t,n)=>{var r=n(487),i=n(8461);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4301:(e,t,n)=>{var r=n(487),i=n(9935);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9966:(e,t,n)=>{var r=n(487),i=n(532);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9295:(e,t,n)=>{var r=n(487),i=n(7589);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9781:(e,t,n)=>{var r=n(487),i=n(8465);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},371:(e,t,n)=>{var r=n(487),i=n(5892);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4623:(e,t,n)=>{var r=n(487),i=n(3874);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1528:(e,t,n)=>{var r=n(487),i=n(2681);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},518:(e,t,n)=>{var r=n(487),i=n(6759);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9757:(e,t,n)=>{var r=n(487),i=n(9650);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5422:(e,t,n)=>{var r=n(487),i=n(2044);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},276:(e,t,n)=>{var r=n(487),i=n(9144);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6781:(e,t,n)=>{var r=n(487),i=n(6626);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},580:(e,t,n)=>{var r=n(487),i=n(6359);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4285:(e,t,n)=>{var r=n(487),i=n(9915);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3313:(e,t,n)=>{var r=n(487),i=n(9310);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8635:(e,t,n)=>{var r=n(487),i=n(6464);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},487:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=s(d),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:d,updater:f(h,t),references:1}),r.push(d)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function f(e,t){var n,r,i;if(t.singleton){var o=m++;n=g||(g=c(t)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var o=l(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=o}}}},788:(e,t,n)=>{var r={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./bn-BD.json":[8525,603],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./si-LK.json":[5497,58],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./ta-IN.json":[3952,395],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-HK.json":[5334,9],"./zh-TW.json":[931,62]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((()=>n.t(i,19)))}i.keys=()=>Object.keys(r),i.id=788,e.exports=i},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(3940),n.b),d=new URL(n(3147),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,'@font-face{font-family:"Virgil";src:url('+h+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]);const g=u},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const s=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]);const s=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const s=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const s=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const s=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+u+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const h=d},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const s=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const s=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const s=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+u+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const h=d},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const s=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const s=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const s=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const s=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);const s=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const s=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const s=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const s=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const s=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const s=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const s=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const s=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const s=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const s=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const s=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const s=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const s=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const s=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const s=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const s=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const s=a},9144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var(--color-primary-chubb);--keybinding-color: var(--color-primary-chubb)}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]);const s=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const s=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList:empty{display:none}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const s=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const s=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(7984),n.b),d=new URL(n(1639),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+h+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-chubb: #625ee0;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-chubb: #726dff;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const g=u},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>o,f:()=>a,qx:()=>s,Iw:()=>l,$e:()=>c,wZ:()=>d,ay:()=>u,oc:()=>h,Oh:()=>p,Ks:()=>g,Vi:()=>m,$C:()=>f,ut:()=>b,C6:()=>x,_D:()=>v,n5:()=>y,rk:()=>w,Hg:()=>k,hs:()=>_,k:()=>E,LO:()=>S,r8:()=>C,pb:()=>j,LL:()=>I,Gj:()=>M,nM:()=>T,Lg:()=>O,HM:()=>L,V4:()=>A,EH:()=>P,ZF:()=>D,UO:()=>z,ah:()=>N,cW:()=>R,kV:()=>H,sS:()=>B,Yx:()=>F,zK:()=>U,ZB:()=>W,qy:()=>V,h6:()=>K,jo:()=>G,$n:()=>Y,hR:()=>Z,Kr:()=>q,tr:()=>X});var r=n(8635),i=n.n(r);const o="Excalidraw",a=10,s=8,l=5,c=1,d=30,u=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},p={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};let g;!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(g||(g={}));const m={TEST:"test",DEVELOPMENT:"development"},f={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},x={LIGHT:"light",DARK:"dark"},v="Segoe UI Emoji",y=20,w=b.Virgil,k="left",_="top",E=20,S={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},C={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},j=window.location.origin,I=500,M=300,T=500,O=5e3,L=100,A=.1,P={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,z={addLibrary:"addLibrary"},N={addLibrary:"addLibrary"},R={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},H=730,B=1e3,F=500,U=2,W=[1,2,3],V=10,K=1440,G=[S.png,S.jpg,S.svg,S.gif],Y=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},X=30},2254:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>qr,default:()=>mp,defaultLang:()=>c,exportToBlob:()=>Eh,exportToCanvas:()=>_h,exportToSvg:()=>Sh,getFreeDrawSvgPath:()=>Fr,getNonDeletedElements:()=>_a,getSceneVersion:()=>ka,isInvisiblySmallElement:()=>Xr,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>td,loadLibraryFromBlob:()=>nd,mutateElement:()=>Yr,newElementWith:()=>Zr,restore:()=>qc,restoreAppState:()=>Zc,restoreElements:()=>Yc,serializeAsJSON:()=>cd});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@zsviczian/excalidraw","i8":"0.10.0-textfix-9"}');"production"!==o.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(a.u2,"@").concat(a.i8,"/dist/"));var s=n(1463),l=n(4451);const c={code:"en",label:"English"},d=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},{code:"kk-KZ",label:"Қазақ тілі"}].concat([c]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>l[e.code]>=85)),u="__test__";"production"===o.Vi.DEVELOPMENT&&d.unshift({code:u,label:"test language"},{code:"".concat(u,".rtl"),label:"‪test language (rtl)‬",rtl:!0});let h=c,p={};const g=async e=>{h=e,document.documentElement.dir=h.rtl?"rtl":"ltr",document.documentElement.lang=h.code,p=e.code.startsWith(u)?{}:await n(788)("./".concat(h.code,".json"))},m=()=>h,f=(e,t)=>{for(let n=0;n<t.length;++n){const r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},b=(e,t)=>{if(h.code.startsWith(u)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"‪[[".concat(n,"]]‬")}const n=e.split(".");let r=f(p,n)||f(s,n);if(void 0===r)throw new Error("Can't find translation for ".concat(e));if(t)for(const e in t)r=r.replace("{{".concat(e,"}}"),String(t[e]));return r};var x=n(4512);const v=()=>(0,x.jsx)("div",{className:"LoadingMessage",children:(0,x.jsx)("span",{children:b("labels.loadingScene")})}),y=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{const t=d.find((t=>t.code===e.langCode))||c;(async()=>{await g(t)})(),n(!1)}),[e.langCode]),t?(0,x.jsx)(v,{}):e.children};function w(e,t,n){if(e&&e.length){const[r,i]=t,o=Math.PI/180*n,a=Math.cos(o),s=Math.sin(o);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-i)*s+r,e[1]=(t-r)*s+(n-i)*a+i}))}}function k(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function _(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const i=[0,0];if(n)for(const t of e)w(t,i,n);const o=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const i=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);i.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(i.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!i.length)return r;let o=[],a=i[0].ymin;for(;o.length||i.length;){if(i.length){let e=-1;for(let t=0;t<i.length&&!(i[t].ymin>a);t++)e=t;i.splice(0,e+1).forEach((e=>{o.push({s:a,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=a))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),o.length>1)for(let e=0;e<o.length;e+=2){const t=e+1;if(t>=o.length)break;const n=o[e].edge,i=o[t].edge;r.push([[Math.round(n.x),a],[Math.round(i.x),a]])}a+=t,o.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)w(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),w(r,t,n)}(o,i,-n)}return o}class E{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class S extends E{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,o=[],a=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k([e,t])&&o.push([[e[0]-a,e[1]+s],[...t]],[[e[0]+a,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(o,t)}}}class C extends E{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const o=r/4;for(const a of e){const e=k(a),s=e/r,l=Math.ceil(s)-1,c=e-l*r,d=(a[0][0]+a[1][0])/2-r/4,u=Math.min(a[0][1],a[1][1]);for(let e=0;e<l;e++){const a=u+c+e*r,s=d-o+2*Math.random()*o,l=a-o+2*Math.random()*o,h=this.helper.ellipse(s,l,i,i,t);n.push(...h.ops)}}return{type:"fillSketch",ops:n}}}class I{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{const o=k(e),a=Math.floor(o/(n+r)),s=(o+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){const o=e*(n+r),a=o+n,c=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)],u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],t))}})),i}}class M{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const i=k(e),o=Math.round(i/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<o;e++){const i=2*e*t,o=2*(e+1)*t,s=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+i*Math.cos(l),a[1]+i*Math.sin(l)],d=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],u=[c[0]+s*Math.cos(l+Math.PI/4),c[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],d[0],d[1],n))}})),r}}const T={};class O{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function A(e,t){return e.type===t}function P(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",i=0,o=n[i];for(;!A(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=L[o.text],r=o.text}else A(o,1)?a=L[r]:(i++,a=L[o.text],r=o.text);if(!(i+a<n.length))throw new Error("Path data ended short");for(let e=i;e<i+a;e++){const t=n[e];if(!A(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof L[r])throw new Error("Bad segment: "+r);{const e={key:r,data:s};t.push(e),i+=a,o=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function D(e){let t=0,n=0,r=0,i=0;const o=[];for(const{key:a,data:s}of e)switch(a){case"M":o.push({key:"M",data:[...s]}),[t,n]=s,[r,i]=s;break;case"m":t+=s[0],n+=s[1],o.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":o.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],o.push({key:"L",data:[t,n]});break;case"C":o.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function z(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,o=0;"C"===n||"S"===n?(e=r+(r-s),o=i+(i-l)):(e=r,o=i),t.push({key:"C",data:[e,o,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[e,o]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=i+(i-l)):(a=r,c=i);const u=r+2*(a-r)/3,h=i+2*(c-i)/3,p=e+2*(a-e)/3,g=o+2*(c-o)/3;t.push({key:"C",data:[u,h,p,g,e,o]}),s=a,l=c,r=e,i=o;break}case"Q":{const[e,n,o,a]=d,c=r+2*(e-r)/3,u=i+2*(n-i)/3,h=o+2*(e-o)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,u,h,p,o,a]}),s=e,l=n,r=o,i=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),o=d[2],a=d[3],s=d[4],l=d[5],c=d[6];if(0===e||0===n)t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c;else if(r!==l||i!==c){R(r,i,l,c,e,n,o,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,i=c}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=c}return t}function N(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function R(e,t,n,r,i,o,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let h=[],p=0,g=0,m=0,f=0;if(c)[p,g,m,f]=c;else{[e,t]=N(e,t,-d),[n,r]=N(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(i*i)+c*c/(o*o);u>1&&(u=Math.sqrt(u),i*=u,o*=u);const h=i*i,b=o*o,x=h*b-h*c*c-b*a*a,v=h*c*c+b*a*a,y=(s===l?-1:1)*Math.sqrt(Math.abs(x/v));m=y*i*c/o+(e+n)/2,f=y*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-f)/o).toFixed(9))),g=Math.asin(parseFloat(((r-f)/o).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>120*Math.PI/180){const e=g,t=n,s=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=R(n=m+i*Math.cos(g),r=f+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,m,f])}b=g-p;const x=Math.cos(p),v=Math.sin(p),y=Math.cos(g),w=Math.sin(g),k=Math.tan(b/4),_=4/3*i*k,E=4/3*o*k,S=[e,t],C=[e+_*v,t-E*x],j=[n+_*w,r-E*y],I=[n,r];if(C[0]=2*S[0]-C[0],C[1]=2*S[1]-C[1],c)return[C,j,I].concat(h);{h=[C,j,I].concat(h);const e=[];for(let t=0;t<h.length;t+=3){const n=N(h[t][0],h[t][1],d),r=N(h[t+1][0],h[t+1][1],d),i=N(h[t+2][0],h[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}const H={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,n){return X(e,t,n)},ellipse:function(e,t,n,r,i){const o=V(n,r,i);return K(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return J(e,t,n,r,i,!0)}};function B(e,t,n,r,i){return{type:"path",ops:J(e,t,n,r,i)}}function F(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...J(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...J(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?B(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function U(e,t,n,r,i){return function(e,t){return F(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function W(e,t){let n=ee(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ee(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function V(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),o=2*Math.PI/i;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-n.curveFitting;return a+=$(a*l,n),s+=$(s*l,n),{increment:o,rx:a,ry:s}}function K(e,t,n,r){const[i,o]=ne(r.increment,e,t,r.rx,r.ry,1,r.increment*X(.1,X(.4,1,n),n),n);let a=te(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=ne(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=te(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function G(e,t,n,r,i,o,a,s,l){const c=e,d=t;let u=Math.abs(n/2),h=Math.abs(r/2);u+=$(.01*u,l),h+=$(.01*h,l);let p=i,g=o;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,f=Math.min(m/2,(g-p)/2),b=re(f,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(f,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...J(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...J(c,d,c+u*Math.cos(g),d+h*Math.sin(g),l)):b.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(p),d+h*Math.sin(p)]})),{type:"path",ops:b}}function Y(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$(e,t),r[0][1]+$(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+$(e,t),r[o][1]+$(e,t)]})}}return{type:"fillPath",ops:n}}function Z(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!T[n])switch(n){case"zigzag":T[n]||(T[n]=new S(t));break;case"cross-hatch":T[n]||(T[n]=new C(t));break;case"dots":T[n]||(T[n]=new j(t));break;case"dashed":T[n]||(T[n]=new I(t));break;case"zigzag-line":T[n]||(T[n]=new M(t));break;default:n="hachure",T[n]||(T[n]=new E(t))}return T[n]}(t,H).fillPolygons(e,t)}function q(e){return e.randomizer||(e.randomizer=new O(e.seed||0)),e.randomizer.next()}function X(e,t,n,r=1){return n.roughness*r*(q(n)*(t-e)+e)}function $(e,t,n=1){return X(-e,e,t,n)}function J(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=Q(e,t,n,r,i,!0,!1);if(a)return s;const l=Q(e,t,n,r,i,!0,!0);return s.concat(l)}function Q(e,t,n,r,i,o,a){const s=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,h=.2+.2*q(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=$(p,i,c),g=$(g,i,c);const m=[],f=()=>$(u,i,c),b=()=>$(d,i,c),x=i.preserveVertices;return o&&(a?m.push({op:"move",data:[e+(x?0:f()),t+(x?0:f())]}):m.push({op:"move",data:[e+(x?0:$(d,i,c)),t+(x?0:$(d,i,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+f(),g+t+(r-t)*h+f(),p+e+2*(n-e)*h+f(),g+t+2*(r-t)*h+f(),n+(x?0:f()),r+(x?0:f())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),g+t+(r-t)*h+b(),p+e+2*(n-e)*h+b(),g+t+2*(r-t)*h+b(),n+(x?0:b()),r+(x?0:b())]}),m}function ee(e,t,n){const r=[];r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]),r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]),i===e.length-1&&r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]);return te(r,null,n)}function te(e,t,n){const r=e.length,i=[];if(r>3){const o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];o[0]=[n[0],n[1]],o[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],o[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],o[3]=[e[t+1][0],e[t+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(e,n),t[1]+$(e,n)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push(...J(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function ne(e,t,n,r,i,o,a,s){const l=[],c=[];if(0===s.roughness){e/=4,c.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let o=0;o<=2*Math.PI;o+=e){const e=[t+r*Math.cos(o),n+i*Math.sin(o)];l.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+i*Math.sin(0)]),c.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const d=$(.5,s)-Math.PI/2;c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const u=2*Math.PI+d-.01;for(let a=d;a<u;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}c.push([$(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),$(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([$(o,s)+t+.98*r*Math.cos(d+a),$(o,s)+n+.98*i*Math.sin(d+a)]),c.push([$(o,s)+t+.9*r*Math.cos(d+.5*a),$(o,s)+n+.9*i*Math.sin(d+.5*a)])}return[c,l]}function re(e,t,n,r,i,o,a,s,l){const c=o+$(.1,l),d=[];d.push([$(s,l)+t+.9*r*Math.cos(c-e),$(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([$(s,l)+t+r*Math.cos(o),$(s,l)+n+i*Math.sin(o)]);return d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),te(d,null,l)}function ie(e,t,n,r,i,o,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let d=[0,0];const u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:$(c[0],s)),a[1]+(h?0:$(c[0],s))]}),d=h?[i,o]:[i+$(c[p],s),o+$(c[p],s)],l.push({op:"bcurveTo",data:[e+$(c[p],s),t+$(c[p],s),n+$(c[p],s),r+$(c[p],s),d[0],d[1]]});return l}function oe(e){return[...e]}function ae(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function se(e,t,n){const r=ae(t,n);if(0===r)return ae(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ae(e,le(t,n,i))}function le(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ce(e,t,n,r){const i=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],o=e[t+3];let a=3*r[0]-2*n[0]-o[0];a*=a;let s=3*r[1]-2*n[1]-o[1];s*=s;let l=3*i[0]-2*o[0]-n[0];l*=l;let c=3*i[1]-2*o[1]-n[1];return c*=c,a<l&&(a=l),s<c&&(s=c),a+s}(e,t)<n){const n=e[t+0];if(i.length){(o=i[i.length-1],a=n,Math.sqrt(ae(o,a)))>1&&i.push(n)}else i.push(n);i.push(e[t+3])}else{const r=.5,o=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=le(o,a,r),d=le(a,s,r),u=le(s,l,r),h=le(c,d,r),p=le(d,u,r),g=le(h,p,r);ce([o,c,h,g],0,n,i),ce([g,p,u,l],0,n,i)}var o,a;return i}function de(e,t){return ue(e,0,e.length,t)}function ue(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;r<n-1;++r){const t=se(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(ue(e,t,c+1,r,o),ue(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function he(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){ce(e,3*n,t,r)}return n&&n>0?ue(r,0,r.length,n):r}const pe="none";class ge{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const o=this._o(i);return this._d("line",[B(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=U(e,t,n,r,o);if(o.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===o.fillStyle?a.push(Y([i],o)):a.push(Z([i],o))}return o.stroke!==pe&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=V(n,r,o),l=K(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=K(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(Z([l.estimatedPoints],o));return o.stroke!==pe&&a.push(l.opset),this._d("ellipse",a,o)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[F(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=G(e,t,n,r,i,o,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const s=G(e,t,n,r,i,o,!0,!1,a);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,o,a){const s=e,l=t;let c=Math.abs(n/2),d=Math.abs(r/2);c+=$(.01*c,a),d+=$(.01*d,a);let u=i,h=o;for(;u<0;)u+=2*Math.PI,h+=2*Math.PI;h-u>2*Math.PI&&(u=0,h=2*Math.PI);const p=(h-u)/a.curveStepCount,g=[];for(let e=u;e<=h;e+=p)g.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return g.push([s+c*Math.cos(h),l+d*Math.sin(h)]),g.push([s,l]),Z([g],a)}(e,t,n,r,i,o,l));return l.stroke!==pe&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=W(e,n);if(n.fill&&n.fill!==pe&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(oe(e[0]),oe(e[1]),oe(e[2]),oe(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const i=[],o=1-t;r.push(oe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(o*n[e+1][0]-o*n[e-1][0])/6,t[1]+(o*n[e+1][1]-o*n[e-1][1])/6],i[2]=[n[e+1][0]+(o*n[e][0]-o*n[e+2][0])/6,n[e+1][1]+(o*n[e][1]-o*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}(e),i=he(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Y([i],n)):r.push(Z([i],n))}return n.stroke!==pe&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=F(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Y([e],n)):r.push(Z([e],n))),n.stroke!==pe&&r.push(i),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=n.fill&&"transparent"!==n.fill&&n.fill!==pe,o=n.stroke!==pe,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=z(D(P(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...he(s,t)),s=[]},c=()=>{l(),o.length&&(i.push(o),o=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],o.push(a);break;case"L":l(),o.push([t[0],t[1]]);break;case"C":if(!s.length){const e=o.length?o[o.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),o.push([a[0],a[1]])}if(c(),!n)return i;const d=[];for(const e of i){const t=de(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return i&&("solid"===n.fillStyle?r.push(Y(s,n)):r.push(Z(s,n))),o&&(a?s.forEach((e=>{r.push(F(e,!1,n))})):r.push(function(e,t){const n=z(D(P(e))),r=[];let i=[0,0],o=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:$(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...J(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]];break;case"C":{const[e,n,i,s,l,c]=a;r.push(...ie(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...J(o[0],o[1],i[0],i[1],t)),o=[i[0],i[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:pe};break;case"fillPath":t={d:this.opsToPath(e),stroke:pe,strokeWidth:0,fill:n.fill||pe};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||pe,strokeWidth:n,fill:pe}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(const o of t)switch(o.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,o,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,i,t),r.restore();break}case"fillSketch":this.fillSketch(r,o,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o),o}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o),o}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o),o}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l),l}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const fe="http://www.w3.org/2000/svg";class be{constructor(e,t){this.svg=e,this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(fe,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(fe,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o)}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o)}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const xe={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function ve(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ve(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ye(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ve(e))&&(r&&(r+=" "),r+=t);return r}let we=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const ke=e=>!!e&&"image"===e.type&&!!e.fileId,_e=e=>!!e&&"image"===e.type,Ee=e=>null!=e&&"text"===e.type,Se=e=>null!=e&&Ce(e.type),Ce=e=>"freedraw"===e,je=e=>null!=e&&Ie(e.type),Ie=e=>"arrow"===e||"line"===e,Me=e=>null!=e&&Te(e.type),Te=e=>"arrow"===e,Oe=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId),Le=e=>{var t;return Oe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},Ae=e=>null!==e&&Ee(e)&&null!==e.containerId,Pe=(e,t,n,r,i)=>[(e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r],De=(e,t,n)=>Pe(e[0],e[1],t[0],t[1],n),ze=(e,t,n,r,i,o,a,s)=>{const l=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*c,t+=a*(1-l),n+=a*-c):e.w&&(t+=i*(1-l),n+=i*-c,t+=a*(1+l),n+=a*c),e.n&&e.s?n+=o+s:e.n?(t+=o*c,n+=o*(1-l),t+=s*-c,n+=s*(1+l)):e.s&&(t+=o*-c,n+=o*(1+l),t+=s*c,n+=s*(1-l)),[t,n]},Ne=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},Re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){const[n,r]=[e[0],e[e.length-1]];return Ne(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},He=(e,t,n)=>{const r=e.length;if(r<3)return!1;const i=[Number.MAX_SAFE_INTEGER,n],o=[t,n];let a=0;for(let t=0;t<r;t++){const n=e[t],s=e[(t+1)%r];if(Ue(n,s,o,i)){if(0===Fe(n,o,s))return Be(n,o,s);a++}}return a%2==1},Be=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]),Fe=(e,t,n)=>{const r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},Ue=(e,t,n,r)=>{const i=Fe(e,t,n),o=Fe(e,t,r),a=Fe(n,r,e),s=Fe(n,r,t);return i!==o&&a!==s||(!(0!==i||!Be(e,n,t))||(!(0!==o||!Be(e,r,t))||(!(0!==a||!Be(n,e,r))||!(0!==s||!Be(n,t,r)))))},We=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Ve=e=>{const t=e.map((e=>e[0])),n=e.map((e=>e[1]));return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Ke=(e,t,n)=>{const r=n.map((t=>t[e])),i=Math.max(...r),o=Math.min(...r),a=i-o,s=0===a?1:t/a;let l=1/0;const c=n.map((t=>t.map(((t,n)=>{if(n!==e)return t;const r=t*s;return l=Math.min(r,l),r}))));if(2===c.length)return c;const d=o-l;return c.map((t=>t.map(((t,n)=>n===e?t+d:t))))},Ge=e=>Se(e)?Xe(e):je(e)?$e(e):[e.x,e.y,e.x+e.width,e.y+e.height],Ye=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Ze=(e,t)=>{let n=[0,0];const{minX:r,minY:i,maxX:o,maxY:a}=e.reduce(((e,r)=>{let{op:i,data:o}=r;if("move"===i)n=o;else if("bcurveTo"===i){const r=[o[0],o[1]],i=[o[2],o[3]],a=[o[4],o[5]],s=n;n=a;const l=(e,t)=>Math.pow(1-e,3)*a[t]+3*e*Math.pow(1-e,2)*i[t]+3*Math.pow(e,2)*(1-e)*r[t]+s[t]*Math.pow(e,3);let c=0;for(;c<=1;){let n=l(c,0),r=l(c,1);t&&([n,r]=t(n,r)),e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),c+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]},qe=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,a]of e)t=Math.min(t,o),n=Math.min(n,a),r=Math.max(r,o),i=Math.max(i,a);return[t,n,r,i]},Xe=e=>{const[t,n,r,i]=qe(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},$e=e=>{let t;if(e.points.length<2||!Tr(e)){const{minX:n,minY:r,maxX:i,maxY:o}=e.points.reduce(((e,t)=>{let[n,r]=t;return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});t=[n+e.x,r+e.y,i+e.x,o+e.y]}else{const n=Tr(e),r=Ye(n[0]),[i,o,a,s]=Ze(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},Je=e=>{let t;const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;if(Se(e)){const[t,n,r,i]=qe(e.points.map((t=>{let[n,r]=t;return Pe(n,r,a-e.x,s-e.y,e.angle)})));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(je(e))t=((e,t,n)=>{if(e.points.length<2||!Tr(e)){const{minX:r,minY:i,maxX:o,maxY:a}=e.points.reduce(((r,i)=>{let[o,a]=i;return[o,a]=Pe(e.x+o,e.y+a,t,n,e.angle),r.minY=Math.min(r.minY,a),r.minX=Math.min(r.minX,o),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,a),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]}const r=Tr(e),i=Ye(r[0]);return Ze(i,((r,i)=>Pe(e.x+r,e.y+i,t,n,e.angle)))})(e,a,s);else if("diamond"===e.type){const[l,c]=Pe(a,r,a,s,e.angle),[d,u]=Pe(a,o,a,s,e.angle),[h,p]=Pe(n,s,a,s,e.angle),[g,m]=Pe(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}else if("ellipse"===e.type){const l=(i-n)/2,c=(o-r)/2,d=Math.cos(e.angle),u=Math.sin(e.angle),h=Math.hypot(l*d,c*u),p=Math.hypot(c*d,l*u);t=[a-h,s-p,a+h,s+p]}else{const[l,c]=Pe(n,r,a,s,e.angle),[d,u]=Pe(n,o,a,s,e.angle),[h,p]=Pe(i,o,a,s,e.angle),[g,m]=Pe(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}return t},Qe=e=>{if(!e.length)return[0,0,0,0];let t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEach((e=>{const[o,a,s,l]=Je(e);t=Math.min(t,o),r=Math.min(r,a),n=Math.max(n,s),i=Math.max(i,l)})),[t,r,n,i]},et=(e,t,n)=>{if(!je(e)&&!Se(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ke(0,t,Ke(1,n,e.points));let i;if(Se(e))i=qe(r);else{const t=xe.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,Lr(e)):t.curve(r,Lr(e)),o=Ye(n);i=Ze(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},tt=(e,t,n)=>{const r=xe.generator(),i="sharp"===n?r.linearPath(t,Lr(e)):r.curve(t,Lr(e)),o=Ye(i),[a,s,l,c]=Ze(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},nt=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i}},rt=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),it=e=>[rt.red[e],rt.pink[e],rt.grape[e],rt.violet[e],rt.indigo[e],rt.blue[e],rt.cyan[e],rt.teal[e],rt.green[e],rt.lime[e],rt.yellow[e],rt.orange[e]],ot={canvasBackground:[rt.white,rt.gray[0],rt.gray[1],...it(0)],elementBackground:["transparent",rt.gray[4],rt.gray[6],...it(6)],elementStroke:[rt.black,rt.gray[8],rt.gray[7],...it(9)]};var at=n(5156);const st=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),lt=/^Win/.test(window.navigator.platform),ct="Equal",dt="Minus",ut="NumpadAdd",ht="NumpadSubtract",pt="Numpad0",gt="BracketRight",mt="BracketLeft",ft="Digit1",bt="Digit2",xt="Quote",vt="Digit0",yt="Slash",wt="KeyC",kt="KeyD",_t="KeyG",Et="KeyF",St="KeyH",Ct="KeyV",jt="KeyX",It="KeyZ",Mt="KeyR",Tt="ArrowDown",Ot="ArrowLeft",Lt="ArrowRight",At="ArrowUp",Pt="Backspace",Dt="Alt",zt=st?"metaKey":"ctrlKey",Nt="Delete",Rt="Enter",Ht="Escape",Bt="?",Ft=" ",Ut="Tab",Wt="a",Vt="d",Kt="e",Gt="g",Yt="l",Zt="o",qt="p",Xt="q",$t="r",Jt="s",Qt="t",en="v",tn="x",nn="y",rn="z",on=e=>e===Ot||e===Lt||e===Tt||e===At,an=e=>e.altKey,sn=e=>e.shiftKey,ln=e=>e.shiftKey;let cn=null;const dn=()=>{if(cn)return cn;const e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),i="".concat(e.getHours()).padStart(2,"0"),o="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(i).concat(o)},un=e=>e.charAt(0).toUpperCase()+e.slice(1),hn=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),pn=e=>{let{fontFamily:t}=e;for(const[e,n]of Object.entries(o.ut))if(n===t)return"".concat(e,", ").concat(o._D);return o._D},gn=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(pn({fontFamily:n}))},mn=(e,t)=>{let n=0,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r=o,clearTimeout(n),n=window.setTimeout((()=>{r=null,e(...o)}),t)};return i.flush=()=>{if(clearTimeout(n),r){const t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},fn=(e,t)=>Math.abs(e-t),bn=e=>{e&&(e.style.cursor="")},xn=(e,t)=>{e&&(e.style.cursor=t)},vn=(e,t)=>{e&&("selection"===t?bn(e):"image"!==t&&(e.style.cursor=o.oc.CROSSHAIR))},yn=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},wn=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),st?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),kn=(e,t)=>{let{clientX:n,clientY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;const c=1/i.value;return{x:(n-i.translation.x-o)*c-s,y:(r-i.translation.y-a)*c-l}},_n=(e,t)=>{let{sceneX:n,sceneY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;return{x:(n+s)*i.value+i.translation.x+o,y:(r+l)*i.value+i.translation.y+a}},En=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),Sn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),Cn=e=>Sn.test(e),jn=e=>{const[t,n]=e;return{x:t,y:n}},In=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},Mn=e=>{const t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===ot.elementBackground[0]},Tn=e=>t=>{(0,at.unstable_batchedUpdates)(e,t)},On=()=>Date.now(),Ln=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),An=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Pn=()=>({theme:o.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:o.rk,currentItemFontSize:o.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:rt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:o.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:An,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(b("labels.untitled"),"-").concat(dn()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:rt.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}),Dn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},zn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=Dn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},Nn=e=>zn(e,"export"),Rn=e=>zn(e,"server");function Hn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Bn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Fn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Un(e,t){return[e[0]*t,e[1]*t]}function Wn(e){return[e[1],-e[0]]}function Vn(e,t){return e[0]*t[0]+e[1]*t[1]}function Kn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Gn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Fn(e,t))}function Yn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Zn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function qn(e,t,n){let r=Math.sin(n),i=Math.cos(n),o=e[0]-t[0],a=e[1]-t[1],s=o*r+a*i;return[o*i-a*r+t[0],s+t[1]]}function Xn(e,t,n){return Bn(e,Un(Fn(t,e),n))}function $n(e,t,n){return Bn(e,Un(t,n))}var{min:Jn,PI:Qn}=Math,er=Qn+1e-4;function tr(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:o=!0,easing:a=(e=>e),start:s={},end:l={},last:c=!1}=t,{cap:d=!0,taper:u=0,easing:h=(e=>e*(2-e))}=s,{cap:p=!0,taper:g=0,easing:m=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let f,b=e[e.length-1].runningLength,x=Math.pow(n*r,2),v=[],y=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Jn(1,t.distance/n),o=Jn(1,1-i);r=Jn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=Hn(n,i,e[e.length-1].pressure,a),_=e[0].vector,E=e[0].point,S=E,C=E,j=S;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:l,distance:c,runningLength:d}=e[t];if(t<e.length-1&&b-d<3)continue;if(i){if(o){let e=Jn(1,c/n),t=Jn(1,1-e);r=Jn(1,w+.275*e*(t-w))}k=Hn(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,I=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,I)),t===e.length-1){let e=Un(Wn(l),k);v.push(Fn(s,e)),y.push(Bn(s,e));continue}let M=e[t+1].vector,T=Vn(l,M);if(T<0){let e=Un(Wn(_),k);for(let t=1/13,n=0;n<=1;n+=t)C=qn(Fn(s,e),s,er*n),v.push(C),j=qn(Bn(s,e),s,er*-n),y.push(j);E=C,S=j;continue}let O=Un(Wn(Xn(M,l,T)),k);C=Fn(s,O),(t<=1||Gn(E,C)>x)&&(v.push(C),E=C),j=Bn(s,O),(t<=1||Gn(S,j)>x)&&(y.push(j),S=j),w=r,_=l}let I=e[0].point.slice(0,2),M=e.length>1?e[e.length-1].point.slice(0,2):Bn(e[0].point,[1,1]),T=[],O=[];if(1===e.length){if(!u&&!g||c){let e=$n(I,Yn(Wn(Fn(I,M))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(qn(e,I,2*er*r));return t}}else{if(!(u||g&&1===e.length))if(d)for(let e=1/13,t=e;t<=1;t+=e){let e=qn(y[0],I,er*t);T.push(e)}else{let e=Fn(v[0],y[0]),t=Un(e,.5),n=Un(e,.51);T.push(Fn(I,t),Fn(I,n),Bn(I,n),Bn(I,t))}let t=Wn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(g||u&&1===e.length)O.push(M);else if(p){let e=$n(M,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(qn(e,M,3*er*n))}else O.push(Bn(M,Un(t,k)),Bn(M,Un(t,.99*k)),Fn(M,Un(t,.99*k)),Fn(M,Un(t,k)))}return v.concat(O,y.reverse(),T)}(function(e,t={}){var n;let{streamline:r=.5,size:i=16,last:o=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),s=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===s.length){let e=s[1];s=s.slice(0,-1);for(let t=1;t<5;t++)s.push(Xn(s[0],e,t/4))}1===s.length&&(s=[...s,[...Bn(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,d=0,u=l[0],h=s.length-1;for(let e=1;e<s.length;e++){let t=o&&e===h?s[e].slice(0,2):Xn(u.point,s[e],a);if(Kn(u.point,t))continue;let n=Zn(t,u.point);if(d+=n,e<h&&!c){if(d<i)continue;c=!0}u={point:t,pressure:s[e][2]>=0?s[e][2]:.5,vector:Yn(Fn(u.point,t)),distance:n,runningLength:d},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}(e,t),t)}const nr=e=>"string"==typeof e;class rr{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){nr(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return nr(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getElementsIncludingDeleted(){return this.elements}getElements(){return this.nonDeletedElements}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){const t=this.getElement(e);return t&&Ea(t)?t:null}getNonDeletedElements(e){const t=[];return e.forEach((e=>{const n=this.getNonDeletedElement(e);null!=n&&t.push(n)})),t}replaceAllElements(e){this.elements=e,this.elementsMap.clear(),e.forEach((e=>{this.elementsMap.set(e.id,e),rr.mapElementToScene(e,this)})),this.nonDeletedElements=_a(this.elements),this.informMutation()}informMutation(){for(const e of Array.from(this.callbacks))e()}addCallback(e){if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw new Error;this.callbacks.delete(e)}}destroy(){rr.sceneMapById.forEach(((e,t)=>{e===this&&rr.sceneMapById.delete(t)})),this.callbacks.clear()}}rr.sceneMapByElement=new WeakMap,rr.sceneMapById=new Map;const ir=rr,or=e=>{let t;e.containerId&&(t=e.width);const n=lr(e.originalText,gn(e),t);Yr(e,{width:n.width,height:n.height,baseline:n.baseline})},ar=(e,t,n)=>{const r=Ln(e);t.forEach((e=>{const t=n.get(e.id),i=br(e);if(i){var o;const a=n.get(i);Yr(r.get(t),{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})}),Yr(r.get(a),{containerId:t})}}))},sr=(e,t)=>{e.forEach((e=>{const n=br(e);if(n){const r=ir.getScene(e).getElement(n);if(r&&r.text){if(!e)return;let n=r.text,i=r.height,a=e.height,s=r.baseline;if("n"!==t&&"s"!==t){let t=0;if(n){t=fr(gn(r));Math.abs(e.width-r.width+2*o.tr)>=t&&(n=pr(r.originalText,gn(r),e.width))}const a=lr(n,gn(r),e.width);i=a.height,s=a.baseline}if(i>e.height-2*o.tr){a=i+2*o.tr;const n=a-e.height,r="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Yr(e,{height:a,y:r})}const l=e.y+a/2-i/2;Yr(r,{text:n,width:e.width-2*o.tr,height:i,x:e.x+o.tr,y:l,baseline:s})}}}))},lr=(e,t,n)=>{e=e.split("\n").map((e=>e||" ")).join("\n");const r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){const e=dr(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(e),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;const i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);const o=i.offsetTop+i.offsetHeight,a=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:a,height:s,baseline:o}},cr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),dr=e=>lr(cr,e,null).height;let ur;const hr=(e,t)=>{ur||(ur=document.createElement("canvas"));const n=ur.getContext("2d");n.font=t;return n.measureText(e).width},pr=(e,t,n)=>{const r=n-2*o.tr,i=[],a=e.split("\n"),s=hr(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])i.push(n[0]);else{let e="",o=0,a=0;for(;a<n.length;){if(hr(n[a],t)>r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=gr.calculate(s,t);o+=l,n[a]=n[a].slice(1),o>=r?(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e),e=s,o=l,o===r&&(e="",o=0)):e+=s}o+s>r?(i.push(e),e="",o=0):(e+=" ",o+=s),a++}else{for(;o<r&&a<n.length;){const s=n[a];if(o=hr(e+s,t),o>=r){i.push(e),o=0,e="";break}a++,e+="".concat(s," ")}o===r&&(e="",o=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e))}})),i.join("\n")},gr=(()=>{const e={},t=(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=hr(t,n);e[n][r]=i}return e[n][r]};return{calculate:t,updateCache:(n,r)=>{const i=n.charCodeAt(0);e[r][i]||(e[r][i]=t(n,r))},clearCacheforFont:t=>{e[t]=[]},getCache:t=>e[t]}})(),mr=e=>lr(cr.split("").join("\n"),e).width+2*o.tr,fr=e=>{const t=gr.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.min(...n)},br=e=>{var t,n;return null==e||null===(t=e.boundElements)||void 0===t||null===(n=t.filter((e=>"text"===e.type))[0])||void 0===n?void 0:n.id},xr="invert(100%) hue-rotate(180deg) saturate(1.25)",vr=Pn(),yr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),wr=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!yr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},kr=e=>[8,8+e],_r=e=>[1.5,6+e],Er=e=>"freedraw"===e.type?12*e.strokeWidth:20,Sr=document.createElement("img");Sr.src="data:".concat(o.LO.svg,",").concat(encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>'));const Cr=document.createElement("img");Cr.src="data:".concat(o.LO.svg,",").concat(encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>'));const jr=(e,t,n,r)=>{switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Tr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Tr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const t=function(e){return Hr.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(t),n.restore();break}case"image":{var i;const t=ke(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==t||t instanceof Promise?((e,t,n)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);const r=Math.min(e.width,e.height),i=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Cr:Sr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,r.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=Cn(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=gn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),o=e.containerId?dr(gn(e)):e.height/i.length,a=e.height-e.baseline,s="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<i.length;e++)n.fillText(i[e],s,(e+1)*o-a);n.restore(),r&&n.canvas.remove()}}n.globalAlpha=1},Ir=new WeakMap,Mr=new WeakMap,Tr=e=>Mr.get(e),Or=e=>Mr.delete(e),Lr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?kr(e.strokeWidth):"dotted"===e.strokeStyle?_r(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t};switch(e.type){case"rectangle":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return Re(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Ar=(e,t)=>{let n=Mr.get(e)||null;if(!n){switch(Ir.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){const r=e.width,i=e.height,o=.25*Math.min(r,i);n=t.path("M ".concat(o," 0 L ").concat(r-o," 0 Q ").concat(r," 0, ").concat(r," ").concat(o," L ").concat(r," ").concat(i-o," Q ").concat(r," ").concat(i,", ").concat(r-o," ").concat(i," L ").concat(o," ").concat(i," Q 0 ").concat(i,", 0 ").concat(i-o," L 0 ").concat(o," Q 0 0, ").concat(o," 0"),Lr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,Lr(e));break;case"diamond":{const[r,i,o,a,s,l,c,d]=(e=>{const t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]})(e);n="round"===e.strokeSharpness?t.path("M ".concat(r+.25*(o-r)," ").concat(i+.25*(a-i)," L ").concat(o-.25*(o-r)," ").concat(a-.25*(a-i)," \n C ").concat(o," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o-.25*(o-s)," ").concat(a+.25*(l-a)," \n L ").concat(s+.25*(o-s)," ").concat(l-.25*(l-a)," \n C ").concat(s," ").concat(l,", ").concat(s," ").concat(l,", ").concat(s-.25*(s-c)," ").concat(l-.25*(l-d)," \n L ").concat(c+.25*(s-c)," ").concat(d+.25*(l-d)," \n C ").concat(c," ").concat(d,", ").concat(c," ").concat(d,", ").concat(c+.25*(r-c)," ").concat(d-.25*(d-i)," \n L ").concat(r-.25*(r-c)," ").concat(i+.25*(d-i)," \n C ").concat(r," ").concat(i,", ").concat(r," ").concat(i,", ").concat(r+.25*(o-r)," ").concat(i+.25*(a-i)),Lr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],Lr(e));break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,Lr(e));break;case"line":case"arrow":{const r=Lr(e),i=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?r.fill?[t.polygon(i,r)]:[t.linearPath(i,r)]:[t.curve(i,r)],"arrow"===e.type){const{startArrowhead:i=null,endArrowhead:o="arrow"}=e,a=(e,n,i,o)=>{const a=((e,t,n,r)=>{const i=Ye(t[0]);if(i.length<1)return null;const o="start"===n?1:i.length-1,a=i[o].data,s=[a[4],a[5]],l=[a[2],a[3]],c=[a[0],a[1]],d=i[o-1];let u=[0,0];"move"===d.op?u=d.data:"bcurveTo"===d.op&&(u=[d.data[4],d.data[5]]);const h=(e,t)=>Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*c[t]+u[t]*Math.pow(e,3),[p,g]="start"===n?u:s,[m,f]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,g-f),x=(p-m)/b,v=(g-f)/b,y={arrow:30,bar:15,dot:15,triangle:15}[r];let w=0;if("arrow"===r){const[t,n]=e.points[e.points.length-1],[r,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];w=Math.hypot(t-r,n-i)}else for(let t=0;t<e.points.length;t++){const[n,r]=e.points[t-1]||[0,0],[i,o]=e.points[t];w+=Math.hypot(i-n,o-r)}const k=Math.min(y,w/2),_=p-x*k,E=g-v*k;if("dot"===r)return[p,g,Math.hypot(E-g,_-p)+e.strokeWidth];const S={arrow:20,bar:90,triangle:25}[r],[C,j]=Pe(_,E,p,g,-S*Math.PI/180),[I,M]=Pe(_,E,p,g,S*Math.PI/180);return[p,g,C,j,I,M]})(e,n,i,o);if(null===a)return[];if("dot"===o){const[n,i,o]=a;return[t.circle(n,i,o,Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){const[n,i,o,s,l,c]=a;return delete r.strokeLineDash,[t.polygon([[n,i],[o,s],[l,c],[n,i]],Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid"}))]}const[s,l,c,d,u,h]=a;if("dotted"===e.strokeStyle){const t=_r(e.strokeWidth-1);r.strokeLineDash=[t[0],t[1]-1]}else delete r.strokeLineDash;return[t.line(c,d,s,l,r),t.line(u,h,s,l,r)]};if(null!==i){const t=a(e,n,"start",i);n.push(...t)}if(null!==o){const t=a(e,n,"end",o);n.push(...t)}}break}case"freedraw":Br(e),n=[];break;case"text":case"image":n=[]}Mr.set(e,n)}},Pr=(e,t)=>{const n=t?t.zoom:vr.zoom,r=Ir.get(e),i=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||i||r.theme!==t.theme){const r=((e,t,n)=>{const r=document.createElement("canvas"),i=r.getContext("2d"),o=Er(e);let a=0,s=0;if(je(e)||Se(e)){const[n,l,c,d]=Ge(e);r.width=fn(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=fn(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?fn(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?fn(e.y,l)*window.devicePixelRatio*t.value:0,i.translate(a,s)}else r.width=e.width*window.devicePixelRatio*t.value+o*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+o*t.value*2;i.save(),i.translate(o*t.value,o*t.value),i.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);const l=xe.canvas(r);return wr(e,n)&&(i.filter=xr),jr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return Ir.set(e,r),r}return r},Dr=(e,t,n,r)=>{const i=e.element,o=Er(i);let[a,s,l,c]=Ge(i);Se(i)&&(a=Math.floor(a),l=Math.ceil(l),s=Math.floor(s),c=Math.ceil(c));const d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio,h=yr(i,r),p="scale"in e.element&&!h?e.element.scale[0]:1,g="scale"in e.element&&!h?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*p,1/window.devicePixelRatio*g),n.translate(d*p,u*g),n.rotate(i.angle*p*g),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},zr=(e,t,n,r)=>{const i=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Ar(e,i),r.isExporting){const t=Pr(e,r);Dr(t,0,n,r)}else{const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),jr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Ar(e,i),r.isExporting){const[i,o,a,s]=Ge(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),wr(e,r)&&(n.filter="none"),jr(e,t,n,r),n.restore()}else{const t=Pr(e,r);Dr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Nr=(e,t,n)=>{if(void 0===n)return e.draw(t);const r={sets:t.sets,shape:t.shape,options:Object.assign(Object.assign({},t.options),{fixedDecimalPlaceDigits:n})};return e.draw(r)},Rr=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ge(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,m=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{Ar(e,m);const r=Nr(t,Tr(e),o.zK),s=e.opacity/100;1!==s&&(r.setAttribute("stroke-opacity","".concat(s)),r.setAttribute("fill-opacity","".concat(s))),r.setAttribute("stroke-linecap","round"),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(r);break}case"line":case"arrow":{Ar(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),Tr(e).forEach((n=>{const l=Nr(t,n,o.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),"line"===e.type&&Re(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),n.appendChild(r);break}case"freedraw":{Br(e);const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=n.ownerDocument.createElementNS(o.hR,"path");r.setAttribute("stroke","none"),r.setAttribute("fill",e.strokeColor),s.setAttribute("d",Fr(e)),r.appendChild(s),n.appendChild(r);break}case"image":{const t=ke(e)&&r[e.fileId];if(t){const r="image-".concat(t.id);let l=n.querySelector("#".concat(r));if(!l){l=n.ownerDocument.createElementNS(o.hR,"symbol"),l.id=r;const e=n.ownerDocument.createElementNS(o.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),n.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",xr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),n.appendChild(c)}break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=e.text.replace(/\r\n?/g,"\n").split("\n"),l=e.height/s.length,c=e.height-e.baseline,d="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,u=Cn(e.text)?"rtl":"ltr",m="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const i=n.ownerDocument.createElementNS(o.hR,"text");i.textContent=s[t],i.setAttribute("x","".concat(d)),i.setAttribute("y","".concat((t+1)*l-c)),i.setAttribute("font-family",pn(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",m),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}n.appendChild(r)}}},Hr=new WeakMap([]);function Br(e){const t=Fr(e),n=new Path2D(t);return Hr.set(e,n),n}function Fr(e){const t=e.simulatePressure?e.points:e.points.length?e.points.map(((t,n)=>{let[r,i]=t;return[r,i,e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";const t=e.length-1;return e.reduce(((e,n,r,i)=>(r===t?e.push(n,Ur(n,i[0]),"L",i[0],"Z"):e.push(n,Ur(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Wr,"$1")}(tr(t,n))}function Ur(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Wr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Vr=new O(Date.now());const Kr=()=>Math.floor(Vr.next()*2**31),Gr=()=>we(),Yr=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!1;const{points:i,fileId:o}=t;void 0!==i&&(t=Object.assign(Object.assign({},Ve(i)),t));for(const n in t){const i=t[n];if(void 0!==i){if(e[n]===i&&("object"!=typeof i||null===i||"groupIds"===n||"scale"===n))continue;if("scale"===n){const t=e[n],r=i;if(t[0]===r[0]&&t[1]===r[1])continue}else if("points"===n){const t=e[n],r=i;if(t.length===r.length){let e=!1,n=t.length;for(;--n;){const i=t[n],o=r[n];if(i[0]!==o[0]||i[1]!==o[1]){e=!0;break}}if(!e)continue}}e[n]=i,r=!0}}if(!r)return e;var a;(void 0===t.height&&void 0===t.width&&void 0===o&&void 0===i||Or(e),e.version++,e.versionNonce=Kr(),e.updated=On(),n)&&(null===(a=ir.getScene(e))||void 0===a||a.informMutation());return e},Zr=(e,t)=>{let n=!1;for(const r in t){const i=t[r];if(void 0!==i){if(e[r]===i&&("object"!=typeof i||null===i))continue;n=!0}}return n?Object.assign(Object.assign(Object.assign({},e),t),{updated:On(),version:e.version+1,versionNonce:Kr()}):e},qr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Kr(),e.updated=On(),e),Xr=e=>je(e)||Se(e)?e.points.length<2:0===e.width&&0===e.height,$r=(e,t,n)=>{const r=Math.abs(t),i=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(i/r)/o.ay)*o.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(r*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Jr=e=>{const t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){const n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){const n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Qr=(e,t,n)=>{const r=n.filter((t=>t.groupIds.includes(e)));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!1}),editingGroupId:null}):t:Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!0}),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),Object.fromEntries(r.map((e=>[e.id,!0]))))})},ei=(e,t)=>null!=ti(e,t),ti=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),ni=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),ri=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Ta(t,e);if(!r.length)return Object.assign(Object.assign({},n),{editingGroupId:null});for(const i of r){let r=i.groupIds;if(e.editingGroupId){const t=r.indexOf(e.editingGroupId);t>-1&&(r=r.slice(0,t))}if(r.length>0){const e=r[r.length-1];n=Qr(e,n,t)}}return n},ii=(e,t)=>e.groupIds.includes(t),oi=(e,t)=>e.filter((e=>ii(e,t))),ai=(e,t,n)=>{const r=[...e],i=n?r.indexOf(n):-1,o=i>-1?i:r.length;return r.splice(o,0,t),r};var si=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const li=(e,t)=>{var n,r;let{x:i,y:o,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,width:p=0,height:g=0,angle:m=0,groupIds:f=[],strokeSharpness:b,boundElements:x=null}=t,v=si(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements"]);return{id:v.id||Gr(),type:e,x:i,y:o,width:p,height:g,angle:m,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:f,strokeSharpness:b,seed:null!==(n=v.seed)&&void 0!==n?n:Kr(),version:v.version||1,versionNonce:null!==(r=v.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:x,updated:On()}},ci=e=>li(e.type,e),di=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ui=e=>{const t=lr(e.text,gn(e)),n=di(e,t);return Zr(Object.assign(Object.assign({},li("text",e)),{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline,containerId:e.containerId||null,originalText:e.text}),{})},hi=(e,t,n)=>{let{text:r,isDeleted:i,originalText:a}=t;const s=n?((e,t)=>{const n=e.containerId?e.width:null,{width:r,height:i,baseline:a}=lr(t,gn(e),n),{textAlign:s,verticalAlign:l}=e;let c,d;if("center"!==s||"middle"!==l||e.containerId){const[t,n,o,a]=Ge(e),[l,u,h,p]=et(e,r,i),g=(t-l)/2,m=(n-u)/2,f=(o-h)/2,b=(a-p)/2;[c,d]=ze({s:!0,e:"center"===s||"left"===s,w:"center"===s||"right"===s},e.x,e.y,e.angle,g,m,f,b)}else{const t=lr(e.text,gn(e),n),o=di(e,{width:r-t.width,height:i-t.height});c=e.x-o.x,d=e.y-o.y}if(Ae(e)){const t=ir.getScene(e).getElement(e.containerId);let n=t.height,a=t.width;i>n-2*o.tr&&(n=i+2*o.tr),r>a-2*o.tr&&(a=r+2*o.tr),n===t.height&&a===t.width||Yr(t,{height:n,width:a})}return{width:r,height:i,x:Number.isFinite(c)?c:e.x,y:Number.isFinite(d)?d:e.y,baseline:a}})(e,r):void 0;return Zr(e,Object.assign({text:r,originalText:a,isDeleted:null!=i?i:e.isDeleted},s))},pi=e=>Object.assign(Object.assign({},li(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),gi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){const n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(const r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=gi(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=gi(e[n],t+1);return r}return e},mi=(e,t,n,r)=>{let i=gi(n);return i.id=Gr(),i.updated=On(),i.seed=Kr(),i.groupIds=((e,t,n)=>{const r=[...e],i=t?e.indexOf(t):-1,o=i>-1?i:e.length;for(let e=0;e<o;e++)r[e]=n(r[e]);return r})(i.groupIds,e,(e=>(t.has(e)||t.set(e,Gr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},fi={mouse:8,pen:16,touch:28},bi={e:!0,s:!0,n:!0,w:!0},xi={e:!0,s:!0,n:!0,w:!0},vi={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},yi={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},wi=(e,t,n,r,i,o,a)=>{const[s,l]=Pe(e+n/2,t+r/2,i,o,a);return[s-n/2,l-r/2,n,r]},ki=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=fi[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,m=s-o,f=(i+a)/2,b=(o+s)/2,x=4/n.value,v=(c-8)/(2*n.value),y={nw:l.nw?void 0:wi(i-x-h+v,o-x-p+v,d,u,f,b,t),ne:l.ne?void 0:wi(a+x-v,o-x-p+v,d,u,f,b,t),sw:l.sw?void 0:wi(i-x-h+v,s+x-v,d,u,f,b,t),se:l.se?void 0:wi(a+x-v,s+x-v,d,u,f,b,t),rotation:l.rotation?void 0:wi(i+g/2-d/2,o-x-p+v-16/n.value,d,u,f,b,t)},w=5*fi.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=wi(i+g/2-d/2,o-x-p+v,d,u,f,b,t)),l.s||(y.s=wi(i+g/2-d/2,s+x-v,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=wi(i-x-h+v,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=wi(a+x-v,o+m/2-u/2,d,u,f,b,t))),y},_i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){const[,t]=e.points;0===t[0]||0===t[1]?r=yi:t[0]>0&&t[1]<0?r=vi:t[0]>0&&t[1]>0?r=yi:t[0]<0&&t[1]>0?r=vi:t[0]<0&&t[1]<0&&(r=yi)}}else Ee(e)&&(r=xi);return ki(Ge(e),e.angle,t,n,r)},Ei=(e,t)=>[0,0,0,0,t,e,1,0],Si=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Ci=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],ji=(e,t)=>Di(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]],Ii=(e,t)=>Di(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[Mi(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]],Mi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],Ti=(e,t)=>[Oi(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]],Oi=(e,t)=>e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0],Li=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),Ai=e=>{const t=Li(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return Ii(e,n/t)},Pi=e=>{const t=(e=>Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1])))(e);return 0===t||1===t?e:Ii(e,1/t)},Di=e=>"number"==typeof e,zi=(Si(1,1),Si(1,2),Si(1,3),Si(1,4),Si(1,5),Si(1,6),Si(1,7),(e,t,n)=>Ai([0,n,e,t,0,0,0,0])),Ni=(e,t)=>Ai(Ti(t,e)),Ri=(e,t)=>((e,t)=>[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]])(e,t),Hi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Bi=e=>[e[5],e[4]],Fi=(e,t)=>Ai(((e,t)=>[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]])(e,t)),Ui=(e,t)=>Li(Ti(e,t)),Wi=(e,t)=>Oi(e,t),Vi=e=>[0,0,0,0,e[4],e[5],0,0],Ki=(e,t)=>((e,t)=>Di(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]])(Ii(e,Math.sin(t/2)),Math.cos(t/2)),Gi=(e,t)=>Ai(Ii(Ii(e,t),Ci(e))),Yi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Zi(e,t,[n,r])&&Xi(e,[n,r],i)},Zi=(e,t,n)=>{const r=10/t.zoom.value,i=Ee(e)?to:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!Mn(e.backgroundColor)||Mn(e.backgroundColor)&&Le(e);return"line"===e.type?t&&Re(e.points):t||_e(e)})(e)?no:ro;return Qi({element:e,point:n,threshold:r,check:i})},qi=(e,t)=>e.selectedElementIds[t.id],Xi=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);return u>o-n&&u<s+n&&h>a-n&&h<l+n},$i=(e,t)=>{let{x:n,y:r}=t;const i=Ji(e,e.width,e.height);return Qi({element:e,point:[n,r],threshold:i,check:io})},Ji=(e,t,n)=>{const r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Qi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=eo(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(oo(e.element,e.point),e.threshold)&&co(e.element,e.point,e.threshold);case"arrow":case"line":return uo(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},eo=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return oo(e,t);case"diamond":return ao(e,t);case"ellipse":return so(e,t)}},to=(e,t)=>e<0,no=(e,t)=>e<t,ro=(e,t)=>Math.abs(e)<t,io=(e,t)=>0<=e&&e<t,oo=(e,t)=>{const[,n,r,i]=ho(e,t);return Math.max(Wi(n,zi(0,1,-i)),Wi(n,zi(1,0,-r)))},ao=(e,t)=>{const[,n,r,i]=ho(e,t),o=zi(i,r,-i*r);return Wi(n,o)},so=(e,t)=>{const[n,r]=lo(e,t);return-(e=>Math.sign(e[1]))(r)*Wi(n,r)},lo=(e,t)=>{const[,n,r,i]=ho(e,t),[o,a]=Bi(n);let s=.707,l=.707;const c=r,d=i;[0,1,2,3].forEach((e=>{const t=(c*c-d*d)*s**3/c,n=(d*d-c*c)*l**3/d,r=c*s-t,i=d*l-n,u=o-t,h=a-n,p=Math.hypot(i,r),g=Math.hypot(h,u);s=Math.min(1,Math.max(0,(u*p/g+t)/c)),l=Math.min(1,Math.max(0,(h*p/g+n)/d));const m=Math.hypot(l,s);s/=m,l/=m}));const u=Ei(c*s,d*l);var h;return[n,Ri(Ni(n,h=u),h)]},co=(e,t,n)=>{let r,i;if(0===e.angle)r=t[0]-e.x,i=t[1]-e.y;else{const[n,o,a,s]=Ge(e),l=De(t,[n+(a-n)/2,o+(s-o)/2],-e.angle);r=l[0]-e.x,i=l[1]-e.y}let o,[a,s]=e.points;if(Ne(a[0],a[1],r,i)<n||Ne(s[0],s[1],r,i)<n)return!0;for(let t=0;t<e.points.length;t++){const l=[s[0]-a[0],s[1]-a[1]],c=Math.hypot(l[1],l[0]),d=[l[0]/c,l[1]/c],u=[r-a[0],i-a[1]],h=(u[0]*d[0]+u[1]*d[1])/Math.hypot(d[1],d[0]);o=[a[0]+d[0]*h,a[1]+d[1]*h];const p=Ne(o[0],o[1],a[0],a[1]),g=Ne(o[0],o[1],s[0],s[1]);if(o=g<p&&p>c?s:p<g&&g>c?a:o,Math.hypot(i-o[1],r-o[0])<n)return!0;a=s,s=e.points[t+1]}return!1},uo=e=>{const{element:t,threshold:n}=e;if(!Tr(t))return!1;const[r,i,o,a]=ho(e.element,e.point),s=zi(0,1,-a),l=zi(1,0,-o);if(!no(Wi(i,s),n)||!no(Wi(i,l),n))return!1;const[c,d]=Bi(r),u=Tr(t);if(e.check===no){if(u.some((e=>Eo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>So(e,c,d,n)))},ho=(e,t)=>{const n=Hi(t),r=Ge(e),i=go(r),o=Ki(i,e.angle),a=Gi(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(ji(a,Vi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=ji(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},po=e=>{const t=Ge(e),n=go(t),r=Ki(n,e.angle),i=Ci((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Vi(n)));return Ii(i,r)},go=e=>{let[t,n,r,i]=e;return Ei((t+r)/2,(n+i)/2)},mo=(e,t,n)=>{const r=po(e),i=Gi(r,Hi(t)),o=Gi(r,Hi(n)),a=Ni(i,o),s=e.height/e.width,l=e.width/2,c=e.height/2,d=a[2],u=a[3],h=a[1],p=Math.abs(u),g=Math.abs(d);switch(e.type){case"rectangle":case"image":case"text":return h/(l*(g+s*p));case"diamond":return p<g?h/(g*l):h/(p*c);case"ellipse":return h/(l*Math.sqrt(d**2+s**2*u**2))}},fo=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":const n=bo(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return xo(t,vo(o,i))})).concat(n.flatMap((e=>wo(e,i,t))));break;case"ellipse":r=yo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ui(e,n)-Ui(t,n)));return[o[0],o[o.length-1]]},bo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Ei(n,r),Ei(n,-r),Ei(-n,-r),Ei(-n,r)];case"diamond":return[Ei(0,r),Ei(n,0),Ei(0,-r),Ei(-n,0)]}},xo=(e,t)=>{const[n,r]=t;return Wi(n,e)*Wi(r,e)>=0?[]:[Fi(e,Ni(n,r))]},vo=(e,t)=>{const[n,r]=e,i=((e,t)=>{const n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]})(((e,t)=>Pi([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Gi(i,n),Gi(i,r)]},yo=(e,t,n)=>{const r=e.width/2+t,i=e.height/2+t,o=n[2],a=n[3],s=n[1],l=r*r*o*o+i*i*a*a,c=l-s*s;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=-r*r*o*s,h=-i*i*a*s;return[Ei((u+r*i*a*d)/l,(h-r*i*o*d)/l),Ei((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},wo=(e,t,n)=>{if(0===t)return 0===Wi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Bi(e),l=r*r+i*i,c=t*t*l-(r*a+i*s+o)**2;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=a*i*i-s*r*i-r*o,h=s*r*r-a*r*i-i*o;return[Ei((u+i*d)/l,(h-r*d)/l),Ei((u-i*d)/l,(h+r*d)/l)]},ko=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Bi(n),c=0===l?1e-4:l,d=s**2*o**2+c**2*i**2,u=(-s*o**2+a*c*Math.sqrt(Math.max(0,d-i**2*o**2)))/d,h=(-u*s-1)/c,p=-(i**2)*u/(h**2*o**2+u**2*i**2);return Ei(p,(-u*p-1)/h)},_o=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=bo(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ni(n,e)[1];t>a&&(a=t,s=e)})),s},Eo=(e,t,n,r)=>{const i=Ye(e),o=[];let a=!1;for(const e of i)"move"===e.op?(a=!a,a&&o.push([e.data[0],e.data[1]])):"bcurveTo"===e.op&&a&&(o.push([e.data[0],e.data[1]]),o.push([e.data[2],e.data[3]]),o.push([e.data[4],e.data[5]]));if(o.length>=4){if("sharp"===r)return He(o,t,n);const e=he(o,10,5);return He(e,t,n)}return!1},So=(e,t,n,r)=>{const i=Ye(e);let o=[0,0];return i.some(((e,i)=>{let{op:a,data:s}=e;if("move"===a)o=s;else if("bcurveTo"===a){const e=[s[0],s[1]],i=[s[2],s[3]],a=[s[4],s[5]],l=o;o=a;const c=((e,t,n,r,i,o)=>{let[a,s]=i;const l=(i,o)=>Math.pow(1-i,3)*r[o]+3*i*Math.pow(1-i,2)*n[o]+3*Math.pow(i,2)*(1-i)*t[o]+e[o]*Math.pow(i,3);let c=0;for(;c<=1;){const e=l(c,0),t=l(c,1);if(Math.sqrt(Math.pow(e-a,2)+Math.pow(t-s,2))<o)return!0;c+=.01}return!1})(l,e,i,a,[t,n],r);return c}return!1}))};var Co=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const jo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],Io=(e,t,n,r,i,o)=>e.reduce(((e,a)=>{if(e)return e;const s=((e,t,n,r,i,o)=>{if(!t.selectedElementIds[e.id])return!1;const a=_i(e,i,o),{rotation:s}=a,l=Co(a,["rotation"]);if(s&&jo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&jo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),Mo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=ki([o,a,s,l],0,r,i,bi);return Object.keys(c).find((e=>{const r=c[e];return r&&jo(r,t,n)}))||!1},To=["ns","nesw","ew","nwse"],Oo=e=>{const{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1;let i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":i=r?"nesw":"nwse";break;case"ne":case"sw":i=r?"nwse":"nesw";break;case"rotation":return"grab"}return i&&t&&(i=((e,t)=>{const n=To.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=To[(n+r)%To.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Lo{constructor(e,t){this.elementId=e.id,ir.mapElementToScene(this.elementId,t),Lo.normalizePoints(e),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}static getElement(e){var t;const n=null===(t=ir.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}static handleBoxSelection(e,t,n){var r;if(!t.editingLinearElement||"selection"!==(null===(r=t.draggingElement)||void 0===r?void 0:r.type))return!1;const{editingLinearElement:i}=t,{selectedPointsIndices:o,elementId:a}=i,s=Lo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ge(t.draggingElement),h=Lo.getPointsGlobalCoordinates(s).reduce(((t,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=c&&n[1]<=u||e.shiftKey&&null!=o&&o.includes(r))&&t.push(r),t)),[]);n({editingLinearElement:Object.assign(Object.assign({},i),{selectedPointsIndices:h.length?h:null})})}static handlePointDragging(e,t,n,r,i){if(!e.editingLinearElement)return!1;const{editingLinearElement:o}=e,{selectedPointsIndices:a,elementId:s,isDragging:l}=o,c=Lo.getElement(s);if(!c)return!1;const d=c.points[o.pointerDownState.lastClickedPoint];if(a&&d){!1===l&&t({editingLinearElement:Object.assign(Object.assign({},o),{isDragging:!0})});const s=Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(Lo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?Lo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize):[c.points[t][0]+u,c.points[t][1]+h],isDragging:t===o.pointerDownState.lastClickedPoint})))),Me(c)){const e=[];0===a[0]&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(jn(Lo.getPointGlobalCoordinates(c,c.points[t]))),e.length&&i(c,e)}return!0}return!1}static handlePointerUp(e,t,n){var r;const{elementId:i,selectedPointsIndices:o,isDragging:a,pointerDownState:s}=t,l=Lo.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){Re(l.points,n.zoom.value)&&Lo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Po(n)?Ko(jn(Lo.getPointAtIndexGlobalCoordinates(l,e)),ir.getScene(l)):null;c[0===e?"startBindingElement":"endBindingElement"]=t}return Object.assign(Object.assign(Object.assign({},t),c),{selectedPointsIndices:a||e.shiftKey?!a&&e.shiftKey&&null!==(r=s.prevSelectedPointsIndices)&&void 0!==r&&r.includes(s.lastClickedPoint)?o&&o.filter((e=>e!==s.lastClickedPoint)):o:null!=o&&o.includes(s.lastClickedPoint)?[s.lastClickedPoint]:o,isDragging:!1,pointerOffset:{x:0,y:0}})}static handlePointerDown(e,t,n,r,i){var o;const a={didAddPoint:!1,hitElement:null};if(!t.editingLinearElement)return a;const{elementId:s}=t.editingLinearElement,l=Lo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Yr(l,{points:[...l.points,Lo.createPointAt(l,i.x,i.y,t.gridSize)]}),r.resumeRecording(),n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[l.points.length-1],lastUncommittedPoint:null,endBindingElement:Ko(i,ir.getScene(l))})}),a.didAddPoint=!0,a;const c=Lo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Po(t)&&Me(l)&&Do(l,e,n)}const[d,u,h,p]=Ge(l),g=(d+h)/2,m=(u+p)/2,f=c>-1&&Pe(l.x+l.points[c][0],l.y+l.points[c][1],g,m,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?Ao([...t.editingLinearElement.selectedPointsIndices||[],c]):[c]:null;return n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:c},selectedPointsIndices:b,pointerOffset:f?{x:i.x-f[0],y:i.y-f[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=Lo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&Lo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=Lo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?Lo.movePoints(s,[{index:s.points.length-1,point:d}]):Lo.addPoints(s,[{point:d}]),Object.assign(Object.assign({},r),{lastUncommittedPoint:s.points[s.points.length-1]})}static getPointGlobalCoordinates(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2;let{x:l,y:c}=e;return[l,c]=Pe(l+t[0],c+t[1],a,s,e.angle),[l,c]}static getPointsGlobalCoordinates(e){const[t,n,r,i]=Ge(e),o=(t+r)/2,a=(n+i)/2;return e.points.map((t=>{let{x:n,y:r}=e;return[n,r]=Pe(n+t[0],r+t[1],o,a,e.angle),[n,r]}))}static getPointAtIndexGlobalCoordinates(e,t){const n=t<0?e.points.length+t:t,[r,i,o,a]=Ge(e),s=(r+o)/2,l=(i+a)/2,c=e.points[n],{x:d,y:u}=e;return Pe(d+c[0],u+c[1],s,l,e.angle)}static pointFromAbsoluteCoords(e,t){const[n,r,i,o]=Ge(e),a=(n+i)/2,s=(r+o)/2,[l,c]=Pe(t[0],t[1],a,s,-e.angle);return[l-e.x,c-e.y]}static getPointIndexUnderCursor(e,t,n,r){const i=this.getPointsGlobalCoordinates(e);let o=i.length;for(;--o>-1;){const e=i[o];if(Ne(n,r,e[0],e[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return o}return-1}static createPointAt(e,t,n,r){const i=We(t,n,r),[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(i[0],i[1],c,d,-e.angle);return[u-e.x,h-e.y]}static getNormalizedPoints(e){const{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(((e,t)=>[e[0]-n,e[1]-r])),x:e.x+n,y:e.y+r}}static normalizePoints(e){Yr(e,Lo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=Lo.getElement(n);if(!r||null===t)return!1;const{points:i}=r,o=[];let a=!1,s=-1;const l=i.reduce(((e,n,r)=>{++s,e.push(n);if(t.includes(r)){const t=i[r+1];t||(a=!0),e.push(t?[(n[0]+t[0])/2,(n[1]+t[1])/2]:[n[0],n[1]]),o.push(s+1),++s}return e}),[]);if(Yr(r,{points:l}),a){const e=r.points[r.points.length-1];Lo.movePoints(r,[{index:r.points.length-1,point:[e[0]+30,e[1]+30]}])}return{appState:Object.assign(Object.assign({},e),{editingLinearElement:Object.assign(Object.assign({},e.editingLinearElement),{selectedPointsIndices:o})})}}static deletePoints(e,t){let n=0,r=0;if(t.includes(0)){const i=e.points.find(((e,n)=>!t.includes(n)));i&&(n=i[0],r=i[1])}const i=e.points.reduce(((e,i,o)=>(t.includes(o)||e.push(e.length?[i[0]-n,i[1]-r]:[0,0]),e)),[]);Lo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];Lo._updatePoints(e,n,0,0)}static movePoints(e,t,n){const{points:r}=e;let i=0,o=0;const a=t.find((e=>{let{index:t}=e;return 0===t}));a&&(i=a.point[0]-r[a.index][0],o=a.point[1]-r[a.index][1]);const s=r.map(((e,n)=>{const s=t.find((e=>e.index===n));if(s){if(a)return e;const t=s.point[0]-r[s.index][0],n=s.point[1]-r[s.index][1];return[e[0]+t,e[1]+n]}return i||o?[e[0]-i,e[1]-o]:e}));Lo._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=tt(e,t,e.strokeSharpness||"round"),a=tt(e,e.points,e.strokeSharpness||"round"),s=(o[0]+o[2])/2,l=(o[1]+o[3])/2,c=(a[0]+a[2])/2,d=(a[1]+a[3])/2,u=Pe(n,r,c-s,d-l,e.angle);Yr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Lo.POINT_HANDLE_SIZE=20;const Ao=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Po=e=>e.isBindingEnabled,Do=(e,t,n)=>{const r=new Set,i=new Set;zo(e,t,n,"start",r,i),zo(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));ir.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Yr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},zo=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Fo(e,t,r):"start"!==r&&n.id===t.id)||(Bo(e,t,r),i.add(t.id));else{const t=Vo(e,r);null!=t&&o.add(t)}},No=e=>{e.forEach((e=>{Me(e)?Do(e,Qo(e,"start"),Qo(e,"end")):Oe(e)&&Ro(e)}))},Ro=e=>{ta(e).forEach((t=>{let[n,r]=t;return Do(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Ho=(e,t,n,r)=>{null!=t.startBoundElement&&Bo(e,t.startBoundElement,"start");const i=Ko(r,n);null==i||Fo(e,i,"end")||Bo(e,i,"end")},Bo=(e,t,n)=>{Yr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Go(e,t,n))});Ln(t.boundElements||[]).has(e.id)||Yr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Fo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Uo(e,null==r?void 0:r.elementId,t)},Uo=(e,t,n)=>t===n.id&&e.points.length<3,Wo=e=>{e.forEach((e=>{Me(e)&&Do(e,null,null)}))},Vo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Yr(e,{[n]:null}),r.elementId)},Ko=(e,t)=>Fa(t.getElements(),(t=>Oe(t)&&$i(t,e))),Go=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=Lo.getPointAtIndexGlobalCoordinates(e,i),s=Lo.getPointAtIndexGlobalCoordinates(e,o);return{focus:mo(t,s,a),gap:Math.max(1,eo(t,a))}},Yo=(e,t)=>{var n;const r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((e=>"arrow"===e.type));if(0===r.length)return;const{newSize:i,simultaneouslyUpdated:o}=null!=t?t:{},a=qo(o);ir.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Zo(t,n))return;const r=$o(n,t.startBinding,i),o=$o(n,t.endBinding,i);a.has(t.id)?Yr(t,{startBinding:r,endBinding:o}):(Xo(t,"start",r,e),Xo(t,"end",o,e))}))},Zo=(e,t)=>{var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},qo=e=>new Set((e||[]).map((e=>e.id))),Xo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=ir.getScene(e).getElement(n.elementId);if(null==i)return;const o="start"===t?-1:1,a=-1===o?0:e.points.length-1,s=a-o,l=Lo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ge(e),n=go(t);return Bi(n)}const r=po(e),i=Gi(r,Hi(n)),o=Ci(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=_o(e,t,i);break;case"ellipse":a=ko(e,t,i)}return Bi(Gi(o,a))})(i,n.focus,l);let d;if(0===n.gap)d=c;else{const e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=po(e),o=Gi(i,Hi(t)),a=Gi(i,Hi(n)),s=Ni(o,a),l=Ci(i);return fo(e,s,o,r).map((e=>Bi(Gi(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}Lo.movePoints(e,[{index:a,point:Lo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},$o=(e,t,n)=>{if(null==t||null==n)return t;const{gap:r,focus:i,elementId:o}=t,{width:a,height:s}=n,{width:l,height:c}=e;return{elementId:o,gap:Math.max(1,Math.min(Ji(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Jo=e=>[Qo(e,"start"),Qo(e,"end")].filter((e=>null!=e)),Qo=(e,t)=>Ko(ea(e,t),ir.getScene(e)),ea=(e,t)=>{const n="start"===t?0:-1;return jn(Lo.getPointAtIndexGlobalCoordinates(e,n))},ta=e=>ir.getScene(e).getElements().map((t=>{if(!Me(t))return null;const n=na(t,"start",e),r=na(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),na=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Fo(e,n,t)&&$i(n,ea(e,t)),ra=(e,t,n,r)=>{const i=new Set,o=new Set,a="duplicatesServeAsOld"===r;t.forEach((e=>{const{boundElements:t}=e;if(null!=t&&t.length>0&&(t.forEach((e=>{a&&!n.has(e.id)&&i.add(e.id)})),o.add(n.get(e.id))),Me(e)){if(null!=e.startBinding){const{elementId:t}=e.startBinding;a&&!n.has(t)&&o.add(t)}if(null!=e.endBinding){const{elementId:t}=e.endBinding;a&&!n.has(t)&&o.add(t)}null==e.startBinding&&null==e.endBinding||i.add(n.get(e.id))}})),e.filter((e=>{let{id:t}=e;return i.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:ia(t,n),endBinding:ia(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Yr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},ia=(e,t)=>{var n;if(null==e)return null;const{elementId:r,focus:i,gap:o}=e;return{focus:i,gap:o,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},oa=(e,t)=>{const n=new Set(t.map((e=>e.id))),r=new Set;t.forEach((e=>{var t;Oe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Yr(e,{startBinding:aa(t,n),endBinding:aa(r,n)})}))},aa=(e,t)=>null==e||t.has(e.elementId)?null:e,sa=e=>e>=2*Math.PI?e-2*Math.PI:e,la=(e,t,n,r)=>{const[i,a,s,l]=Ge(e),c=(i+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);r&&(u+=o.ay/2,u-=u%o.ay),u=sa(u),Yr(e,{angle:u});const h=br(e);if(h){const t=ir.getScene(e).getElement(h);Yr(t,{angle:u})}},ca=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let[p,g]="end"===t?[u-e.x,h-e.y]:[e.x+e.points[1][0]-u,e.y+e.points[1][1]-h];n&&([p,g]=((e,t,n,r)=>{const i=$r(e,...Pe(t,n,0,0,r));return Pe(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[m,f]=ze("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-p)/2,(e.points[1][1]-g)/2);Yr(e,{x:m,y:f,points:[[0,0],[p,g]]})},da=(e,t,n)=>je(e)||Se(e)?{points:Ke(0,t,Ke(1,n,e.points))}:{},ua=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=lr(e.text,gn({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},ha=(e,t,n,r,i)=>{const[o,a,s,l]=Ge(e),c=(o+s)/2,d=(a+l)/2,[u,h]=Pe(r,i,c,d,-e.angle);let p;switch(t){case"se":p=Math.max((u-o)/(s-o),(h-a)/(l-a));break;case"nw":p=Math.max((s-u)/(s-o),(l-h)/(l-a));break;case"ne":p=Math.max((u-o)/(s-o),(l-h)/(l-a));break;case"sw":p=Math.max((s-u)/(s-o),(h-a)/(l-a))}if(p>0){const r=e.width*p,i=e.height*p,c=ua(e,r,i);if(null===c)return;const[d,u,h,g]=et(e,r,i),m=(o-d)/2,f=(a-u)/2,b=(s-h)/2,x=(l-g)/2,[v,y]=ze(((e,t)=>({n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}))(t,n),e.x,e.y,e.angle,m,f,b,x);Yr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x:v,y})}},pa=(e,t,n,r,i,o,a)=>{const[s,l,c,d]=et(e,e.width,e.height),u=[s,l],h=[c,d],p=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(u,h),g=De([o,a],p,-e.angle),[m,f,b,x]=et(n,n.width,n.height),v=br(n),y=b-m,w=x-f;let k=(h[0]-u[0])/y,_=(h[1]-u[1])/w;r.includes("e")&&(k=(g[0]-u[0])/y),r.includes("s")&&(_=(g[1]-u[1])/w),r.includes("w")&&(k=(h[0]-g[0])/y),r.includes("n")&&(_=(h[1]-g[1])/w);const E=e.width,S=e.height;let C=n.width*k,j=n.height*_;if(i&&(C=2*C-E,j=2*j-S),t){const e=Math.abs(C)/E,t=Math.abs(j)/S;if(1===r.length&&(j*=e,C*=t),2===r.length){const n=Math.max(e,t);C=E*n*Math.sign(C),j=S*n*Math.sign(j)}}const[I,M,T,O]=et(e,C,j),L=T-I,A=O-M;if((L<0||A<0)&&v)return;let P=[...u];if(["n","w","nw"].includes(r)&&(P=[h[0]-Math.abs(L),h[1]-Math.abs(A)]),"ne"===r){const e=[u[0],h[1]];P=[e[0],e[1]-Math.abs(A)]}if("sw"===r){const e=[h[0],u[1]];P=[e[0]-Math.abs(L),e[1]]}t&&(["s","n"].includes(r)&&(P[0]=p[0]-L/2),["e","w"].includes(r)&&(P[1]=p[1]-A/2)),C<0&&(r.includes("e")&&(P[0]-=Math.abs(L)),r.includes("w")&&(P[0]+=Math.abs(L))),j<0&&(r.includes("s")&&(P[1]-=Math.abs(A)),r.includes("n")&&(P[1]+=Math.abs(A))),i&&(P[0]=p[0]-Math.abs(L)/2,P[1]=p[1]-Math.abs(A)/2);const D=e.angle,z=De(P,p,D),N=[P[0]+Math.abs(L)/2,P[1]+Math.abs(A)/2],R=De(N,p,D);P=De(z,R,-D);const H=da(e,C,j),B=[...P];B[0]+=e.x-I,B[1]+=e.y-M;const F=Object.assign({width:Math.abs(C),height:Math.abs(j),x:B[0],y:B[1]},H);"scale"in n&&"scale"in e&&Yr(n,{scale:[(Math.sign(k)||e.scale[0])*e.scale[0],(Math.sign(_)||e.scale[1])*e.scale[1]]});let U=0;if(v){const e=ir.getScene(n).getElement(v);U=mr(gn(e))}F.width>U&&0!==F.height&&Number.isFinite(F.x)&&Number.isFinite(F.y)&&(Yo(n,{newSize:{width:F.width,height:F.height}}),Yr(n,F),sr([n],r))},ga=(e,t,n,r)=>{const[i,o,a,s]=Qe(e);let l,c;switch(t){case"se":l=Math.max((n-i)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[r,a]=t,[s,c]=n;return{x:e.x+(r-i)*(l-1)+r-s,y:e.y+(a-o)*(l-1)+a-c}};break;case"nw":l=Math.max((a-n)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[,,r,i]=t,[,,o,c]=n;return{x:e.x-(a-r)*(l-1)+r-o,y:e.y-(s-i)*(l-1)+i-c}};break;case"ne":l=Math.max((n-i)/(a-i),(s-r)/(s-o)),c=(e,t,n)=>{let[r,,,o]=t,[a,,,c]=n;return{x:e.x+(r-i)*(l-1)+r-a,y:e.y-(s-o)*(l-1)+o-c}};break;case"sw":l=Math.max((a-n)/(a-i),(r-o)/(s-o)),c=(e,t,n)=>{let[,r,i]=t,[,s,c]=n;return{x:e.x-(a-i)*(l-1)+i-c,y:e.y+(r-o)*(l-1)+r-s}}}if(l>0){const t=e.reduce(((t,n)=>{if(!t)return t;const r=n.width*l,i=n.height*l;let o={};if(Ee(n)){const e=ua(n,r,i);if(null===e)return null;o={fontSize:e.size,baseline:e.baseline}}const a=Ge(n),s=da(n,r,i);Yo(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const d=et(Object.assign(Object.assign({},n),s),r,i),{x:u,y:h}=c(n,a,d);return[...t,Object.assign(Object.assign({width:r,height:i,x:u,y:h},s),o)]}),[]);t&&e.forEach(((e,n)=>{Yr(e,t[n])}))}},ma=(e,t,n,r,i,a,s)=>{let l=5*Math.PI/2+Math.atan2(r-s,n-a);i&&(l+=o.ay/2,l-=l%o.ay),t.forEach(((t,n)=>{var r,i;const[o,c,d,u]=Ge(t),h=(o+d)/2,p=(c+u)/2,g=null!==(r=null===(i=e.originalElements.get(t.id))||void 0===i?void 0:i.angle)&&void 0!==r?r:t.angle,[m,f]=Pe(h,p,a,s,l+g-t.angle);Yr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:sa(l+g)});const b=br(t);if(b){const e=ir.getScene(t).getElement(b);Yr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:sa(l+g)})}}))},fa=(e,t,n,r,i,o)=>{let a,s;if(e){const l=e&&t<n,c=e&&t>n,d=r.originalElements.get(i.id);a=l&&d?d.x:i.x+o.x,s=c&&d?d.y:i.y+o.y}else a=i.x+o.x,s=i.y+o.y;Yr(i,{x:a,y:s})},ba=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=$r(t,a,o<r?-s:s)),s<0&&(s=-s)));let u=i<n?n-a:n,h=o<r?r-s:r;c&&(u=n-(a+=a)/2,h=r-(s+=s)/2),0!==a&&0!==s&&Yr(e,{x:u,y:h,width:a,height:s})},xa=e=>e.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"),va=(e,t,n,r,i,o)=>{const{zoom:a,offsetTop:s,offsetLeft:l}=r,c=180*n/Math.PI;let d=(e-2*l)*(a.value-1)/2,u=(t-2*s)*(a.value-1)/2;return e>i&&1!==a.value&&(d=(i-2*l)*(a.value-1)/2),t>o&&1!==a.value&&(u=(o-2*s)*(a.value-1)/2),"translate(".concat(d,"px, ").concat(u,"px) scale(").concat(a.value,") rotate(").concat(c,"deg)")},ya=e=>{let{id:t,appState:n,onChange:r,onSubmit:i,getViewportCoords:a,element:s,canvas:l,excalidrawContainer:c}=e;let d,u=Ee(s)?dr(gn(s)):0;const h=()=>{var e;const r=null===(e=ir.getScene(s))||void 0===e?void 0:e.getElement(t);if(r&&Ee(r)){let e=r.x,t=r.y,s=null!=r&&r.containerId?ir.getScene(r).getElement(r.containerId):null,l=r.width,h=r.height,g=r.width;const m=0===p.scrollHeight?r.height:p.scrollHeight;if(s&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replaceAll('"',"");return pn({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,p);if(n){var i;const e=null===(i=ir.getScene(r))||void 0===i?void 0:i.getElement(r.containerId);if(u=Ee(r)?dr(gn(r)):0,r.height>e.height-2*o.tr){const e=r.height+2*o.tr;d=e,Yr(s,{height:e}),s=Object.assign(Object.assign({},s),{height:e})}p.style.height="".concat(r.height,"px")}if(d||(d=s.height),l=s.width-2*o.tr,h=s.height-2*o.tr,g=l,e=s.x+o.tr,p.scrollHeight>h){const e=Math.min(p.scrollHeight-h,u);return void Yr(s,{height:s.height+e})}if(s.height>d&&p.scrollHeight<h){const e=Math.min(h-p.scrollHeight,u);Yr(s,{height:s.height-e})}else{(p.scrollHeight/u>1||n)&&(t=s.y+s.height/2-p.scrollHeight/2)}}const[f,b]=a(e,t),{textAlign:x,angle:v}=r;p.value=r.originalText||r.text;const y=r.originalText.split("\n"),w=r.containerId?u:r.height/y.length;s||(l=(n.width+n.offsetLeft-f-8)/n.zoom.value-Number(getComputedStyle(null==c?void 0:c.parentNode).marginRight.slice(0,-2)));const k=(n.height+n.offsetTop-b)/n.zoom.value;console.log({maxWidth:l,editorMaxHeight:k,width:g,height:m,viewportX:f,viewportY:b,appStateWidth:n.width,appStateHeight:n.height,scrollX:n.scrollX,scrollY:n.scrollY,transform:va(g,m,v,n,l,k)}),Object.assign(p.style,{font:gn(r),lineHeight:"".concat(w,"px"),width:"".concat(g,"px"),height:"".concat(m,"px"),left:"".concat(f,"px"),top:"".concat(b,"px"),transform:va(g,m,v,n,l,k),textAlign:x,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(l,"px"),maxHeight:"".concat(k,"px")})}},p=document.createElement("textarea");p.dir="auto",p.tabIndex=0,p.dataset.type="wysiwyg",p.wrap="off",p.classList.add("excalidraw-wysiwyg");let g="pre",m="normal";Ae(s)&&(g="pre-wrap",m="break-word"),Object.assign(p.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:m,whiteSpace:g,overflowWrap:"break-word"}),h(),r&&(p.oninput=()=>{const e=p.scrollHeight/u;Ae(s)&&e>1&&(p.style.height="auto",p.style.height="".concat(p.scrollHeight,"px")),r(xa(p.value))}),p.onkeydown=e=>{if(e.stopPropagation(),e.key===Ht)e.preventDefault(),k=!0,_();else if(e.key===Rt&&e[zt]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;k=!0,_()}else(e.key===Ut||e[zt]&&(e.code===mt||e.code===gt))&&(e.preventDefault(),e.shiftKey||e.code===mt?v():x(),p.dispatchEvent(new Event("input")))};const f=" ".repeat(4),b=new RegExp("^ {1,".concat(4,"}")),x=()=>{const{selectionStart:e,selectionEnd:t}=p,n=y();let r=p.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(f).concat(n)})),p.value=r,p.selectionStart=e+4,p.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=p,n=y(),r=[];let i=p.value;n.forEach((e=>{const t=i.slice(e,e+4).match(b);if(t){const n=i.slice(0,e),o=i.slice(e+t[0].length);i="".concat(n).concat(o),r.push(e)}})),p.value=i,r.length&&(e>r[r.length-1]?p.selectionStart=Math.max(e-4,r[r.length-1]):p.selectionStart=e,p.selectionEnd=Math.max(p.selectionStart,t-4*r.length))},y=()=>{let{selectionStart:e,selectionEnd:t,value:n}=p;const r=n.slice(0,e).match(/[^\n]*$/)[0].length;e-=r;return n.slice(e,t).split("\n").reduce(((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e)),[]).reverse()},w=e=>{e.preventDefault(),e.stopPropagation()};let k=!1;const _=()=>{var e;E();const t=null===(e=ir.getScene(s))||void 0===e?void 0:e.getElement(s.id);if(!t)return;let n="";if(Ee(t)&&null!=t&&t.containerId){const e=ir.getScene(t).getElement(t.containerId);if(e&&(n=pr(p.value,gn(t),e.width),Ee(t)&&t.containerId)){const n=Number(p.style.height.slice(0,-2));if(p.value){Yr(t,{y:e.y+e.height/2-n/2,height:n,width:Number(p.style.width.slice(0,-2)),x:e.x+o.tr});const r=br(e);r&&r===s.id||Yr(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:s.id})})}else{var r;Yr(e,{boundElements:null===(r=e.boundElements)||void 0===r?void 0:r.filter((e=>"text"!==e.type))})}}}else n=p.value;i({text:xa(n),viaKeyboard:k,originalText:p.value})},E=()=>{I||(I=!0,p.onblur=null,p.oninput=null,p.onkeydown=null,M&&M.disconnect(),window.removeEventListener("resize",h),window.removeEventListener("wheel",w,!0),window.removeEventListener("pointerdown",C),window.removeEventListener("pointerup",S),window.removeEventListener("blur",_),j(),p.remove())},S=e=>{window.removeEventListener("pointerup",S);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&hn(t);setTimeout((()=>{p.onblur=_,t&&n&&(t.onblur=()=>{p.focus()}),n||p.focus()}))},C=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&hn(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!hn(e.target)||t)&&(p.onblur=null,window.addEventListener("pointerup",S),window.addEventListener("blur",_))},j=ir.getScene(s).addCallback((()=>{var e;h();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||p.focus()}));let I=!1;p.select(),S();let M=null;l&&"ResizeObserver"in window?(M=new window.ResizeObserver((()=>{h()})),M.observe(l)):window.addEventListener("resize",h),window.addEventListener("pointerdown",C),window.addEventListener("wheel",w,{passive:!1,capture:!0}),null==c||c.querySelector(".excalidraw-textEditorContainer").appendChild(p)},wa=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Ta(t,e).length||"selection"!==e.elementType)),ka=e=>e.reduce(((e,t)=>e+t.version),0),_a=e=>e.filter((e=>!e.isDeleted)),Ea=e=>!e.isDeleted,Sa=e=>_a(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ca=e=>Sa(e),ja=e=>Sa(e),Ia=(e,t,n)=>{const[r,i]=[e.horizontal,e.vertical].map((e=>null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height));return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Ma=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Ta=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&Ae(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Oa=(e,t)=>t.editingElement?[t.editingElement]:Ta(e,t),La=e=>{let{scenePoint:t,viewportDimensions:n,zoom:r}=e;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},Aa=(e,t,n)=>{if(!(e=(e=>e.filter((e=>!e.isDeleted&&!Xr(e))))(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=Qe(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=_n({sceneX:r,sceneY:i},e),{x:c,y:d}=_n({sceneX:o,sceneY:a},e);return c-s>e.width||d-l>e.height})(t,0,[r,i,o,a])&&([r,i,o,a]=((e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0];return e.forEach((e=>{const[i,o,a,s]=Je(e),l=Ne((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),Je(r)})(e,kn({clientX:t.scrollX,clientY:t.scrollY},t)));return La({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Pa=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e,Da=e=>"image"!==e,za=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Na=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Ra=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ha=e=>"text"===e,Ba=e=>"arrow"===e,Fa=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){const i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Ua=(e,t,n,r)=>{let i=null;for(let o=e.length-1;o>=0;--o){if(e[o].isDeleted)continue;const[a,s,l,c]=Ge(e[o]);if(a<t&&t<l&&s<n&&n<c&&e[o].type!==r){i=e[o];break}}return i},Wa=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},Va=e=>{const t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,30))};n(5422);class Ka extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";super(),this.name=t,this.message=e}}class Ga extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const Ya=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,x.jsx)("div",{className:"Spinner",children:(0,x.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,x.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},Za=i().forwardRef(((e,t)=>{const{id:n}=Zh(),o=i().useRef(null);i().useImperativeHandle(t,(()=>o.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(!0),d=async t=>{var n;const r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t));if(r&&"then"in r)try{l(!0),await r}catch(e){if(!(e instanceof Ga))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,r.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,r.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,x.jsxs)("button",{className:ye("ToolIcon_type_button",a,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:t,onClick:d,ref:o,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,x.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,x.jsx)(Ya,{})]}),e.showAriaLabel&&(0,x.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,x.jsx)(Ya,{})]}),e.children]})}return(0,x.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:e=>{u.current=e.pointerType||null},onPointerUp:()=>{requestAnimationFrame((()=>{u.current=null}))},children:[(0,x.jsx)("input",{className:"ToolIcon_type_radio ".concat(a),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:u.current})},checked:e.checked,ref:o}),(0,x.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,x.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Za.defaultProps={visible:!0,className:"",size:"medium"};const qa=e=>e===o.C6.LIGHT?rt.orange[4]:rt.orange[9],Xa=e=>e===o.C6.LIGHT?rt.white:"#1e1e1e",$a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;const{width:n=512,height:r=n,mirror:i,style:o}="number"==typeof t?{width:t}:t;return(0,x.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:ye({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,x.jsx)("path",{fill:"currentColor",d:e}):e})},Ja=$a((0,x.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Qa=$a("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),es=$a("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),ts=$a("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),ns=$a("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),rs=$a("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),is=$a("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),os=$a("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),as=$a("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),ss=$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,x.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0}),ls=$a("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),cs=$a("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),ds=$a("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),us=$a("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),hs=$a("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),ps=$a("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),gs=$a("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),ms=$a("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),fs=($a("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),$a("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),$a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),(0,x.jsx)("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),$a((0,x.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),xs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),_s=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Es=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Ss=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,x.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:qa(t),stroke:qa(t),strokeWidth:"2"})]}),{width:24})})),Cs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:qa(t),stroke:qa(t),strokeWidth:"2"}),(0,x.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Is=$a("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),Ms=($a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),$a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),$a("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Ts=$a("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Os=$a("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),Ls=($a("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),$a("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512})),As=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ps=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,x.jsx)("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,x.jsxs)("g",{fill:Xa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,x.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,x.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ds=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),zs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,x.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,x.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),Ns=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Rs=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return $a((0,x.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),Hs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Bs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Fs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Us=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ws=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Vs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ks=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Gs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ys=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),Zs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,x.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,x.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),qs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),Xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,x.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),$s=i().memo((e=>{let{theme:t,flip:n=!1}=e;return $a((0,x.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,x.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,x.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),Js=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),Qs=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),el=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),tl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),nl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),rl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),il=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)(x.Fragment,{children:(0,x.jsx)("path",{fill:"var(--icon-fill-color)",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),ol=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),al=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:"var(--icon-fill-color)"}),{width:448,height:512})})),sl=i().memo((e=>{let{theme:t}=e;return $a((0,x.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),ll=$a((0,x.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});let cl=[];const dl=e=>(cl=cl.concat(e),e),ul=(e,t)=>{if(e.editingGroupId){const n=oi(_a(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},hl=dl({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=Lo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=ul(t,n);return{elements:n,appState:Object.assign(Object.assign({},r),{editingLinearElement:null}),commitToHistory:!1}}const s={startBindingElement:null!=r&&r.includes(0)?null:i,endBindingElement:null!=r&&r.includes(a.points.length-1)?null:o};return Lo.deletePoints(a,r),{elements:e,appState:Object.assign(Object.assign({},t),{editingLinearElement:Object.assign(Object.assign(Object.assign({},t.editingLinearElement),s),{selectedPointsIndices:(null==r?void 0:r[0])>0?[r[0]-1]:[0]})}),commitToHistory:!0}}let{elements:n,appState:r}=((e,t)=>({elements:e.map((e=>t.selectedElementIds[e.id]||Ae(e)&&t.selectedElementIds[e.containerId]?Zr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return oa(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=ul(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{elementType:"selection",multiElement:null}),commitToHistory:Ma(_a(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===Pt||e.key===Nt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:is,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),pl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=Ln(Ta(e,t,!0));for(;++o<e.length;)a.get(e[o].id)?(r.length&&(n=n.concat(r),r=[]),n.push(o),i=o+1):e[o].isDeleted&&i===o?(i=o+1,r.push(o)):r=[];return n},gl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=ir.getScene(e).getElement(e.containerId);if(n)return t.indexOf(n)}}else{var r,i;const o=null===(r=e.boundElements)||void 0===r||null===(i=r.find((e=>"arrow"!==e.type)))||void 0===i?void 0:i.id;if(o){if("left"===n)return t.indexOf(e);const r=ir.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},ml=(e,t,n,r)=>{const i=t[n],o=t=>!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId)),a="left"===r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,o,Math.max(0,n-1)):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,o,n+1),s=t[a];if(!s)return-1;if(e.editingGroupId){var l;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(l=gl(s,t,r))&&void 0!==l?l:a;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}var c;if(!s.groupIds.length)return null!==(c=gl(s,t,r))&&void 0!==c?c:a;const d=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],u=oi(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},fl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),bl=(e,t,n)=>{const r=pl(t,e),i=fl(t,r);let o=(e=>{let t=0;return e.reduce(((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n)),[])})(r);return"right"===n&&(o=o.reverse()),o.forEach(((r,i)=>{const o=r[0],a=r[r.length-1],s="left"===n?o:a,l=ml(e,t,s,n);if(-1===l||s===l)return;const c="left"===n?t.slice(0,l):t.slice(0,o),d=t.slice(o,a+1),u="left"===n?t.slice(l,o):t.slice(a+1,l+1),h="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?[...c,...d,...u,...h]:[...c,...u,...d,...h]})),t.map((e=>i[e.id]?qr(e):e))},xl=(e,t,n)=>{const r=pl(e,t),i=fl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;a=e.indexOf(n[0])}else a=0;s=r[r.length-1]}else{if(t.editingGroupId){const n=oi(e,t.editingGroupId);if(!n.length)return e;s=e.indexOf(n[n.length-1])}else s=e.length-1;a=r[0]}for(let t=a;t<s+1;t++)r.includes(t)||o.push(e[t]);const l=Object.values(i).map((e=>qr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},vl=(e,t)=>bl(t,e,"left"),yl=(e,t)=>bl(t,e,"right"),wl=(e,t)=>xl(e,t,"left"),kl=(e,t)=>xl(e,t,"right"),_l=dl({name:"sendBackward",perform:(e,t)=>({elements:vl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendBackward")," — ").concat(wn("CtrlOrCmd+[")),children:(0,x.jsx)(bs,{theme:n.theme})})}}),El=dl({name:"bringForward",perform:(e,t)=>({elements:yl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[zt]&&!e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.bringForward")," — ").concat(wn("CtrlOrCmd+]")),children:(0,x.jsx)(fs,{theme:n.theme})})}}),Sl=dl({name:"sendToBack",perform:(e,t)=>({elements:wl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>st?e[zt]&&e.altKey&&e.code===mt:e[zt]&&e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendToBack")," — ").concat(wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,x.jsx)(vs,{theme:n.theme})})}}),Cl=dl({name:"bringToFront",perform:(e,t)=>({elements:kl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>st?e[zt]&&e.altKey&&e.code===gt:e[zt]&&e.shiftKey&&e.code===gt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,x.jsx)(xs,{theme:n.theme})})}}),jl=dl({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:ri(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ee(t)&&t.containerId||(e[t.id]=!0),e)),{})}),_a(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[zt]&&e.key===Wt}),Il=dl({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=Lo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},Ml(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[zt]&&e.key===Vt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",icon:Os,title:"".concat(b("labels.duplicateSelection")," — ").concat(wn("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Ma(_a(t),n)})}}),Ml=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=mi(t.editingGroupId,n,e,{x:e.x+o.k/2,y:e.y+o.k/2});return a.set(e.id,s.id),i.push(e),r.push(s),s},l=[];let c=0;const d=Ln(Ta(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=ti(t,n);if(r){const t=oi(e,r);l.push(...t,...t.map((e=>s(e)))),c+=t.length;continue}}l.push(n,s(n))}else l.push(n);c++}return ar(l,i,a),ra(l,i,a),{elements:l,appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Ae(t)||(e[t.id]=!0),e)),{})}),_a(l))}},Tl=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,x.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,x.jsxs)("label",{className:ye({active:n===e.value}),title:e.text,children:[(0,x.jsx)("input",{type:"radio",name:i,onChange:()=>r(e.value),checked:n===e.value}),e.icon]},e.text)))})};n(4301);const Ol=e=>{let{children:t,left:n,top:i,onCloseRequest:o,fitInViewport:a=!1}=e;const s=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{if(a&&s.current){const e=s.current,{x:t,y:n,width:r,height:i}=e.getBoundingClientRect(),o=window.innerWidth;t+r>o&&(e.style.left="".concat(o-r,"px"));const a=window.innerHeight;n+i>a&&(e.style.top="".concat(a-i,"px"))}}),[a]),(0,r.useEffect)((()=>{if(o){const e=e=>{var t;null!==(t=s.current)&&void 0!==t&&t.contains(e.target)||(0,at.unstable_batchedUpdates)((()=>o(e)))};return document.addEventListener("pointerdown",e,!1),()=>document.removeEventListener("pointerdown",e,!1)}}),[o]),(0,x.jsx)("div",{className:"popover",style:{top:i,left:n},ref:s,children:t})};n(4220);const Ll=e=>{const t=(new Option).style;return t.color=e,!!t.color},Al=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Pl=e=>{let{colors:t,color:n,onChange:r,onClose:o,label:a,showInput:s=!0,type:l}=e;const c=i().useRef(),d=i().useRef(),u=i().useRef(),h=i().useRef();i().useEffect((()=>{d.current?d.current.focus():h.current?h.current.focus():u.current&&u.current.focus()}),[]);return(0,x.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),onKeyDown:e=>{if(e.key===Ut){const{activeElement:r}=document;var t;if(e.shiftKey){if(r===c.current)null===(t=h.current)||void 0===t||t.focus(),e.preventDefault()}else if(r===h.current){var n;null===(n=c.current)||void 0===n||n.focus(),e.preventDefault()}}else if(on(e.key)){const{activeElement:t}=document,n=m().rtl,r=Array.prototype.indexOf.call(u.current.children,t);if(-1!==r){const t=u.current.children.length-(s?1:0),i=e.key===(n?Ot:Lt)?(r+1)%t:e.key===(n?Lt:Ot)?(t+r-1)%t:e.key===Tt?(r+5)%t:e.key===At?(t+r-5)%t:r;u.current.children[i].focus()}e.preventDefault()}else if(Al.includes(e.key.toLowerCase())&&!hn(e.target)){const t=Al.indexOf(e.key.toLowerCase());u.current.children[t].focus(),e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,x.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,x.jsx)("div",{className:"color-picker-triangle"}),(0,x.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(u.current=e)},tabIndex:0,children:[t.map(((e,t)=>{const i=e.replace("#","");return(0,x.jsxs)("button",{className:"color-picker-swatch",onClick:t=>{t.currentTarget.focus(),r(e)},title:"".concat(b("colors.".concat(i))).concat(Mn(e)?"":" (".concat(e,")")," — ").concat(Al[t].toUpperCase()),"aria-label":b("colors.".concat(i)),"aria-keyshortcuts":Al[t],style:{color:e},ref:r=>{r&&0===t&&(c.current=r),r&&e===n&&(d.current=r)},onFocus:()=>{r(e)},children:[Mn(e)?(0,x.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,x.jsx)("span",{className:"color-picker-keybinding",children:Al[t]})]},e)})),s&&(0,x.jsx)(Dl,{color:n,label:a,onChange:e=>{r(e)},ref:h})]})]})},Dl=i().forwardRef(((e,t)=>{let{color:n,onChange:r,label:o}=e;const[a,s]=i().useState(n),l=i().useRef(null);i().useEffect((()=>{s(n)}),[n]),i().useImperativeHandle(t,(()=>l.current));const c=i().useCallback((e=>{const t=e.toLowerCase(),n=(e=>Mn(e)||Ll(e)?e:Ll("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,x.jsxs)("label",{className:"color-input-container",children:[(0,x.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,x.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),zl=e=>{let{type:t,color:n,onChange:r,label:o,isActive:a,setActive:s}=e;const l=i().useRef(null);return(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"color-picker-control-container",children:[(0,x.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:l}),(0,x.jsx)(Dl,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,x.jsx)(i().Suspense,{fallback:"",children:a?(0,x.jsx)(Ol,{onCloseRequest:e=>e.target!==l.current&&s(!1),children:(0,x.jsx)(Pl,{colors:ot[t],color:n||null,onChange:e=>{r(e)},onClose:()=>{var e;s(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function Nl(e){let{options:t,value:n,label:r,onChange:o,onClose:a}=e;const s=i().useRef(),l=i().useRef(),c=i().useRef(null);i().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,x.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:e=>{const n=t.find((t=>t.keyBinding===e.key.toLowerCase()));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Ut)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(on(e.key)){const{activeElement:n}=document,r=m().rtl,i=Array.prototype.indexOf.call(c.current.children,n);if(-1!==i){const n=t.length;let o=i;switch(e.key){case r?Ot:Lt:case Tt:o=(i+1)%n;break;case r?Lt:Ot:case At:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==Ht&&e.key!==Rt||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,x.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,x.jsxs)("button",{className:"picker-option",onClick:t=>{t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:r=>{r&&0===t&&(s.current=r),r&&e.value===n&&(l.current=r)},onFocus:()=>{o(e.value)},children:[e.icon,(0,x.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function Rl(e){var t;let{value:n,label:r,options:o,onChange:a,group:s=""}=e;const[l,c]=i().useState(!1),d=i().useRef(null),u=m().rtl;return(0,x.jsxs)("label",{className:"picker-container",children:[(0,x.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=o.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,x.jsx)(i().Suspense,{fallback:"",children:l?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ol,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,x.jsx)(Nl,{options:o,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,x.jsx)("div",{className:"picker-triangle"})]}):null})]})}const Hl=(e,t,n)=>e.map((e=>{var r;return t.selectedElementIds[e.id]||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e})),Bl=function(e,t,n,r){var i,o;const a=t.editingElement,s=_a(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Ma(s,t)?((e,t,n)=>{const r=Array.from(new Set(Ta(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null})(s,t,n):r)&&void 0!==i?i:null},Fl=(dl({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Hl(e,t,(e=>Da(e.type)?Zr(e,{strokeColor:n.currentItemStrokeColor}):e))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemStrokeColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.stroke")}),(0,x.jsx)(zl,{type:"elementStroke",label:b("labels.stroke"),color:Bl(t,n,(e=>e.strokeColor),n.currentItemStrokeColor),onChange:e=>r({currentItemStrokeColor:e}),isActive:"strokeColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"strokeColorPicker":null})})]})}}),dl({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Hl(e,t,(e=>Zr(e,{backgroundColor:n.currentItemBackgroundColor})))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{"aria-hidden":"true",children:b("labels.background")}),(0,x.jsx)(zl,{type:"elementBackground",label:b("labels.background"),color:Bl(t,n,(e=>e.backgroundColor),n.currentItemBackgroundColor),onChange:e=>r({currentItemBackgroundColor:e}),isActive:"backgroundColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"backgroundColorPicker":null})})]})}}),dl({name:"changeFillStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{fillStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemFillStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fill")}),(0,x.jsx)(Tl,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,x.jsx)(Ds,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,x.jsx)(zs,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,x.jsx)(Ns,{theme:n.theme})}],group:"fill",value:Bl(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),dl({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeWidth:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeWidth:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeWidth")}),(0,x.jsx)(Tl,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,x.jsx)(Rs,{theme:n.theme,strokeWidth:10})}],value:Bl(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),dl({name:"changeSloppiness",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{seed:Kr(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.sloppiness")}),(0,x.jsx)(Tl,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,x.jsx)(Us,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,x.jsx)(Ws,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,x.jsx)(Vs,{theme:n.theme})}],value:Bl(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),dl({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{strokeStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.strokeStyle")}),(0,x.jsx)(Tl,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,x.jsx)(Hs,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,x.jsx)(Bs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,x.jsx)(Fs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),dl({name:"changeOpacity",perform:(e,t,n)=>({elements:Hl(e,t,(e=>Zr(e,{opacity:n}))),appState:Object.assign(Object.assign({},t),{currentItemOpacity:n}),commitToHistory:!0}),PanelComponent:e=>{var t;let{elements:n,appState:r,updateData:i}=e;return(0,x.jsxs)("label",{className:"control-label",children:[b("labels.opacity"),(0,x.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),onWheel:e=>{e.stopPropagation();const t=+e.target.value;e.deltaY<0&&t<100?i(t+10):e.deltaY>0&&t>0&&i(t-10)},value:null!==(t=Bl(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),dl({name:"changeFontSize",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontSize:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontSize:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontSize")}),(0,x.jsx)(Tl,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,x.jsx)(Js,{theme:n.theme})},{value:20,text:b("labels.medium"),icon:(0,x.jsx)(Qs,{theme:n.theme})},{value:28,text:b("labels.large"),icon:(0,x.jsx)(el,{theme:n.theme})},{value:36,text:b("labels.veryLarge"),icon:(0,x.jsx)(tl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.fontSize),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),dl({name:"changeFontFamily",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{fontFamily:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=[{value:o.ut.Virgil,text:b("labels.handDrawn"),icon:(0,x.jsx)(nl,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,x.jsx)(rl,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,x.jsx)(il,{theme:n.theme})}];return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.fontFamily")}),(0,x.jsx)(Tl,{group:"font-family",options:i,value:Bl(t,n,(e=>Ee(e)&&e.fontFamily),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),dl({name:"changeTextAlign",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(Ee(e)){const t=Zr(e,{textAlign:n});return or(t),t}return e})),appState:Object.assign(Object.assign({},t),{currentItemTextAlign:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.textAlign")}),(0,x.jsx)(Tl,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,x.jsx)(ol,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,x.jsx)(al,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,x.jsx)(sl,{theme:n.theme})}],value:Bl(t,n,(e=>Ee(e)&&e.textAlign),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),dl({name:"changeSharpness",perform:(e,t,n)=>{const r=Oa(_a(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.elementType),o=r.length?r.every(je):Ie(t.elementType);return{elements:Hl(e,t,(e=>Zr(e,{strokeSharpness:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeSharpness:i?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:o?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.edges")}),(0,x.jsx)(Tl,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,x.jsx)(Ks,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,x.jsx)(Gs,{theme:n.theme})}],value:Bl(t,n,(e=>e.strokeSharpness),Ra(n.elementType)&&(Ie(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),dl({name:"changeArrowhead",perform:(e,t,n)=>({elements:Hl(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Zr(e,{startArrowhead:r})}if("end"===t){return Zr(e,{endArrowhead:r})}}return e})),appState:Object.assign(Object.assign({},t),{["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=m().rtl;return(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.arrowheads")}),(0,x.jsxs)("div",{className:"iconSelectList",children:[(0,x.jsx)(Rl,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,x.jsx)(Ys,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,x.jsx)(Zs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,x.jsx)(Xs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,x.jsx)(qs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,x.jsx)(Rl,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,x.jsx)(Ys,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,x.jsx)(Zs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,x.jsx)(Xs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,x.jsx)(qs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,x.jsx)($s,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Bl(t,n,(e=>je(e)&&Ba(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}}),e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,x.jsx)(Za,{type:"icon",icon:e.value===o.C6.LIGHT?Ul.MOON:Ul.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===o.C6.DARK?o.C6.LIGHT:o.C6.DARK),"data-testid":"toggle-dark-mode"})}),Ul={SUN:(0,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:(0,x.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})};n(6781);const Wl=()=>{const e=document.querySelector(".excalidraw-tooltip");if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},Vl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>Wl().classList.remove("excalidraw-tooltip--visible")),[]),(0,x.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:e=>((e,t,n,r)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;const{x:i,bottom:o,top:a,width:s}=e.getBoundingClientRect(),{width:l,height:c}=t.getBoundingClientRect(),d=window.innerWidth,u=i+s/2-l/2,h=u+l>=d?u+l-d:0,p=o+5,g=p+c>=window.innerHeight?o-a+c+10:0;Object.assign(t.style,{top:"".concat(p-g,"px"),left:"".concat(u-h,"px")})})(e.currentTarget,Wl(),n,i),onPointerLeave:()=>Wl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const Kl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,x.jsx)("div",{className:ye("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const Gl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=Yl(t);if(!r)return null;return(0,at.createPortal)((0,x.jsxs)("div",{className:ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===Ht&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,x.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,x.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)},Yl=e=>{const[t,n]=(0,r.useState)(null),i=Gh(),o=(0,r.useRef)(i);o.current=i;const{container:a}=Zh();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i)}),[t,i]),(0,r.useLayoutEffect)((()=>{const t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,r=document.createElement("div");return r.classList.add("excalidraw","excalidraw-modal-container"),r.classList.toggle("excalidraw--mobile",o.current),t&&(r.classList.add("theme--dark"),r.classList.add("theme--dark-background-none")),document.body.appendChild(r),n(r),()=>{document.body.removeChild(r)}}),[a,e]),t},Zl=e=>{const[t,n]=(()=>{const[e,t]=(0,r.useState)(null);return[e,(0,r.useCallback)((e=>t(e)),[])]})(),[i]=(0,r.useState)(document.activeElement),{id:o}=Zh();(0,r.useEffect)((()=>{if(!t)return;const n=a(t);n.length>0&&!1!==e.autofocus&&(n[1]||n[0]).focus();const r=e=>{if(e.key===Ut){const n=a(t),{activeElement:r}=document,i=n.findIndex((e=>e===r));0===i&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i!==n.length-1||e.shiftKey||(n[0].focus(),e.preventDefault())}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}),[t,e.autofocus]);const a=e=>{const t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=()=>{i.focus(),e.onCloseRequest()};return(0,x.jsx)(Gl,{className:ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,x.jsxs)(Kl,{ref:n,children:[(0,x.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,x.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,x.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":b("buttons.close"),children:Gh()?Ts:Ms})]}),(0,x.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var ql=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=ql(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,x.jsxs)(Zl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,x.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,x.jsx)(Za,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,x.jsx)(Za,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},$l=e=>{let{onConfirm:t}=e;const[n,i]=(0,r.useState)(!1),o=()=>{i(!n)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",icon:is,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:Gh(),onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,x.jsx)(Xl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,x.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},Jl=(dl({name:"changeViewBackgroundColor",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.viewBackgroundColor}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{position:"relative"},children:(0,x.jsx)(zl,{label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:e=>n({viewBackgroundColor:e}),isActive:"canvasColorPicker"===t.openPopup,setActive:e=>n({openPopup:e?"canvasColorPicker":null}),"data-testid":"canvas-background-picker"})})}}),dl({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Zr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},Pn()),{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)($l,{onConfirm:t})}}),dl({name:"zoomIn",perform:(e,t)=>{const n=Wa(Va(t.zoom.value+o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:cs,title:"".concat(b("buttons.zoomIn")," — ").concat(wn("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ct||e.code===ut)&&(e[zt]||e.shiftKey)}),dl({name:"zoomOut",perform:(e,t)=>{const n=Wa(Va(t.zoom.value-o.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Object.assign(Object.assign({},t),{zoom:n}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ds,title:"".concat(b("buttons.zoomOut")," — ").concat(wn("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===dt||e.code===ht)&&(e[zt]||e.shiftKey)}),dl({name:"resetZoom",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{zoom:Wa(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Vl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,x.jsxs)(Za,{type:"button",className:"reset-zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===vt||e.code===pt)&&(e[zt]||e.shiftKey)}),(e,t,n)=>{const r=_a(e),i=Ta(r,t),a=n&&i.length>0?Qe(i):Qe(r),s=((e,t)=>{const[n,r,i,a]=e,s=i-n,l=t.width/s,c=a-r,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/o.V4)*o.V4;return Math.min(Math.max(h,o.V4),1)})(a,{width:t.width,height:t.height}),l=Wa(s,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),[c,d,u,h]=a,p=(c+u)/2,g=(d+h)/2;return{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:{x:p,y:g},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{zoom:l}),commitToHistory:!1}}),Ql=(dl({name:"zoomToSelection",perform:(e,t)=>Jl(e,t,!0),keyTest:e=>e.code===bt&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"zoomToFit",perform:(e,t)=>Jl(e,t,!1),keyTest:e=>e.code===ft&&e.shiftKey&&!e.altKey&&!e[zt]}),dl({name:"toggleTheme",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===o.C6.LIGHT?o.C6.DARK:o.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,x.jsx)(Fl,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===kt}),dl({name:"finalize",perform:(e,t,n,r)=>{var i;let{canvas:o,focusContainer:a}=r;if(t.editingLinearElement){const{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,o=Lo.getElement(n);if(o)return Me(o)&&Do(o,r,i),{elements:o.points.length<2||Xr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Yr(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();const l=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(l){if("freedraw"!==l.type&&"touch"!==t.lastPointerDownWith){const{points:e,lastCommittedPoint:t}=l;t&&e[e.length-1]===t||Yr(l,{points:l.points.slice(0,-1)})}Xr(l)&&(s=s.slice(0,-1));const e=Re(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Yr(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Me(l)&&!e&&l.points.length>1){const[e,n]=Lo.getPointAtIndexGlobalCoordinates(l,-1);Ho(l,t,ir.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&l||bn(o),{elements:s,appState:Object.assign(Object.assign({},t),{elementType:(t.elementLocked||"freedraw"===t.elementType)&&l?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.elementType?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:(e,t)=>e.key===Ht&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Ht||e.key===Rt)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:us,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement})}}));var ec,tc;const nc="undefined"!=typeof process&&null!==(ec={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==ec&&ec.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(tc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==tc&&tc.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const rc=e=>{const{id:t}=Zh(),[n,i]=(0,r.useState)(e.value);return(0,x.jsxs)("div",{className:"ProjectName",children:[(0,x.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,x.jsx)("input",{type:"text",className:"TextInput",onBlur:t=>{(e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}})(t.target);const n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:n,onChange:e=>i(e.target.value)}):(0,x.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},ic=(e,t)=>{if(null!=t&&t.collaborators){const n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}const n=e.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0),r=ot.elementBackground.slice(1),i=ot.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let oc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(oc||(oc={}));const ac=(()=>{const e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]})(),sc=function(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(o,a),e.rotate(s),l&&e.fillRect(t-o,n-a,r,i),e.strokeRect(t-o,n-a,r,i),e.restore()},lc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},cc=(e,t,n,r,i,a,s)=>{if(null===a)return{atLeastOneVisibleElement:!1};const{renderScrollbars:l=!0,renderSelection:c=!0,renderGrid:d=!0,isExporting:u}=s,h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.save(),h.scale(r,r);const p=a.width/r,g=a.height/r;if(u&&"dark"===s.theme&&(h.filter=o.ZF),"string"==typeof s.viewBackgroundColor){("transparent"===s.viewBackgroundColor||5===s.viewBackgroundColor.length||9===s.viewBackgroundColor.length||/(hsla|rgba)\(/.test(s.viewBackgroundColor))&&h.clearRect(0,0,p,g),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,g),h.restore()}else h.clearRect(0,0,p,g);const f=s.zoom.translation.x,b=s.zoom.translation.y;h.save(),h.translate(f,b),h.scale(s.zoom.value,s.zoom.value),d&&t.gridSize&&((e,t,n,r,i,o)=>{e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(let a=n;a<n+i+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+o+2*t);for(let a=r;a<r+o+2*t;a+=t)e.moveTo(n-t,a),e.lineTo(n+i+2*t,a);e.stroke(),e.restore()})(h,t.gridSize,-Math.ceil(f/s.zoom.value/t.gridSize)*t.gridSize+s.scrollX%t.gridSize,-Math.ceil(b/s.zoom.value/t.gridSize)*t.gridSize+s.scrollY%t.gridSize,p/s.zoom.value,g/s.zoom.value);const x=e.filter((e=>mc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(x.forEach((e=>{try{zr(e,i,h,s)}catch(e){console.error(e)}})),t.editingLinearElement){const e=Lo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Lo.getPointsGlobalCoordinates(r).forEach(((r,i)=>{var o,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(o=t.editingLinearElement)&&void 0!==o&&null!==(a=o.selectedPointsIndices)&&void 0!==a&&a.includes(i)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";const{POINT_HANDLE_SIZE:s}=Lo;lc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{zr(n,i,h,s)}catch(e){console.error(e)}if(Po(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{hc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!ei(t,n)&&r.push(rt.black),s.remoteSelectedElementIds[n.id]&&r.push(...s.remoteSelectedElementIds[n.id].map((e=>{const{background:n}=ic(e,t);return n}))),r.length){const[t,i,o,a]=Ge(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=oi(e,t),[i,o,a,s]=Qe(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[rt.black]})};for(const e of ni(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>uc(h,s,e)));const i=Ta(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=rt.white;const e=_i(i[0],s.zoom,"mouse");t.viewModeEnabled||dc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=rt.white;const[t,n,r,o]=Qe(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,sc(h,t-e,n-e,r-t+2*e,o-n+2*e,(t+r)/2,(n+o)/2,0),h.lineWidth=l,h.setLineDash(a);const c=ki([t,n,r,o],0,s.zoom,"mouse",bi);dc(h,s,c,0)}h.restore()}h.restore();for(const e in s.remotePointerViewportCoords){let{x:n,y:r}=s.remotePointerViewportCoords[e];n-=t.offsetLeft,r-=t.offsetTop;const i=9,o=14,a=n<0||n>p-i||r<0||r>g-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,g-o);const{background:l,stroke:c}=ic(e,t);h.save(),h.strokeStyle=c,h.fillStyle=l;const d=s.remotePointerUserStates[e];(a||d===oc.AWAY)&&(h.globalAlpha=.48),s.remotePointerButton&&"down"===s.remotePointerButton[e]&&(h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=3,h.strokeStyle="#ffffff88",h.stroke(),h.closePath(),h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=1,h.strokeStyle=c,h.stroke(),h.closePath()),h.beginPath(),h.moveTo(n,r),h.lineTo(n+1,r+14),h.lineTo(n+4,r+9),h.lineTo(n+9,r+10),h.lineTo(n,r),h.fill(),h.stroke();const u=s.remotePointerUsernames[e];let m="";d===oc.AWAY?m=ac?"⚫️":" (".concat(oc.AWAY,")"):d===oc.IDLE?m=ac?"💤":" (".concat(oc.IDLE,")"):d===oc.ACTIVE&&(m=ac?"🟢":"");const f="".concat(u?"".concat(u," "):"").concat(m);if(!a&&f){const e=n+i,t=r+o,a=4,s=4,d=h.measureText(f),u=d.actualBoundingBoxDescent+d.actualBoundingBoxAscent;h.fillStyle=c,h.fillRect(e-1,t-1,d.width+2*a+2,u+2*s+2),h.fillStyle=l,h.fillRect(e,t,d.width+2*a,u+2*s),h.fillStyle=rt.white,h.fillText(f,e+a,t+s+d.actualBoundingBoxAscent)}h.restore(),h.closePath()}let v;return l&&(v=((e,t,n,r)=>{let{scrollX:i,scrollY:o,zoom:a}=r;if(0===e.length)return{horizontal:null,vertical:null};const[s,l,c,d]=Qe(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,f={top:parseInt(En("sat")),bottom:parseInt(En("sab")),left:parseInt(En("sal")),right:parseInt(En("sar"))},b=m().rtl,x=p/2-i+f.left,v=g/2-o+f.top,y=x+u-f.right,w=v+h-f.bottom,k=Math.min(s,x),_=Math.min(l,v),E=Math.max(c,y),S=Math.max(d,w);return{horizontal:x===k&&y===E?null:{x:Math.max(f.left,4)+(x-k)/(E-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-x)/(E-k)*t-Math.max(8,f.left+f.right),height:6},vertical:v===_&&w===S?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(v-_)/(S-_)*n+Math.max(f.top,4),width:6,height:(w-v)/(S-_)*n-Math.max(8,f.top+f.bottom)}}})(e,p,g,s),h.save(),h.fillStyle="rgba(0,0,0,0.3)",h.strokeStyle="rgba(255,255,255,0.8)",[v.horizontal,v.vertical].forEach((e=>{e&&((e,t,n,r,i,o)=>{e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill(),e.stroke()})(h,e.x,e.y,e.width,e.height,3)})),h.restore()),h.restore(),{atLeastOneVisibleElement:x.length>0,scrollBars:v}},dc=(e,t,n,r)=>{Object.keys(n).forEach((i=>{const o=n[i];void 0!==o&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===i?lc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):sc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},uc=(e,t,n)=>{const{angle:r,elementX1:i,elementY1:o,elementX2:a,elementY2:s,selectionColors:l}=n,c=a-i,d=s-o,u=4/t.zoom.value,h=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;const g=l.length;for(let t=0;t<g;++t)e.strokeStyle=l[t],e.setLineDash([h,p+(h+p)*(g-1)]),e.lineDashOffset=(h+p)*t,sc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},hc=(e,t,n)=>{const r=Array.isArray(n)?gc:pc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},pc=(e,t)=>{const[n,r,i,o]=Ge(t),a=i-n,s=o-r,l=Ji(t,a,s);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;const c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":sc(e,n-c,r-c,a+2*c,s+2*c,n+a/2,r+s/2,t.angle);break;case"diamond":const i=Math.hypot(a,s);((e,t,n,r,i,o)=>{e.save(),e.translate(r,i),e.rotate(o),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()})(e,a+2*(c*i/s),s+2*(c*i/a),n+a/2,r+s/2,t.angle);break;case"ellipse":((e,t,n,r,i,o)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,o,0,2*Math.PI),e.stroke()})(e,a+2*c,s+2*c,n+a/2,r+s/2,t.angle)}},gc=(e,t)=>{const[n,r,i]=t,o=Ji(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)";("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((t=>{const[r,i]=Lo.getPointAtIndexGlobalCoordinates(n,t);lc(e,r,i,o)}))},mc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=kn({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=kn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var fc=Object.defineProperty,bc=(e,t)=>()=>(e&&(t=e(e=0)),t),xc=(e,t)=>{for(var n in(e=>{fc(e,"__esModule",{value:!0})})(e),t)fc(e,n,{get:t[n],enumerable:!0})},vc={};xc(vc,{default:()=>yc});var yc,wc=bc((()=>{yc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let i=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=i||"";let o=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(o,(()=>a(n)),r);r.addEventListener("change",(()=>{o(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),kc={};xc(kc,{default:()=>Ec});var _c,Ec,Sc=bc((()=>{_c=async e=>{let t=await e.getFile();return t.handle=e,t},Ec=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(_c));return e[0].multiple?r:r[0]}})),Cc={};xc(Cc,{default:()=>jc});var jc,Ic=bc((()=>{jc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let i=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(i,(()=>o(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),i(t)})),r.click()})))})),Mc={};xc(Mc,{default:()=>Oc});var Tc,Oc,Lc=bc((()=>{Tc=async(e,t,n=e.name,r)=>{let i=[],o=[];for await(let a of e.values()){let s=`${n}/${a.name}`;"file"===a.kind?o.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push(Tc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Oc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Tc(t,e.recursive,void 0,e.skipDirectory)}})),Ac={};xc(Ac,{default:()=>Pc});var Pc,Dc=bc((()=>{Pc=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),i=new Response(r);return n.releaseLock(),new Blob([await i.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let i=()=>{"function"==typeof o&&o()},o=t.legacySetup&&t.legacySetup(i,(()=>o(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),i()})),n.click(),null}})),zc={};xc(zc,{default:()=>Nc});var Nc,Rc=bc((()=>{Nc=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let i=[];if(t.forEach(((t,n)=>{i[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{i[n].accept[e]=t.extensions||[]}))):e.type&&(i[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:i,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(a),o):"body"in e?(await e.body.pipeTo(a),o):(await a.write(blob),await a.close(),o)}})),Hc=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),Bc=Hc?Promise.resolve().then((()=>(Sc(),kc))):Promise.resolve().then((()=>(wc(),vc)));Hc?Promise.resolve().then((()=>(Lc(),Mc))):Promise.resolve().then((()=>(Ic(),Cc)));var Fc=Hc?Promise.resolve().then((()=>(Rc(),zc))):Promise.resolve().then((()=>(Dc(),Ac)));const Uc=e=>{var t,n,r;const i=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(o.LO[t]),e)),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce(((e,t)=>"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))),[]);return async function(...e){return(await Bc).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=mn(n,500),a=()=>{s(),document.addEventListener(o.Ks.KEYUP,i),document.addEventListener(o.Ks.POINTER_UP,i),i()},s=()=>{var n;if(null!==(n=r.files)&&void 0!==n&&n.length){const n=e.multiple?[...r.files]:r.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(o.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),i.cancel(),window.removeEventListener(o.Ks.FOCUS,a),document.removeEventListener(o.Ks.KEYUP,i),document.removeEventListener(o.Ks.POINTER_UP,i),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Ga))}}})},Wc=(e,t)=>async function(...e){return(await Fc).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),Vc={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Kc=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g;const m={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||Gr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(i=e.strokeStyle)&&void 0!==i?i:"solid",roughness:null!==(o=e.roughness)&&void 0!==o?o:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(s=t.x)&&void 0!==s?s:e.x)&&void 0!==a?a:0,y:null!==(l=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==l?l:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(d=e.seed)&&void 0!==d?d:1,groupIds:null!==(u=e.groupIds)&&void 0!==u?u:[],strokeSharpness:null!==(h=e.strokeSharpness)&&void 0!==h?h:Ie(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((e=>({type:"arrow",id:e}))):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(g=e.updated)&&void 0!==g?g:On()};return Object.assign(Object.assign(Object.assign({},m),Jr(m)),t)},Gc=e=>{var t,n,r,i;switch(e.type){case"text":let a=e.fontSize,s=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");a=parseInt(t,10),i=n,s=Object.keys(o.ut).includes(i)?o.ut[i]:o.rk}return Kc(e,{fontSize:a,fontFamily:s,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||o.Hg,verticalAlign:e.verticalAlign||o.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:null!==(r=e.originalText)&&void 0!==r?r:""});case"freedraw":return Kc(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Kc(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":{const{startArrowhead:t=null,endArrowhead:n=("arrow"===e.type?"arrow":null)}=e;let r=e.x,i=e.y,o=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===o[0][0]&&0===o[0][1]||({points:o,x:r,y:i}=Lo.getNormalizedPoints(e)),Kc(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:o,x:r,y:i})}case"ellipse":case"rectangle":case"diamond":return Kc(e,{})}},Yc=(e,t)=>{const n=t?Ln(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Xr(t)){let r=Gc(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=qr(r,i.version)),e.push(r)}}return e}),[])},Zc=(e,t)=>{e=e||{};const n=Pn(),r={};for(const[i,o]of Object.entries(n)){const n=e[i],a=t?t[i]:void 0;r[i]=void 0!==n?n:void 0!==a?a:o}return Object.assign(Object.assign({},r),{elementType:Vc[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:n.zoom.translation}:e.zoom||n.zoom})},qc=(e,t,n)=>({elements:Yc(null==e?void 0:e.elements,n),appState:Zc(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),Xc=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:Gr(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||Gr(),status:e.status||t,created:e.created||Date.now()}))}return n},$c=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}else if(t="text"in Blob?await e.text():await new Promise((t=>{const n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}})),e.type===o.LO.svg)try{return await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}return t},Jc=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},Qc=e=>{const t=Jc(e);return"png"===t||"svg"===t},ed=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},td=async(e,t,n)=>{const r=await $c(e);try{const i=JSON.parse(r);if(!ud(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return qc({elements:ja(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},Nn(i.appState||{})),t?Aa(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},nd=async e=>{const t=await $c(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},rd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new Ka(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),id=async e=>{try{const n=await window.crypto.subtle.digest("SHA-1",await e.arrayBuffer());return t=new Uint8Array(n),Array.from(t).map((e=>"0".concat(e.toString(16)).slice(-2))).join("")}catch(e){return console.error(e),we(40)}var t},od=async e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>{const e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)})),ad=async(e,t)=>{if(e.type===o.LO.svg)return e;const[r,i]=await Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((e=>e.default)),n.e(736).then(n.bind(n,100)).then((e=>e.default))]),a=i({pica:r({features:["js","wasm"]})});if(t.outputType){const{outputType:e}=t;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then((e=>(t.out_blob=e,t)))}}if(!ed(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:o.LO.svg})},ld=(e,t)=>{const n={};for(const r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},cd=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?ja(e):Ca(e),appState:"local"===r?Nn(t):Rn(t),files:"local"===r?ld(e,n):void 0};return JSON.stringify(i,null,2)},dd=async(e,t,n)=>{const r=cd(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await Wc(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Qc(t.fileHandle)?null:t.fileHandle})}},ud=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),hd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),pd=async e=>{let{fileIds:t,files:n,imageCache:r}=e;const i=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!i.has(t)?(i.set(t,!0),e.concat((async()=>{try{if(s.mimeType===o.LO.binary)throw new Error("Only images can be added to ImageCache");const e=hd(s.dataURL),n={image:e,mimeType:s.mimeType};r.set(t,n);const i=await e;r.set(t,Object.assign(Object.assign({},n),{image:i}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:r,updatedFiles:i,erroredFiles:a}},gd=e=>e.filter((e=>ke(e))),md="\x3c!-- svg-source:excalidraw --\x3e",fd=async function(e,t,n,r){let{exportBackground:i,exportPadding:a=o.qy,viewBackgroundColor:s}=r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(e,n)=>{const r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}};const[c,d,u,h]=xd(e,a),{canvas:p,scale:g=1}=l(u,h),m=Pn(),{imageCache:f}=await pd({imageCache:new Map,fileIds:gd(e).map((e=>e.fileId)),files:n});return cc(e,t,null,g,xe.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:m.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:f,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},bd=async(e,t,r)=>{const{exportPadding:i=o.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodeSvgMetadata({text:cd(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=xd(e,i),g=document.createElementNS(o.hR,"svg");if(g.setAttribute("version","1.1"),g.setAttribute("xmlns",o.hR),g.setAttribute("viewBox","0 0 ".concat(h," ").concat(p)),g.setAttribute("width","".concat(h*s)),g.setAttribute("height","".concat(p*s)),t.exportWithDarkMode&&g.setAttribute("filter",o.ZF),g.innerHTML="\n ".concat(md,"\n ").concat(c,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a){const e=g.ownerDocument.createElementNS(o.hR,"rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width","".concat(h)),e.setAttribute("height","".concat(p)),e.setAttribute("fill",a),g.appendChild(e)}return function(e,t,n,r){let{offsetX:i=0,offsetY:o=0,exportWithDarkMode:a=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n&&e.forEach((e=>{if(!e.isDeleted)try{Rr(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,xe.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},xd=(e,t)=>{const[n,r,i,o]=Qe(e);return[n,r,fn(n,i)+2*t,fn(r,o)+t+t]},vd=32,yd=12,wd=256,kd="NOT_SPREADSHEET",_d="VALID_SPREADSHEET",Ed=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Sd=(e,t)=>e.slice(1).every((e=>null!==Ed(e[t]))),Cd=e=>{const t=e[0].length;if(t>2)return{type:kd,reason:"More than 2 columns"};if(1===t){if(!Sd(e,0))return{type:kd,reason:"Value is not numeric"};const t=null===Ed(e[0][0]),n=(t?e.slice(1):e).map((e=>Ed(e[0])));return n.length<2?{type:kd,reason:"Less than two rows"}:{type:_d,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Sd(e,0)?0:1;if(!Sd(e,n))return{type:kd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Ed(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:kd,reason:"Less than 2 rows"}:{type:_d,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Ed(e[n])))}}},jd=ot.elementBackground.slice(2,ot.elementBackground.length),Id={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:ot.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Md=e=>({chartWidth:44*e.values.length+yd,chartHeight:280}),Td=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:vd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Od=(e,t,n,r,i)=>{const o=ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-yd,text:"0",textAlign:"right"}));return[o,ui(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Id),{x:t-yd,y:n-wd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Ld=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Md(e);return[pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),pi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"line",x:t,y:n-wd-yd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Ad=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Md(e),c=e.title?ui(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{text:e.title,x:t+s/2,y:n-wd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ci(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Id),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:ot.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...Td(e,t,n,r,i),...Od(e,t,n,r,i),...Ld(e,t,n,r,i)]},Pd=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*wd;l.push([e,n]),s++}const c=Math.max(...l.map((e=>e[0]))),d=Math.max(...l.map((e=>e[1]))),u=Math.min(...l.map((e=>e[0]))),h=Math.min(...l.map((e=>e[1]))),p=pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+yd+16,y:n-yd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,o)=>{const s=44*o+6,l=-e/r*wd+6;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:yd,height:yd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*wd+6+yd;return pi(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"line",x:t+s+16+6,y:n-l,startArrowhead:null,endArrowhead:null,height:l,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,l]]}))}));return[...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...m,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Gr(),a=jd[Math.floor(Math.random()*jd.length)],s=e.values.map(((e,o)=>{const s=e/r*wd;return ci(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Id),{type:"rectangle",x:t+44*o+yd,y:n-s-yd,width:vd,height:s}))}));return[...s,...Ad(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let Dd="",zd=!1;const Nd="clipboard"in navigator&&"readText"in navigator.clipboard,Rd="clipboard"in navigator&&"writeText"in navigator.clipboard,Hd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Bd=async(e,t,n)=>{const r=Ta(e,t,!0),i={type:o.r8.excalidrawClipboard,elements:r,files:r.reduce(((e,t)=>(ke(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(i);Dd=a;try{zd=!1,await Vd(a)}catch(e){zd=!0,console.error(e)}},Fd=()=>{if(!Dd)return{};try{return JSON.parse(Dd)}catch(e){return console.error(e),{}}},Ud=e=>{const t=(e=>{let t=e.trim().split("\n").map((e=>e.trim().split("\t")));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((e=>e.trim().split(",")))),0===t.length)return{type:kd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:kd,reason:"All rows don't have same number of columns"};const i=Cd(t);if(i.type!==_d){const e=Cd((e=>{const t=[];for(let n=0;n<e[0].length;n++){const r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t})(t));if(e.type===_d)return e}return i})(e);return t.type===_d?{spreadsheet:t.spreadsheet}:null},Wd=async e=>{const t=await(async e=>{try{var t;return(e?null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim():Nd&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(md))return Fd();const n=Ud(t);if(n)return n;const r=Fd();try{const e=JSON.parse(t);return i=e,[o.r8.excalidraw,o.r8.excalidrawClipboard].includes(null==i?void 0:i.type)&&Array.isArray(i.elements)?{elements:e.elements,files:e.files}:r}catch(e){return zd&&r.elements?r:{text:t}}var i},Vd=async e=>{let t=!1;if(Rd)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!Kd(e||" "))throw new Error("couldn't copy")},Kd=e=>{const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),i},Gd=async(e,t,r,i,a)=>{let{exportBackground:s,exportPadding:l=o.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(b("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await bd(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await Wc(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:u});if("clipboard-svg"===e)return void await Vd(n.outerHTML)}const h=await fd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await rd(h);if(h.remove(),"png"===e)return r.exportEmbedScene&&(p=await(await Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673))).encodePngMetadata({blob:p,metadata:cd(t,r,i,"local")})),await Wc(p,{description:"Export to PNG",name:d,extension:"png",fileHandle:u});if("clipboard"===e)try{await(async e=>{await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])})(p)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}};n(7225);const Yd=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,x.jsxs)("div",{className:ye("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,x.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:Ja}),(0,x.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const Zd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},qd=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,x.jsx)("div",{className:ye("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const Xd=e=>{let{fileName:t,onSave:n}=e;return(0,x.jsxs)(Zd,{className:"ActiveFile",gap:1,align:"center",children:[(0,x.jsxs)("span",{className:"ActiveFile__fileName",children:[Ls,(0,x.jsx)("span",{children:t})]}),(0,x.jsx)(Za,{type:"icon",icon:es,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},$d=(dl({name:"changeProjectName",perform:(e,t,n)=>(nc("change","title"),{appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,x.jsx)(rc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),dl({name:"changeExportScale",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportScale:n}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=_a(t),a=Ma(i,n)?Ta(i,n):i;return(0,x.jsx)(x.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=xd(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,o.qy,e),s="".concat(b("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(i,")");return(0,x.jsx)(Za,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:s,"aria-label":s,id:"export-canvas-scale",checked:e===n.exportScale,onChange:()=>r(e)},e)}))})}}),dl({name:"changeExportBackground",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportBackground:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Yd,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),dl({name:"changeExportEmbedScene",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportEmbedScene:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsxs)(Yd,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,x.jsx)(Vl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,x.jsx)("div",{className:"excalidraw-tooltip-icon",children:ms})})]})}}),dl({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=Qc(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=Jc(a);if(!a||"png"!==(l=s)&&"svg"!==l)throw new Error("fileHandle should exist and should be of type svg or png when resaving");var l;return t=Object.assign(Object.assign({},t),{exportEmbedScene:!0}),await Gd(s,_a(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await dd(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):b("toast.fileSaved"):null})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e[zt]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,x.jsx)(Xd,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),dl({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await dd(e,Object.assign(Object.assign({},t),{fileHandle:null}),r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Jt&&e.shiftKey&&e[zt],PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(Za,{type:"button",icon:ts,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:Gh(),hidden:!Hc,onClick:()=>t(null),"data-testid":"save-as-button"})}}));dl({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await Uc({description:"Excalidraw files"});return td(n,e,t)})(t,e);return{elements:n,appState:r,files:i,commitToHistory:!0}}catch(n){return"AbortError"===(null==n?void 0:n.name)?(console.warn(n),!1):{elements:e,appState:Object.assign(Object.assign({},t),{errorMessage:n.message}),files:r.files,commitToHistory:!1}}},keyTest:e=>e[zt]&&e.key===Zt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ns,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:Gh(),onClick:t,"data-testid":"load-button"})}}),dl({name:"exportWithDarkMode",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportWithDarkMode:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,x.jsx)(Fl,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let Jd="{}";const Qd=dl({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(Jd=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===wt}),eu=dl({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(Jd);return"text"!==(null==(r=n)?void 0:r.type)&&"diamond"!==(null==r?void 0:r.type)&&"rectangle"!==(null==r?void 0:r.type)&&"ellipse"!==(null==r?void 0:r.type)&&"arrow"!==(null==r?void 0:r.type)&&"freedraw"!==(null==r?void 0:r.type)&&"line"!==(null==r?void 0:r.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Zr(e,{backgroundColor:null==n?void 0:n.backgroundColor,strokeWidth:null==n?void 0:n.strokeWidth,strokeColor:null==n?void 0:n.strokeColor,strokeStyle:null==n?void 0:n.strokeStyle,fillStyle:null==n?void 0:n.fillStyle,opacity:null==n?void 0:n.opacity,roughness:null==n?void 0:n.roughness});return Ee(t)&&(Yr(t,{fontSize:(null==n?void 0:n.fontSize)||o.n5,fontFamily:(null==n?void 0:n.fontFamily)||o.rk,textAlign:(null==n?void 0:n.textAlign)||o.Hg}),or(t)),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[zt]&&e.altKey&&e.code===Ct}),tu=e=>(0,x.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:ms}),nu=(dl({name:"toggleCanvasMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,x.jsx)(Za,{type:"button",icon:hs,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),dl({name:"toggleEditMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{visible:wa(n,_a(t)),type:"button",icon:os,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),dl({name:"toggleFullScreen",perform:()=>(yn()||document.documentElement.requestFullscreen(),yn()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===Et&&!e[zt]}),dl({name:"toggleShortcuts",perform:(e,t,n,r)=>{let{focusContainer:i}=r;return t.showHelpDialog&&i(),{appState:Object.assign(Object.assign({},t),{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,x.jsx)(tu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Bt}),(e,t)=>{const n=Ta(_a(e),t,!0);return n.length>=2&&!(e=>{if(e.length>=2){const t=e[0].groupIds;for(const n of t)if(e.reduce(((e,t)=>e&&ii(t,n)),!0))return!0}return!1})(n)}),ru=dl({name:"group",perform:(e,t)=>{const n=Ta(_a(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=ni(t);if(1===r.length){const i=r[0],o=new Set(oi(e,i).map((e=>e.id))),a=new Set(n.map((e=>e.id)));if(new Set([...Array.from(o),...Array.from(a)]).size===o.size)return{appState:t,elements:e,commitToHistory:!1}}const i=Gr(),o=Ln(n),a=e.map((e=>o.get(e.id)?Zr(e,{groupIds:ai(e.groupIds,i,t.editingGroupId)}):e)),s=oi(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!ii(e,i))),...s,...d];return{appState:Qr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>nu(e,t),keyTest:e=>!e.shiftKey&&e[zt]&&e.code===_t,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!nu(t,n),type:"button",icon:(0,x.jsx)(As,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(wn("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Ma(_a(t),n)})}}),iu=dl({name:"ungroup",perform:(e,t)=>{if(0===ni(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=e.map((e=>{const n=((e,t)=>e.filter((e=>!t[e])))(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:Zr(e,{groupIds:n})}));return{appState:ri(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_a(n)),elements:n,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[zt]&&e.code===_t,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>ni(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{type:"button",hidden:0===ni(n).length,icon:(0,x.jsx)(Ps,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(wn("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Ma(_a(t),n)})}});n(2789);const ou=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,x.jsx)("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:i,children:t})},au=(dl({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),La({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:e=>{let{appState:t,updateData:n,data:r}=e;const i=null==r?void 0:r.id;if(!i)return null;const o=t.collaborators.get(i);if(!o)return null;const{background:a,stroke:s}=ic(i,t),l=(e=>{if(!e)return"?";const t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();const n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()})(o.username);return(0,x.jsx)(ou,{color:a,border:s,onClick:()=>n(o.pointer),children:l})}}),dl({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Ta(_a(e),t,!0);return i.some((e=>"image"===e.type))?{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((e=>r.library.saveLibrary([{id:Gr(),status:"unpublished",elements:i.map(gi),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),su=e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())},lu=(e,t,n)=>{let{axis:r,position:i}=n;const o=nt(e),[a,s]="x"===r?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return"start"===i?Object.assign(Object.assign({},l),{[r]:t[a]-o[a]}):"end"===i?Object.assign(Object.assign({},l),{[r]:t[s]-o[s]}):Object.assign(Object.assign({},l),{[r]:(t[a]+t[s])/2-(o[a]+o[s])/2})},cu=(e,t)=>Ta(_a(e),t).length>1,du=(e,t,n)=>{const r=((e,t)=>{const n=su(e),r=nt(e);return n.flatMap((e=>{const n=lu(e,r,t);return e.map((e=>Zr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},uu=(dl({name:"alignTop",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===At,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ys,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(wn("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Ma(_a(t),n)})}}),dl({name:"alignBottom",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Tt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ws,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(wn("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Ma(_a(t),n)})}}),dl({name:"alignLeft",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Ot,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(ks,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(wn("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Ma(_a(t),n)})}}),dl({name:"alignRight",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[zt]&&e.shiftKey&&e.key===Lt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(_s,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(wn("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Ma(_a(t),n)})}}),dl({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(Cs,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Ma(_a(t),n)})}}),dl({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:du(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!cu(t,n),type:"button",icon:(0,x.jsx)(js,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Ma(_a(t),n)})}}),e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[...r,e])})),Array.from(t.values())}),hu=e=>{const[t,n,r,i]=Qe(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},pu=(e,t)=>Ta(_a(e),t).length>1,gu=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=hu(e),s=uu(e).map((e=>[e,hu(e)])).sort(((e,t)=>e[1][r]-t[1][r]));let l=0;for(const e of s)l+=e[1][o];const c=(a[o]-l)/(s.length-1);if(c<0){const e=s.findIndex((e=>e[1][n]===a[n])),o=s.findIndex((e=>e[1][i]===a[i])),l=(s[o][1][r]-s[e][1][r])/(s.length-1);let c=s[e][1][r];return s.flatMap(((n,i)=>{let[a,s]=n;const d={x:0,y:0};return i!==e&&i!==o&&(c+=l,d[t.axis]=c-s[r]),a.map((e=>Zr(e,{x:e.x+d.x,y:e.y+d.y})))}))}let d=a[n];return s.flatMap((e=>{let[r,i]=e;const a={x:0,y:0};return a[t.axis]=d-i[n],d+=c,d+=i[o],r.map((e=>Zr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Ta(_a(e),t),n),i=Ln(r);return e.map((e=>i.get(e.id)||e))},mu=(dl({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===St,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Es,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(wn("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Ma(_a(t),n)})}}),dl({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:gu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===Ct,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,x.jsx)(Za,{hidden:!pu(t,n),type:"button",icon:(0,x.jsx)(Ss,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(wn("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Ma(_a(t),n)})}}),dl({name:"flipHorizontal",perform:(e,t)=>({elements:bu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Ta(_a(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),fu=dl({name:"flipVertical",perform:(e,t)=>({elements:bu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Ta(_a(e),t).length)(e,t)}),bu=(e,t,n)=>{const r=Ta(_a(e),t);if(r.length>1)return e;const i=xu(r,t,n),o=Ln(i);return e.map((e=>o.get(e.id)||e))},xu=(e,t,n)=>(e.forEach((e=>{vu(e,t),"vertical"===n&&yu(e,Math.PI)})),e),vu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=sa(e.angle);let s=0;(je(e)||Se(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Yr(e,{angle:sa(0)});const l=_i(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Yr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)Lo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);Lo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,pa(e,!0,e,c?"nw":"ne",!1,d,u[1]),Yr(e,{width:i,height:o});let h=sa(2*Math.PI-a);h<0&&(h=sa(h+2*Math.PI)),Yr(e,{angle:h}),Yr(e,{x:n+s,y:r}),Yo(e)},yu=(e,t)=>{const n=e.x,r=e.y;let i=sa(e.angle+t);i<0&&(i=sa(2*Math.PI+i)),Yr(e,{angle:i}),Yr(e,{x:n,y:r})},wu=dl({name:"copy",perform:(e,t,n,r)=>(Bd(_a(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),ku=dl({name:"cut",perform:(e,t,n,r)=>(wu.perform(e,t,n,r),hl.perform(e,t,n,r)),contextItemLabel:"labels.cut",keyTest:e=>e[zt]&&e.code===jt}),_u=dl({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard-svg",i.length?i:_a(e),t,r.files,t),{commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsSvg"}),Eu=dl({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ta(_a(e),t,!0);try{return await Gd("clipboard",i.length?i:_a(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyToClipboardAsPng",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}),commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsPng",keyTest:e=>e.code===wt&&e.altKey&&e.shiftKey}),Su=dl({name:"gridMode",perform(e,t){return nc("view","mode","grid"),{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:o.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[zt]&&e.code===xt}),Cu=dl({name:"zenMode",perform(e,t){return nc("view","mode","zen"),{appState:Object.assign(Object.assign({},t),{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.zenModeEnabled,contextItemLabel:"buttons.zenMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===It}),ju=dl({name:"stats",perform(e,t){return{appState:Object.assign(Object.assign({},t),{showStats:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.showStats,contextItemLabel:"stats.title",keyTest:e=>!e[zt]&&e.altKey&&e.code===yt}),Iu=(e,t,n)=>{const r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){const i=n();if(null===i)return{commitToHistory:r};const o=Ln(e),a=i.elements,s=Ln(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Zr(o.get(e.id)||e,e))).concat(l.map((e=>Zr(e,{isDeleted:!0}))));return oa(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}};class Mu{constructor(e,t,n,r){this.actions={},this.renderAction=(e,t)=>{const n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&"PanelComponent"in this.actions[e]&&(!(e in n)||n[e])){const n=this.actions[e],r=n.PanelComponent,i=e=>{this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))};return(0,x.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:i,appProps:this.app.props,data:t})}return null},this.updater=t=>{if(!t||!("then"in t))return e(t);t.then((t=>e(t)))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach((e=>this.registerAction(e)))}handleKeyDown(e){const t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort(((e,t)=>(t.keyPriority||0)-(e.keyPriority||0))).filter((n=>(!(n.name in t)||t[n.name])&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted())));if(0===n.length)return!1;const{viewModeEnabled:r}=this.getAppState();return!(r&&!Object.values(o.EH).includes(n[0].name))&&(e.preventDefault(),this.updater(n[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}executeAction(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}const Tu=class{constructor(e){this.libraryCache=null,this.resetLibrary=async()=>{var e,t;await(null===(e=(t=this.app.props).onLibraryChange)||void 0===e?void 0:e.call(t,[])),this.libraryCache=[]},this.restoreLibraryItem=e=>{const t=_a(Yc(e.elements,null));return t.length?Object.assign(Object.assign({},e),{elements:t}):null},this.loadLibrary=()=>new Promise((async e=>{if(this.libraryCache)return e(JSON.parse(JSON.stringify(this.libraryCache)));try{const t=this.app.libraryItemsFromStorage;if(!t)return e([]);const n=t.reduce(((e,t)=>(this.restoreLibraryItem(t)&&e.push(t),e)),[]);this.libraryCache=JSON.parse(JSON.stringify(n)),e(n)}catch(t){console.error(t),e([])}})),this.saveLibrary=async e=>{const t=this.libraryCache;try{var n,r;const t=JSON.stringify(e);this.libraryCache=JSON.parse(t),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,e))}catch(e){throw this.libraryCache=t,e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await nd(e);if(!n||!n.libraryItems&&!n.library)return;const r=(e,t)=>!e.find((e=>e.elements.length===t.elements.length&&e.elements.every(((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)))),i=await this.loadLibrary(),o=n.libraryItems||n.library||[],a=Xc(o,t),s=[];for(const e of a){const t=this.restoreLibraryItem(e);t&&r(i,t)&&s.push(t)}await this.saveLibrary([...s,...i])}},Ou=e=>{const t=Array.from(e.values());return{x:Au(t,(e=>e.x))/t.length,y:Au(t,(e=>e.y))/t.length}},Lu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Au=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Pu=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Du=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Pu(e),elements:t.reduce(((t,n)=>{if(je(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Object.assign(Object.assign({},n),{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}hydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.parse(t),elements:n.map((e=>{var t;const n=null===(t=this.elementCache.get(e.id))||void 0===t?void 0:t.get(e.versionNonce);if(!n)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return n}))}}dehydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.stringify(t),elements:n.map((e=>{this.elementCache.has(e.id)||this.elementCache.set(e.id,new Map);const t=this.elementCache.get(e.id);return t.has(e.versionNonce)||t.set(e.versionNonce,gi(e)),{id:e.id,versionNonce:e.versionNonce}}))}}getSnapshotForTest(){return{recording:this.recording,stateHistory:this.stateHistory.map((e=>this.hydrateHistoryEntry(e))),redoStack:this.redoStack.map((e=>this.hydrateHistoryEntry(e)))}}clear(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}shouldCreateEntry(e){const{lastEntry:t}=this;if(!t)return!0;if(e.elements.length!==t.elements.length)return!0;for(let n=e.elements.length-1;n>-1;n--){const r=e.elements[n],i=t.elements[n];if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}let n;for(n in e.appState){var r,i;if("editingLinearElement"===n)if((null===(r=e.appState[n])||void 0===r?void 0:r.elementId)===(null===(i=t.appState[n])||void 0===i?void 0:i.elementId))continue;if("selectedElementIds"!==n&&"selectedGroupIds"!==n&&e.appState[n]!==t.appState[n])return!0}return!1}pushEntry(e,t){const n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}clearRedoStack(){this.redoStack.splice(0,this.redoStack.length)}redoOnce(){if(0===this.redoStack.length)return null;const e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}undoOnce(){if(1===this.stateHistory.length)return null;const e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}setCurrentState(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}resumeRecording(){this.recording=!0}record(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}},zu=[{icon:(0,x.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,x.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:en},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:$t},{icon:(0,x.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,x.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Vt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Kt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,x.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:Wt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 6 6",children:(0,x.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[qt,Yt]},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:tn},{icon:(0,x.jsx)("svg",{viewBox:"0 0 448 512",children:(0,x.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:Qt},{icon:(0,x.jsx)("svg",{viewBox:"0 0 512 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}];n(1292);const Nu={cut:[wn("CtrlOrCmd+X")],copy:[wn("CtrlOrCmd+C")],paste:[wn("CtrlOrCmd+V")],copyStyles:[wn("CtrlOrCmd+Alt+C")],pasteStyles:[wn("CtrlOrCmd+Alt+V")],selectAll:[wn("CtrlOrCmd+A")],deleteSelectedElements:[wn("Del")],duplicateSelection:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))],sendBackward:[wn("CtrlOrCmd+[")],bringForward:[wn("CtrlOrCmd+]")],sendToBack:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[wn("Shift+Alt+C")],copyAsSvg:[],group:[wn("CtrlOrCmd+G")],ungroup:[wn("CtrlOrCmd+Shift+G")],gridMode:[wn("CtrlOrCmd+'")],zenMode:[wn("Alt+Z")],stats:[wn("Alt+/")],addToLibrary:[],flipHorizontal:[wn("Shift+H")],flipVertical:[wn("Shift+V")],viewMode:[wn("Alt+R")]},Ru=e=>{const t=Nu[e];return t&&t.length>0?t[0]:""},Hu=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a}=e;return(0,x.jsx)(Ol,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,children:(0,x.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,x.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name,s=e.contextItemLabel?b(e.contextItemLabel):"";return(0,x.jsx)("li",{"data-testid":i,onClick:n,children:(0,x.jsxs)("button",{className:ye("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:()=>o.executeAction(e),children:[(0,x.jsx)("div",{className:"context-menu-option__label",children:s}),(0,x.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?Ru(i):""})]})},t)}))})})},Bu=new WeakMap,Fu={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,at.render)((0,x.jsx)(Hu,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=Bu.get(e);t&&((0,at.unmountComponentAtNode)(t),t.remove(),Bu.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState}),(e=>{let t=Bu.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),Bu.set(e,t),t)})(e.container))}},Uu=e=>{var t;let{appState:n,elements:r,renderAction:i,elementType:o}=e;const a=Oa(_a(r),n),s=Boolean(n.editingElement),l=Gh(),c="rtl"===document.documentElement.getAttribute("dir"),d=Pa(o)||a.some((e=>Pa(e.type)&&!Mn(e.backgroundColor))),u=Pa(o)||a.some((e=>Pa(e.type)));let h=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==h){h=null;break}return(0,x.jsxs)("div",{className:"panelColumn",children:[(Da(o)&&"image"!==o&&"image"!==h||a.some((e=>Da(e.type))))&&i("changeStrokeColor"),u&&i("changeBackgroundColor"),d&&i("changeFillStyle"),(za(o)||a.some((e=>za(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Na(o)||a.some((e=>Na(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Ra(o)||a.some((e=>Ra(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeSharpness")}),(Ha(o)||a.some((e=>Ha(e.type))))&&(0,x.jsxs)(x.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),(Ba(o)||a.some((e=>Ba(e.type))))&&(0,x.jsx)(x.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.layers")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.align")}),(0,x.jsxs)("div",{className:"buttonList",children:[c?(0,x.jsxs)(x.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,x.jsxs)(x.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,x.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&!s&&a.length>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.actions")}),(0,x.jsxs)("div",{className:"buttonList",children:[i("duplicateSelection"),i("deleteSelectedElements"),i("group"),i("ungroup")]})]})]})},Wu=e=>{let{canvas:t,elementType:n,setAppState:r,onImageAction:i}=e;return(0,x.jsx)(x.Fragment,{children:zu.map(((e,o)=>{let{value:a,icon:s,key:l}=e;const c=b("toolBar.".concat(a)),d=l&&("string"==typeof l?l:l[0]),u=d?"".concat(un(d)," ").concat(b("helpDialog.or")," ").concat(o+1):"".concat(o+1);return(0,x.jsx)(Za,{className:"Shape",type:"radio",icon:s,checked:n===a,name:"editor-current-shape",title:"".concat(un(c)," — ").concat(u),keyBindingLabel:"".concat(o+1),"aria-label":un(c),"aria-keyshortcuts":u,"data-testid":a,onChange:e=>{let{pointerType:n}=e;r({elementType:a,multiElement:null,selectedElementIds:{}}),vn(t,a),"image"===a&&i({pointerType:n})}},a)}))})},Vu=e=>{let{renderAction:t,zoom:n}=e;return(0,x.jsx)(qd,{gap:1,children:(0,x.jsxs)(Zd,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},Ku=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,x.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const Gu=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(Za,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:Is,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:Gh(),children:n>0&&(0,x.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},Yu=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=Zh(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,x.jsx)(x.Fragment,{children:o&&(0,x.jsx)(Zl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,x.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const Zu="filter"in document.createElement("canvas").getContext("2d"),qu=()=>(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{children:b("canvasError.cannotShowPreview")}),(0,x.jsx)("p",{children:(0,x.jsx)("span",{children:b("canvasError.canvasTooBig")})}),(0,x.jsxs)("em",{children:["(",b("canvasError.canvasTooBigTip"),")"]})]}),Xu=(e,t)=>{(0,at.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,at.render)((0,x.jsx)(qu,{}),t)},$u=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,x.jsx)("button",{className:"ExportDialog-imageExportButton",style:{"--button-color":rt[i][o],"--button-color-darker":rt[i][o+1],"--button-color-darkest":rt[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},Ju=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Ma(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,v=h?Ta(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&fd(v,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>rd(t).then((()=>{Xu(t,e)})))).catch((t=>{console.error(t),Xu(new Ka,e)}))}),[n,i,v,m,a,f]),(0,x.jsxs)("div",{className:"ExportDialog",children:[(0,x.jsx)("div",{className:"ExportDialog__preview",ref:g}),Zu&&s.renderAction("exportWithDarkMode"),(0,x.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,x.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,x.jsx)(Yd,{checked:h,onChange:e=>p(e),children:b("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,x.jsx)(Zd,{gap:2,children:s.renderAction("changeExportScale")}),(0,x.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,x.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Hc&&s.renderAction("changeProjectName")}),(0,x.jsxs)(Zd,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,x.jsx)($u,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(v),children:"PNG"}),(0,x.jsx)($u,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(v),children:"SVG"}),Hd&&(0,x.jsx)($u,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(v),color:"gray",shade:7,children:rs})]})]})},Qu=e=>{let{elements:t,appState:n,files:a,exportPadding:s=o.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,r.useState)(!1),g=i().useCallback((()=>{p(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:ss,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:Gh(),title:b("buttons.exportImage")}),h&&(0,x.jsx)(Zl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,x.jsx)(Ju,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const eh=e=>{let{children:t,side:n,className:r}=e;return(0,x.jsx)("div",{className:ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const th=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{elementType:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if("arrow"===i||"line"===i)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i)return b("hints.freeDraw");if("text"===i)return b("hints.text");if("image"===t.elementType&&t.pendingImageElement)return b("hints.placeImage");const c=Ta(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):_e(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length){if(je(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?b("hints.lineEditor_pointSelected"):b("hints.lineEditor_nothingSelected"):b("hints.lineEditor_info");if(null!=(d=c[0])&&("rectangle"===d.type||"diamond"===d.type||"ellipse"===d.type||"image"===d.type))return b("hints.bindTextToElement")}var d;return 1===c.length&&Ee(c[0])?b("hints.text_selected"):t.editingElement&&Ee(t.editingElement)?b("hints.text_editing"):"selection"!==i||c.length||r?null:b("hints.canvasPanning")})({appState:t,elements:n,isMobile:r});return i?(i=wn(i),(0,x.jsx)("div",{className:"HintViewer",children:(0,x.jsx)("span",{children:i})})):null},nh={CHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,x.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,x.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,x.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})},rh=e=>(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:e.checked?nh.CHECKED:nh.UNCHECKED})]});var ih=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const oh=e=>{let{heading:t,children:n}=e,r=ih(e,["heading","children"]);const{id:i}=Zh(),o=(0,x.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:b("headings.".concat(t))});return(0,x.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,x.jsxs)(x.Fragment,{children:[o,n]})}))};n(580);const ah=e=>{let{children:t,className:n,mobile:r}=e;return(0,x.jsx)("div",{className:ye("UserList",n,{UserList_mobile:r}),children:t})},sh=(0,x.jsx)("svg",{viewBox:"0 0 576 512",children:(0,x.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),lh=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,x.jsxs)("label",{className:ye("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(un(b("toolBar.library"))," — 0"),children:[(0,x.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":un(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,x.jsx)("div",{className:"ToolIcon__icon",children:sh})]})},ch=e=>{let{appState:t,elements:n,libraryMenu:r,actionManager:o,renderJSONExportDialog:a,renderImageExportDialog:s,setAppState:l,onCollabButtonClick:c,onLockToggle:d,canvas:u,isCollaborating:h,renderCustomFooter:p,viewModeEnabled:g,showThemeBtn:m,onImageAction:f,renderTopRightUI:v}=e;return(0,x.jsxs)(x.Fragment,{children:[!g&&(0,x.jsxs)(eh,{side:"top",className:"App-top-bar",children:[(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"center",children:[(0,x.jsxs)(Zd,{gap:1,className:"App-toolbar-container",children:[(0,x.jsxs)(Kl,{padding:1,className:"App-toolbar",children:[e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Wu,{canvas:u,elementType:t.elementType,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;f({insertOnCanvasDirectly:"mouse"!==t})}})})]}),v&&v(!0,t),(0,x.jsx)(rh,{checked:t.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,x.jsx)(lh,{appState:t,setAppState:l,isMobile:!0})]}),r]})}),(0,x.jsx)(th,{appState:t,elements:n,isMobile:!0})]}),(0,x.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,x.jsxs)(Kl,{padding:0,children:["canvas"===t.openMenu?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,x.jsx)("div",{className:"panelColumn",children:(0,x.jsxs)(qd,{gap:4,children:[g?(0,x.jsxs)(x.Fragment,{children:[a(),s()]}):(0,x.jsxs)(x.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,x.jsx)(Gu,{isCollaborating:h,collaboratorCount:t.collaborators.size,onClick:c}),(0,x.jsx)(Ku,{actionManager:o,appState:t,setAppState:l,showThemeBtn:m})]}),null==p?void 0:p(!0,t),t.collaborators.size>0&&(0,x.jsxs)("fieldset",{children:[(0,x.jsx)("legend",{children:b("labels.collaborators")}),(0,x.jsx)(ah,{mobile:!0,children:Array.from(t.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[t,n]=e;return(0,x.jsx)(i().Fragment,{children:o.renderAction("goToCollaborator",{id:t})},t)}))})]})]})})}):"shape"===t.openMenu&&!g&&wa(t,n)?(0,x.jsx)(oh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,x.jsx)(Uu,{appState:t,elements:n,renderAction:o.renderAction,elementType:t.elementType})}):null,(0,x.jsxs)("footer",{className:"App-toolbar",children:[g?(0,x.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,x.jsxs)("div",{className:"App-toolbar-content",children:[o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(t.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),t.scrolledOutside&&!t.openMenu&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},Aa(n,t)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const dh=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=Pd(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},null),o.appendChild(r),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(r)}}),[e.spreadsheet,e.chartType,e.selected]),(0,x.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,x.jsx)("div",{ref:t})})},uh=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),nc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,x.jsx)(Zl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,x.jsxs)("div",{className:"container",children:[(0,x.jsx)(dh,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,x.jsx)(dh,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const hh=()=>(0,x.jsxs)("div",{className:"HelpDialog--header",children:[(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.documentation")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.blog")}),(0,x.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.github")})]}),ph=e=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("h3",{children:e.title}),e.children]}),gh=e=>(0,x.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),mh=e=>(0,x.jsx)("div",{style:{width:"49%"},children:e.children}),fh=e=>(0,x.jsxs)("div",{className:"HelpDialog--island",children:[(0,x.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),bh=e=>(0,x.jsx)("div",{className:"HelpDialog--shortcut",children:(0,x.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,x.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,x.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,x.jsxs)(i().Fragment,{children:[(0,x.jsx)(xh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});bh.defaultProps={isOr:!0};const xh=e=>(0,x.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),vh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(Zl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,x.jsx)(hh,{}),(0,x.jsx)(ph,{title:b("helpDialog.shortcuts"),children:(0,x.jsxs)(gh,{children:[(0,x.jsxs)(mh,{children:[(0,x.jsxs)(fh,{caption:b("helpDialog.shapes"),children:[(0,x.jsx)(bh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,x.jsx)(bh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,x.jsx)(bh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,x.jsx)(bh,{label:b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,x.jsx)(bh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,x.jsx)(bh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,x.jsx)(bh,{label:b("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,x.jsx)(bh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,x.jsx)(bh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,x.jsx)(bh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,x.jsx)(bh,{label:b("helpDialog.editSelectedShape"),shortcuts:[wn("Enter"),b("helpDialog.doubleClick")]}),(0,x.jsx)(bh,{label:b("helpDialog.textNewLine"),shortcuts:[wn("Enter"),wn("Shift+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.textFinish"),shortcuts:[wn("Esc"),wn("CtrlOrCmd+Enter")]}),(0,x.jsx)(bh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,x.jsx)(bh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,x.jsx)(bh,{label:b("helpDialog.preventBinding"),shortcuts:[wn("CtrlOrCmd")]})]}),(0,x.jsxs)(fh,{caption:b("helpDialog.view"),children:[(0,x.jsx)(bh,{label:b("buttons.zoomIn"),shortcuts:[wn("CtrlOrCmd++")]}),(0,x.jsx)(bh,{label:b("buttons.zoomOut"),shortcuts:[wn("CtrlOrCmd+-")]}),(0,x.jsx)(bh,{label:b("buttons.resetZoom"),shortcuts:[wn("CtrlOrCmd+0")]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,x.jsx)(bh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,x.jsx)(bh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,x.jsx)(bh,{label:b("buttons.zenMode"),shortcuts:[wn("Alt+Z")]}),(0,x.jsx)(bh,{label:b("labels.showGrid"),shortcuts:[wn("CtrlOrCmd+'")]}),(0,x.jsx)(bh,{label:b("labels.viewMode"),shortcuts:[wn("Alt+R")]}),(0,x.jsx)(bh,{label:b("labels.toggleTheme"),shortcuts:[wn("Alt+Shift+D")]}),(0,x.jsx)(bh,{label:b("stats.title"),shortcuts:[wn("Alt+/")]})]})]}),(0,x.jsx)(mh,{children:(0,x.jsxs)(fh,{caption:b("helpDialog.editor"),children:[(0,x.jsx)(bh,{label:b("labels.selectAll"),shortcuts:[wn("CtrlOrCmd+A")]}),(0,x.jsx)(bh,{label:b("labels.multiSelect"),shortcuts:[wn("Shift+".concat(b("helpDialog.click")))]}),(0,x.jsx)(bh,{label:b("labels.moveCanvas"),shortcuts:[wn("Space+".concat(b("helpDialog.drag"))),wn("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,x.jsx)(bh,{label:b("labels.cut"),shortcuts:[wn("CtrlOrCmd+X")]}),(0,x.jsx)(bh,{label:b("labels.copy"),shortcuts:[wn("CtrlOrCmd+C")]}),(0,x.jsx)(bh,{label:b("labels.paste"),shortcuts:[wn("CtrlOrCmd+V")]}),(0,x.jsx)(bh,{label:b("labels.copyAsPng"),shortcuts:[wn("Shift+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.copyStyles"),shortcuts:[wn("CtrlOrCmd+Alt+C")]}),(0,x.jsx)(bh,{label:b("labels.pasteStyles"),shortcuts:[wn("CtrlOrCmd+Alt+V")]}),(0,x.jsx)(bh,{label:b("labels.delete"),shortcuts:[wn("Del")]}),(0,x.jsx)(bh,{label:b("labels.sendToBack"),shortcuts:[wn(st?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,x.jsx)(bh,{label:b("labels.bringToFront"),shortcuts:[wn(st?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,x.jsx)(bh,{label:b("labels.sendBackward"),shortcuts:[wn("CtrlOrCmd+[")]}),(0,x.jsx)(bh,{label:b("labels.bringForward"),shortcuts:[wn("CtrlOrCmd+]")]}),(0,x.jsx)(bh,{label:b("labels.alignTop"),shortcuts:[wn("CtrlOrCmd+Shift+Up")]}),(0,x.jsx)(bh,{label:b("labels.alignBottom"),shortcuts:[wn("CtrlOrCmd+Shift+Down")]}),(0,x.jsx)(bh,{label:b("labels.alignLeft"),shortcuts:[wn("CtrlOrCmd+Shift+Left")]}),(0,x.jsx)(bh,{label:b("labels.alignRight"),shortcuts:[wn("CtrlOrCmd+Shift+Right")]}),(0,x.jsx)(bh,{label:b("labels.duplicateSelection"),shortcuts:[wn("CtrlOrCmd+D"),wn("Alt+".concat(b("helpDialog.drag")))]}),(0,x.jsx)(bh,{label:b("buttons.undo"),shortcuts:[wn("CtrlOrCmd+Z")]}),(0,x.jsx)(bh,{label:b("buttons.redo"),shortcuts:lt?[wn("CtrlOrCmd+Y"),wn("CtrlOrCmd+Shift+Z")]:[wn("CtrlOrCmd+Shift+Z")]}),(0,x.jsx)(bh,{label:b("labels.group"),shortcuts:[wn("CtrlOrCmd+G")]}),(0,x.jsx)(bh,{label:b("labels.ungroup"),shortcuts:[wn("CtrlOrCmd+Shift+G")]}),(0,x.jsx)(bh,{label:b("labels.flipHorizontal"),shortcuts:[wn("Shift+H")]}),(0,x.jsx)(bh,{label:b("labels.flipVertical"),shortcuts:[wn("Shift+V")]}),(0,x.jsx)(bh,{label:b("labels.showStroke"),shortcuts:[wn("S")]}),(0,x.jsx)(bh,{label:b("labels.showBackground"),shortcuts:[wn("G")]})]})})]})})]})})};n(5080);const yh=e=>{let{children:t,color:n}=e;return(0,x.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":rt[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":rt[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":rt[n][9]},children:t})},wh=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,x.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,x.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,x.jsxs)(yh,{color:"lime",children:[(0,x.jsx)("div",{className:"Card-icon",children:ls}),(0,x.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,x.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!Hc&&i.renderAction("changeProjectName")]}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction($d)}})]}),s&&(0,x.jsxs)(yh,{color:"pink",children:[(0,x.jsx)("div",{className:"Card-icon",children:Qa}),(0,x.jsx)("h2",{children:b("exportDialog.link_title")}),(0,x.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,x.jsx)(Za,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>s(t,n,r,a)})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},kh=e=>{let{elements:t,appState:n,files:o,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,r.useState)(!1),u=i().useCallback((()=>{d(!1)}),[]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{onClick:()=>{d(!0)},"data-testid":"json-export-button",icon:as,type:"button","aria-label":b("buttons.export"),showAriaLabel:Gh(),title:b("buttons.export")}),c&&(0,x.jsx)(Zl,{onCloseRequest:u,title:b("buttons.export"),children:(0,x.jsx)(wh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},_h=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=qc({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return fd(_a(a),Object.assign(Object.assign({},s),{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:l,viewBackgroundColor:c},((e,t)=>{var n;const r=document.createElement("canvas");if(i){"function"==typeof o&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");const n=Math.max(e,t),a=i/n;return r.width=e*a,r.height=t*a,{canvas:r,scale:a}}const a=(null==o?void 0:o(e,t))||{width:e,height:t};return r.width=a.width,r.height=a.height,{canvas:r,scale:null!==(n=a.scale)&&void 0!==n?n:1}}))},Eh=async e=>{var t;let{mimeType:n=o.LO.png,quality:r}=e;n===o.LO.png&&"number"==typeof r&&console.warn('"quality" will be ignored for "'.concat(o.LO.png,'" mimeType')),"image/jpg"===n&&(n=o.LO.jpg),n!==o.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(o.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const i=await _h(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Sh=async e=>{let{elements:t,appState:n=Pn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=qc({elements:t,appState:n},null,null);return bd(_a(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)};n(9295),n(9781);const Ch=e=>{let{libItem:t,appState:n,index:i,onChange:o,onRemove:a}=e;const s=(0,r.useRef)(null),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Sh({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:rt.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,x.jsxs)("div",{className:"single-library-item",children:[(0,x.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,x.jsx)(Za,{"aria-label":b("buttons.remove"),type:"button",icon:Ms,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:b("buttons.remove")}),(0,x.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,x.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,x.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,x.jsx)("span",{style:{fontWeight:500,color:rt.gray[6]},children:b("publishDialog.itemName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,i)}})]}),(0,x.jsx)("span",{className:"error",children:t.error})]})]})},jh="publish-library-data",Ih=async e=>{const t=128,n=Math.round(8),r=Math.max(Math.round(2),2),i=((e,t)=>{if(!e.length||t<1)return[];let n=0,r=0;const i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i})(e,6),a=document.createElement("canvas");a.width=i[0].length*t+(i[0].length+1)*(2*n)-2*n,a.height=i.length*t+(i.length+1)*(2*n)-2*n;const s=a.getContext("2d");s.fillStyle=rt.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await _h({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(i/6)*(t+2*n),d=i%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=r,s.strokeStyle=rt.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await ad(new File([await rd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Mh=e=>{let{onClose:t,libraryItems:n,appState:i,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,r.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(jh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,m]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{m(n.slice())}),[n]);const f=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},v=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(jh,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,x.jsx)(Zl,{onCloseRequest:v,title:b("publishDialog.title"),className:"publish-library",children:y?(0,x.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=b("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return m(t),void p(!1);const r=await Ih(g),i={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:g},l=JSON.stringify(i,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",d.name),u.append("authorName",d.authorName),u.append("githubHandle",d.githubHandle),u.append("name",d.name),u.append("description",d.description),u.append("twitterHandle",d.twitterHandle),u.append("website",d.website),fetch("".concat("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries","/submit"),{method:"post",body:u}).then((e=>e.ok?e.json().then((e=>{let{url:t}=e;localStorage.removeItem(jh),a({url:t,authorName:d.authorName,items:g})})):e.json().catch((()=>{throw new Error(e.statusText||"something went wrong")})).then((t=>{throw new Error(t.message||e.statusText||"something went wrong")}))),(e=>{console.error(e),s(e),p(!1)})).catch((e=>{console.error(e),s(e),p(!1)}))},children:[(0,x.jsxs)("div",{className:"publish-library-note",children:[b("publishDialog.noteDescription.pre"),(0,x.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteDescription.link")})," ",b("publishDialog.noteDescription.post")]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteGuidelines.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteGuidelines.link")}),b("publishDialog.noteGuidelines.post")]}),(0,x.jsx)("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,x.jsx)("div",{className:"single-library-item-wrapper",children:(0,x.jsx)(Ch,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,m(n)},onRemove:c})},n))})),(0,x.jsx)("div",{className:"selected-library-items",children:e})})(),(0,x.jsxs)("div",{className:"publish-library__fields",children:[(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:f,placeholder:b("publishDialog.placeholder.libraryName")})]}),(0,x.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.libraryDesc")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:f,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),(0,x.jsxs)("label",{children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{children:b("publishDialog.authorName")}),(0,x.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,x.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:f,placeholder:b("publishDialog.placeholder.authorName")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.githubUsername")}),(0,x.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:f,placeholder:b("publishDialog.placeholder.githubHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.twitterUsername")}),(0,x.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:f,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),(0,x.jsxs)("label",{children:[(0,x.jsx)("span",{children:b("publishDialog.website")}),(0,x.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:d.website,onChange:f,placeholder:b("publishDialog.placeholder.website")})]}),(0,x.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteLicense.pre"),(0,x.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteLicense.link")}),b("publishDialog.noteLicense.post")]})]}),(0,x.jsxs)("div",{className:"publish-library__buttons",children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:v,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,x.jsx)(Za,{type:"submit",title:b("buttons.submit"),"aria-label":b("buttons.submit"),label:b("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,x.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})};n(4406);var Th=n(2891);n(694);const Oh=(0,x.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,x.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),Lh=e=>{let{id:t,elements:n,files:i,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await bd(n,{exportBackground:!1,viewBackgroundColor:rt.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=Gh(),g=a&&(0,x.jsx)("div",{className:"library-unit__adder",children:Oh});return(0,x.jsxs)("div",{className:ye("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,x.jsx)("div",{className:ye("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!n,onClick:n||a?e=>{t&&e.shiftKey?c(t,e):s()}:void 0,onDragStart:e=>{h(!1),e.dataTransfer.setData(o.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,x.jsx)(Yd,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const Ah=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:i,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:m,onPublish:f,resetLibrary:v}=e;const y=(0,r.useCallback)((()=>{const e=g.length?b("alerts.removeItemsFromsLibrary",{count:g.length}):b("alerts.resetLibrary"),t=g.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return(0,x.jsx)(Xl,{onConfirm:()=>{g.length?n():v(),k(!1)},onCancel:()=>{k(!1)},title:t,children:(0,x.jsx)("p",{children:e})})}),[g,n,v]),[w,k]=(0,r.useState)(!1),_=Gh(),E=_?4:6,S=d||window.location.origin+window.location.pathname,C=g.some((e=>{var n;return"published"===(null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.status)})),j=e=>{var t,n,r,i,o;return(0,x.jsx)(qd,{children:(0,x.jsx)(Lh,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:h,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||(()=>{}),id:(null===(i=e.item)||void 0===i?void 0:i.id)||null,selected:!(null===(o=e.item)||void 0===o||!o.id)&&g.includes(e.item.id),onToggle:(e,t)=>{m(e,t)}})},e.key)},I=e=>{const t=e.map((e=>e.id?j({item:e,onClick:()=>a(e.elements),key:e.id}):j({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,Th.chunk)(t,E);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(E-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,x.jsx)(Zd,{align:"center",gap:1,children:e},t))))},M=t.filter((e=>"published"===e.status)),T=[...s.length?[{id:null,elements:s}]:[],...t.filter((e=>"published"!==e.status))];return(0,x.jsxs)("div",{className:"library-menu-items-container",children:[w&&y(),(0,x.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,r=b(e?"buttons.remove":"buttons.resetLibrary");return(0,x.jsxs)("div",{className:"library-actions",children:[(!e||!_)&&(0,x.jsx)(Za,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:ns,onClick:()=>{(async e=>{const t=await Uc({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Za,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:ls,onClick:async()=>{(async e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e},n=JSON.stringify(t,null,2);await Wc(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(In).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--export",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,x.jsx)(Za,{type:"button",title:r,"aria-label":r,icon:is,onClick:()=>k(!0),className:"library-actions--remove",children:g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!C&&(0,x.jsx)(Vl,{label:b("hints.publishLibrary"),children:(0,x.jsxs)(Za,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:ll,className:"library-actions--publish",onClick:f,children:[!_&&(0,x.jsx)("label",{children:b("buttons.publishLibrary")}),g.length>0&&(0,x.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,x.jsx)("a",{href:"".concat("https://libraries.excalidraw.com","?target=").concat(window.name||"_blank","&referrer=").concat(S,"&useHash=true&token=").concat(p,"&theme=").concat(l,"&version=").concat(o.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:b("labels.libraries")})]},"library-header"),(0,x.jsxs)(qd,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"separator",children:b("labels.personalLib")}),I(T)]}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),I(M)]})]})]})},Ph=(e,t)=>e.filter((e=>t.includes(e.id))),Dh=e=>{let{onClose:t,onInsertShape:n,pendingElements:i,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const m=(0,r.useRef)(null);((e,t)=>{(0,r.useEffect)((()=>{const n=n=>{e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),()=>{document.removeEventListener("pointerdown",n)}}),[e,t])})(m,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,r.useEffect)((()=>{const e=e=>{e.key===Ht&&t()};return document.addEventListener(o.Ks.KEYDOWN,e),()=>{document.removeEventListener(o.Ks.KEYDOWN,e)}}),[t]);const[f,v]=(0,r.useState)([]),[y,w]=(0,r.useState)("preloading"),[k,_]=(0,r.useState)([]),[E,S]=(0,r.useState)(!1),[C,j]=(0,r.useState)(null),I=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{I.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{v(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(I.current)})),[h]);const M=(0,r.useCallback)((async()=>{const e=await h.loadLibrary(),t=e.filter((e=>!k.includes(e.id)));h.saveLibrary(t).catch((t=>{v(e),l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),_([]),v(t)}),[h,l,k,_]),T=(0,r.useCallback)((()=>{h.resetLibrary(),v([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const t=await h.loadLibrary(),n=[{status:"unpublished",elements:e,id:Gr(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((e=>{v(t),l({errorMessage:b("alerts.errorAddingToLibrary")})})),v(n)}),[a,h,l]),L=(0,r.useCallback)((()=>(0,x.jsxs)(Zl,{onCloseRequest:()=>j(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,x.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:C.authorName})," ",(0,x.jsx)("a",{href:null==C?void 0:C.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,x.jsx)(Za,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>j(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[j,C]),A=(0,r.useCallback)((e=>{S(!1),j({url:e.url,authorName:e.authorName});const t=f.slice();t.forEach((e=>{k.includes(e.id)&&(e.status="published")})),h.saveLibrary(t),v(t)}),[S,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,x.jsxs)(Kl,{padding:1,ref:m,className:"layer-ui__library",children:[E&&(0,x.jsx)(Mh,{onClose:()=>S(!1),libraryItems:Ph(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>_(k.filter((t=>t!==e)))}),C&&L(),"loading"===y?(0,x.jsx)("div",{className:"layer-ui__library-message",children:b("labels.libraryLoadingMessage")}):(0,x.jsx)(Ah,{libraryItems:f,onRemoveFromLibrary:M,onAddToLibrary:O,onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:k,onToggle:(e,t)=>{if(!k.includes(e)){if(t.shiftKey&&P){const t=f.findIndex((e=>e.id===P)),n=f.findIndex((t=>t.id===e));if(-1===t||-1===n)return void _([...k,e]);const r=Ln(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);_(i)}else _([...k,e]);D(e)}else D(null),_(k.filter((t=>t!==e)))},onPublish:()=>S(!0),resetLibrary:T})]})};n(3336),n(276);var zh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Nh=e=>{let{actionManager:t,appState:n,files:i,setAppState:a,canvas:s,elements:l,onCollabButtonClick:c,onLockToggle:d,onInsertElements:u,zenModeEnabled:h,showExitZenModeBtn:p,showThemeBtn:g,toggleZenMode:m,isCollaborating:f,renderTopRightUI:y,renderCustomFooter:w,viewModeEnabled:k,libraryReturnUrl:_,UIOptions:E,focusContainer:S,library:C,id:j,onImageAction:I}=e;const M=Gh(),T=()=>E.canvasActions.export?(0,x.jsx)(kh,{elements:l,appState:n,files:i,actionManager:t,exportOpts:E.canvasActions.export,canvas:s}):null,O=()=>{if(!E.canvasActions.saveAsImage)return null;const e=e=>async t=>{const r=await Gd(e,t,n,i,{exportBackground:n.exportBackground,name:n.name,viewBackgroundColor:n.viewBackgroundColor}).catch(In).catch((e=>{console.error(e),a({errorMessage:e.message})}));n.exportEmbedScene&&r&&Qc(r)&&a({fileHandle:r})};return(0,x.jsx)(Qu,{elements:l,appState:n,files:i,actionManager:t,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},L=()=>(0,x.jsx)("div",{style:{width:".625em"}}),A=(0,r.useCallback)((()=>{!!document.querySelector(".Dialog")||a({isLibraryOpen:!1})}),[a]),P=(0,r.useCallback)((()=>{a({selectedElementIds:{},selectedGroupIds:{}})}),[a]),D=n.isLibraryOpen?(0,x.jsx)(Dh,{pendingElements:Ta(l,n,!0),onClose:A,onInsertShape:u,onAddToLibrary:P,setAppState:a,libraryReturnUrl:_,focusContainer:S,library:C,theme:n.theme,files:i,id:j,appState:n}):null,z=(0,x.jsxs)(x.Fragment,{children:[n.isLoading&&(0,x.jsx)(v,{}),n.errorMessage&&(0,x.jsx)(Yu,{message:n.errorMessage,onClose:()=>a({errorMessage:null})}),n.showHelpDialog&&(0,x.jsx)(vh,{onClose:()=>{a({showHelpDialog:!1})}}),n.pasteDialog.shown&&(0,x.jsx)(uh,{setAppState:a,appState:n,onInsertChart:u,onClose:()=>a({pasteDialog:{shown:!1,data:null}})})]});return M?(0,x.jsxs)(x.Fragment,{children:[z,(0,x.jsx)(ch,{appState:n,elements:l,actionManager:t,libraryMenu:D,renderJSONExportDialog:T,renderImageExportDialog:O,setAppState:a,onCollabButtonClick:c,onLockToggle:d,canvas:s,isCollaborating:f,renderCustomFooter:w,viewModeEnabled:k,showThemeBtn:g,onImageAction:I,renderTopRightUI:y})]}):(0,x.jsxs)("div",{className:ye("layer-ui__wrapper",{"disable-pointerEvents":n.draggingElement||n.resizingElement||n.editingElement&&!Ee(n.editingElement)}),children:[z,(()=>{const e=wa(n,l);return(0,x.jsx)(eh,{side:"top",children:(0,x.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,x.jsxs)(qd,{gap:4,className:ye({"disable-pointerEvents":h}),children:[k?(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsx)(qd,{gap:4,children:(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[T(),O()]})})})}):(0,x.jsx)(oh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{padding:2,style:{zIndex:1},children:(0,x.jsxs)(qd,{gap:4,children:[(0,x.jsxs)(Zd,{gap:1,justifyContent:"space-between",children:[t.renderAction("clearCanvas"),(0,x.jsx)(L,{}),t.renderAction("loadScene"),T(),O(),(0,x.jsx)(L,{}),c&&(0,x.jsx)(Gu,{isCollaborating:f,collaboratorCount:n.collaborators.size,onClick:c})]}),(0,x.jsx)(Ku,{actionManager:t,appState:n,setAppState:a,showThemeBtn:g}),n.fileHandle&&(0,x.jsx)(x.Fragment,{children:t.renderAction("saveToActiveFile")})]})})}),e&&(0,x.jsx)(oh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":h}),children:(0,x.jsx)(Kl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(n.height-(n.fileHandle?248:200),"px")},children:(0,x.jsx)(Uu,{appState:n,elements:l,renderAction:t.renderAction,elementType:n.elementType})})})]}),!k&&(0,x.jsx)(oh,{heading:"shapes",children:e=>(0,x.jsxs)(qd,{gap:4,align:"start",children:[(0,x.jsxs)(Zd,{gap:1,className:ye("App-toolbar-container",{"zen-mode":h}),children:[(0,x.jsx)(rh,{zenModeEnabled:h,checked:n.elementLocked,onChange:d,title:b("toolBar.lock")}),(0,x.jsxs)(Kl,{padding:1,className:ye("App-toolbar",{"zen-mode":h}),children:[(0,x.jsx)(th,{appState:n,elements:l,isMobile:M}),e,(0,x.jsx)(Zd,{gap:1,children:(0,x.jsx)(Wu,{canvas:s,elementType:n.elementType,setAppState:a,onImageAction:e=>{let{pointerType:t}=e;I({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,x.jsx)(lh,{appState:n,setAppState:a})]}),D]})}),(0,x.jsxs)("div",{className:ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":h}),children:[(0,x.jsx)(ah,{children:n.collaborators.size>0&&Array.from(n.collaborators).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[n,r]=e;return(0,x.jsx)(Vl,{label:r.username||"Unknown user",children:t.renderAction("goToCollaborator",{id:n})},n)}))}),null==y?void 0:y(M,n)]})]})})})(),(0,x.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":h}),children:(0,x.jsx)(qd,{gap:2,children:(0,x.jsxs)(oh,{heading:"canvasActions",children:[(0,x.jsx)(Kl,{padding:1,children:(0,x.jsx)(Vu,{renderAction:t.renderAction,zoom:n.zoom})}),!k&&(0,x.jsxs)("div",{className:ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:[t.renderAction("undo",{size:"small"}),t.renderAction("redo",{size:"small"})]})]})})}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":h}),children:null==w?void 0:w(!1,n)}),(0,x.jsx)("div",{className:ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":h}),children:t.renderAction("toggleShortcuts")}),(0,x.jsx)("button",{className:ye("disable-zen-mode",{"disable-zen-mode--visible":p}),onClick:m,children:b("buttons.exitZenMode")})]}),n.scrolledOutside&&(0,x.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{a(Object.assign({},Aa(l,n)))},children:b("buttons.scrollBackToContent")})]})},Rh=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return zh(e,["suggestedBindings","startBoundElement"])},r=n(e.appState),i=n(t.appState),o=Object.keys(r);return e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&o.every((e=>r[e]===i[e]))},Hh=i().memo(Nh,Rh);n(1528);const Bh=e=>{var t;const n=Gh(),r=Qe(e.elements),i=Oa(e.elements,e.appState),o=Qe(i);return n&&e.appState.openMenu?null:(0,x.jsx)("div",{className:"Stats",children:(0,x.jsxs)(Kl,{padding:2,children:[(0,x.jsx)("div",{className:"close",onClick:e.onClose,children:Ms}),(0,x.jsx)("h3",{children:b("stats.title")}),(0,x.jsx)("table",{children:(0,x.jsxs)("tbody",{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.scene")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:e.elements.length})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.element")})}),i.length>1&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("tr",{children:(0,x.jsx)("th",{colSpan:2,children:b("stats.selected")})}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.elements")}),(0,x.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"x"}),(0,x.jsx)("td",{children:Math.round(o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:"y"}),(0,x.jsx)("td",{children:Math.round(o[1])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.width")}),(0,x.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.height")}),(0,x.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,x.jsxs)("tr",{children:[(0,x.jsx)("td",{children:b("stats.angle")}),(0,x.jsx)("td",{children:"".concat(Math.round(180*i[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})};n(9757);const Fh=e=>{let{message:t,clearToast:n}=e;const i=(0,r.useRef)(0),a=(0,r.useCallback)((()=>i.current=window.setTimeout((()=>n()),o.Lg)),[n]);return(0,r.useEffect)((()=>(a(),()=>clearTimeout(i.current))),[a,t]),(0,x.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==i?void 0:i.current),onMouseLeave:a,children:(0,x.jsx)("p",{className:"Toast__message",children:t})})},Uh=dl({name:"viewMode",perform(e,t){return nc("view","mode","view"),{appState:Object.assign(Object.assign({},t),{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.viewModeEnabled,contextItemLabel:"labels.viewMode",keyTest:e=>!e[zt]&&e.altKey&&e.code===Mt});var Wh=n(200),Vh=n.n(Wh);const Kh=i().createContext(!1),Gh=()=>(0,r.useContext)(Kh),Yh=i().createContext({container:null,id:null}),Zh=()=>(0,r.useContext)(Yh);let qh=!1,Xh=0,$h=0,Jh=0,Qh=!1,ep=!1,tp=!1,np={horizontal:null,vertical:null},rp=0,ip=!1,op=null;const ap={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class sp extends i().Component{constructor(e){super(e),lp.call(this);const t=Pn(),{excalidrawRef:n,viewModeEnabled:r=!1,zenModeEnabled:i=!1,gridModeEnabled:a=!1,theme:s=t.theme,name:l=t.name}=e;if(this.state=Object.assign(Object.assign(Object.assign(Object.assign({},t),{theme:s,isLoading:!0}),this.getCanvasOffsets()),{viewModeEnabled:r,zenModeEnabled:i,gridSize:a?o.k:null,name:l,width:window.innerWidth,height:window.innerHeight}),this.id=we(),n){var c;const e="current"in n&&(null===(c=n.current)||void 0===c?void 0:c.readyPromise)||(()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n})(),t={ready:!0,readyPromise:e,updateScene:this.updateScene,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,refresh:this.refresh,importLibrary:this.importLibraryFromUrl,setToastMessage:this.setToastMessage,id:this.id};"function"==typeof n?n(t):n.current=t,e.resolve(t)}var d;this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.scene=new ir,this.library=new Tu(this),this.history=new Du,this.actionManager=new Mu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(cl),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Iu(e,t,(()=>d.undoOnce())),keyTest:e=>e[zt]&&e.key.toLowerCase()===rn&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:ps,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",perform:(t,n)=>Iu(t,n,(()=>e.redoOnce())),keyTest:e=>e[zt]&&e.shiftKey&&e.key.toLowerCase()===rn||lt&&e.ctrlKey&&!e.shiftKey&&e.key===nn,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,x.jsx)(Za,{type:"button",icon:gs,"aria-label":b("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1}))(this.history))}renderCanvas(){const e=window.devicePixelRatio,{width:t,height:n,viewModeEnabled:r}=this.state,i=t*e,a=n*e;return r?(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:o.oc.GRAB},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:b("labels.drawingCanvas")}):(0,x.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:b("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,{onCollabButtonClick:i,renderTopRightUI:o,renderFooter:a,renderCustomStats:s}=this.props;return(0,x.jsx)("div",{className:ye("excalidraw excalidraw-container",{"excalidraw--view-mode":r,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,x.jsx)(Yh.Provider,{value:this.excalidrawContainerValue,children:(0,x.jsxs)(Kh.Provider,{value:this.isMobile,children:[(0,x.jsx)(Hh,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:i,onLockToggle:this.toggleLock,onInsertElements:e=>this.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null}),zenModeEnabled:n,toggleZenMode:this.toggleZenMode,langCode:m().code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:o,renderCustomFooter:a,viewModeEnabled:r,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&n,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,x.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,x.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,x.jsx)(Bh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:s}),null!==this.state.toastMessage&&(0,x.jsx)(Fh,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,x.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===o.Vi.TEST||"production"===o.Vi.DEVELOPMENT){this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:function(){return n.setState(...arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})}if(this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current)this.resizeObserver=new ResizeObserver((()=>{const{width:e,height:t}=this.excalidrawContainerRef.current.getBoundingClientRect();this.isMobile=e<o.kV||t<o.Yx&&e<o.sS,this.updateDOMRect()})),null===(t=this.resizeObserver)||void 0===t||t.observe(this.excalidrawContainerRef.current);else if(window.matchMedia){const e=window.matchMedia("(max-width: ".concat(o.kV,"px), (max-height: ").concat(o.Yx,"px) and (max-width: ").concat(o.sS,"px)")),t=()=>this.isMobile=e.matches;e.addListener(t),this.detachIsMobileMqHandler=()=>e.removeListener(t)}new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene)}componentWillUnmount(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),clearTimeout(rp),rp=0}removeEventListeners(){var e,t;document.removeEventListener(o.Ks.POINTER_UP,this.removePointer),document.removeEventListener(o.Ks.COPY,this.onCopy),document.removeEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(o.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(o.Ks.SCROLL,this.onScroll),document.removeEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(o.Ks.KEYUP,this.onKeyUp),window.removeEventListener(o.Ks.RESIZE,this.onResize,!1),window.removeEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(o.Ks.BLUR,this.onBlur,!1),window.removeEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.removeEventListener(o.Ks.DROP,this.disableEvent,!1),document.removeEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),null===(t=this.detachIsMobileMqHandler)||void 0===t||t.call(this)}addEventListeners(){var e,t;this.removeEventListeners(),document.addEventListener(o.Ks.POINTER_UP,this.removePointer),document.addEventListener(o.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(o.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(o.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=(e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;const{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e))return t;t=t.parentElement}return document})(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(o.Ks.SCROLL,this.onScroll)),window.addEventListener(o.Ks.RESIZE,this.onResize,!1),window.addEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(o.Ks.BLUR,this.onBlur,!1),window.addEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),window.addEventListener(o.Ks.DROP,this.disableEvent,!1))}componentDidUpdate(e,t){var n;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?o.k:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((()=>{this.actionManager.executeAction(Ql)}));const{multiElement:r}=t;t.elementType!==this.state.elementType&&null!=r&&Po(this.state)&&Me(r)&&Ho(r,this.state,this.scene,jn(Lo.getPointAtIndexGlobalCoordinates(r,-1)));const i={},a={},s={},l={},c={};this.state.collaborators.forEach(((e,t)=>{if(e.selectedElementIds)for(const n of Object.keys(e.selectedElementIds))n in s||(s[n]=[]),s[n].push(t);e.pointer&&(e.username&&(l[t]=e.username),e.userState&&(c[t]=e.userState),a[t]=_n({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!_e(e)||!this.state.pendingImageElement||e.id!==this.state.pendingImageElement.id)&&(!this.state.editingElement||"text"!==this.state.editingElement.type||e.id!==this.state.editingElement.id))),{atLeastOneVisibleElement:u,scrollBars:h}=cc(d,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:a,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile});h&&(np=h);const p=!Ee(this.state.editingElement)&&(!u&&d.length>0);var g,m;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(m=this.props).onChange)||void 0===g||g.call(m,this.scene.getElementsIncludingDeleted(),this.state,this.files))}static resetTapTwice(){qh=!1}addTextFromPaste(e){const{x:t,y:n}=kn({clientX:$h,clientY:Jh},this.state),r=ui({x:t,y:n,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:o.hs});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}selectShapeTool(e){var t;Qh||vn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}handleTextWysiwyg(e,t){var n=this;let{isExistingElement:r=!1}=t;const i=function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n.scene.replaceAllElements([...n.scene.getElementsIncludingDeleted().map((n=>n.id===e.id&&Ee(n)?hi(n,{text:t,isDeleted:i,originalText:r},o):n))])};ya({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=_n({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:Tn((t=>{i(t,t,!1,!e.containerId),Ea(e)&&Yo(e)})),onSubmit:Tn((t=>{let{text:n,viaKeyboard:o,originalText:a}=t;const s=!n.trim();if(i(n,a,s,!0),!s&&o){const t=e.containerId?e.containerId:e.id;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[t]:!0})})))}s&&oa(this.scene.getElements(),[e]),s&&!r||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&vn(this.canvas,this.state.elementType),this.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current}),this.deselectElements(),i(e.text,e.originalText)}deselectElements(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}getTextElementAtPosition(e,t){const n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ee(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e];const i=r[r.length-1];return Yi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((e=>!(Ee(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return qi(t,e)?Xi(e,o,i):Zi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==op&&op(e)}updateGestureOnPointerDown(e){ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===ap.pointers.size&&(ap.lastCenter=Ou(ap.pointers),ap.initialScale=this.state.zoom.value,ap.initialDistance=Lu(Array.from(ap.pointers.values())))}initialPointerDownState(e){const t=kn(e,this.state),n=Ta(this.scene.getElements(),this.state),[r,i,o,a]=Qe(n);return{origin:t,withCmdOrCtrl:e[zt],originInGrid:jn(We(t.x,t.y,this.state.gridSize)),scrollbars:Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Object.assign({},t),originalElements:this.scene.getElements().reduce(((e,t)=>(e.set(t.id,gi(t)),e)),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+r)/2,y:(a+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(e,t){if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;tp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=Tn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=Tn((()=>{tp=!1,vn(this.canvas,this.state.elementType),op=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,n),window.removeEventListener(o.Ks.POINTER_UP,r)}));return op=r,window.addEventListener(o.Ks.POINTER_MOVE,n),window.addEventListener(o.Ks.POINTER_UP,r),!0}isASelectedElement(e){return null!=e&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;const n=10/this.state.zoom.value,[r,i,o,a]=Qe(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return Tn((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return Tn((t=>{t.key===Dt&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return Tn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=jn(((e,t,n)=>{const[r,i]=Qe(e);return[t-r,n-i]})(Ta(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const i=kn(t,this.state),[a,s]=We(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.elementType||"line"===this.state.elementType)&&Ne(i.x,i.y,e.origin.x,e.origin.y)<o.f)return;if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(Lo.handlePointDragging(this.state,(e=>this.setState(e)),i.x,i.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}if((e.hit.allHitElements.some((e=>this.isASelectedElement(e)))||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!this.state.editingLinearElement||!t.shiftKey)&&(!this.state.editingLinearElement||(null===(n=this.state.editingLinearElement)||void 0===n?void 0:n.elementId)!==(null===(r=e.hit.element)||void 0===r?void 0:r.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;const n=Ta(this.scene.getElements(),this.state);if(n.length>0&&!e.withCmdOrCtrl){const[r,o]=We(i.x-e.drag.offset.x,i.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],l=t.shiftKey;if(function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;const[s,l]=Qe(t),c={x:n-s,y:r-l};t.forEach((n=>{if(fa(i,o,a,e,n,c),!n.groupIds.length){const t=br(n);if(t){const r=ir.getScene(n).getElement(t);fa(i,o,a,e,r,c)}}Yo(n,{simultaneouslyUpdated:t})}))}(e,n,r,o,l,a,s),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],i=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Ta(l,this.state,!0).map((e=>e.id));for(const d of l)if(c.includes(d.id)||d.id===(null==s?void 0:s.id)&&e.hit.wasAddedToSelection){const s=mi(this.state.editingGroupId,i,d),[l,c]=We(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Yr(s,{x:s.x+(l-r),y:s.y+(c-o)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];ar(t,n,a),ra(d,n,a,"duplicatesServeAsOld"),this.scene.replaceAllElements(d)}return}}const l=this.state.draggingElement;if(l){if("freedraw"===l.type){const e=l.points,n=i.x-l.x,r=i.y-l.y,o=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Yr(l,{points:[...e,[n,r]],pressures:o})}else if(je(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,o=s-l.y;ln(t)&&2===n.length&&({width:r,height:o}=$r(this.state.elementType,r,o)),1===n.length?Yr(l,{points:[...n,[r,o]]}):n.length>1&&Yr(l,{points:[...n.slice(0,-1),[r,o]]}),Me(l)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[i],this.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeDragNewGenericElement(e,t);if("selection"===this.state.elementType){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Ma(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>ri(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)Lo.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ge(t);return e.filter((e=>{const[t,a,s,l]=Je(e);return"selection"!==e.type&&!Ae(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>ri(Object.assign(Object.assign({},n),{selectedElementIds:Object.assign(Object.assign(Object.assign({},n.selectedElementIds),t.reduce(((e,t)=>(e[t.id]=!0,e)),{})),e.hit.element?{[e.hit.element.id]:!t.length}:null)}),this.scene.getElements())))}}}}))}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){const n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){const n=e.clientY,r=n-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return Tn((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,elementType:a,elementLocked:s,isResizing:l,isRotating:c}=this.state;var d,u;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Ee(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(d=e.hit)||void 0===d||null===(u=d.element)||void 0===u?void 0:u.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=Lo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(Ql);if(op=null,window.removeEventListener(o.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(o.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(o.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(o.Ks.KEYUP,e.eventListeners.onKeyUp),this.state.pendingImageElement&&this.setState({pendingImageElement:null}),"freedraw"===(null==n?void 0:n.type)){const e=kn(t,this.state),r=n.points;let i=e.x-n.x,o=e.y-n.y;i===r[0][0]&&o===r[0][1]&&(o+=1e-4,i+=1e-4);const a=n.simulatePressure?[]:[...n.pressures,t.pressure];return Yr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(Ql)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(Ql)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(Ql)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=kn(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Po(this.state)&&Me(n)&&Ho(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),s?this.setState((e=>({draggingElement:null,selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))):(bn(this.canvas),this.setState((e=>({draggingElement:null,elementType:"selection",selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Yr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a&&n&&Xr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Yr(n,Jr(n)),r&&this.history.resumeRecording(),r&&Xr(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(h&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[h.id])if(ei(this.state,h)){const e=h.groupIds.flatMap((e=>oi(this.scene.getElements(),e))).map((e=>({[e.id]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{});this.setState((t=>({selectedGroupIds:Object.assign(Object.assign({},t.selectedElementIds),h.groupIds.map((e=>({[e]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),e)})))}else this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!0})})));else this.setState((e=>Object.assign({},ri(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Yi(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a||Ma(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(Po(this.state)?No:Wo)(Ta(this.scene.getElements(),this.state)),s||"freedraw"===a?this.setState({draggingElement:null,suggestedBindings:[]}):(bn(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}))}maybeSuggestBindingForAll(e){const t=(e=>{const t=new Set(e.map((e=>{let{id:t}=e;return t})));return e.flatMap((e=>Me(e)?Jo(e).filter((e=>!t.has(e.id))):Oe(e)?ta(e).filter((e=>!t.has(e[0].id))):[]))})(e);this.setState({suggestedBindings:t})}clearSelection(e){this.setState((t=>({selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&ii(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Ua(this.scene.getElementsIncludingDeleted().filter((e=>!Ee(e))),e,t);if(a){const r=a.x+a.width/2,i=a.y+a.height/2;if(Math.hypot(e-r,t-i)<o.wZ){const{x:e,y:t}=_n({sceneX:r,sceneY:i},n);return{viewportX:e,viewportY:t,elementCenterX:r,elementCenterY:i}}}}getCanvasOffsets(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){const e=this.excalidrawContainerRef.current,{left:t,top:n}=e.getBoundingClientRect();return{offsetLeft:t,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){const e=d.find((e=>e.code===this.props.langCode))||c;await g(e),this.setAppState({})}}sp.defaultProps={UIOptions:o.cW};var lp=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=i().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=()=>{var e;this.props.autoFocus&&(null===(e=this.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=()=>this.scene.getElementsIncludingDeleted(),this.getSceneElements=()=>this.scene.getElements(),this.syncActionResult=Tn((e=>{if(this.unmounted||!1===e)return;let t=null;if(e.elements&&(e.elements.forEach((e=>{var n;(null===(n=this.state.editingElement)||void 0===n?void 0:n.id)===e.id&&this.state.editingElement!==e&&Ea(e)&&(t=e)})),this.scene.replaceAllElements(e.elements),e.commitToHistory&&this.history.resumeRecording()),e.files&&(this.files=e.replaceFiles?e.files:Object.assign(Object.assign({},this.files),e.files),this.addNewImagesToImageCache()),e.appState||t){var n,r,i,a,s,l;e.commitToHistory&&this.history.resumeRecording();let c=(null==e||null===(n=e.appState)||void 0===n?void 0:n.viewModeEnabled)||!1,d=(null==e||null===(r=e.appState)||void 0===r?void 0:r.zenModeEnabled)||!1,u=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||o.C6.LIGHT,p=null!==(s=null==e||null===(l=e.appState)||void 0===l?void 0:l.name)&&void 0!==s?s:this.state.name;void 0!==this.props.viewModeEnabled&&(c=this.props.viewModeEnabled),void 0!==this.props.zenModeEnabled&&(d=this.props.zenModeEnabled),void 0!==this.props.gridModeEnabled&&(u=this.props.gridModeEnabled?o.k:null),void 0!==this.props.theme&&(h=this.props.theme),void 0!==this.props.name&&(p=this.props.name),this.setState((n=>{var r;return Object.assign(e.appState||{},{editingElement:t||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:d,gridSize:u,theme:h,name:p})}),(()=>{e.syncHistory&&this.history.setCurrentState(this.state,this.scene.getElementsIncludingDeleted())}))}})),this.onBlur=Tn((()=>{Qh=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ee(e)&&Or(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(o.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(o.ah.addLibrary),window.history.replaceState({},o.iC,"#".concat(e.toString()))}else if(window.location.search.includes(o.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(o.UO.addLibrary),window.history.replaceState({},o.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i=JSON.parse(await r.text());if(!(e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version))(i))throw new Error;(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:(i.libraryItems||i.library||[]).length})))&&(await this.library.importLibrary(r,"published"),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0}))}catch(e){window.alert(b("alerts.errorLoadingLibrary")),console.error(e)}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=Tn((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},Pn()),{isLoading:(null==e||!e.resetLoadingState)&&t.isLoading,theme:this.state.theme}))),this.resetHistory()})),this.initializeScene=async()=>{var e;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer((async e=>{if(!e.files.length)return;const t=e.files[0],n=await t.getFile();n.handle=t,td(n,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))})),this.state.isLoading||this.setState({isLoading:!0});let t=null;try{var n;t=await this.props.initialData||null,null!==(n=t)&&void 0!==n&&n.libraryItems&&(this.libraryItemsFromStorage=Xc(t.libraryItems,"unpublished"))}catch(e){console.error(e),t={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const r=qc(t,null,null);r.appState=Object.assign(Object.assign({},r.appState),{elementType:"image"===r.appState.elementType?"selection":r.appState.elementType,isLoading:!1}),null!==(e=t)&&void 0!==e&&e.scrollToContent&&(r.appState=Object.assign(Object.assign({},r.appState),Aa(r.elements,Object.assign(Object.assign({},r.appState),{width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})))),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},r),{commitToHistory:!0}));const i=new URLSearchParams(window.location.hash.slice(1)).get(o.ah.addLibrary)||new URLSearchParams(window.location.search).get(o.UO.addLibrary);i&&await this.importLibraryFromUrl(i)},this.onResize=Tn((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>Or(e))),this.setState({})})),this.onScroll=mn((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),o.HM),this.onCut=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=Tn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!hn(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.copyAll(),this.actionManager.executeAction(hl)},this.copyAll=()=>{Bd(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(!qh)return qh=!0,clearTimeout(Xh),void(Xh=window.setTimeout(sp.resetTapTwice,o.Gj));if(qh&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),qh=!1,clearTimeout(Xh)}e.preventDefault(),2===e.touches.length&&this.setState({selectedElementIds:{}})},this.onTapEnd=e=>{e.touches.length>0&&this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds})},this.pasteFromClipboard=Tn((async e=>{var t,n;const r=document.activeElement;if(!(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(r)))return;const i=document.elementFromPoint($h,Jh);if(e&&(!(i instanceof HTMLCanvasElement)||hn(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await Wd(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=sd(e))}if(ed(o)){const{x:e,y:t}=kn({clientX:$h,clientY:Jh},this.state),n=this.createImageElement({sceneX:e,sceneY:t});return this.insertImageElement(n,o),this.initializeImageDimensions(n),void this.setState({selectedElementIds:{[n.id]:!0}})}if(this.props.onPaste)try{if(!1===await this.props.onPaste(a,e))return}catch(e){console.error(e)}a.errorMessage?this.setState({errorMessage:a.errorMessage}):a.spreadsheet?this.setState({pasteDialog:{data:a.spreadsheet,shown:!0}}):a.elements?this.addElementsFromPasteOrLibrary({elements:a.elements,files:a.files||null,position:"cursor"}):a.text&&this.addTextFromPaste(a.text),this.selectShapeTool("selection"),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=Yc(e.elements,null),[n,r,i,o]=Qe(t),a=fn(n,i)/2,s=fn(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?$h:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?Jh:this.state.height/2+this.state.offsetTop,{x:d,y:u}=kn({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[m,f]=We(h,p,this.state.gridSize),b=new Map,x=t.map((e=>{const t=mi(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));ar(x,t,b);const v=[...this.scene.getElementsIncludingDeleted(),...x];ra(v,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(v),this.history.resumeRecording(),this.setState(ri(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:x.reduce(((e,t)=>(Ee(t)&&!t.containerId&&(e[t.id]=!0),e)),{}),selectedGroupIds:{}}),this.scene.getElements()),(()=>{e.files&&this.addNewImagesToImageCache()})),this.selectShapeTool("selection")},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{"touch"===e.pointerType&&rp&&(clearTimeout(rp),rp=0,ip=!1),ap.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Cu)},this.toggleStats=()=>{this.state.showStats||nc("dialog","stats"),this.actionManager.executeAction(ju)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},Aa(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=()=>{this.setState({toastMessage:null})},this.setToastMessage=e=>{this.setState({toastMessage:e})},this.restoreFileFromShare=async()=>{try{const e=await caches.open("web-share-target"),t=await e.match("shared-file");if(t){const n=await t.blob();this.loadFileToCanvas(n),await e.delete("shared-file"),window.history.replaceState(null,o.iC,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}},this.addFiles=Tn((e=>{const t=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map);this.files=Object.assign(Object.assign({},this.files),Object.fromEntries(t)),this.scene.getElements().forEach((e=>{ke(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),Or(e),qr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=Tn((e=>{e.commitToHistory&&this.history.resumeRecording(),e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(e.elements),e.collaborators&&this.setState({collaborators:e.collaborators})})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=Tn((e=>{$h=e.clientX,Jh=e.clientY})),this.onKeyDown=Tn((e=>{var t;if(("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){const r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(hn(e.target)&&e.key!==Ht||on(e.key)&&(t=e.target,t instanceof HTMLElement&&"wysiwyg"===t.dataset.type||t instanceof HTMLBRElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)))&&(e.key===Bt&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[zt]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===vt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),on(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=this.scene.getElements().filter((e=>this.state.selectedElementIds[e.id]));let r=0,i=0;e.key===Ot?r=-t:e.key===Lt?r=t:e.key===At?i=-t:e.key===Tt&&(i=t),n.forEach((e=>{Yr(e,{x:e.x+r,y:e.y+i}),Yo(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Rt){const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)}));else if(1===t.length&&!je(t[0])){const n=t[0];return this.startTextEditing({sceneX:n.x+n.width/2,sceneY:n.y+n.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===this.state.draggingElement){const t=(e=>{const t=zu.find(((t,n)=>e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))));return(null==t?void 0:t.value)||null})(e.key);t?this.selectShapeTool(t):e.key===Xt&&this.toggleLock()}if(e.key===Ft&&0===ap.pointers.size&&(Qh=!0,xn(this.canvas,o.oc.GRABBING)),e.key===Gt||e.key===Jt){const t=Ta(this.scene.getElements(),this.state);if("selection"===this.state.elementType&&!t.length)return;e.key===Gt&&(Pa(this.state.elementType)||t.some((e=>Pa(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Jt&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=Tn((e=>{if(e.key===Ft&&(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):"selection"===this.state.elementType?bn(this.canvas):(vn(this.canvas,this.state.elementType),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Qh=!1),e[zt]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),on(e.key)){const e=Ta(this.scene.getElements(),this.state);Po(this.state)?No(e):Wo(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=Tn((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),ap.initialScale=this.state.zoom.value})),this.onGestureChange=Tn((e=>{if(e.preventDefault(),2===ap.pointers.size)return;const t=ap.initialScale;t&&this.setState((n=>{let{zoom:r,offsetLeft:i,offsetTop:o}=n;return{zoom:Wa(Va(t*e.scale),r,{left:i,top:o},{x:$h,y:Jh})}}))})),this.onGestureEnd=Tn((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),ap.initialScale=null})),this.startTextEditing=e=>{var t;let{sceneX:n,sceneY:r,shouldBind:i,insertAtParentCenter:a=!0}=e,s=a&&this.getTextWysiwygSnappedToCenterPosition(n,r,this.state,this.canvas,window.devicePixelRatio);const l=i||s?Ua(this.scene.getElements(),n,r,"text"):null;let c=this.getTextElementAtPosition(n,r);if(l){const e=br(l);e&&(c=this.scene.getElement(e))}if(!c&&l){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=mr(gn(e)),i=(d=gn(e),dr(d)+2*o.tr),a=Math.max(l.height,i),c=Math.max(l.width,t);Yr(l,{height:a,width:c}),n=l.x+c/2,r=l.y+a/2,s&&(s=this.getTextWysiwygSnappedToCenterPosition(n,r,this.state,this.canvas,window.devicePixelRatio))}var d;const u=c||ui({x:s?s.elementCenterX:n,y:s?s.elementCenterY:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:"",fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:s?"center":this.state.currentItemTextAlign,verticalAlign:s?"middle":o.hs,containerId:null!==(t=null==l?void 0:l.id)&&void 0!==t?t:void 0});this.setState({editingElement:u}),c?s&&"center"===u.textAlign||Yr(u,{verticalAlign:o.hs}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),u]),s||Yr(u,{y:u.y-u.baseline/2})),this.setState({editingElement:u}),this.handleTextWysiwyg(u,{isExistingElement:!!c})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.elementType)return;const t=Ta(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new Lo(t[0],this.scene)})));bn(this.canvas);let{x:n,y:r}=kn(e,this.state);if(ni(this.state).length>0){const e=this.getElementAtPosition(n,r),t=e&&((e,t)=>e.groupIds.find((e=>t[e])))(e,this.state.selectedGroupIds);if(t)return void this.setState((n=>ri(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(bn(this.canvas),!e[zt]&&!this.state.viewModeEnabled){const t=Ta(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Le(e)&&(n=e.x+e.width/2,r=e.y+e.height/2)}this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey})}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),ap.pointers.has(e.pointerId)&&ap.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=ap.initialScale;if(2===ap.pointers.size&&ap.lastCenter&&t&&ap.initialDistance){const e=Ou(ap.pointers),n=e.x-ap.lastCenter.x,r=e.y-ap.lastCenter.y;ap.lastCenter=e;const i=Lu(Array.from(ap.pointers.values()))/ap.initialDistance;this.setState((o=>{let{zoom:a,scrollX:s,scrollY:l,offsetLeft:c,offsetTop:d}=o;return{scrollX:s+n/a.value,scrollY:l+r/a.value,zoom:Wa(Va(t*i),a,{left:c,top:d},e),shouldCacheIgnoreZoom:!0}})),this.resetShouldCacheIgnoreZoomDebounced()}else ap.lastCenter=ap.initialDistance=ap.initialScale=null;if(Qh||ep||tp)return;const n=Ia(np,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?bn(this.canvas):vn(this.canvas,this.state.elementType));const r=kn(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Lo.handlePointerMove(e,i,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(r):this.setState({suggestedBindings:[]})}if(Te(this.state.elementType)){const{draggingElement:e}=this.state;Me(e)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:r,lastCommittedPoint:s}=e,l=r[r.length-1];return vn(this.canvas,this.state.elementType),void(l===s?Ne(i-t,a-n,l[0],l[1])>=o.qx?Yr(e,{points:[...r,[i-t,a-n]]}):xn(this.canvas,o.oc.POINTER):r.length>2&&s&&Ne(i-t,a-n,s[0],s[1])<o.qx?(xn(this.canvas,o.oc.POINTER),Yr(e,{points:r.slice(0,-1)})):(Re(r,this.state.zoom.value)&&xn(this.canvas,o.oc.POINTER),Yr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.elementType&&"text"!==this.state.elementType)return;const s=this.scene.getElements(),l=Ta(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=Mo(Qe(l),i,a,this.state.zoom,e.pointerType);if(t)return void xn(this.canvas,Oo({transformHandleType:t}))}}else{const t=Io(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void xn(this.canvas,Oo(t))}const c=this.getElementAtPosition(r.x,r.y);if("text"===this.state.elementType)xn(this.canvas,Ee(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)xn(this.canvas,o.oc.GRAB);else if(n)xn(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=Lo.getElement(this.state.editingLinearElement.elementId);e&&Zi(e,this.state,[r.x,r.y])?xn(this.canvas,o.oc.MOVE):xn(this.canvas,o.oc.AUTO)}else e[zt]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)?xn(this.canvas,o.oc.AUTO):xn(this.canvas,o.oc.MOVE)},this.handleTouchMove=e=>{ip=!0},this.handleCanvasPointerDown=e=>{const t=document.getSelection();if(null!=t&&t.anchorNode&&t.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),this.maybeCleanupAfterMissingPointerUp(e),ep)return;if(this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(this.updateGestureOnPointerDown(e),ap.pointers.size>1)return;const n=this.initialPointerDownState(e);if(this.handleDraggingScrollBar(e,n))return;if(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,n))return;if("text"===this.state.elementType)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.elementType||"line"===this.state.elementType)this.handleLinearElementOnPointerDown(e,this.state.elementType,n);else if("image"===this.state.elementType){if(xn(this.canvas,o.oc.CROSSHAIR),!this.state.pendingImageElement)return;this.setState({draggingElement:this.state.pendingImageElement,editingElement:this.state.pendingImageElement,pendingImageElement:null,multiElement:null});const{x:t,y:n}=kn(e,this.state);Yr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.elementType?this.handleFreeDrawElementOnPointerDown(e,this.state.elementType,n):this.createGenericElementOnPointerDown(this.state.elementType,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);op=i,this.state.viewModeEnabled||(window.addEventListener(o.Ks.POINTER_MOVE,r),window.addEventListener(o.Ks.POINTER_UP,i),window.addEventListener(o.Ks.KEYDOWN,a),window.addEventListener(o.Ks.KEYUP,s),n.eventListeners.onMove=r,n.eventListeners.onUp=i,n.eventListeners.onKeyUp=s,n.eventListeners.onKeyDown=a)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(ip=!1,rp?ip=!0:rp=window.setTimeout((()=>{rp=0,ip||this.handleCanvasContextMenu(e)}),o.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==ap.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&Qh||this.state.viewModeEnabled))return!1;ep=!0;let t=!1;const n=/Linux/.test(window.navigator.platform);xn(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=Tn((e=>{const a=r-e.clientX,s=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(o.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(o.Ks.PASTE,e),window.removeEventListener(o.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(o.Ks.PASTE,e),window.addEventListener(o.Ks.POINTER_UP,n)}this.setState({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-s/this.state.zoom.value})})),s=Tn(op=()=>{op=null,ep=!1,Qh||(this.state.viewModeEnabled?xn(this.canvas,o.oc.GRAB):vn(this.canvas,this.state.elementType)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,a),window.removeEventListener(o.Ks.POINTER_UP,s),window.removeEventListener(o.Ks.BLUR,s)});return window.addEventListener(o.Ks.BLUR,s),window.addEventListener(o.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(o.Ks.POINTER_UP,s),!0},this.clearSelectionIfNotUsingSelection=()=>{"selection"!==this.state.elementType&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.elementType){const r=this.scene.getElements(),i=Ta(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=Mo(Qe(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=Io(r,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType);null!=n&&(this.setState({resizingElement:n.element}),t.resize.handleType=n.transformHandleType)}if(t.resize.handleType)xn(this.canvas,Oo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=jn(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ge(t[0]):Qe(t),l=(i+a)/2,c=(o+s)/2,d=1===t.length?t[0].angle:0;switch([n,r]=Pe(n,r,l,c,-d),e){case"n":return Pe(n-(i+a)/2,r-o,0,0,d);case"s":return Pe(n-(i+a)/2,r-s,0,0,d);case"w":return Pe(n-i,r-(o+s)/2,0,0,d);case"e":return Pe(n-a,r-(o+s)/2,0,0,d);case"nw":return Pe(n-i,r-o,0,0,d);case"ne":return Pe(n-a,r-o,0,0,d);case"sw":return Pe(n-i,r-s,0,0,d);case"se":return Pe(n-a,r-s,0,0,d);default:return[0,0]}})(t.resize.handleType,i,t.origin.x,t.origin.y)),1===i.length&&je(i[0])&&2===i[0].points.length&&(t.resize.arrowDirection=((e,t)=>{const[,[n,r]]=t.points;return"nw"===e&&(n<0||r<0)||"ne"===e&&n>=0||"sw"===e&&n<=0||"se"===e&&(n>0||r>0)?"end":"origin"})(t.resize.handleType,i[0]));else{var n;if(this.state.editingLinearElement){const n=Lo.handlePointerDown(e,this.state,(e=>this.setState(e)),this.history,t.origin);if(n.hitElement&&(t.hit.element=n.hitElement),n.didAddPoint)return!0}t.hit.element=null!==(n=t.hit.element)&&void 0!==n?n:this.getElementAtPosition(t.origin.x,t.origin.y),t.hit.element&&(t.hit.hasHitElementInside=Zi(t.hit.element,this.state,[t.origin.x,t.origin.y])),t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);const r=t.hit.element,i=t.hit.allHitElements.some((e=>this.isASelectedElement(e)));if(null!==r&&i||e.shiftKey||t.hit.hasHitCommonBoundingBoxOfSelectedElements||this.clearSelection(r),this.state.editingLinearElement)this.setState({selectedElementIds:{[this.state.editingLinearElement.elementId]:!0}});else if(null!=r){if(e[zt])return this.state.selectedElementIds[r.id]||(t.hit.wasAddedToSelection=!0),this.setState((e=>{return Object.assign(Object.assign({},(t=e,n=r,Object.assign(Object.assign({},t),{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[n.id]:!0}}))),{previousSelectedElementIds:this.state.selectedElementIds});var t,n})),!1;this.state.selectedElementIds[r.id]||(this.state.editingGroupId&&!ii(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>ri(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[r.id]:!0})}),this.scene.getElements()))),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1},this.handleTextOnPointerDown=(e,t)=>{if(Ee(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Le(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),bn(this.canvas),this.state.elementLocked||this.setState({elementType:"selection"})},this.handleFreeDrawElementOnPointerDown=(e,t,n)=>{const[r,i]=We(n.origin.x,n.origin.y,null),o=(a={type:t,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Object.assign(Object.assign({},li(a.type,a)),{points:a.points||[],pressures:[],simulatePressure:a.simulatePressure,lastCommittedPoint:null}));var a;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[o.id]:!1})})));const s=o.simulatePressure?o.pressures:[...o.pressures,e.pressure];Yr(o,{points:[[0,0]],pressures:s});const l=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),o]),this.setState({draggingElement:o,editingElement:o,startBoundElement:l,suggestedBindings:[]})},this.createImageElement=e=>{let{sceneX:t,sceneY:n}=e;const[r,i]=We(t,n,this.state.gridSize);var o;return o={type:"image",x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness},Object.assign(Object.assign({},li("image",o)),{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=(e,t,n)=>{if(this.state.multiElement){const{multiElement:e}=this.state;if("line"===e.type&&Re(e.points,this.state.zoom.value))return Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(Ql);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&Ne(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(Ql);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Yr(e,{lastCommittedPoint:e.points[e.points.length-1]}),xn(this.canvas,o.oc.POINTER)}else{const[e,r]=We(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=pi({type:t,x:e,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemLinearStrokeSharpness,startArrowhead:a,endArrowhead:s});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Yr(l,{points:[...l.points,[0,0]]});const c=Ko(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),l]),this.setState({draggingElement:l,editingElement:l,startBoundElement:c,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=(e,t)=>{const[n,r]=We(t.origin.x,t.origin.y,this.state.gridSize),i=ci({type:e,x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness});"selection"===i.type?this.setState({selectionElement:i,draggingElement:i}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!ed(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(xn(this.canvas,"wait"),l===o.LO.svg)try{i=sd(await(async e=>{const t=(new DOMParser).parseFromString(e,o.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(r=n)?void 0:r.nodeName.toLowerCase()))throw new Error(b("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),n.outerHTML;var r})(await i.text()),i.name)}catch(e){throw console.warn(e),new Error(b("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,i))||id(i));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(b("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{i=await ad(i,{maxWidthOrHeight:o.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(i.size>o.$n)throw new Error(b("errors.fileTooBig",{maxSize:"".concat(Math.trunc(o.$n/1024/1024),"MB")}))}if(s){var u;const e=null===(u=this.files[c])||void 0===u?void 0:u.dataURL,t=e&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return new File([o],t,{type:i})}(e);this.setImagePreviewCursor(t||i)}const h=(null===(r=this.files[c])||void 0===r?void 0:r.dataURL)||await od(i),p=Yr(a,{fileId:c},!1);return new Promise((async(e,t)=>{try{var n,r;this.files=Object.assign(Object.assign({},this.files),{[c]:{mimeType:l,id:c,dataURL:h,created:Date.now()}});const t=this.imageCache.get(c);t||(this.addNewImagesToImageCache(),await this.updateImageCache([p])),(null==t?void 0:t.image)instanceof Promise&&await t.image,(null===(n=this.state.pendingImageElement)||void 0===n?void 0:n.id)!==p.id&&(null===(r=this.state.draggingElement)||void 0===r?void 0:r.id)!==p.id&&this.initializeImageDimensions(p,!0),e(p)}catch(e){console.error(e),t(new Error(b("errors.imageInsertError")))}finally{s||bn(this.canvas)}}))},this.insertImageElement=async(e,t,n)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),e]);try{await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){Yr(e,{isDeleted:!0}),this.actionManager.executeAction(Ql),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await ad(e,{maxWidthOrHeight:96});let n=await od(t);if(e.type===o.LO.svg){const e=await hd(n);let t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));const i=document.createElement("canvas");i.height=t,i.width=r;i.getContext("2d").drawImage(e,0,0,r,t),n=i.toDataURL(o.LO.svg)}this.state.pendingImageElement&&xn(this.canvas,"url(".concat(n,") 4 4, auto"))},this.onImageAction=async function(){let{insertOnCanvasDirectly:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1};try{const n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,{x:i,y:o}=kn({clientX:n,clientY:r},e.state),a=await Uc({description:"Image",extensions:["jpg","png","svg","gif"]}),s=e.createImageElement({sceneX:i,sceneY:o});t?(e.insertImageElement(s,a),e.initializeImageDimensions(s),e.setState({selectedElementIds:{[s.id]:!0}},(()=>{e.actionManager.executeAction(Ql)}))):e.setState({pendingImageElement:s},(()=>{e.insertImageElement(s,a,!0)}))}catch(t){"AbortError"!==t.name?console.error(t):console.warn(t),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(()=>{e.actionManager.executeAction(Ql)}))}},this.initializeImageDimensions=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ke(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!i||i instanceof Promise){if(t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=100/e.state.zoom.value;Yr(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(r||t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=Math.max(e.state.height-120,160),r=Math.min(n,Math.floor(.5*e.state.height)/e.state.zoom.value),o=Math.min(i.naturalHeight,r),a=o*(i.naturalWidth/i.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-o/2;Yr(t,{x:s,y:l,width:a,height:o})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await pd({imageCache:e.imageCache,fileIds:t.map((e=>e.fileId)),files:n});if(r.size||i.size)for(const e of t)r.has(e.fileId)&&Or(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Zr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gd(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const r=t.filter((t=>!t.isDeleted&&!e.imageCache.has(t.fileId)));if(r.length){const{updatedFiles:t}=await e.updateImageCache(r,n);t.size&&e.scene.informMutation()}},this.scheduleImageRefresh=Vh()((()=>{this.addNewImagesToImageCache()}),o.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[zt])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Ko(e,this.scene);this.setState({suggestedBindings:null!=t?[t]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=(e,t,n)=>{if(!t.length)return;const r=t.reduce(((t,r)=>{const i=Ko(r,this.scene);return null==i||Uo(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,r;null!==e?(this.canvas=e,this.rc=xe.canvas(this.canvas),this.canvas.addEventListener(o.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(o.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(o.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(o.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(o.Ks.TOUCH_START,this.onTapStart),null===(r=this.canvas)||void 0===r||r.removeEventListener(o.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files[0];if(ed(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(Hc)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await td(t,this.state,this.scene.getElementsIncludingDeleted());return void this.syncActionResult(Object.assign(Object.assign({},n),{appState:Object.assign(Object.assign({},n.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))}catch(e){if("EncodingError"!==e.name)throw e}const{x:n,y:r}=kn(e,this.state),i=this.createImageElement({sceneX:n,sceneY:r});return this.insertImageElement(i,t),this.initializeImageDimensions(i),void this.setState({selectedElementIds:{[i.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const r=e.dataTransfer.getData(o.LO.excalidrawlib);if(""!==r)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(r),position:e,files:null});const i=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if((null==i?void 0:i.type)===o.LO.excalidrawlib||null!=i&&null!==(n=i.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(i).then((()=>{this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0})})).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else{if(this.setState({isLoading:!0}),Hc)try{const t=e.dataTransfer.items[0];i.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(i)}},this.loadFileToCanvas=e=>{td(e,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=e=>{e.preventDefault();const{x:t,y:n}=kn(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0}),i=r?"element":"canvas",o=this.excalidrawContainerRef.current,{top:a,left:s}=o.getBoundingClientRect(),l=e.clientX-s,c=e.clientY-a;r&&!this.state.selectedElementIds[r.id]?this.setState({selectedElementIds:{[r.id]:!0}},(()=>{this._openContextMenu({top:c,left:l},i)})):this._openContextMenu({top:c,left:l},i)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type)ba(n,this.state.elementType,e.origin.x,e.origin.y,r.x,r.y,fn(e.origin.x,r.x),fn(e.origin.y,r.y),sn(t),an(t));else{var i;const[o,a]=We(r.x,r.y,this.state.gridSize),s=ke(n)&&(null===(i=this.imageCache.get(n.fileId))||void 0===i?void 0:i.image),l=!s||s instanceof Promise?null:s.width/s.height;ba(n,this.state.elementType,e.originInGrid.x,e.originInGrid.y,o,a,fn(e.originInGrid.x,o),fn(e.originInGrid.y,a),_e(n)?!sn(t):sn(t),an(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Ta(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=We(i.x-e.resize.offset.x,i.y-e.resize.offset.y,this.state.gridSize);return!!((e,t,n,r,i,o,a,s,l,c,d)=>{if(1===n.length){const[c]=n;return"rotation"===t?(la(c,s,l,i),Yo(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ee(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&pa(e.originalElements.get(c.id),a,c,t,o,s,l):(ha(c,t,o,s,l),Yo(c)):ca(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return ma(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return ga(n,t,s,l),sr(n,t),!0}return!1})(e,r,n,e.resize.arrowDirection,ln(t),an(t),1===n.length&&_e(n[0])?!sn(t):sn(t),o,a,e.resize.center.x,e.resize.center.y)&&(this.maybeSuggestBindingForAll(n),!0)},this._openContextMenu=(e,t)=>{let{left:n,top:r}=e;const i=ru.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=mu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=fu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l="separator",c=this.scene.getElements(),d=[];if(Hd&&c.length>0&&d.push(Eu),Rd&&c.length>0&&d.push(_u),"canvas"===t){const e=[...d,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju];this.state.viewModeEnabled?Fu.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&navigator.clipboard&&l,Hd&&c.length>0&&Eu,Rd&&c.length>0&&_u,(Hd&&c.length>0||Rd&&c.length>0)&&l,jl,l,void 0===this.props.gridModeEnabled&&Su,void 0===this.props.zenModeEnabled&&Cu,void 0===this.props.viewModeEnabled&&Uh,ju],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current})}else"element"===t&&(this.state.viewModeEnabled?Fu.push({options:[navigator.clipboard&&wu,...d],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}):Fu.push({options:[this.isMobile&&ku,this.isMobile&&navigator.clipboard&&wu,this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&l,...d,l,Qd,eu,l,i&&ru,o&&iu,(i||o)&&l,au,l,_l,El,Sl,Cl,l,a&&mu,s&&fu,(a||s)&&l,Il,hl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current}))},this.handleWheel=Tn((e=>{if(e.preventDefault(),ep)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:r,previousSelectedElementIds:i}=this.state;if(e.metaKey||e.ctrlKey){const e=Math.sign(n),t=10;let a=Math.abs(n);a>t&&(a=t),a*=e,0!==Object.keys(i).length&&setTimeout((()=>{this.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);let s=this.state.zoom.value-a/100;return s+=Math.log10(Math.max(1,this.state.zoom.value))*-e,s=Math.round(s*o.V4*100)/(100*o.V4),this.setState((e=>{let{zoom:t,offsetLeft:n,offsetTop:o}=e;return{zoom:Wa(Va(s),t,{left:n,top:o},{x:$h,y:Jh}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(r).length?r:i,shouldCacheIgnoreZoom:!0}})),void this.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?this.setState((e=>{let{zoom:r,scrollX:i}=e;return{scrollX:i-(n||t)/r.value}})):this.setState((e=>{let{zoom:r,scrollX:i,scrollY:o}=e;return{scrollX:i-t/r.value,scrollY:o-n/r.value}}))})),this.savePointer=(e,t,n)=>{var r,i;if(!e||!t)return;const o=kn({clientX:e,clientY:t},this.state);isNaN(o.x)||isNaN(o.y),null===(r=(i=this.props).onPointerUpdate)||void 0===r||r.call(i,{pointer:o,button:n,pointersMap:ap.pointers})},this.resetShouldCacheIgnoreZoomDebounced=mn((()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=e=>{var t;if(null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current){const t=this.excalidrawContainerRef.current,{width:n,height:r,left:i,top:o}=t.getBoundingClientRect(),{width:a,height:s,offsetTop:l,offsetLeft:c}=this.state;if(n===a&&r===s&&i===c&&o===l)return void(e&&e());this.setState({width:n,height:r,offsetLeft:i,offsetTop:o},(()=>{e&&e()}))}},this.refresh=()=>{this.setState(Object.assign({},this.getCanvasOffsets()))}};"production"!==o.Vi.TEST&&"production"!==o.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app.scene.getElementsIncludingDeleted()},set(e){return this.app.scene.replaceAllElements(e)}}}));const cp=sp;n(4285),n(3313);var dp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const up=e=>{var t;const{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p=c.code,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,onPaste:_,detectScroll:E=!0,handleKeyboardGlobally:S=!1,onLibraryChange:C,autoFocus:j=!1,generateIdForFile:I}=e,M=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,T={canvasActions:Object.assign(Object.assign({},o.cW.canvasActions),M)};var O,L;null!=M&&M.export&&(T.canvasActions.export.saveFileToDisk=null!==(O=null===(L=M.export)||void 0===L?void 0:L.saveFileToDisk)&&void 0!==O?O:o.cW.canvasActions.export.saveFileToDisk);return(0,r.useEffect)((()=>{const e=e=>{"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),()=>{document.removeEventListener("touchmove",e)}}),[]),(0,x.jsx)(y,{langCode:p,children:(0,x.jsx)(cp,{onChange:n,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:l,onPointerUpdate:d,renderTopRightUI:u,renderFooter:h,langCode:p,viewModeEnabled:g,zenModeEnabled:m,gridModeEnabled:f,libraryReturnUrl:b,theme:v,name:w,renderCustomStats:k,UIOptions:T,onPaste:_,detectScroll:E,handleKeyboardGlobally:S,onLibraryChange:C,autoFocus:j,generateIdForFile:I})})},hp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=dp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=dp(t,["initialData","UIOptions"]),l=Object.keys(r),c=Object.keys(a);if(l.length!==c.length)return!1;const d=l.every((e=>{if("canvasActions"===e){Object.keys(r.canvasActions).every((e=>{var t,n,i,o;return"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=a&&null!==(n=a.canvasActions)&&void 0!==n&&n.export?r.canvasActions.export.saveFileToDisk===a.canvasActions.export.saveFileToDisk:(null==r||null===(i=r.canvasActions)||void 0===i?void 0:i[e])===(null==a||null===(o=a.canvasActions)||void 0===o?void 0:o[e])}))}return!0})),u=Object.keys(e),h=Object.keys(t);return d&&u.length===h.length&&u.every((e=>i[e]===s[e]))},pp=(0,r.forwardRef)(((e,t)=>(0,x.jsx)(up,Object.assign(Object.assign({},e),{excalidrawRef:t})))),gp=i().memo(pp,hp);n(8336);const mp=gp},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current file","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')},4451:e=>{"use strict";e.exports=JSON.parse('{"ar-SA":86,"bg-BG":59,"bn-BD":0,"ca-ES":78,"cs-CZ":25,"da-DK":17,"de-DE":100,"el-GR":88,"en":100,"es-ES":88,"fa-IR":66,"fi-FI":100,"fr-FR":100,"he-IL":84,"hi-IN":58,"hu-HU":52,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":82,"kk-KZ":24,"ko-KR":58,"lv-LV":100,"my-MM":49,"nb-NO":100,"nl-NL":93,"nn-NO":87,"oc-FR":99,"pa-IN":84,"pl-PL":97,"pt-BR":99,"pt-PT":87,"ro-RO":100,"ru-RU":86,"si-LK":9,"sk-SK":99,"sv-SE":99,"ta-IN":98,"tr-TR":78,"uk-UA":85,"zh-CN":92,"zh-HK":29,"zh-TW":100}')}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);l.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(i,o),i},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"i18n-zh-HK-json",43:"i18n-de-DE-json",58:"i18n-si-LK-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",395:"i18n-ta-IN-json",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",499:"image",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",603:"i18n-bn-BD-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"f82802143c7042511410",43:"e676479528793fb9755f",58:"c5e207625d8f7a06eb15",60:"fc3ee48a144b19bcca0d",62:"79c634b00f4602a2d9a6",137:"c6208f4ec6ec8d61df2f",149:"73605e7eed8d224609aa",164:"7aaa4a5ea8484b941af2",196:"be44386cc68047e2da24",213:"17f1500f11b6e08b677b",242:"6d186d192f0024208fe2",246:"a8b16b7360f5df195438",262:"dfc95883bf533087b673",280:"319132bcecbfaf90ef79",304:"a13fbd80677ff3f0122c",317:"2996f978aa8d44a1bc72",351:"93b7462bd1d0fe76d2b5",364:"f470b9806c21d127df35",381:"ad09ed1c16a3d2b6d4b8",384:"eb8b237a2970da7034ad",387:"1244df10086a058f2d41",395:"f20bc85c68e334566d53",401:"0261a2d60b0803cc8354",465:"1cd7244d3b42597e1555",472:"bb5e3af1d7bb005f0c7d",491:"43b313d6c7c52122220b",499:"87e58979d258cd38208c",526:"cef06f766f46d7ab798a",558:"6fcb7979cd290e0e51d9",565:"ad1cdc3ba675116187a4",583:"4798e5a14cecdddbfb50",603:"87d5cd14de43ad6ec162",617:"85af69d03d5a188d4d3e",649:"654dee98c29976300a26",661:"dbaf9c47430503d4a710",698:"4b274bae10479b585716",710:"84150b1f61e3d7a0afcf",736:"8698157b56eb5e0ee549",752:"b48f7b508a0884880f63",852:"2df7909ca92201d653d7",869:"cd5378c60549c20232c7",899:"bfb22930b5a31d1f92ee",920:"074a3f14a8e56d66eeb7",933:"07d3a348a9723eeb51a3"}[e]+".js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},o="Excalidraw:",l.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+n){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+n),a.src=e),i[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{l.b=document.baseURI||self.location.href;var e={388:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=l.p+l.u(t),a=new Error;l.l(o,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,s]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)s(l)}for(t&&t(n);c<o.length;c++)i=o[c],l.o(e,i)&&e[i]&&e[i][0](),e[o[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(2254)})()}));