network-stories/docs/static/js/excalidraw.js

980 lines
505 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){
shadow$provide[606]=function(aa,K,za,t){var l=K(2);!function(A,n){"object"==typeof t&&"object"==typeof za?za.exports=n(K(13),K(22)):"function"==typeof define&&define.amd?define(["react","react-dom"],n):"object"==typeof t?t.Excalidraw=n(K(13),K(22)):A.Excalidraw=n(A.React,A.ReactDOM)}(self,function(A,n){return function(){function k(u){var m=a[u];if(void 0!==m)return m.exports;m=a[u]={id:u,exports:{}};return p[u](m,m.exports,k),m.exports}var b,f,h,p={7945:function(u,m,e){u.exports=e(1602)},4516:function(u){var m=
Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;u.exports=function(){try{if(!Object.assign)return!1;var w=new String("abc");if(w[5]="de","5"===Object.getOwnPropertyNames(w)[0])return!1;var y={};for(w=0;10>w;w++)y["_"+String.fromCharCode(w)]=w;if("0123456789"!==Object.getOwnPropertyNames(y).map(function(M){return y[M]}).join(""))return!1;var E={};return"abcdefghijklmnopqrst".split("").forEach(function(M){E[M]=M}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},
E)).join("")}catch(M){return!1}}()?Object.assign:function(w,y){var E;if(null==w)throw new TypeError("Object.assign cannot be called with null or undefined");var M=Object(w);for(var G=1;G<arguments.length;G++){for(var B in E=Object(arguments[G]))e.call(E,B)&&(M[B]=E[B]);if(m){var F=m(E);for(var v=0;v<F.length;v++)q.call(E,F[v])&&(M[F[v]]=E[F[v]])}}return M}},6094:function(u,m,e){function q(G,B,F){var v,T={},ca=null,W=null;for(v in void 0!==F&&(ca=""+F),void 0!==B.key&&(ca=""+B.key),void 0!==B.ref&&
(W=B.ref),B)E.call(B,v)&&!M.hasOwnProperty(v)&&(T[v]=B[v]);if(G&&G.defaultProps)for(v in B=G.defaultProps)void 0===T[v]&&(T[v]=B[v]);return{$$typeof:w,type:G,key:ca,ref:W,props:T,_owner:y.current}}e(4516);u=e(4698);var w=60103;if(m.Fragment=60107,"function"==typeof Symbol&&Symbol.for)e=Symbol.for,w=e("react.element"),m.Fragment=e("react.fragment");var y=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0};
m.jsx=q;m.jsxs=q},4512:function(u,m,e){u.exports=e(6094)},1602:function(u){u=function(m){function e(wa,Da,ya){return Object.defineProperty(wa,Da,{value:ya,enumerable:!0,configurable:!0,writable:!0}),wa[Da]}function q(wa,Da,ya,Ma){Da=Object.create((Da&&Da.prototype instanceof y?Da:y).prototype);Ma=new ca(Ma||[]);return Da._invoke=function(Ra,Ta,db){var Ib=N;return function(Fb,Sb){if(Ib===ba)throw Error("Generator is already running");if(Ib===ua){if("throw"===Fb)throw Sb;return ia()}db.method=Fb;for(db.arg=
Sb;;){if(Fb=db.delegate)if(Fb=F(Fb,db)){if(Fb===U)continue;return Fb}if("next"===db.method)db.sent=db._sent=db.arg;else if("throw"===db.method){if(Ib===N)throw Ib=ua,db.arg;db.dispatchException(db.arg)}else"return"===db.method&&db.abrupt("return",db.arg);Ib=ba;Fb=w(Ra,Ta,db);if("normal"===Fb.type){if(Ib=db.done?ua:J,Fb.arg===U)continue;return{value:Fb.arg,done:db.done}}"throw"===Fb.type&&(Ib=ua,db.method="throw",db.arg=Fb.arg)}}}(wa,ya,Ma),Da}function w(wa,Da,ya){try{return{type:"normal",arg:wa.call(Da,
ya)}}catch(Ma){return{type:"throw",arg:Ma}}}function y(){}function E(){}function M(){}function G(wa){["next","throw","return"].forEach(function(Da){e(wa,Da,function(ya){return this._invoke(Da,ya)})})}function B(wa,Da){function ya(Ra,Ta,db,Ib){Ra=w(wa[Ra],wa,Ta);if("throw"!==Ra.type){var Fb=Ra.arg;return(Ra=Fb.value)&&"object"==typeof Ra&&O.call(Ra,"__await")?Da.resolve(Ra.__await).then(function(Sb){ya("next",Sb,db,Ib)},function(Sb){ya("throw",Sb,db,Ib)}):Da.resolve(Ra).then(function(Sb){Fb.value=
Sb;db(Fb)},function(Sb){return ya("throw",Sb,db,Ib)})}Ib(Ra.arg)}var Ma;this._invoke=function(Ra,Ta){function db(){return new Da(function(Ib,Fb){ya(Ra,Ta,Ib,Fb)})}return Ma=Ma?Ma.then(db,db):db()}}function F(wa,Da){var ya=wa.iterator[Da.method];if(ya===ja){if(Da.delegate=null,"throw"===Da.method){if(wa.iterator.return&&(Da.method="return",Da.arg=ja,F(wa,Da),"throw"===Da.method))return U;Da.method="throw";Da.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}ya=w(ya,wa.iterator,
Da.arg);return"throw"===ya.type?(Da.method="throw",Da.arg=ya.arg,Da.delegate=null,U):(ya=ya.arg)?ya.done?(Da[wa.resultName]=ya.value,Da.next=wa.nextLoc,"return"!==Da.method&&(Da.method="next",Da.arg=ja),Da.delegate=null,U):ya:(Da.method="throw",Da.arg=new TypeError("iterator result is not an object"),Da.delegate=null,U)}function v(wa){var Da={tryLoc:wa[0]};1 in wa&&(Da.catchLoc=wa[1]);2 in wa&&(Da.finallyLoc=wa[2],Da.afterLoc=wa[3]);this.tryEntries.push(Da)}function T(wa){var Da=wa.completion||{};
Da.type="normal";delete Da.arg;wa.completion=Da}function ca(wa){this.tryEntries=[{tryLoc:"root"}];wa.forEach(v,this);this.reset(!0)}function W(wa){if(wa){var Da=wa[Q];if(Da)return Da.call(wa);if("function"==typeof wa.next)return wa;if(!isNaN(wa.length)){var ya=-1;Da=function Ra(){for(;++ya<wa.length;)if(O.call(wa,ya))return Ra.value=wa[ya],Ra.done=!1,Ra;return Ra.value=ja,Ra.done=!0,Ra};return Da.next=Da}}return{next:ia}}function ia(){return{value:ja,done:!0}}var ja,da=Object.prototype,O=da.hasOwnProperty,
X="function"==typeof Symbol?Symbol:{},Q=X.iterator||"@@iterator",V=X.asyncIterator||"@@asyncIterator",L=X.toStringTag||"@@toStringTag";try{e({},"")}catch(wa){e=function(Da,ya,Ma){return Da[ya]=Ma}}m.wrap=q;var N="suspendedStart",J="suspendedYield",ba="executing",ua="completed",U={};X={};X[Q]=function(){return this};var oa=Object.getPrototypeOf;(oa=oa&&oa(oa(W([]))))&&oa!==da&&O.call(oa,Q)&&(X=oa);var ta=M.prototype=y.prototype=Object.create(X);return E.prototype=ta.constructor=M,M.constructor=E,E.displayName=
e(M,L,"GeneratorFunction"),m.isGeneratorFunction=function(wa){wa="function"==typeof wa&&wa.constructor;return!!wa&&(wa===E||"GeneratorFunction"===(wa.displayName||wa.name))},m.mark=function(wa){return Object.setPrototypeOf?Object.setPrototypeOf(wa,M):(wa.__proto__=M,e(wa,L,"GeneratorFunction")),wa.prototype=Object.create(ta),wa},m.awrap=function(wa){return{__await:wa}},G(B.prototype),B.prototype[V]=function(){return this},m.AsyncIterator=B,m.async=function(wa,Da,ya,Ma,Ra){void 0===Ra&&(Ra=Promise);
var Ta=new B(q(wa,Da,ya,Ma),Ra);return m.isGeneratorFunction(Da)?Ta:Ta.next().then(function(db){return db.done?db.value:Ta.next()})},G(ta),e(ta,L,"Generator"),ta[Q]=function(){return this},ta.toString=function(){return"[object Generator]"},m.keys=function(wa){var Da=[],ya;for(ya in wa)Da.push(ya);return Da.reverse(),function Ra(){for(;Da.length;){var Ta=Da.pop();if(Ta in wa)return Ra.value=Ta,Ra.done=!1,Ra}return Ra.done=!0,Ra}},m.values=W,ca.prototype={constructor:ca,reset:function(wa){if(this.prev=
0,this.next=0,this.sent=this._sent=ja,this.done=!1,this.delegate=null,this.method="next",this.arg=ja,this.tryEntries.forEach(T),!wa)for(var Da in this)"t"===Da.charAt(0)&&O.call(this,Da)&&!isNaN(+Da.slice(1))&&(this[Da]=ja)},stop:function(){this.done=!0;var wa=this.tryEntries[0].completion;if("throw"===wa.type)throw wa.arg;return this.rval},dispatchException:function(wa){function Da(Fb,Sb){return Ta.type="throw",Ta.arg=wa,ya.next=Fb,Sb&&(ya.method="next",ya.arg=ja),!!Sb}if(this.done)throw wa;for(var ya=
this,Ma=this.tryEntries.length-1;0<=Ma;--Ma){var Ra=this.tryEntries[Ma],Ta=Ra.completion;if("root"===Ra.tryLoc)return Da("end");if(Ra.tryLoc<=this.prev){var db=O.call(Ra,"catchLoc"),Ib=O.call(Ra,"finallyLoc");if(db&&Ib){if(this.prev<Ra.catchLoc)return Da(Ra.catchLoc,!0);if(this.prev<Ra.finallyLoc)return Da(Ra.finallyLoc)}else if(db){if(this.prev<Ra.catchLoc)return Da(Ra.catchLoc,!0)}else{if(!Ib)throw Error("try statement without catch or finally");if(this.prev<Ra.finallyLoc)return Da(Ra.finallyLoc)}}}},
abrupt:function(wa,Da){for(var ya=this.tryEntries.length-1;0<=ya;--ya){var Ma=this.tryEntries[ya];if(Ma.tryLoc<=this.prev&&O.call(Ma,"finallyLoc")&&this.prev<Ma.finallyLoc){var Ra=Ma;break}}Ra&&("break"===wa||"continue"===wa)&&Ra.tryLoc<=Da&&Da<=Ra.finallyLoc&&(Ra=null);ya=Ra?Ra.completion:{};return ya.type=wa,ya.arg=Da,Ra?(this.method="next",this.next=Ra.finallyLoc,U):this.complete(ya)},complete:function(wa,Da){if("throw"===wa.type)throw wa.arg;return"break"===wa.type||"continue"===wa.type?this.next=
wa.arg:"return"===wa.type?(this.rval=this.arg=wa.arg,this.method="return",this.next="end"):"normal"===wa.type&&Da&&(this.next=Da),U},finish:function(wa){for(var Da=this.tryEntries.length-1;0<=Da;--Da){var ya=this.tryEntries[Da];if(ya.finallyLoc===wa)return this.complete(ya.completion,ya.afterLoc),T(ya),U}},catch:function(wa){for(var Da=this.tryEntries.length-1;0<=Da;--Da){var ya=this.tryEntries[Da];if(ya.tryLoc===wa){wa=ya.completion;if("throw"===wa.type){var Ma=wa.arg;T(ya)}return Ma}}throw Error("illegal catch attempt");
},delegateYield:function(wa,Da,ya){return this.delegate={iterator:W(wa),resultName:Da,nextLoc:ya},"next"===this.method&&(this.arg=ja),U}},m}(u.exports);try{regeneratorRuntime=u}catch(m){Function("r","regeneratorRuntime \x3d r")(u)}},8336:function(u,m,e){m=e(487);e=e(4295);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},554:function(u,m,e){m=e(487);e=e(9135);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,
{insert:"head",singleton:!1});u.exports=e.locals||{}},2789:function(u,m,e){m=e(487);e=e(3729);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},5080:function(u,m,e){m=e(487);e=e(4241);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7225:function(u,m,e){m=e(487);e=e(6029);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",
singleton:!1});u.exports=e.locals||{}},778:function(u,m,e){m=e(487);e=e(9609);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4220:function(u,m,e){m=e(487);e=e(2345);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1292:function(u,m,e){m=e(487);e=e(6578);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=
e.locals||{}},196:function(u,m,e){m=e(487);e=e(9482);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},2205:function(u,m,e){m=e(487);e=e(7955);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1310:function(u,m,e){m=e(487);e=e(3195);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3922:function(u,
m,e){m=e(487);e=e(2978);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7096:function(u,m,e){m=e(487);e=e(1587);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},7117:function(u,m,e){m=e(487);e=e(9478);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1106:function(u,m,e){m=e(487);e=
e(7369);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3336:function(u,m,e){m=e(487);e=e(1434);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},694:function(u,m,e){m=e(487);e=e(5644);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},8328:function(u,m,e){m=e(487);e=e(6843);"string"==
typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},8051:function(u,m,e){m=e(487);e=e(8461);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4301:function(u,m,e){m=e(487);e=e(9935);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},9966:function(u,m,e){m=e(487);e=e(532);"string"==typeof(e=e.__esModule?
e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4623:function(u,m,e){m=e(487);e=e(3874);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},1528:function(u,m,e){m=e(487);e=e(2681);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},518:function(u,m,e){m=e(487);e=e(6759);"string"==typeof(e=e.__esModule?e.default:e)&&(e=
[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},9757:function(u,m,e){m=e(487);e=e(9650);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},5422:function(u,m,e){m=e(487);e=e(2044);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},6781:function(u,m,e){m=e(487);e=e(6626);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);
m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},580:function(u,m,e){m=e(487);e=e(6359);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},4285:function(u,m,e){m=e(487);e=e(9915);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},3313:function(u,m,e){m=e(487);e=e(9310);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",
singleton:!1});u.exports=e.locals||{}},8635:function(u,m,e){m=e(487);e=e(6464);"string"==typeof(e=e.__esModule?e.default:e)&&(e=[[u.id,e,""]]);m(e,{insert:"head",singleton:!1});u.exports=e.locals||{}},487:function(u,m,e){function q(ja){for(var da=-1,O=0;O<v.length;O++)if(v[O].identifier===ja){da=O;break}return da}function w(ja,da){for(var O={},X=[],Q=0;Q<ja.length;Q++){var V=ja[Q],L=da.base?V[0]+da.base:V[0],N=O[L]||0,J="".concat(L," ").concat(N);O[L]=N+1;L=q(J);V={css:V[1],media:V[2],sourceMap:V[3]};
-1!==L?(v[L].references++,v[L].updater(V)):v.push({identifier:J,updater:G(V,da),references:1});X.push(J)}return X}function y(ja){var da=document.createElement("style"),O=ja.attributes||{};if(void 0===O.nonce){var X=e.nc;X&&(O.nonce=X)}if(Object.keys(O).forEach(function(Q){da.setAttribute(Q,O[Q])}),"function"==typeof ja.insert)ja.insert(da);else{ja=F(ja.insert||"head");if(!ja)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");ja.appendChild(da)}return da}
function E(ja,da,O,X){O=O?"":X.media?"@media ".concat(X.media," {").concat(X.css,"}"):X.css;ja.styleSheet?ja.styleSheet.cssText=ca(da,O):(O=document.createTextNode(O),X=ja.childNodes,X[da]&&ja.removeChild(X[da]),X.length?ja.insertBefore(O,X[da]):ja.appendChild(O))}function M(ja,da,O){da=O.css;var X=O.media;O=O.sourceMap;if(X?ja.setAttribute("media",X):ja.removeAttribute("media"),O&&"undefined"!=typeof btoa&&(da+="\n/*# sourceMappingURL\x3ddata:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(O)))),
" */")),ja.styleSheet)ja.styleSheet.cssText=da;else{for(;ja.firstChild;)ja.removeChild(ja.firstChild);ja.appendChild(document.createTextNode(da))}}function G(ja,da){if(da.singleton){var O=ia++;var X=W||(W=y(da));var Q=E.bind(null,X,O,!1);var V=E.bind(null,X,O,!0)}else X=y(da),Q=M.bind(null,X,da),V=function(){if(null===X.parentNode)var L=!1;else X.parentNode.removeChild(X),L=void 0;!L};return Q(ja),function(L){L?(L.css!==ja.css||L.media!==ja.media||L.sourceMap!==ja.sourceMap)&&Q(ja=L):V()}}var B,F=
function(){var ja={};return function(da){if(void 0===ja[da]){var O=document.querySelector(da);if(window.HTMLIFrameElement&&O instanceof window.HTMLIFrameElement)try{O=O.contentDocument.head}catch(X){O=null}ja[da]=O}return ja[da]}}(),v=[],T,ca=(T=[],function(ja,da){return T[ja]=da,T.filter(Boolean).join("\n")}),W=null,ia=0;u.exports=function(ja,da){(da=da||{}).singleton||"boolean"==typeof da.singleton||(da.singleton=(void 0===B&&(B=!(!(window&&document&&document.all)||window.atob)),B));var O=w(ja=
ja||[],da);return function(X){if(X=X||[],"[object Array]"===Object.prototype.toString.call(X)){for(var Q=0;Q<O.length;Q++){var V=q(O[Q]);v[V].references--}X=w(X,da);for(Q=0;Q<O.length;Q++)V=q(O[Q]),0===v[V].references&&(v[V].updater(),v.splice(V,1));O=X}}}},788:function(u,m,e){function q(y){if(!e.o(w,y))return Promise.resolve().then(function(){var G=Error("Cannot find module '"+y+"'");throw G.code="MODULE_NOT_FOUND",G;});var E=w[y],M=E[0];return Promise.all(E.slice(1).map(e.e)).then(function(){return e.t(M,
19)})}var w={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./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],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-TW.json":[931,
62]};q.keys=function(){return Object.keys(w)};q.id=788;u.exports=q},9713:function(u){u.exports=function(m,e,q){return e in m?Object.defineProperty(m,e,{value:q,enumerable:!0,configurable:!0,writable:!0}):m[e]=q,m}},6479:function(u,m,e){var q=e(7316);u.exports=function(w,y){if(null==w)return{};var E,M=q(w,y);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(w);for(E=0;E<G.length;E++){var B=G[E];0<=y.indexOf(B)||Object.prototype.propertyIsEnumerable.call(w,B)&&(M[B]=w[B])}}return M}},
7316:function(u){u.exports=function(m,e){if(null==m)return{};var q,w={},y=Object.keys(m);for(q=0;q<y.length;q++){var E=y[q];0<=e.indexOf(E)||(w[E]=m[E])}return w}},4295:function(u,m,e){e.r(m);var q=e(3645),w=e.n(q);q=e(1667);q=e.n(q);var y=e(7464);e=e(9638);w=w()(function(E){return E[1]});y=q()(y.Z);q=q()(e.Z);w.push([u.id,'@font-face{font-family:"Virgil";src:url('+y+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+q+");font-display:swap}",""]);m.default=w},9135:function(u,m,e){e.r(m);
var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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;-webkit-margin-end:.3em;margin-inline-end:.3em;-webkit-transform:scaleY(0.9);transform:scaleY(0.9)}",""]);m.default=e},3729:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});
e.push([u.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}",""]);m.default=e},4241:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},6029:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},9609:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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\x3dltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir\x3drtl] .excalidraw .CollabButton-collaborators{left:-5px}",
""]);m.default=e},2345:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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\x3dltr] .excalidraw .color-picker{left:-5.5px}:root[dir\x3drtl] .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\x3dltr] .excalidraw .color-picker-triangle{left:12px}:root[dir\x3drtl] .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;-webkit-filter:var(--theme-filter);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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg\x3d\x3d") 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\x3dltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir\x3drtl] .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\x3dltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir\x3drtl] .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\x3dltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir\x3drtl] .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;-webkit-padding-start:.5em;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir\x3dltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir\x3drtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;-webkit-filter:var(--theme-filter);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\x3dltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir\x3drtl] .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\x3dtransparent] .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\x3dtransparent] .color-picker-keybinding{color:#000}',
""]);m.default=e},6578:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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;-webkit-margin-end:20px;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{-webkit-margin-end:0;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}',
""]);m.default=e},9482:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},7955:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg\x3d\x3d") 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{-webkit-filter:none;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\x3e*{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}',
""]);m.default=e},3195:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer\x3e*{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}",""]);m.default=e},2978:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});
e.push([u.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}",
""]);m.default=e},1587:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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\x3espan{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",
""]);m.default=e},9478:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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,.excalidraw .picker button:focus{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus svg,.excalidraw .picker button:focus 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\x3dltr] .excalidraw .picker-triangle{left:12px}:root[dir\x3drtl] .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-auto-flow:column;grid-gap:.5rem;border-radius:4px}:root[dir\x3drtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir\x3dltr] .excalidraw .picker-keybinding{right:2px}:root[dir\x3drtl] .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\x3dtransparent] .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\x3dtransparent] .picker-keybinding{color:#000}',
""]);m.default=e},7369:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:4px;padding:calc(var(--padding) * var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);m.default=e},1434:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-end:18px;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .layer-ui__library-items{max-height:50vh;overflow:auto}.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:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir\x3dltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(-76px, 0);transform:translate(-76px, 0)}:root[dir\x3drtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(76px, 0);transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{-webkit-transform:translate(0, 92px);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\x3dltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir\x3drtl] .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\x3e*{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;-webkit-margin-end:1em;margin-inline-end:1em}",
""]);m.default=e},5644:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,".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__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger\x3esvg{-webkit-filter:var(--theme-filter);filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__removeFromLibrary,.excalidraw .library-unit__removeFromLibrary:hover,.excalidraw .library-unit__removeFromLibrary:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:0;position:absolute;right:5px;top:5px}.excalidraw .library-unit__removeFromLibrary\x3esvg{height:16px;width:16px}.excalidraw .library-unit__pulse{-webkit-transform:scale(1);transform:scale(1);-webkit-animation:library-unit__pulse-animation 1s ease-in infinite;animation:library-unit__pulse-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit__active{cursor:pointer}@-webkit-keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}@keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}",
""]);m.default=e},6843:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-animation:Modal__content_fade-in .1s ease-out .05s forwards;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}@-webkit-keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);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}",
""]);m.default=e},8461:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},9935:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,".excalidraw .popover{position:absolute;z-index:10}",""]);m.default=e},532:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},3874:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",""]);m.default=e},2681:function(u,
m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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\x3drtl] .excalidraw .Stats{left:12px;right:initial}:root[dir\x3drtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir\x3drtl] .excalidraw .Stats .close{float:left}",
""]);m.default=e},6759:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{color:var(--text-primary-color);display:inline-block;border:1.5px solid var(--button-gray-1);line-height:1;padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw .TextInput:not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw .TextInput:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}",
""]);m.default=e},9650:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{-webkit-animation:fade-in .5s;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}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}",
""]);m.default=e},2044:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;font-family:Cascadia;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:var(--space-factor);-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1)}.excalidraw .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.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(--space-factor)}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__icon+.ToolIcon__label{-webkit-margin-start:0;margin-inline-start:0}.excalidraw .ToolIcon__label{color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.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,.excalidraw .Modal .ToolIcon_type_button:focus,.excalidraw .ToolIcon_type_button:focus{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+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus+.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:focus{box-shadow:none}.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.ToolIcon__lock{-webkit-margin-end:var(--space-factor);margin-inline-end:var(--space-factor)}.excalidraw .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.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{-webkit-margin-end:0;margin-inline-end:0;top:60px}}:root[dir\x3dltr] .excalidraw .unlocked-icon{left:2px}:root[dir\x3drtl] .excalidraw .unlocked-icon{right:2px}",
""]);m.default=e},6626:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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;height:100%}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",
""]);m.default=e},6359:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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\x3e*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile\x3e*{margin:0 var(--space-factor) var(--space-factor) 0}",
""]);m.default=e},9915:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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}",
""]);m.default=e},9310:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.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(\'data:image/svg+xml,\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"292.4" height\x3d"292.4" viewBox\x3d"0 0 292 292"\x3e\x3cpath d\x3d"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"/\x3e\x3c/svg\x3e\');--focus-highlight-color: #a5d8ff;--icon-fill-color: #000000;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #dee2e6;--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 1px 5px rgba(0, 0, 0, 0.15);--space-factor: 0.25rem;--text-primary-color: #343a40}.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(\'data:image/svg+xml,\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"292.4" height\x3d"292.4" viewBox\x3d"0 0 292 292"\x3e\x3cpath fill\x3d"%23ced4da" d\x3d"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"/\x3e\x3c/svg\x3e\');--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;--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: 0 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da}: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{-webkit-filter:var(--theme-filter);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\x3dradio],.excalidraw .panelColumn .buttonList input[type\x3dbutton]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;-webkit-margin-end:8px;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{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:4px;margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus,.excalidraw .buttonList label:focus{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(--button-gray-2)}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--button-gray-2)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--button-gray-3)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:36px;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\x3e.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\x3e.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:1fr auto 1fr;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top\x3e*{pointer-events:all}.excalidraw .App-menu_top\x3e*:first-child{justify-self:flex-start}.excalidraw .App-menu_top\x3e*: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\x3dltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir\x3drtl] .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\x3e*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom\x3e*: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;-webkit-padding-start:.5rem;padding-inline-start:.5rem;-webkit-padding-end:1.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\x3drtl] .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;-webkit-margin-end:8px;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;-webkit-transform:translateX(-50%);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;-webkit-margin-start:.6em;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\x3drtl] .excalidraw .rtl-mirror{-webkit-transform:scaleX(-1);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}@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}',
""]);m.default=e},6464:function(u,m,e){e.r(m);var q=e(3645);e=e.n(q)()(function(w){return w[1]});e.push([u.id,"",""]);e.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};m.default=e},3645:function(u){u.exports=function(m){var e=[];return e.toString=function(){return this.map(function(q){var w=m(q);return q[2]?"@media ".concat(q[2]," {").concat(w,"}"):w}).join("")},e.i=function(q,w,y){"string"==typeof q&&(q=[[null,q,""]]);var E={};if(y)for(var M=0;M<this.length;M++){var G=this[M][0];null!=G&&(E[G]=
!0)}for(M=0;M<q.length;M++)G=[].concat(q[M]),y&&E[G[0]]||(w&&(G[2]?G[2]="".concat(w," and ").concat(G[2]):G[2]=w),e.push(G))},e}},1667:function(u){u.exports=function(m,e){return e||(e={}),"string"!=typeof(m=m&&m.__esModule?m.default:m)?m:(/^['"].*['"]$/.test(m)&&(m=m.slice(1,-1)),e.hash&&(m+=e.hash),/["'() \t\n]/.test(m)||e.needQuotes?'"'.concat(m.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):m)}},9638:function(u,m,e){m.Z=e.p+"excalidraw-assets/Cascadia.woff2"},7464:function(u,m,e){m.Z=e.p+"excalidraw-assets/Virgil.woff2"},
8288:function(u,m,e){e.d(m,{iC:function(){return w},f:function(){return y},qx:function(){return E},Iw:function(){return M},$e:function(){return G},wZ:function(){return B},ay:function(){return F},oc:function(){return v},Oh:function(){return T},Ks:function(){return q},Vi:function(){return ca},$C:function(){return W},ut:function(){return ia},_D:function(){return ja},n5:function(){return da},rk:function(){return O},Hg:function(){return X},hs:function(){return Q},k:function(){return V},LO:function(){return L},
r8:function(){return N},pb:function(){return J},Gj:function(){return ba},nM:function(){return ua},Lg:function(){return U},HM:function(){return oa},V4:function(){return ta},EH:function(){return wa},ZF:function(){return Da},UO:function(){return ya},ah:function(){return Ma},cW:function(){return Ra},kV:function(){return Ta},sS:function(){return db},Yx:function(){return Ib},zK:function(){return Fb},ZB:function(){return Sb},qy:function(){return hc}});var q;u=e(8635);e=e.n(u);var w="Excalidraw",y=10,E=8,
M=5,G=1,B=30,F=Math.PI/12,v={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},T={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(Db){Db.COPY="copy";Db.PASTE="paste";Db.CUT="cut";Db.KEYDOWN="keydown";Db.KEYUP="keyup";Db.MOUSE_MOVE="mousemove";Db.RESIZE="resize";Db.UNLOAD="unload";Db.FOCUS="focus";Db.BLUR="blur";Db.DRAG_OVER="dragover";Db.DROP="drop";Db.GESTURE_END="gestureend";Db.BEFORE_UNLOAD="beforeunload";Db.GESTURE_START="gesturestart";Db.GESTURE_CHANGE=
"gesturechange";Db.POINTER_MOVE="pointermove";Db.POINTER_UP="pointerup";Db.STATE_CHANGE="statechange";Db.WHEEL="wheel";Db.TOUCH_START="touchstart";Db.TOUCH_END="touchend";Db.HASHCHANGE="hashchange";Db.VISIBILITY_CHANGE="visibilitychange";Db.SCROLL="scroll"}(q||(q={}));var ca={TEST:"test",DEVELOPMENT:"development"},W={SHAPE_ACTIONS_MENU:"App-menu__left"},ia={Virgil:1,Helvetica:2,Cascadia:3},ja="Segoe UI Emoji",da=20,O=ia.Virgil,X="left",Q="top",V=20,L={excalidraw:"application/vnd.excalidraw+json",
excalidrawlib:"application/vnd.excalidrawlib+json"},N={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},J=window.location.origin,ba=300,ua=500,U=5E3,oa=100,ta=.1,wa={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},Da=e().themeFilter,ya={addLibrary:"addLibrary"},Ma={addLibrary:"addLibrary"},Ra={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},Ta=730,db=
1E3,Ib=500,Fb=2,Sb=[1,2,3],hc=10},21:function(u,m,e){function q(Z,x){if(!(Z instanceof x))throw new TypeError("Cannot call a class as a function");}function w(Z,x){for(var D=0;D<x.length;D++){var R=x[D];R.enumerable=R.enumerable||!1;R.configurable=!0;"value"in R&&(R.writable=!0);Object.defineProperty(Z,R.key,R)}}function y(Z,x,D){return x&&w(Z.prototype,x),D&&w(Z,D),Z}function E(Z,x){return(E=Object.setPrototypeOf||function(D,R){return D.__proto__=R,D})(Z,x)}function M(Z,x){if("function"!=typeof x&&
null!==x)throw new TypeError("Super expression must either be null or a function");Z.prototype=Object.create(x&&x.prototype,{constructor:{value:Z,writable:!0,configurable:!0}});x&&E(Z,x)}function G(Z){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(x){return typeof x}:function(x){return x&&"function"==typeof Symbol&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x})(Z)}function B(Z){if(void 0===Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return Z}function F(Z,x){return!x||"object"!==G(x)&&"function"!=typeof x?B(Z):x}function v(Z){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)})(Z)}function T(Z){var x=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}();return function(){var D=v(Z);
if(x){var R=v(this).constructor;D=Reflect.construct(D,arguments,R)}else D=D.apply(this,arguments);return F(this,D)}}function ca(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function W(Z,x){if(Z){if("string"==typeof Z)return ca(Z,x);var D=Object.prototype.toString.call(Z).slice(8,-1);return"Object"===D&&Z.constructor&&(D=Z.constructor.name),"Map"===D||"Set"===D?Array.from(Z):"Arguments"===D||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D)?ca(Z,x):void 0}}
function ia(Z,x){if(!(Z=function(D){if(Array.isArray(D))return D}(Z)||function(D,R){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(D)){var z=[],na=!0,sa=!1,ha=void 0;try{for(var va,Aa=D[Symbol.iterator]();!(na=(va=Aa.next()).done)&&(z.push(va.value),!R||z.length!==R);na=!0);}catch(Ba){sa=!0,ha=Ba}finally{try{na||null==Aa.return||Aa.return()}finally{if(sa)throw ha;}}return z}}(Z,x)||W(Z,x)))throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
return Z}function ja(Z){var x=Array.isArray(Z)?ca(Z):void 0;x||(x="undefined"!=typeof Symbol&&Symbol.iterator in Object(Z)?Array.from(Z):void 0);if(!(Z=x||W(Z)))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return Z}function da(Z,x,D){return x in Z?Object.defineProperty(Z,x,{value:D,enumerable:!0,configurable:!0,writable:!0}):Z[x]=D,Z}function O(Z,x,D){if(Z&&Z.length){const [R,z]=x;x=Math.PI/
180*D;const na=Math.cos(x),sa=Math.sin(x);Z.forEach(ha=>{const [va,Aa]=ha;ha[0]=(va-R)*na-(Aa-z)*sa+R;ha[1]=(va-R)*sa+(Aa-z)*na+z})}}function X(Z){const x=Z[0];Z=Z[1];return Math.sqrt(Math.pow(x[0]-Z[0],2)+Math.pow(x[1]-Z[1],2))}function Q(Z,x,D,R){const z=x[1]-Z[1];x=Z[0]-x[0];Z=z*Z[0]+x*Z[1];const na=R[1]-D[1];R=D[0]-R[0];D=na*D[0]+R*D[1];const sa=z*R-na*x;return sa?[(R*Z-x*D)/sa,(z*D-na*Z)/sa]:null}function V(Z,x,D){const R=Z.length;if(3>R)return!1;const z=[Number.MAX_SAFE_INTEGER,D];x=[x,D];D=
0;for(let na=0;na<R;na++){const sa=Z[na],ha=Z[(na+1)%R];if(J(sa,ha,x,z)){if(0===N(sa,x,ha))return L(sa,x,ha);D++}}return 1==D%2}function L(Z,x,D){return x[0]<=Math.max(Z[0],D[0])&&x[0]>=Math.min(Z[0],D[0])&&x[1]<=Math.max(Z[1],D[1])&&x[1]>=Math.min(Z[1],D[1])}function N(Z,x,D){Z=(x[1]-Z[1])*(D[0]-x[0])-(x[0]-Z[0])*(D[1]-x[1]);return 0===Z?0:0<Z?1:2}function J(Z,x,D,R){const z=N(Z,x,D),na=N(Z,x,R),sa=N(D,R,Z),ha=N(D,R,x);return z!==na&&sa!==ha||!(0!==z||!L(Z,D,x))||!(0!==na||!L(Z,R,x))||!(0!==sa||
!L(D,Z,R))||!(0!==ha||!L(D,x,R))}function ba(Z,x){const D=[0,0],R=Math.round(x.hachureAngle+90);R&&O(Z,D,R);x=function(z,na){var sa=[...z];sa[0].join(",")!==sa[sa.length-1].join(",")&&sa.push([sa[0][0],sa[0][1]]);z=[];if(sa&&2<sa.length){let va=na.hachureGap;0>va&&(va=4*na.strokeWidth);va=Math.max(va,.1);na=[];for(var ha=0;ha<sa.length-1;ha++){const Ha=sa[ha],Va=sa[ha+1];if(Ha[1]!==Va[1]){const Ya=Math.min(Ha[1],Va[1]);na.push({ymin:Ya,ymax:Math.max(Ha[1],Va[1]),x:Ya===Ha[1]?Ha[0]:Va[0],islope:(Va[0]-
Ha[0])/(Va[1]-Ha[1])})}}if(na.sort((Ha,Va)=>Ha.ymin<Va.ymin?-1:Ha.ymin>Va.ymin?1:Ha.x<Va.x?-1:Ha.x>Va.x?1:Ha.ymax===Va.ymax?0:(Ha.ymax-Va.ymax)/Math.abs(Ha.ymax-Va.ymax)),!na.length)return z;let Aa=[],Ba=na[0].ymin;for(;Aa.length||na.length;){if(na.length){sa=-1;for(ha=0;ha<na.length&&!(na[ha].ymin>Ba);ha++)sa=ha;na.splice(0,sa+1).forEach(Ha=>{Aa.push({s:Ba,edge:Ha})})}if(Aa=Aa.filter(Ha=>!(Ha.edge.ymax<=Ba)),Aa.sort((Ha,Va)=>Ha.edge.x===Va.edge.x?0:(Ha.edge.x-Va.edge.x)/Math.abs(Ha.edge.x-Va.edge.x)),
1<Aa.length)for(sa=0;sa<Aa.length;sa+=2){ha=sa+1;if(ha>=Aa.length)break;z.push([[Math.round(Aa[sa].edge.x),Ba],[Math.round(Aa[ha].edge.x),Ba]])}Ba+=va;Aa.forEach(Ha=>{Ha.edge.x+=va*Ha.edge.islope})}}return z}(Z,x);return R&&(O(Z,D,-R),function(z,na,sa){const ha=[];z.forEach(va=>ha.push(...va));O(ha,na,sa)}(x,D,-R)),x}function ua(Z){const x=[];a:{var D=Z;for(var R=[];""!==D;){if(!D.match(/^([ \t\r\n,]+)/))if(D.match(/^([aAcChHlLmMqQsStTvVzZ])/))R[R.length]={type:0,text:RegExp.$1};else{if(!D.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)){D=
[];break a}R[R.length]={type:1,text:`${parseFloat(RegExp.$1)}`}}D=D.substr(RegExp.$1.length)}D=(R[R.length]={type:2,text:""},R)}R="BOD";let z=0;for(var na=D[z];2!==na.type;){let sa=0;const ha=[];if("BOD"===R){if("M"!==na.text&&"m"!==na.text)return ua("M0,0"+Z);z++;sa=ck[na.text];R=na.text}else 1===na.type?sa=ck[R]:(z++,sa=ck[na.text],R=na.text);if(!(z+sa<D.length))throw Error("Path data ended short");for(na=z;na<z+sa;na++){const va=D[na];if(1!==va.type)throw Error("Param not a number: "+R+","+va.text);
ha[ha.length]=+va.text}if("number"!=typeof ck[R])throw Error("Bad segment: "+R);x.push({key:R,data:ha});z+=sa;na=D[z];"M"===R&&(R="L");"m"===R&&(R="l")}return x}function U(Z){let x=0,D=0,R=0,z=0;const na=[];for(const {key:sa,data:ha}of Z)switch(sa){case "M":na.push({key:"M",data:[...ha]});[x,D]=ha;[R,z]=ha;break;case "m":x+=ha[0];D+=ha[1];na.push({key:"M",data:[x,D]});R=x;z=D;break;case "L":na.push({key:"L",data:[...ha]});[x,D]=ha;break;case "l":x+=ha[0];D+=ha[1];na.push({key:"L",data:[x,D]});break;
case "C":na.push({key:"C",data:[...ha]});x=ha[4];D=ha[5];break;case "c":Z=ha.map((va,Aa)=>Aa%2?va+D:va+x);na.push({key:"C",data:Z});x=Z[4];D=Z[5];break;case "Q":na.push({key:"Q",data:[...ha]});x=ha[2];D=ha[3];break;case "q":Z=ha.map((va,Aa)=>Aa%2?va+D:va+x);na.push({key:"Q",data:Z});x=Z[2];D=Z[3];break;case "A":na.push({key:"A",data:[...ha]});x=ha[5];D=ha[6];break;case "a":x+=ha[5];D+=ha[6];na.push({key:"A",data:[ha[0],ha[1],ha[2],ha[3],ha[4],x,D]});break;case "H":na.push({key:"H",data:[...ha]});
x=ha[0];break;case "h":x+=ha[0];na.push({key:"H",data:[x]});break;case "V":na.push({key:"V",data:[...ha]});D=ha[0];break;case "v":D+=ha[0];na.push({key:"V",data:[D]});break;case "S":na.push({key:"S",data:[...ha]});x=ha[2];D=ha[3];break;case "s":Z=ha.map((va,Aa)=>Aa%2?va+D:va+x);na.push({key:"S",data:Z});x=Z[2];D=Z[3];break;case "T":na.push({key:"T",data:[...ha]});x=ha[0];D=ha[1];break;case "t":x+=ha[0];D+=ha[1];na.push({key:"T",data:[x,D]});break;case "Z":case "z":na.push({key:"Z",data:[]}),x=R,D=
z}return na}function oa(Z){const x=[];var D="";let R=0,z=0,na=0,sa=0,ha=0,va=0;for(const {key:Ba,data:Ha}of Z){switch(Ba){case "M":x.push({key:"M",data:[...Ha]});[R,z]=Ha;[na,sa]=Ha;break;case "C":x.push({key:"C",data:[...Ha]});R=Ha[4];z=Ha[5];ha=Ha[2];va=Ha[3];break;case "L":x.push({key:"L",data:[...Ha]});[R,z]=Ha;break;case "H":R=Ha[0];x.push({key:"L",data:[R,z]});break;case "V":z=Ha[0];x.push({key:"L",data:[R,z]});break;case "S":var Aa=Z=0;"C"===D||"S"===D?(Z=R+(R-ha),Aa=z+(z-va)):(Z=R,Aa=z);x.push({key:"C",
data:[Z,Aa,...Ha]});ha=Ha[0];va=Ha[1];R=Ha[2];z=Ha[3];break;case "T":const [Va,Ya]=Ha;Aa=Z=0;"Q"===D||"T"===D?(Z=R+(R-ha),Aa=z+(z-va)):(Z=R,Aa=z);x.push({key:"C",data:[R+2*(Z-R)/3,z+2*(Aa-z)/3,Va+2*(Z-Va)/3,Ya+2*(Aa-Ya)/3,Va,Ya]});ha=Z;va=Aa;R=Va;z=Ya;break;case "Q":const [ob,Bb,Rb,ic]=Ha;x.push({key:"C",data:[R+2*(ob-R)/3,z+2*(Bb-z)/3,Rb+2*(ob-Rb)/3,ic+2*(Bb-ic)/3,Rb,ic]});ha=ob;va=Bb;R=Rb;z=ic;break;case "A":D=Math.abs(Ha[0]);Z=Math.abs(Ha[1]);Aa=Ha[2];const mc=Ha[3],Sc=Ha[4],Xc=Ha[5],Pc=Ha[6];
if(0===D||0===Z)x.push({key:"C",data:[R,z,Xc,Pc,Xc,Pc]}),R=Xc,z=Pc;else if(R!==Xc||z!==Pc)wa(R,z,Xc,Pc,D,Z,Aa,mc,Sc).forEach(function(Yc){x.push({key:"C",data:Yc})}),R=Xc,z=Pc;break;case "Z":x.push({key:"Z",data:[]}),R=na,z=sa}D=Ba}return x}function ta(Z,x,D){return[Z*Math.cos(D)-x*Math.sin(D),Z*Math.sin(D)+x*Math.cos(D)]}function wa(Z,x,D,R,z,na,sa,ha,va,Aa){const Ba=(Ha=sa,Math.PI*Ha/180);var Ha;Ha=[];if(Aa)[ha,Va,Ya,ob]=Aa;else{[Z,x]=ta(Z,x,-Ba);[D,R]=ta(D,R,-Ba);var Va=(Z-D)/2;var Ya=(x-R)/2;
var ob=Va*Va/(z*z)+Ya*Ya/(na*na);1<ob&&(ob=Math.sqrt(ob),z*=ob,na*=ob);ob=z*z;var Bb=na*na;ha=(ha===va?-1:1)*Math.sqrt(Math.abs((ob*Bb-ob*Ya*Ya-Bb*Va*Va)/(ob*Ya*Ya+Bb*Va*Va)));Ya=ha*z*Ya/na+(Z+D)/2;ob=ha*-na*Va/z+(x+R)/2;ha=Math.asin(parseFloat(((x-ob)/na).toFixed(9)));Va=Math.asin(parseFloat(((R-ob)/na).toFixed(9)));Z<Ya&&(ha=Math.PI-ha);D<Ya&&(Va=Math.PI-Va);0>ha&&(ha=2*Math.PI+ha);0>Va&&(Va=2*Math.PI+Va);va&&ha>Va&&(ha-=2*Math.PI);!va&&Va>ha&&(Va-=2*Math.PI)}if(Math.abs(Va-ha)>120*Math.PI/180){Ha=
Va;Bb=D;const Rb=R;Va=va&&Va>ha?ha+120*Math.PI/180:ha+120*Math.PI/180*-1;Ha=wa(D=Ya+z*Math.cos(Va),R=ob+na*Math.sin(Va),Bb,Rb,z,na,sa,0,va,[Va,Ha,Ya,ob])}sa=Math.tan((Va-ha)/4);z=4/3*z*sa;sa*=4/3*na;na=[Z,x];Z=[Z+z*Math.sin(ha),x-sa*Math.cos(ha)];x=[D+z*Math.sin(Va),R-sa*Math.cos(Va)];D=[D,R];if(Z[0]=2*na[0]-Z[0],Z[1]=2*na[1]-Z[1],Aa)return[Z,x,D].concat(Ha);Ha=[Z,x,D].concat(Ha);Aa=[];for(D=0;D<Ha.length;D+=3)R=ta(Ha[D][0],Ha[D][1],Ba),Z=ta(Ha[D+1][0],Ha[D+1][1],Ba),x=ta(Ha[D+2][0],Ha[D+2][1],Ba),
Aa.push([R[0],R[1],Z[0],Z[1],x[0],x[1]]);return Aa}function Da(Z,x,D){const R=(Z||[]).length;if(2<R){const z=[];for(let na=0;na<R-1;na++)z.push(...Db(Z[na][0],Z[na][1],Z[na+1][0],Z[na+1][1],D));return x&&z.push(...Db(Z[R-1][0],Z[R-1][1],Z[0][0],Z[0][1],D)),{type:"path",ops:z}}return 2===R?{type:"path",ops:Db(Z[0][0],Z[0][1],Z[1][0],Z[1][1],D)}:{type:"path",ops:[]}}function ya(Z,x){let D=Zb(Z,1+.2*x.roughness,x);if(!x.disableMultiStroke){var R=1.5*(1+.22*x.roughness);const z=Object.assign({},x);z.randomizer=
void 0;x.seed&&(z.seed=x.seed+1);Z=Zb(Z,R,z);D=D.concat(Z)}return{type:"path",ops:D}}function Ma(Z,x,D){const R=2*Math.PI/Math.max(D.curveStepCount,D.curveStepCount/Math.sqrt(200)*Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(Z/2,2)+Math.pow(x/2,2))/2)));Z=Math.abs(Z/2);x=Math.abs(x/2);const z=1-D.curveFitting;return Z+=hc(Z*z,D),x+=hc(x*z,D),{increment:R,rx:Z,ry:x}}function Ra(Z,x,D,R){const [z,na]=hb(R.increment,Z,x,R.rx,R.ry,1,R.increment*Sb(.1,Sb(.4,1,D),D),D);let sa=Ab(z,null,D);D.disableMultiStroke||
([Z]=hb(R.increment,Z,x,R.rx,R.ry,1.5,0,D),D=Ab(Z,null,D),sa=sa.concat(D));return{estimatedPoints:na,opset:{type:"path",ops:sa}}}function Ta(Z,x,D,R,z,na,sa,ha,va){D=Math.abs(D/2);R=Math.abs(R/2);D+=hc(.01*D,va);for(R+=hc(.01*R,va);0>z;)z+=2*Math.PI,na+=2*Math.PI;na-z>2*Math.PI&&(z=0,na=2*Math.PI);var Aa=Math.min(2*Math.PI/va.curveStepCount/2,(na-z)/2);const Ba=ib(Aa,Z,x,D,R,z,na,1,va);va.disableMultiStroke||(Aa=ib(Aa,Z,x,D,R,z,na,1.5,va),Ba.push(...Aa));return sa&&(ha?Ba.push(...Db(Z,x,Z+D*Math.cos(z),
x+R*Math.sin(z),va),...Db(Z,x,Z+D*Math.cos(na),x+R*Math.sin(na),va)):Ba.push({op:"lineTo",data:[Z,x]},{op:"lineTo",data:[Z+D*Math.cos(z),x+R*Math.sin(z)]})),{type:"path",ops:Ba}}function db(Z,x){const D=[];if(Z.length){const R=x.maxRandomnessOffset||0,z=Z.length;if(2<z){D.push({op:"move",data:[Z[0][0]+hc(R,x),Z[0][1]+hc(R,x)]});for(let na=1;na<z;na++)D.push({op:"lineTo",data:[Z[na][0]+hc(R,x),Z[na][1]+hc(R,x)]})}}return{type:"fillPath",ops:D}}function Ib(Z,x){var D=ln;let R=x.fillStyle||"hachure";
if(!Bh[R])switch(R){case "zigzag":Bh[R]||(Bh[R]=new Ii(D));break;case "cross-hatch":Bh[R]||(Bh[R]=new mh(D));break;case "dots":Bh[R]||(Bh[R]=new Ji(D));break;case "dashed":Bh[R]||(Bh[R]=new ug(D));break;case "zigzag-line":Bh[R]||(Bh[R]=new ii(D));break;default:R="hachure",Bh[R]||(Bh[R]=new Pf(D))}return Bh[R].fillPolygon(Z,x)}function Fb(Z){return Z.randomizer||(Z.randomizer=new pi(Z.seed||0)),Z.randomizer.next()}function Sb(Z,x,D,R=1){return D.roughness*R*(Fb(D)*(x-Z)+Z)}function hc(Z,x,D=1){return Sb(-Z,
Z,x,D)}function Db(Z,x,D,R,z,na=!1){const sa=na?z.disableMultiStrokeFill:z.disableMultiStroke;na=ec(Z,x,D,R,z,!0,!1);if(sa)return na;Z=ec(Z,x,D,R,z,!0,!0);return na.concat(Z)}function ec(Z,x,D,R,z,na,sa){var ha=Math.pow(Z-D,2)+Math.pow(x-R,2),va=Math.sqrt(ha);let Aa;Aa=200>va?1:500<va?.4:-.0016668*va+1.233334;let Ba=z.maxRandomnessOffset||0;Ba*Ba*100>ha&&(Ba=va/10);ha=Ba/2;va=.2+.2*Fb(z);let Ha=z.bowing*z.maxRandomnessOffset*(R-x)/200,Va=z.bowing*z.maxRandomnessOffset*(Z-D)/200;Ha=hc(Ha,z,Aa);Va=
hc(Va,z,Aa);const Ya=[],ob=z.preserveVertices;return na&&(sa?Ya.push({op:"move",data:[Z+(ob?0:hc(ha,z,Aa)),x+(ob?0:hc(ha,z,Aa))]}):Ya.push({op:"move",data:[Z+(ob?0:hc(Ba,z,Aa)),x+(ob?0:hc(Ba,z,Aa))]})),sa?Ya.push({op:"bcurveTo",data:[Ha+Z+(D-Z)*va+hc(ha,z,Aa),Va+x+(R-x)*va+hc(ha,z,Aa),Ha+Z+2*(D-Z)*va+hc(ha,z,Aa),Va+x+2*(R-x)*va+hc(ha,z,Aa),D+(ob?0:hc(ha,z,Aa)),R+(ob?0:hc(ha,z,Aa))]}):Ya.push({op:"bcurveTo",data:[Ha+Z+(D-Z)*va+hc(Ba,z,Aa),Va+x+(R-x)*va+hc(Ba,z,Aa),Ha+Z+2*(D-Z)*va+hc(Ba,z,Aa),Va+x+
2*(R-x)*va+hc(Ba,z,Aa),D+(ob?0:hc(Ba,z,Aa)),R+(ob?0:hc(Ba,z,Aa))]}),Ya}function Zb(Z,x,D){const R=[];R.push([Z[0][0]+hc(x,D),Z[0][1]+hc(x,D)]);R.push([Z[0][0]+hc(x,D),Z[0][1]+hc(x,D)]);for(let z=1;z<Z.length;z++)R.push([Z[z][0]+hc(x,D),Z[z][1]+hc(x,D)]),z===Z.length-1&&R.push([Z[z][0]+hc(x,D),Z[z][1]+hc(x,D)]);return Ab(R,null,D)}function Ab(Z,x,D){const R=Z.length,z=[];if(3<R){const na=[],sa=1-D.curveTightness;z.push({op:"move",data:[Z[1][0],Z[1][1]]});for(let ha=1;ha+2<R;ha++){const va=Z[ha];na[0]=
[va[0],va[1]];na[1]=[va[0]+(sa*Z[ha+1][0]-sa*Z[ha-1][0])/6,va[1]+(sa*Z[ha+1][1]-sa*Z[ha-1][1])/6];na[2]=[Z[ha+1][0]+(sa*Z[ha][0]-sa*Z[ha+2][0])/6,Z[ha+1][1]+(sa*Z[ha][1]-sa*Z[ha+2][1])/6];na[3]=[Z[ha+1][0],Z[ha+1][1]];z.push({op:"bcurveTo",data:[na[1][0],na[1][1],na[2][0],na[2][1],na[3][0],na[3][1]]})}x&&2===x.length&&(Z=D.maxRandomnessOffset,z.push({op:"lineTo",data:[x[0]+hc(Z,D),x[1]+hc(Z,D)]}))}else 3===R?(z.push({op:"move",data:[Z[1][0],Z[1][1]]}),z.push({op:"bcurveTo",data:[Z[1][0],Z[1][1],Z[2][0],
Z[2][1],Z[2][0],Z[2][1]]})):2===R&&z.push(...Db(Z[0][0],Z[0][1],Z[1][0],Z[1][1],D));return z}function hb(Z,x,D,R,z,na,sa,ha){const va=[],Aa=[],Ba=hc(.5,ha)-Math.PI/2;Aa.push([hc(na,ha)+x+.9*R*Math.cos(Ba-Z),hc(na,ha)+D+.9*z*Math.sin(Ba-Z)]);for(let Ha=Ba;Ha<2*Math.PI+Ba-.01;Ha+=Z){const Va=[hc(na,ha)+x+R*Math.cos(Ha),hc(na,ha)+D+z*Math.sin(Ha)];va.push(Va);Aa.push(Va)}return Aa.push([hc(na,ha)+x+R*Math.cos(Ba+2*Math.PI+.5*sa),hc(na,ha)+D+z*Math.sin(Ba+2*Math.PI+.5*sa)]),Aa.push([hc(na,ha)+x+.98*R*
Math.cos(Ba+sa),hc(na,ha)+D+.98*z*Math.sin(Ba+sa)]),Aa.push([hc(na,ha)+x+.9*R*Math.cos(Ba+.5*sa),hc(na,ha)+D+.9*z*Math.sin(Ba+.5*sa)]),[Aa,va]}function ib(Z,x,D,R,z,na,sa,ha,va){var Aa=na+hc(.1,va);na=[];for(na.push([hc(ha,va)+x+.9*R*Math.cos(Aa-Z),hc(ha,va)+D+.9*z*Math.sin(Aa-Z)]);Aa<=sa;Aa+=Z)na.push([hc(ha,va)+x+R*Math.cos(Aa),hc(ha,va)+D+z*Math.sin(Aa)]);return na.push([x+R*Math.cos(sa),D+z*Math.sin(sa)]),na.push([x+R*Math.cos(sa),D+z*Math.sin(sa)]),Ab(na,null,va)}function La(Z,x,D,R,z,na,sa,
ha){const va=[],Aa=[ha.maxRandomnessOffset||1,(ha.maxRandomnessOffset||1)+.3];let Ba;const Ha=ha.disableMultiStroke?1:2,Va=ha.preserveVertices;for(let Ya=0;Ya<Ha;Ya++)0===Ya?va.push({op:"move",data:[sa[0],sa[1]]}):va.push({op:"move",data:[sa[0]+(Va?0:hc(Aa[0],ha)),sa[1]+(Va?0:hc(Aa[0],ha))]}),Ba=Va?[z,na]:[z+hc(Aa[Ya],ha),na+hc(Aa[Ya],ha)],va.push({op:"bcurveTo",data:[Z+hc(Aa[Ya],ha),x+hc(Aa[Ya],ha),D+hc(Aa[Ya],ha),R+hc(Aa[Ya],ha),Ba[0],Ba[1]]});return va}function Ja(Z,x){return Math.pow(Z[0]-x[0],
2)+Math.pow(Z[1]-x[1],2)}function Ua(Z,x,D){return[Z[0]+(x[0]-Z[0])*D,Z[1]+(x[1]-Z[1])*D]}function lb(Z,x,D,R){R=R||[];var z=Z[x+0],na=Z[x+1],sa=Z[x+2];const ha=Z[x+3];var va=3*na[0]-2*z[0]-ha[0];va*=va;na=3*na[1]-2*z[1]-ha[1];na*=na;let Aa=3*sa[0]-2*ha[0]-z[0];Aa*=Aa;z=3*sa[1]-2*ha[1]-z[1];(z*=z,va<Aa&&(va=Aa),na<z&&(na=z),va+na)<D?(D=Z[x+0],R.length?1<(Ba=R[R.length-1],Ha=D,Math.sqrt(Ja(Ba,Ha)))&&R.push(D):R.push(D),R.push(Z[x+3])):(Ba=Z[x+0],va=Z[x+1],Ha=Z[x+2],Z=Z[x+3],x=Ua(Ba,va,.5),z=Ua(va,
Ha,.5),Ha=Ua(Ha,Z,.5),va=Ua(x,z,.5),z=Ua(z,Ha,.5),sa=Ua(va,z,.5),lb([Ba,x,va,sa],0,D,R),lb([sa,z,Ha,Z],0,D,R));var Ba,Ha;return R}function Yb(Z,x,D,R,z){z=z||[];const na=Z[x],sa=Z[D-1];let ha=0,va=1;for(let Ya=x+1;Ya<D-1;++Ya){var Aa=Z[Ya];var Ba=na,Ha=sa,Va=Ja(Ba,Ha);0===Va?Aa=Ja(Aa,Ba):(Va=((Aa[0]-Ba[0])*(Ha[0]-Ba[0])+(Aa[1]-Ba[1])*(Ha[1]-Ba[1]))/Va,Aa=(Va=Math.max(0,Math.min(1,Va)),Ja(Aa,Ua(Ba,Ha,Va))));Aa>ha&&(ha=Aa,va=Ya)}return Math.sqrt(ha)>R?(Yb(Z,x,va+1,R,z),Yb(Z,va,D,R,z)):(z.length||z.push(na),
z.push(sa)),z}function Ub(Z,x=.15,D){const R=[],z=(Z.length-1)/3;for(let na=0;na<z;na++)lb(Z,3*na,x,R);return D&&0<D?Yb(R,0,R.length,D):R}function Kc(Z){var x,D,R="";if("string"==typeof Z||"number"==typeof Z)R+=Z;else if("object"==typeof Z)if(Array.isArray(Z))for(x=0;x<Z.length;x++)Z[x]&&(D=Kc(Z[x]))&&(R&&(R+=" "),R+=D);else for(x in Z)Z[x]&&(R&&(R+=" "),R+=x);return R}function Dc(){for(var Z,x,D=0,R="";D<arguments.length;)(Z=arguments[D++])&&(x=Kc(Z))&&(R&&(R+=" "),R+=x);return R}function Hc(Z,x){var D=
"undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Mc(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Mc(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=
Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Mc(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=
Array(x);D<x;D++)R[D]=Z[D];return R}function rd(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Td(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Td(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&
(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Td(Z,
x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function ud(Z,x,D,R=z=>z){return Z*R(.5-x*(.5-D))}function ze(Z,x){return[Z[0]+x[0],Z[1]+x[1]]}function Ee(Z,x){return[Z[0]-x[0],Z[1]-x[1]]}function xd(Z,x){return[Z[0]*x,Z[1]*x]}function Dd(Z){return[Z[1],-Z[0]]}function Ie(Z,x){return Z[0]===x[0]&&Z[1]===x[1]}function qg(Z,x){Z=Ee(Z,x);return Z[0]*Z[0]+Z[1]*Z[1]}function qf(Z){var x=Math.hypot(Z[0],Z[1]);return[Z[0]/x,Z[1]/x]}function rf(Z,x){return Math.hypot(Z[1]-
x[1],Z[0]-x[0])}function hf(Z,x,D){let R=Math.sin(D);D=Math.cos(D);let z=Z[0]-x[0];Z=Z[1]-x[1];return[z*D-Z*R+x[0],z*R+Z*D+x[1]]}function Gf(Z,x,D){return ze(Z,xd(Ee(x,Z),D))}function og(Z,x,D){return ze(Z,xd(x,D))}function Ih(Z,x={}){var D;let {size:R=16,smoothing:z=.5,thinning:na=.5,simulatePressure:sa=!0,easing:ha=pf=>pf,start:va={},end:Aa={},last:Ba=!1}=x,{cap:Ha=!0,taper:Va=0,easing:Ya=pf=>pf*(2-pf)}=va,{cap:ob=!0,taper:Bb=0,easing:Rb=pf=>--pf*pf*pf+1}=Aa;if(0===Z.length)return[];var ic,mc=Z[Z.length-
1].runningLength,Sc=Math.pow(R*z,2);x=[];var Xc=[],Pc=Z.slice(0,10).reduce((pf,ye)=>{var Mg=ye.pressure;sa&&(ye=Wl(1,ye.distance/R),Mg=Wl(1,1-ye),Mg=Wl(1,pf+.275*ye*(Mg-pf)));return(pf+Mg)/2},Z[0].pressure),Yc=ud(R,na,Z[Z.length-1].pressure,ha);let Bd=Z[0].vector;var Xd=Z[0].point;let kd=Xd;var qd=Xd,Hd=kd,He=!0;for(let pf=0;pf<Z.length-1;pf++){var {pressure:Tg}=Z[pf];let {point:ye,vector:Mg,distance:Wi,runningLength:rk}=Z[pf];if(!(0<pf&&He&&rk<R/2)){(He&&(He=!1),na)?(sa&&(Yc=Wl(1,Wi/R),Tg=Wl(1,1-
Yc),Tg=Wl(1,Pc+.275*Yc*(Tg-Pc))),Yc=ud(R,na,Tg,ha)):Yc=R/2;void 0===ic&&(ic=Yc);var ni=rk<Va?Ya(rk/Va):1,Bi=mc-rk<Bb?Rb((mc-rk)/Bb):1;Yc=Math.max(.01,Yc*Math.min(ni,Bi));Bi=(null==(D=Z[pf+1])?void 0:D.vector)||Mg;ni=Mg[0]*Bi[0]+Mg[1]*Bi[1];if(0>ni){Xd=xd(Dd(Bd),Yc);for(let El=1/13,Fl=0;1>=Fl;Fl+=El)Hd=hf(ze(ye,Xd),ye,Gm*-Fl),qd=hf(Ee(ye,Xd),ye,Gm*Fl),Xc.push(Hd),x.push(qd);Xd=qd;kd=Hd}else Hd=xd(Dd(Gf(Bi,Mg,ni)),Yc),qd=Ee(ye,Hd),Hd=ze(ye,Hd),((Pc=2>pf||.25>ni)||qg(Xd,qd)>Sc)&&(x.push(qd),Xd=qd),(Pc||
qg(kd,Hd)>Sc)&&(Xc.push(Hd),kd=Hd),Pc=Tg,Bd=Mg}}D=Z[0];ic=Z[Z.length-1];if((mc=He||2>Xc.length||2>x.length)&&(!Va&&!Bb||Ba)){x=0;Xc=Ie(D.point,ic.point)?ze(D.point,[1,1]):ic.point;for(qd=0;qd<Z.length;qd++){let {pressure:pf,runningLength:ye}=Z[qd];if(ye>R){x=ud(R,na,pf,ha);break}}x=og(D.point,Dd(qf(Ee(D.point,Xc))),-(x||Yc));Xc=[];for(let pf=1/13,ye=pf;1>=ye;ye+=pf)Xc.push(hf(x,D.point,2*Gm*ye));return Xc}Z=[];He=[];if(1<x.length&&1<Xc.length){Hd=Xc[1];for(Sc=1;Sc<x.length;Sc++)if(!Ie(Hd,x[Sc])){qd=
x[Sc];break}if(Ha||Va)if(Va||Bb&&mc)Z.push(D.point.slice(0,2));else{if(!Ie(Hd,qd)){Hd=og(D.point,qf(Ee(qd,Hd)),-rf(Hd,qd)/2);for(let pf=1/13,ye=pf;1>=ye;ye+=pf){Sc=hf(Hd,D.point,Gm*ye);if(1>rf(Sc,qd))break;Z.push(Sc)}x.shift();Xc.shift()}}else Ie(Hd,qd)||(Sc=qf(Ee(qd,Hd)),qd=rf(Hd,qd)/2,Z.push(og(D.point,Sc,-qd),og(D.point,Sc,.95*-qd),og(D.point,Sc,.95*qd),og(D.point,Sc,qd)),x.shift(),Xc.shift());D=xd(ze(x[x.length-1],Xc[Xc.length-1]),.5);qd=ic.point;Hd=Dd(qf(Ee(qd,D)));if(ob||Bb)if(Bb||Va&&mc)He.push(qd.slice(0,
2));else{Yc=og(qd,Hd,Yc);for(let pf=1/29,ye=0;1>=ye;ye+=pf)Hd=hf(Yc,qd,3*Gm*ye),He.push(Hd)}else D=Gf(D,qd,.95),Yc*=.95,He.push(og(D,Hd,Yc),og(qd,Hd,Yc),og(qd,Hd,-Yc),og(D,Hd,-Yc))}return x.concat(He,Xc.reverse(),Z)}function Jh(Z,x={}){return Ih(function(D,R={}){var z;let {streamline:na=.5,size:sa=16,last:ha=!1}=R;if(0===D.length)return[];R=.15+.85*(1-na);D=Array.isArray(D[0])?D:D.map(({x:Ya,y:ob,pressure:Bb=.5})=>[Ya,ob,Bb]);1===D.length&&D.push([...ze(D[0],[1,1]),D[0][2]||.5]);let va=[{point:[D[0][0],
D[0][1]],pressure:D[0][2]||.25,vector:[1,1],distance:0,runningLength:0}],Aa=!1,Ba=0,Ha=va[0],Va=D.length-1;for(let Ya=1;Ya<D.length;Ya++){let ob=ha&&Ya===Va?D[Ya]:Gf(Ha.point,D[Ya],R);if(Ie(Ha.point,ob))continue;let Bb=rf(ob,Ha.point);if(Ba+=Bb,Ya<Va&&!Aa){if(Ba<sa)continue;Aa=!0}Ha={point:ob,pressure:D[Ya][2]||.5,vector:qf(Ee(Ha.point,ob)),distance:Bb,runningLength:Ba};va.push(Ha)}return va[0].vector=(null==(z=va[1])?void 0:z.vector)||[0,0],va}(Z,x),x)}function Te(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=
Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function yg(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Te(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Te(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function xg(Z){var x=
Se(Z);x=new Path2D(x);return Oh.set(Z,x),x}function Se(Z){return function(x){if(!x.length)return"";var D=x.length-1;return x.reduce(function(R,z,na,sa){return na===D?R.push(z,vb(z,sa[0]),"L",sa[0],"Z"):R.push(z,vb(z,sa[na+1])),R},["M",x[0],"Q"]).join(" ").replaceAll(Ue,"$1")}(Jh(Z.simulatePressure?Z.points:Z.points.length?Z.points.map(function(x,D){x=ia(x,2);return[x[0],x[1],Z.pressures[D]]}):[[0,0,.5]],{simulatePressure:Z.simulatePressure,size:4.25*Z.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,
easing:function(x){return Math.sin(x*Math.PI/2)},last:!1}))}function vb(Z,x){return[(Z[0]+x[0])/2,(Z[1]+x[1])/2]}function Eb(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function rb(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Eb(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Eb(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Za(Z,x){if(null==Z)return{};var D;if(null==Z)var R={};else{R={};var z=Object.keys(Z);for(D=0;D<z.length;D++){var na=z[D];0<=x.indexOf(na)||(R[na]=Z[na])}}if(Object.getOwnPropertySymbols)for(z=Object.getOwnPropertySymbols(Z),D=0;D<z.length;D++)na=z[D],0<=x.indexOf(na)||Object.prototype.propertyIsEnumerable.call(Z,na)&&(R[na]=
Z[na]);return R}function kb(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return wb(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return wb(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;
x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function wb(Z,x){(null==
x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function Vb(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function rc(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Vb(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,
Object.getOwnPropertyDescriptors(D)):Vb(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function zc(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Tc(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?zc(Object(D),!0).forEach(function(R){da(Z,
R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):zc(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Fd(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return jd(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);
if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return jd(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=
D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function jd(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function me(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function vc(Z){for(var x=
1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?me(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):me(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function $b(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,
z).enumerable}));D.push.apply(D,R)}return D}function Ae(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function hd(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Ae(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):
Ae(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Je(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function tb(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Je(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Je(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function nc(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function mb(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?nc(Object(D),
!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):nc(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function oc(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function vd(Z){for(var x=1;x<arguments.length;x++){var D=
null!=arguments[x]?arguments[x]:{};x%2?oc(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):oc(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Kd(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,
R)}return D}function Zd(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Kd(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Kd(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function bf(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,
z).enumerable}));D.push.apply(D,R)}return D}function Ic(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?bf(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):bf(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function $c(Z){var x=Z.options,D=Z.value,R=Z.label,z=Z.onChange,na=Z.onClose,sa=ce().useRef(),ha=ce().useRef(),
va=ce().useRef(null);ce().useEffect(function(){ha.current?ha.current.focus():va.current&&va.current.focus()},[]);return(0,Sa.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":R,onKeyDown:function(Aa){var Ba=x.find(function(ob){return ob.keyBinding===Aa.key.toLowerCase()});if(Aa.metaKey||Aa.altKey||Aa.ctrlKey||!Ba)if("Tab"===Aa.key)setTimeout(function(){ha.current!==document.activeElement&&na()},0);else if(oh(Aa.key)){Ba=Cg.rtl;var Ha=Array.prototype.indexOf.call(va.current.children,
document.activeElement);if(-1!==Ha){var Va=x.length,Ya=Ha;switch(Aa.key){case Ba?"ArrowLeft":"ArrowRight":case "ArrowDown":Ya=(Ha+1)%Va;break;case Ba?"ArrowRight":"ArrowLeft":case "ArrowUp":Ya=(Va+Ha-1)%Va}va.current.children[Ya].focus()}Aa.preventDefault()}else"Escape"!==Aa.key&&"Enter"!==Aa.key||(Aa.preventDefault(),na());else Ba=x.indexOf(Ba),va.current.children[Ba].focus(),Aa.preventDefault();Aa.nativeEvent.stopImmediatePropagation();Aa.stopPropagation()},children:(0,Sa.jsx)("div",{className:"picker-content",
ref:va,children:x.map(function(Aa,Ba){return(0,Sa.jsxs)("button",{className:"picker-option",onClick:function(Ha){Ha.currentTarget.focus();z(Aa.value)},title:"".concat(Aa.text," — ").concat(Aa.keyBinding.toUpperCase()),"aria-label":Aa.text||"none","aria-keyshortcuts":Aa.keyBinding,ref:function(Ha){Ha&&0===Ba&&(sa.current=Ha);Ha&&Aa.value===D&&(ha.current=Ha)},onFocus:function(){z(Aa.value)},children:[Aa.icon,(0,Sa.jsx)("span",{className:"picker-keybinding",children:Aa.keyBinding})]},Aa.text)})})})}
function qc(Z){var x,D=Z.value,R=Z.label,z=Z.options,na=Z.onChange;Z=Z.group;Z=void 0===Z?"":Z;var sa=ia(ce().useState(!1),2),ha=sa[0],va=sa[1],Aa=ce().useRef(null);sa=Cg.rtl;return(0,Sa.jsxs)("label",{className:"picker-container",children:[(0,Sa.jsx)("button",{name:Z,className:ha?"active":"","aria-label":R,onClick:function(){return va(!ha)},ref:Aa,children:null===(x=z.find(function(Ba){return Ba.value===D}))||void 0===x?void 0:x.icon}),(0,Sa.jsx)(ce().Suspense,{fallback:"",children:ha?(0,Sa.jsxs)(Sa.Fragment,
{children:[(0,Sa.jsx)(Fa,Ic(Ic({onCloseRequest:function(Ba){return Ba.target!==Aa.current&&va(!1)}},sa?{right:5.5}:{left:-5.5}),{},{children:(0,Sa.jsx)($c,{options:z,value:D,label:R,onChange:na,onClose:function(){var Ba;va(!1);null===(Ba=Aa.current)||void 0===Ba||Ba.focus()}})})),(0,Sa.jsx)("div",{className:"picker-triangle"})]}):null})]})}function yb(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,
z).enumerable}));D.push.apply(D,R)}return D}function od(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?yb(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):yb(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function sf(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);
x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Rd(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?sf(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):sf(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function jg(Z,x){var D=Object.keys(Z);
if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Ia(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?jg(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):jg(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,
R))})}return Z}function cb(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Wa(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Wa(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;
x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Wa(Z,x){(null==
x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function nb(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(Z){return!1}}function Lb(Z,x,D){return(Lb=nb()?Reflect.construct:function(R,z,na){var sa=[null];sa.push.apply(sa,z);R=new (Function.bind.apply(R,sa));return na&&E(R,na.prototype),R}).apply(null,
arguments)}function xc(Z){var x="function"==typeof Map?new Map:void 0;return(xc=function(D){function R(){return Lb(D,arguments,v(this).constructor)}if(null===D||(z=D,-1===Function.toString.call(z).indexOf("[native code]")))return D;var z;if("function"!=typeof D)throw new TypeError("Super expression must either be null or a function");if(void 0!==x){if(x.has(D))return x.get(D);x.set(D,R)}return R.prototype=Object.create(D.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),
E(R,D)})(Z)}function Bc(Z){var x=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}();return function(){var D=v(Z);if(x){var R=v(this).constructor;D=Reflect.construct(D,arguments,R)}else D=D.apply(this,arguments);return F(this,D)}}function Nc(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];
if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Cd(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Cd(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;
},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Cd(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function bd(Z,x){var D=Object.keys(Z);
if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Ud(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?bd(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):bd(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,
R))})}return Z}function md(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function ge(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?md(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):md(Object(D)).forEach(function(R){Object.defineProperty(Z,
R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function kg(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return ne(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return ne(ha,va)}}(Z))||x&&Z&&"number"==
typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;
}}}}function ne(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function $a(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function fa(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?$a(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):$a(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function ma(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function xa(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?ma(Object(D),
!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):ma(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Na(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function jb(Z){for(var x=1;x<arguments.length;x++){var D=
null!=arguments[x]?arguments[x]:{};x%2?Na(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Na(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function xb(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,
R)}return D}function Xb(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?xb(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):xb(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function tc(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,
z).enumerable}));D.push.apply(D,R)}return D}function gd(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?tc(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):tc(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Jd(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);
x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function ve(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Jd(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Jd(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Ge(Z,x){var D=Object.keys(Z);
if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function he(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Ge(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Ge(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,
R))})}return Z}function je(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return qe(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return qe(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;
x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function qe(Z,x){(null==
x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function tf(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Kg(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?tf(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,
Object.getOwnPropertyDescriptors(D)):tf(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Uh(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Vh(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Uh(Object(D),!0).forEach(function(R){da(Z,
R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Uh(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Lg(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Ye(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);
if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Ye(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=
D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Ye(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function ph(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Id(Z){for(var x=
1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?ph(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):ph(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function gi(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,
z).enumerable}));D.push.apply(D,R)}return D}function oi(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?gi(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):gi(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Vj(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);
x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Ni(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Vj(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Vj(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Qe(Z,x){var D=Object.keys(Z);
if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Dk(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Qe(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Qe(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,
R))})}return Z}function Xk(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function yh(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Xk(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Xk(Object(D)).forEach(function(R){Object.defineProperty(Z,
R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function ol(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Ol(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?ol(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):
ol(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function xj(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function sg(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?xj(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?
Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):xj(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function yj(Z,x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return Hi(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);
if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return Hi(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();
return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function Hi(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=Array(x);D<x;D++)R[D]=Z[D];return R}function Pl(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Wj(Z){for(var x=1;x<arguments.length;x++){var D=
null!=arguments[x]?arguments[x]:{};x%2?Pl(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Pl(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Yk(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,
R)}return D}function Zi(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Fk(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Yj(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=
Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function ql(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Yj(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Yj(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function lj(Z,
x){var D="undefined"!=typeof Symbol&&Z[Symbol.iterator]||Z["@@iterator"];if(!D){if(Array.isArray(Z)||(D=function(ha,va){if(ha){if("string"==typeof ha)return $i(ha,va);var Aa=Object.prototype.toString.call(ha).slice(8,-1);"Object"===Aa&&ha.constructor&&(Aa=ha.constructor.name);if("Map"===Aa||"Set"===Aa)return Array.from(ha);if("Arguments"===Aa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Aa))return $i(ha,va)}}(Z))||x&&Z&&"number"==typeof Z.length){D&&(Z=D);var R=0;x=function(){};return{s:x,n:function(){return R>=
Z.length?{done:!0}:{done:!1,value:Z[R++]}},e:function(ha){throw ha;},f:x}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var z,na=!0,sa=!1;return{s:function(){D=D.call(Z)},n:function(){var ha=D.next();return na=ha.done,ha},e:function(ha){sa=!0;z=ha},f:function(){try{na||null==D.return||D.return()}finally{if(sa)throw z;}}}}function $i(Z,x){(null==x||x>Z.length)&&(x=Z.length);for(var D=0,R=
Array(x);D<x;D++)R[D]=Z[D];return R}function Zj(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function Wd(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Zj(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):
Zj(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Pe(Z){var x=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}();return function(){var D=v(Z);if(x){var R=v(this).constructor;D=Reflect.construct(D,arguments,R)}else D=D.apply(this,arguments);return F(this,
D)}}function Wh(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function qh(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Wh(Object(D),!0).forEach(function(R){da(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):Wh(Object(D)).forEach(function(R){Object.defineProperty(Z,
R,Object.getOwnPropertyDescriptor(D,R))})}return Z}function Og(Z,x){var D=Object.keys(Z);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(Z);x&&(R=R.filter(function(z){return Object.getOwnPropertyDescriptor(Z,z).enumerable}));D.push.apply(D,R)}return D}function km(Z){for(var x=1;x<arguments.length;x++){var D=null!=arguments[x]?arguments[x]:{};x%2?Og(Object(D),!0).forEach(function(R){mj()(Z,R,D[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(D)):
Og(Object(D)).forEach(function(R){Object.defineProperty(Z,R,Object.getOwnPropertyDescriptor(D,R))})}return Z}e.r(m);e.d(m,{FONT_FAMILY:function(){return yc.ut},default:function(){return Nv},defaultLang:function(){return Wg},exportToBlob:function(){return Qu},exportToCanvas:function(){return it},exportToSvg:function(){return Yv},getElementMap:function(){return al},getFreeDrawSvgPath:function(){return Se},getSceneVersion:function(){return Uj},isInvisiblySmallElement:function(){return Kj},languages:function(){return bk},
loadFromBlob:function(){return vl},loadLibraryFromBlob:function(){return jo},restore:function(){return Tm},restoreAppState:function(){return Um},restoreElements:function(){return sl},serializeAsJSON:function(){return Jn}});var Hg=e(6479),Xh=e.n(Hg),ak=e(9713),mj=e.n(ak),ue=e(4698),ce=e.n(ue),yc=e(8288),Gk=JSON.parse('{"u2":"@excalidraw/excalidraw","i8":"0.10.0"}');"production"!==yc.Vi.TEST&&(e.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(Gk.u2,"@").concat(Gk.i8,"/dist/"));var ff=e(8950),
Oi=e(7945),Yd=e.n(Oi),Pm=e(1463),Ik=e(4451),Wg={code:"en",label:"English"},bk=[{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([Wg]).sort(function(Z,x){return Z.label>x.label?1:-1}).filter(function(Z){return 85<=Ik[Z.code]});"production"===yc.Vi.DEVELOPMENT&&bk.unshift({code:"__test__",label:"test language"},{code:"".concat("__test__",".rtl"),label:"test language (rtl)",
rtl:!0});var Cg=Wg,zh={},tg=function(){var Z=(0,ff.Z)(Yd().mark(function R(D){return Yd().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(Cg=D,document.documentElement.dir=Cg.rtl?"rtl":"ltr",document.documentElement.lang=Cg.code,!D.code.startsWith("__test__")){z.next=7;break}zh={};z.next=10;break;case 7:return z.next=9,e(788)("./".concat(Cg.code,".json"));case 9:zh=z.sent;case 10:case "end":return z.stop()}},R)}));return function(D){return Z.apply(this,arguments)}}(),Ah=function(Z,x){for(var D=
0;D<x.length;++D){var R=x[D];if(void 0===Z[R])return;Z=Z[R]}if("string"==typeof Z)return Z},Wb=function(Z,x){if(Cg.code.startsWith("__test__"))return Z=x?"".concat(Z,"(").concat(JSON.stringify(x).slice(1,-1),")"):Z,"[[".concat(Z,"]]");var D=Z.split(".");D=Ah(zh,D)||Ah(Pm,D);if(void 0===D)throw Error("Can't find translation for ".concat(Z));if(x)for(var R in x)D=D.replace("{{".concat(R,"}}"),x[R]);return D},Sa=e(4512),Aj=function(){return(0,Sa.jsx)("div",{className:"LoadingMessage",children:(0,Sa.jsx)("span",
{children:Wb("labels.loadingScene")})})},Rl=function(Z){function x(){var z,na;q(this,x);for(var sa=arguments.length,ha=Array(sa),va=0;va<sa;va++)ha[va]=arguments[va];return F(na,(z=na=R.call.apply(R,[this].concat(ha)),na.state={isLoading:!0},z))}M(x,Z);var D,R=T(x);return y(x,[{key:"componentDidMount",value:(D=(0,ff.Z)(Yd().mark(function na(){var sa,ha=this;return Yd().wrap(function(va){for(;;)switch(va.prev=va.next){case 0:return sa=bk.find(function(Aa){return Aa.code===ha.props.langCode})||Wg,va.next=
3,tg(sa);case 3:this.setState({isLoading:!1});case 4:case "end":return va.stop()}},na,this)})),function(){return D.apply(this,arguments)})},{key:"render",value:function(){return this.state.isLoading?(0,Sa.jsx)(Aj,{}):this.props.children}}]),x}(ce().Component);class Pf{constructor(Z){this.helper=Z}fillPolygon(Z,x){return this._fillPolygon(Z,x)}_fillPolygon(Z,x,D=!1){let R=ba(Z,x);D&&(Z=this.connectingLines(Z,R),R=R.concat(Z));return{type:"fillSketch",ops:this.renderLines(R,x)}}renderLines(Z,x){const D=
[];for(const R of Z)D.push(...this.helper.doubleLineOps(R[0][0],R[0][1],R[1][0],R[1][1],x));return D}connectingLines(Z,x){const D=[];if(1<x.length)for(let z=1;z<x.length;z++){var R=x[z-1];3>X(R)||(R=[x[z][0],R[1]],3<X(R)&&(R=this.splitOnIntersections(Z,R),D.push(...R)))}return D}midPointInPolygon(Z,x){return V(Z,(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2)}splitOnIntersections(Z,x){var D=Math.max(5,.1*X(x)),R=[];for(var z=0;z<Z.length;z++){var na=Z[z],sa=Z[(z+1)%Z.length];if(J(na,sa,...x)&&(na=Q(na,sa,
x[0],x[1]))){sa=X([na,x[0]]);const ha=X([na,x[1]]);sa>D&&ha>D&&R.push({point:na,distance:sa})}}if(1<R.length){D=R.sort((ha,va)=>ha.distance-va.distance).map(ha=>ha.point);if(V(Z,...x[0])||D.shift(),V(Z,...x[1])||D.pop(),1>=D.length)return this.midPointInPolygon(Z,x)?[x]:[];x=[x[0],...D,x[1]];D=[];for(R=0;R<x.length-1;R+=2)z=[x[R],x[R+1]],this.midPointInPolygon(Z,z)&&D.push(z);return D}return this.midPointInPolygon(Z,x)?[x]:[]}}class Ii extends Pf{fillPolygon(Z,x){return this._fillPolygon(Z,x,!0)}}
class mh extends Pf{fillPolygon(Z,x){const D=this._fillPolygon(Z,x);x=Object.assign({},x,{hachureAngle:x.hachureAngle+90});Z=this._fillPolygon(Z,x);return D.ops=D.ops.concat(Z.ops),D}}class Ji{constructor(Z){this.helper=Z}fillPolygon(Z,x){Z=ba(Z,x=Object.assign({},x,{curveStepCount:4,hachureAngle:0,roughness:1}));return this.dotsOnLines(Z,x)}dotsOnLines(Z,x){const D=[];let R=x.hachureGap;0>R&&(R=4*x.strokeWidth);R=Math.max(R,.1);let z=x.fillWeight;0>z&&(z=x.strokeWidth/2);const na=R/4;for(const Aa of Z){var sa=
X(Aa);Z=Math.ceil(sa/R)-1;sa-=Z*R;const Ba=(Aa[0][0]+Aa[1][0])/2-R/4,Ha=Math.min(Aa[0][1],Aa[1][1]);for(let Va=0;Va<Z;Va++){var ha=Ha+sa+Va*R,va=this.helper.randOffsetWithRange(Ba-na,Ba+na,x);ha=this.helper.randOffsetWithRange(ha-na,ha+na,x);va=this.helper.ellipse(va,ha,z,z,x);D.push(...va.ops)}}return{type:"fillSketch",ops:D}}}class ug{constructor(Z){this.helper=Z}fillPolygon(Z,x){Z=ba(Z,x);return{type:"fillSketch",ops:this.dashedLine(Z,x)}}dashedLine(Z,x){const D=0>x.dashOffset?0>x.hachureGap?4*
x.strokeWidth:x.hachureGap:x.dashOffset,R=0>x.dashGap?0>x.hachureGap?4*x.strokeWidth:x.hachureGap:x.dashGap,z=[];return Z.forEach(na=>{var sa=X(na);const ha=Math.floor(sa/(D+R));sa=(sa+R-ha*(D+R))/2;let va=na[0];var Aa=na[1];va[0]>Aa[0]&&(va=na[1],Aa=na[0]);na=Math.atan((Aa[1]-va[1])/(Aa[0]-va[0]));for(Aa=0;Aa<ha;Aa++){var Ba=Aa*(D+R),Ha=Ba+D;Ba=[va[0]+Ba*Math.cos(na)+sa*Math.cos(na),va[1]+Ba*Math.sin(na)+sa*Math.sin(na)];Ha=[va[0]+Ha*Math.cos(na)+sa*Math.cos(na),va[1]+Ha*Math.sin(na)+sa*Math.sin(na)];
z.push(...this.helper.doubleLineOps(Ba[0],Ba[1],Ha[0],Ha[1],x))}}),z}}class ii{constructor(Z){this.helper=Z}fillPolygon(Z,x){const D=0>x.hachureGap?4*x.strokeWidth:x.hachureGap,R=0>x.zigzagOffset?D:x.zigzagOffset;Z=ba(Z,x=Object.assign({},x,{hachureGap:D+R}));return{type:"fillSketch",ops:this.zigzagLines(Z,R,x)}}zigzagLines(Z,x,D){const R=[];return Z.forEach(z=>{var na=X(z);na=Math.round(na/(2*x));let sa=z[0];var ha=z[1];sa[0]>ha[0]&&(sa=z[1],ha=z[0]);z=Math.atan((ha[1]-sa[1])/(ha[0]-sa[0]));for(ha=
0;ha<na;ha++){var va=2*ha*x,Aa=2*(ha+1)*x,Ba=Math.sqrt(2*Math.pow(x,2));va=[sa[0]+va*Math.cos(z),sa[1]+va*Math.sin(z)];Aa=[sa[0]+Aa*Math.cos(z),sa[1]+Aa*Math.sin(z)];Ba=[va[0]+Ba*Math.cos(z+Math.PI/4),va[1]+Ba*Math.sin(z+Math.PI/4)];R.push(...this.helper.doubleLineOps(va[0],va[1],Ba[0],Ba[1],D),...this.helper.doubleLineOps(Ba[0],Ba[1],Aa[0],Aa[1],D))}}),R}}const Bh={};class pi{constructor(Z){this.seed=Z}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}
const ck={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},ln={randOffset:function(Z,x){return hc(Z,x)},randOffsetWithRange:function(Z,x,D){return Sb(Z,x,D)},ellipse:function(Z,x,D,R,z){D=Ma(D,R,z);return Ra(Z,x,z,D).opset},doubleLineOps:function(Z,x,D,R,z){return Db(Z,x,D,R,z,!0)}};class aj{constructor(Z){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,combineNestedSvgPaths:!1,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1};this.config=Z||{};this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(Z){return Z?Object.assign({},this.defaultOptions,Z):this.defaultOptions}_d(Z,x,D){return{shape:Z,sets:x||[],options:D||this.defaultOptions}}line(Z,x,D,R,z){z=this._o(z);
return this._d("line",[{type:"path",ops:Db(Z,x,D,R,z)}],z)}rectangle(Z,x,D,R,z){z=this._o(z);const na=[];var sa=Da([[Z,x],[Z+D,x],[Z+D,x+R],[Z,x+R]],!0,z);z.fill&&(Z=[[Z,x],[Z+D,x],[Z+D,x+R],[Z,x+R]],"solid"===z.fillStyle?na.push(db(Z,z)):na.push(Ib(Z,z)));return"none"!==z.stroke&&na.push(sa),this._d("rectangle",na,z)}ellipse(Z,x,D,R,z){z=this._o(z);const na=[];R=Ma(D,R,z);D=Ra(Z,x,z,R);z.fill&&("solid"===z.fillStyle?(Z=Ra(Z,x,z,R).opset,Z.type="fillPath",na.push(Z)):na.push(Ib(D.estimatedPoints,
z)));return"none"!==z.stroke&&na.push(D.opset),this._d("ellipse",na,z)}circle(Z,x,D,R){Z=this.ellipse(Z,x,D,D,R);return Z.shape="circle",Z}linearPath(Z,x){x=this._o(x);return this._d("linearPath",[Da(Z,!1,x)],x)}arc(Z,x,D,R,z,na,sa=!1,ha){ha=this._o(ha);const va=[],Aa=Ta(Z,x,D,R,z,na,sa,!0,ha);if(sa&&ha.fill)if("solid"===ha.fillStyle)Z=Ta(Z,x,D,R,z,na,!0,!1,ha),Z.type="fillPath",va.push(Z);else{sa=va.push;D=Math.abs(D/2);R=Math.abs(R/2);D+=hc(.01*D,ha);for(R+=hc(.01*R,ha);0>z;)z+=2*Math.PI,na+=2*
Math.PI;na-z>2*Math.PI&&(z=0,na=2*Math.PI);const Ba=(na-z)/ha.curveStepCount,Ha=[];for(;z<=na;z+=Ba)Ha.push([Z+D*Math.cos(z),x+R*Math.sin(z)]);Z=(Ha.push([Z+D*Math.cos(na),x+R*Math.sin(na)]),Ha.push([Z,x]),Ib(Ha,ha));sa.call(va,Z)}return"none"!==ha.stroke&&va.push(Aa),this._d("arc",va,ha)}curve(Z,x){x=this._o(x);const D=[],R=ya(Z,x);x.fill&&"none"!==x.fill&&3<=Z.length&&(Z=Ub(function(z,na=0){var sa=z.length;if(3>sa)throw Error("A curve must have at least three points.");const ha=[];if(3===sa)ha.push([...z[0]],
[...z[1]],[...z[2]],[...z[2]]);else{sa=[];sa.push(z[0],z[0]);for(var va=1;va<z.length;va++)sa.push(z[va]),va===z.length-1&&sa.push(z[va]);z=[];na=1-na;ha.push([...sa[0]]);for(va=1;va+2<sa.length;va++){const Aa=sa[va];z[0]=[Aa[0],Aa[1]];z[1]=[Aa[0]+(na*sa[va+1][0]-na*sa[va-1][0])/6,Aa[1]+(na*sa[va+1][1]-na*sa[va-1][1])/6];z[2]=[sa[va+1][0]+(na*sa[va][0]-na*sa[va+2][0])/6,sa[va+1][1]+(na*sa[va][1]-na*sa[va+2][1])/6];z[3]=[sa[va+1][0],sa[va+1][1]];ha.push(z[1],z[2],z[3])}}return ha}(Z),10,(1+x.roughness)/
2),"solid"===x.fillStyle?D.push(db(Z,x)):D.push(Ib(Z,x)));return"none"!==x.stroke&&D.push(R),this._d("curve",D,x)}polygon(Z,x){x=this._o(x);const D=[],R=Da(Z,!0,x);return x.fill&&("solid"===x.fillStyle?D.push(db(Z,x)):D.push(Ib(Z,x))),"none"!==x.stroke&&D.push(R),this._d("polygon",D,x)}path(Z,x){const D=this._o(x),R=[];if(!Z)return this._d("path",R,D);Z=(Z||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");x=D.fill&&"transparent"!==D.fill&&"none"!==D.fill;const z="none"!==D.stroke,
na=!!(D.simplification&&1>D.simplification),sa=function(ha,va,Aa){var Ba=oa(U(ua(ha)));ha=[];let Ha=[];var Va=[0,0];let Ya=[];const ob=()=>{4<=Ya.length&&Ha.push(...Ub(Ya,va));Ya=[]};for(const {key:Bb,data:Rb}of Ba)switch(Bb){case "M":ob();Ha.length&&(ha.push(Ha),Ha=[]);Va=[Rb[0],Rb[1]];Ha.push(Va);break;case "L":ob();Ha.push([Rb[0],Rb[1]]);break;case "C":Ya.length||(Ba=Ha.length?Ha[Ha.length-1]:Va,Ya.push([Ba[0],Ba[1]]));Ya.push([Rb[0],Rb[1]]);Ya.push([Rb[2],Rb[3]]);Ya.push([Rb[4],Rb[5]]);break;
case "Z":ob(),Ha.push([Va[0],Va[1]])}ob();Ha.length&&(ha.push(Ha),Ha=[]);if(!Aa)return ha;Va=[];for(const Bb of ha)ha=Yb(Bb,0,Bb.length,Aa),ha.length&&Va.push(ha);return Va}(Z,1,na?4-4*D.simplification:(1+D.roughness)/2);if(x)if(D.combineNestedSvgPaths){const ha=[];sa.forEach(va=>ha.push(...va));"solid"===D.fillStyle?R.push(db(ha,D)):R.push(Ib(ha,D))}else sa.forEach(ha=>{"solid"===D.fillStyle?R.push(db(ha,D)):R.push(Ib(ha,D))});return z&&(na?sa.forEach(ha=>{R.push(Da(ha,!1,D))}):R.push(function(ha,
va){ha=oa(U(ua(ha)));const Aa=[];let Ba=[0,0],Ha=[0,0];for(const {key:Va,data:Ya}of ha)switch(Va){case "M":const ob=1*(va.maxRandomnessOffset||0),Bb=va.preserveVertices;Aa.push({op:"move",data:Ya.map(Yc=>Yc+(Bb?0:hc(ob,va)))});Ha=[Ya[0],Ya[1]];Ba=[Ya[0],Ya[1]];break;case "L":Aa.push(...Db(Ha[0],Ha[1],Ya[0],Ya[1],va));Ha=[Ya[0],Ya[1]];break;case "C":const [Rb,ic,mc,Sc,Xc,Pc]=Ya;Aa.push(...La(Rb,ic,mc,Sc,Xc,Pc,Ha,va));Ha=[Xc,Pc];break;case "Z":Aa.push(...Db(Ha[0],Ha[1],Ba[0],Ba[1],va)),Ha=[Ba[0],Ba[1]]}return{type:"path",
ops:Aa}}(Z,D))),this._d("path",R,D)}opsToPath(Z,x){let D="";for(const R of Z.ops)switch(Z="number"==typeof x&&0<=x?R.data.map(z=>+z.toFixed(x)):R.data,R.op){case "move":D+=`M${Z[0]} ${Z[1]} `;break;case "bcurveTo":D+=`C${Z[0]} ${Z[1]}, ${Z[2]} ${Z[3]}, ${Z[4]} ${Z[5]} `;break;case "lineTo":D+=`L${Z[0]} ${Z[1]} `}return D.trim()}toPaths(Z){var x=Z.sets||[];Z=Z.options||this.defaultOptions;const D=[];for(const R of x){x=null;switch(R.type){case "path":x={d:this.opsToPath(R),stroke:Z.stroke,strokeWidth:Z.strokeWidth,
fill:"none"};break;case "fillPath":x={d:this.opsToPath(R),stroke:"none",strokeWidth:0,fill:Z.fill||"none"};break;case "fillSketch":x=this.fillSketch(R,Z)}x&&D.push(x)}return D}fillSketch(Z,x){let D=x.fillWeight;return 0>D&&(D=x.strokeWidth/2),{d:this.opsToPath(Z),stroke:x.fill||"none",strokeWidth:D,fill:"none"}}}class $k{constructor(Z,x){this.canvas=Z;this.ctx=this.canvas.getContext("2d");this.gen=new aj(x)}draw(Z){const x=Z.sets||[],D=Z.options||this.getDefaultOptions(),R=this.ctx;for(const z of x)switch(z.type){case "path":R.save();
R.strokeStyle="none"===D.stroke?"transparent":D.stroke;R.lineWidth=D.strokeWidth;D.strokeLineDash&&R.setLineDash(D.strokeLineDash);D.strokeLineDashOffset&&(R.lineDashOffset=D.strokeLineDashOffset);this._drawToContext(R,z);R.restore();break;case "fillPath":R.save();R.fillStyle=D.fill||"";this._drawToContext(R,z,"curve"===Z.shape||"polygon"===Z.shape?"evenodd":"nonzero");R.restore();break;case "fillSketch":this.fillSketch(R,z,D)}}fillSketch(Z,x,D){let R=D.fillWeight;0>R&&(R=D.strokeWidth/2);Z.save();
D.fillLineDash&&Z.setLineDash(D.fillLineDash);D.fillLineDashOffset&&(Z.lineDashOffset=D.fillLineDashOffset);Z.strokeStyle=D.fill||"";Z.lineWidth=R;this._drawToContext(Z,x);Z.restore()}_drawToContext(Z,x,D="nonzero"){Z.beginPath();for(const R of x.ops){const z=R.data;switch(R.op){case "move":Z.moveTo(z[0],z[1]);break;case "bcurveTo":Z.bezierCurveTo(z[0],z[1],z[2],z[3],z[4],z[5]);break;case "lineTo":Z.lineTo(z[0],z[1])}}"fillPath"===x.type?Z.fill(D):Z.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(Z,
x,D,R,z){Z=this.gen.line(Z,x,D,R,z);return this.draw(Z),Z}rectangle(Z,x,D,R,z){Z=this.gen.rectangle(Z,x,D,R,z);return this.draw(Z),Z}ellipse(Z,x,D,R,z){Z=this.gen.ellipse(Z,x,D,R,z);return this.draw(Z),Z}circle(Z,x,D,R){Z=this.gen.circle(Z,x,D,R);return this.draw(Z),Z}linearPath(Z,x){Z=this.gen.linearPath(Z,x);return this.draw(Z),Z}polygon(Z,x){Z=this.gen.polygon(Z,x);return this.draw(Z),Z}arc(Z,x,D,R,z,na,sa=!1,ha){Z=this.gen.arc(Z,x,D,R,z,na,sa,ha);return this.draw(Z),Z}curve(Z,x){Z=this.gen.curve(Z,
x);return this.draw(Z),Z}path(Z,x){Z=this.gen.path(Z,x);return this.draw(Z),Z}}class Hn{constructor(Z,x){this.svg=Z;this.gen=new aj(x)}draw(Z){var x=Z.sets||[];const D=Z.options||this.getDefaultOptions(),R=this.svg.ownerDocument||window.document,z=R.createElementNS("http://www.w3.org/2000/svg","g"),na=Z.options.fixedDecimalPlaceDigits;for(const sa of x){x=null;switch(sa.type){case "path":x=R.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",this.opsToPath(sa,na));x.setAttribute("stroke",
D.stroke);x.setAttribute("stroke-width",D.strokeWidth+"");x.setAttribute("fill","none");D.strokeLineDash&&x.setAttribute("stroke-dasharray",D.strokeLineDash.join(" ").trim());D.strokeLineDashOffset&&x.setAttribute("stroke-dashoffset",`${D.strokeLineDashOffset}`);break;case "fillPath":x=R.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",this.opsToPath(sa,na));x.setAttribute("stroke","none");x.setAttribute("stroke-width","0");x.setAttribute("fill",D.fill||"");"curve"!==Z.shape&&
"polygon"!==Z.shape||x.setAttribute("fill-rule","evenodd");break;case "fillSketch":x=this.fillSketch(R,sa,D)}x&&z.appendChild(x)}return z}fillSketch(Z,x,D){let R=D.fillWeight;0>R&&(R=D.strokeWidth/2);Z=Z.createElementNS("http://www.w3.org/2000/svg","path");return Z.setAttribute("d",this.opsToPath(x,D.fixedDecimalPlaceDigits)),Z.setAttribute("stroke",D.fill||""),Z.setAttribute("stroke-width",R+""),Z.setAttribute("fill","none"),D.fillLineDash&&Z.setAttribute("stroke-dasharray",D.fillLineDash.join(" ").trim()),
D.fillLineDashOffset&&Z.setAttribute("stroke-dashoffset",`${D.fillLineDashOffset}`),Z}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(Z,x){return this.gen.opsToPath(Z,x)}line(Z,x,D,R,z){Z=this.gen.line(Z,x,D,R,z);return this.draw(Z)}rectangle(Z,x,D,R,z){Z=this.gen.rectangle(Z,x,D,R,z);return this.draw(Z)}ellipse(Z,x,D,R,z){Z=this.gen.ellipse(Z,x,D,R,z);return this.draw(Z)}circle(Z,x,D,R){Z=this.gen.circle(Z,x,D,R);return this.draw(Z)}linearPath(Z,x){Z=
this.gen.linearPath(Z,x);return this.draw(Z)}polygon(Z,x){Z=this.gen.polygon(Z,x);return this.draw(Z)}arc(Z,x,D,R,z,na,sa=!1,ha){Z=this.gen.arc(Z,x,D,R,z,na,sa,ha);return this.draw(Z)}curve(Z,x){Z=this.gen.curve(Z,x);return this.draw(Z)}path(Z,x){Z=this.gen.path(Z,x);return this.draw(Z)}}var Bj={canvas:(Z,x)=>new $k(Z,x),svg:(Z,x)=>new Hn(Z,x),generator:Z=>new aj(Z),newSeed:()=>aj.newSeed()};let dk=(Z=21)=>{let x="",D=crypto.getRandomValues(new Uint8Array(Z));for(;Z--;){let R=63&D[Z];x+=36>R?R.toString(36):
62>R?(R-26).toString(36).toUpperCase():63>R?"_":"-"}return x};var Yg=function(Z){return null!=Z&&"text"===Z.type},ki=function(Z){return null!=Z&&"freedraw"===Z.type},Dg=function(Z){return null!=Z&&oj(Z.type)},oj=function(Z){return"arrow"===Z||"line"===Z},Xg=function(Z){return null!=Z&&"arrow"===Z.type},Ze=function(Z){return null!=Z&&("rectangle"===Z.type||"diamond"===Z.type||"ellipse"===Z.type||"text"===Z.type)},Jf=function(Z,x,D,R,z){return[(Z-D)*Math.cos(z)-(x-R)*Math.sin(z)+D,(Z-D)*Math.sin(z)+
(x-R)*Math.cos(z)+R]},Df=function(Z,x,D){return Jf(Z[0],Z[1],x[0],x[1],D)},qi=function(Z,x,D,R,z,na,sa,ha){var va=Math.cos(R);R=Math.sin(R);return Z.e&&Z.w?x+=z+sa:Z.e?(x+=z*(1+va),D+=z*R,x+=sa*(1-va),D+=sa*-R):Z.w&&(x+=z*(1-va),D+=z*-R,x+=sa*(1+va),D+=sa*R),Z.n&&Z.s?D+=na+ha:Z.n?(x+=na*R,D+=na*(1-va),x+=ha*-R,D+=ha*(1+va)):Z.s&&(x+=na*-R,D+=na*(1+va),x+=ha*R,D+=ha*(1-va)),[x,D]},qj=function(Z){var x=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;if(3<=Z.length){var D=[Z[0],Z[Z.length-1]],
R=D[0];D=D[1];return Math.hypot(D[0]-R[0],D[1]-R[1])<=yc.qx/x}return!1},ek=function(Z,x,D){var R=Z.length;if(3>R)return!1;var z=[Number.MAX_SAFE_INTEGER,D];x=[x,D];for(var na=D=0;na<R;na++){var sa=Z[na],ha=Z[(na+1)%R],va=sa,Aa=ha,Ba=x,Ha=z,Va=Qi(va,Aa,Ba),Ya=Qi(va,Aa,Ha),ob=Qi(Ba,Ha,va),Bb=Qi(Ba,Ha,Aa);if(Va!==Ya&&ob!==Bb||0===Va&&nh(va,Ba,Aa)||0===Ya&&nh(va,Ha,Aa)||0===ob&&nh(Ba,va,Ha)||0===Bb&&nh(Ba,Aa,Ha)){if(0===Qi(sa,x,ha))return nh(sa,x,ha);D++}}return 1==D%2},nh=function(Z,x,D){return x[0]<=
Math.max(Z[0],D[0])&&x[0]>=Math.min(Z[0],D[0])&&x[1]<=Math.max(Z[1],D[1])&&x[1]>=Math.min(Z[1],D[1])},Qi=function(Z,x,D){Z=(x[1]-Z[1])*(D[0]-x[0])-(x[0]-Z[0])*(D[1]-x[1]);return 0===Z?0:0<Z?1:2},Dh=function(Z,x,D){return D?[Math.round(Z/D)*D,Math.round(x/D)*D]:[Z,x]},lm=function(Z,x,D){var R=D.map(function(va){return va[Z]}),z=Math.max.apply(Math,ja(R));R=Math.min.apply(Math,ja(R));z-=R;var na=0===z?1:x/z,sa=1/0;x=D.map(function(va){return va.map(function(Aa,Ba){if(Ba!==Z)return Aa;Aa*=na;return sa=
Math.min(Aa,sa),Aa})});if(2===x.length)return x;var ha=R-sa;return x.map(function(va){return va.map(function(Aa,Ba){return Ba===Z?Aa+ha:Aa})})},Vf=function(Z){if(ki(Z)){var x=ia(tl(Z.points),4);Z=[x[0]+Z.x,x[1]+Z.y,x[2]+Z.x,x[3]+Z.y]}else Z=Dg(Z)?jf(Z):[Z.x,Z.y,Z.x+Z.width,Z.y+Z.height];return Z},Jk=function(Z){var x,D=Hc(Z.sets);try{for(D.s();!(x=D.n()).done;){var R=x.value;if("path"===R.type)return R.ops}}catch(z){D.e(z)}finally{D.f()}return Z.sets[0].ops},Mh=function(Z,x){var D=[0,0];Z=Z.reduce(function(R,
z){var na=z.op;z=z.data;if("move"===na)D=z;else if("bcurveTo"===na){var sa=[z[0],z[1]],ha=[z[2],z[3]],va=[z[4],z[5]],Aa=D;D=va;na=function(Va,Ya){return Math.pow(1-Va,3)*va[Ya]+3*Va*Math.pow(1-Va,2)*ha[Ya]+3*Math.pow(Va,2)*(1-Va)*sa[Ya]+Aa[Ya]*Math.pow(Va,3)};for(z=0;1>=z;){var Ba=na(z,0),Ha=na(z,1);x&&(Ha=ia(x(Ba,Ha),2),Ba=Ha[0],Ha=Ha[1]);R.minY=Math.min(R.minY,Ha);R.minX=Math.min(R.minX,Ba);R.maxX=Math.max(R.maxX,Ba);R.maxY=Math.max(R.maxY,Ha);z+=.1}}return R},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/
0});return[Z.minX,Z.minY,Z.maxX,Z.maxY]},tl=function(Z){var x,D=1/0,R=1/0,z=-1/0,na=-1/0;Z=Hc(Z);try{for(Z.s();!(x=Z.n()).done;){var sa=ia(x.value,2),ha=sa[0],va=sa[1];D=Math.min(D,ha);R=Math.min(R,va);z=Math.max(z,ha);na=Math.max(na,va)}}catch(Aa){Z.e(Aa)}finally{Z.f()}return[D,R,z,na]},jf=function(Z){if(2>Z.points.length||!kh.get(Z)){var x=Z.points.reduce(function(D,R){var z=ia(R,2);R=z[0];z=z[1];return D.minY=Math.min(D.minY,z),D.minX=Math.min(D.minX,R),D.maxX=Math.max(D.maxX,R),D.maxY=Math.max(D.maxY,
z),D},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});Z=[x.minX+Z.x,x.minY+Z.y,x.maxX+Z.x,x.maxY+Z.y]}else x=kh.get(Z),x=Jk(x[0]),x=ia(Mh(x),4),Z=[x[0]+Z.x,x[1]+Z.y,x[2]+Z.x,x[3]+Z.y];return Z},gk=function(Z){var x=ia(Vf(Z),4),D=x[0],R=x[1];var z=x[2];var na=x[3],sa=(D+z)/2,ha=(R+na)/2;if(ki(Z))return z=tl(Z.points.map(function(Ha){Ha=ia(Ha,2);return Jf(Ha[0],Ha[1],sa-Z.x,ha-Z.y,Z.angle)})),z=ia(z,4),[z[0]+Z.x,z[1]+Z.y,z[2]+Z.x,z[3]+Z.y];if(Dg(Z))z=function(Ha,Va,Ya){if(2>Ha.points.length||!kh.get(Ha)){var ob=
Ha.points.reduce(function(Bb,Rb){var ic=ia(Rb,2);Rb=ic[0];ic=ic[1];var mc=ia(Jf(Ha.x+Rb,Ha.y+ic,Va,Ya,Ha.angle),2);return Rb=mc[0],ic=mc[1],Bb.minY=Math.min(Bb.minY,ic),Bb.minX=Math.min(Bb.minX,Rb),Bb.maxX=Math.max(Bb.maxX,Rb),Bb.maxY=Math.max(Bb.maxY,ic),Bb},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[ob.minX,ob.minY,ob.maxX,ob.maxY]}ob=kh.get(Ha);ob=Jk(ob[0]);return Mh(ob,function(Bb,Rb){return Jf(Ha.x+Bb,Ha.y+Rb,Va,Ya,Ha.angle)})}(Z,sa,ha);else if("diamond"===Z.type){R=ia(Jf(sa,R,sa,ha,Z.angle),
2);x=R[0];R=R[1];na=ia(Jf(sa,na,sa,ha,Z.angle),2);var va=na[0];na=na[1];var Aa=ia(Jf(D,ha,sa,ha,Z.angle),2);D=Aa[0];Aa=Aa[1];var Ba=ia(Jf(z,ha,sa,ha,Z.angle),2);z=Ba[0];Ba=Ba[1];z=[Math.min(x,va,D,z),Math.min(R,na,Aa,Ba),Math.max(x,va,D,z),Math.max(R,na,Aa,Ba)]}else"ellipse"===Z.type?(z=(z-D)/2,R=(na-R)/2,va=Math.cos(Z.angle),D=Math.sin(Z.angle),x=Math.hypot(z*va,R*D),z=Math.hypot(R*va,z*D),z=[sa-x,ha-z,sa+x,ha+z]):(va=ia(Jf(D,R,sa,ha,Z.angle),2),x=va[0],va=va[1],Aa=ia(Jf(D,na,sa,ha,Z.angle),2),D=
Aa[0],Aa=Aa[1],Ba=ia(Jf(z,na,sa,ha,Z.angle),2),na=Ba[0],Ba=Ba[1],R=ia(Jf(z,R,sa,ha,Z.angle),2),z=R[0],R=R[1],z=[Math.min(x,D,na,z),Math.min(va,Aa,Ba,R),Math.max(x,D,na,z),Math.max(va,Aa,Ba,R)]);return z},Bg=function(Z){if(!Z.length)return[0,0,0,0];var x=1/0,D=-1/0,R=1/0,z=-1/0;return Z.forEach(function(na){na=ia(gk(na),4);var sa=na[1],ha=na[2],va=na[3];x=Math.min(x,na[0]);R=Math.min(R,sa);D=Math.max(D,ha);z=Math.max(z,va)}),[x,R,D,z]},Re=function(Z,x,D){if(!Dg(Z)&&!ki(Z))return[Z.x,Z.y,Z.x+x,Z.y+
D];x=lm(0,x,lm(1,D,Z.points));ki(Z)?x=tl(x):(D=Bj.generator(),x="sharp"===Z.strokeSharpness?D.linearPath(x,Yf(Z)):D.curve(x,Yf(Z)),x=Jk(x),x=Mh(x));x=ia(x,4);return[x[0]+Z.x,x[1]+Z.y,x[2]+Z.x,x[3]+Z.y]},ul=function(Z,x,D){var R=Bj.generator();x="sharp"===D?R.linearPath(x,Yf(Z)):R.curve(x,Yf(Z));x=Jk(x);x=ia(Mh(x),4);return[x[0]+Z.x,x[1]+Z.y,x[2]+Z.x,x[3]+Z.y]},mf=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"]}'),
$h=function(Z){return[mf.red[Z],mf.pink[Z],mf.grape[Z],mf.violet[Z],mf.indigo[Z],mf.blue[Z],mf.cyan[Z],mf.teal[Z],mf.green[Z],mf.lime[Z],mf.yellow[Z],mf.orange[Z]]},ri={canvasBackground:[mf.white,mf.gray[0],mf.gray[1]].concat(ja($h(0))),elementBackground:["transparent",mf.gray[4],mf.gray[6]].concat(ja($h(6))),elementStroke:[mf.black,mf.gray[8],mf.gray[7]].concat(ja($h(9)))},rh=e(6207),xi=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),nj=/^Win/.test(window.navigator.platform),Af=xi?"metaKey":
"ctrlKey",oh=function(Z){return"ArrowLeft"===Z||"ArrowRight"===Z||"ArrowDown"===Z||"ArrowUp"===Z},Nh=function(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)},Dj=function(Z){return Z instanceof HTMLElement&&"wysiwyg"===Z.dataset.type||Z instanceof HTMLBRElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLInputElement&&("text"===Z.type||"number"===Z.type)},mm=function(Z){Z=Z.fontFamily;for(var x=0,D=Object.entries(yc.ut);x<D.length;x++){var R=ia(D[x],2),z=R[0];if(R[1]===Z)return"".concat(z,
", ").concat(yc._D)}return yc._D},jk=function(Z){var x=Z.fontFamily;return"".concat(Z.fontSize,"px ").concat(mm({fontFamily:x}))},Vl=function(Z,x){var D=document.createElement("div"),R=document.body;D.style.position="absolute";D.style.whiteSpace="pre";D.style.font=x;R.appendChild(D);D.innerText=Z.split("\n").map(function(z){return z||" "}).join("\n");Z=D.offsetWidth;x=D.offsetHeight;R=document.createElement("span");R.style.display="inline-block";R.style.overflow="hidden";R.style.width="1px";R.style.height=
"1px";D.appendChild(R);R=R.offsetTop+R.offsetHeight;return document.body.removeChild(D),{width:Z,height:x,baseline:R}},Sm=function(Z,x){var D=0,R=null,z=function(){for(var na=arguments.length,sa=Array(na),ha=0;ha<na;ha++)sa[ha]=arguments[ha];R=sa;clearTimeout(D);D=window.setTimeout(function(){R=null;Z.apply(void 0,sa)},x)};return z.flush=function(){if(clearTimeout(D),R){var na=R;R=null;Z.apply(void 0,ja(na))}},z.cancel=function(){R=null;clearTimeout(D)},z},Pi=function(Z){Z&&(Z.style.cursor="")},zi=
function(Z,x){Z&&(Z.style.cursor=x)},si=function(Z,x){Z&&("selection"===x?Pi(Z):Z.style.cursor=yc.oc.CROSSHAIR)},Ul=function(){var Z;return"HTML"===(null===(Z=document.fullscreenElement)||void 0===Z?void 0:Z.nodeName)},Vd=function(Z){return Z=Z.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),xi?Z.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):Z.replace(/\bCtrlOrCmd\b/i,"Ctrl")},hh=function(Z,x){var D=x.zoom,
R=1/D.value;return{x:(Z.clientX-D.translation.x-x.offsetLeft)*R-x.scrollX,y:(Z.clientY-D.translation.y-x.offsetTop)*R-x.scrollY}},hk=function(Z,x){var D=x.zoom;return{x:(Z.sceneX+x.scrollX+x.offsetLeft)*D.value+D.translation.x,y:(Z.sceneY+x.scrollY+x.offsetTop)*D.value+D.translation.y}},Gj=function(Z){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(Z))},ik=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),Hj=function(Z){Z=ia(Z,
2);return{x:Z[0],y:Z[1]}},kk=function(Z){if("AbortError"!==(null==Z?void 0:Z.name))throw Z;},Ri=function(Z){var x=5===Z.length&&"0"===Z.substr(4,1),D=9===Z.length&&"00"===Z.substr(7,2);return x||D||Z===ri.elementBackground[0]},ag=function(Z){return function(x){(0,rh.unstable_batchedUpdates)(Z,x)}},Bm=yc.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Ij=function(){var Z=new Map,x=yc.rk,D=yc.n5,R=mf.black,z=yc.Hg,na="".concat(Wb("labels.untitled"),"-"),sa=na.concat;var ha=new Date;var va=ha.getFullYear();
var Aa="".concat(ha.getMonth()+1).padStart(2,"0"),Ba="".concat(ha.getDate()).padStart(2,"0"),Ha="".concat(ha.getHours()).padStart(2,"0");ha="".concat(ha.getMinutes()).padStart(2,"0");va="".concat(va,"-").concat(Aa,"-").concat(Ba,"-").concat(Ha).concat(ha);return{theme:"light",collaborators:Z,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:x,currentItemFontSize:D,currentItemLinearStrokeSharpness:"round",
currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:R,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:z,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:Bm,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,
isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:sa.call(na,va),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:mf.white,zenModeEnabled:!1,
zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1}},xl={theme:{browser:!0,export:!1},collaborators:{browser:!1,export:!1},currentChartType:{browser:!0,export:!1},currentItemBackgroundColor:{browser:!0,export:!1},currentItemEndArrowhead:{browser:!0,export:!1},currentItemFillStyle:{browser:!0,export:!1},currentItemFontFamily:{browser:!0,export:!1},currentItemFontSize:{browser:!0,export:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1},currentItemOpacity:{browser:!0,export:!1},currentItemRoughness:{browser:!0,
export:!1},currentItemStartArrowhead:{browser:!0,export:!1},currentItemStrokeColor:{browser:!0,export:!1},currentItemStrokeSharpness:{browser:!0,export:!1},currentItemStrokeStyle:{browser:!0,export:!1},currentItemStrokeWidth:{browser:!0,export:!1},currentItemTextAlign:{browser:!0,export:!1},cursorButton:{browser:!0,export:!1},draggingElement:{browser:!1,export:!1},editingElement:{browser:!1,export:!1},editingGroupId:{browser:!0,export:!1},editingLinearElement:{browser:!1,export:!1},elementLocked:{browser:!0,
export:!1},elementType:{browser:!0,export:!1},errorMessage:{browser:!1,export:!1},exportBackground:{browser:!0,export:!1},exportEmbedScene:{browser:!0,export:!1},exportScale:{browser:!0,export:!1},exportWithDarkMode:{browser:!0,export:!1},fileHandle:{browser:!1,export:!1},gridSize:{browser:!0,export:!0},height:{browser:!1,export:!1},isBindingEnabled:{browser:!1,export:!1},isLibraryOpen:{browser:!1,export:!1},isLoading:{browser:!1,export:!1},isResizing:{browser:!1,export:!1},isRotating:{browser:!1,
export:!1},lastPointerDownWith:{browser:!0,export:!1},multiElement:{browser:!1,export:!1},name:{browser:!0,export:!1},offsetLeft:{browser:!1,export:!1},offsetTop:{browser:!1,export:!1},openMenu:{browser:!0,export:!1},openPopup:{browser:!1,export:!1},pasteDialog:{browser:!1,export:!1},previousSelectedElementIds:{browser:!0,export:!1},resizingElement:{browser:!1,export:!1},scrolledOutside:{browser:!0,export:!1},scrollX:{browser:!0,export:!1},scrollY:{browser:!0,export:!1},selectedElementIds:{browser:!0,
export:!1},selectedGroupIds:{browser:!0,export:!1},selectionElement:{browser:!1,export:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1},showHelpDialog:{browser:!1,export:!1},showStats:{browser:!0,export:!1},startBoundElement:{browser:!1,export:!1},suggestedBindings:{browser:!1,export:!1},toastMessage:{browser:!1,export:!1},viewBackgroundColor:{browser:!0,export:!0},width:{browser:!1,export:!1},zenModeEnabled:{browser:!0,export:!1},zoom:{browser:!0,export:!1},viewModeEnabled:{browser:!1,export:!1}},
fk=function(Z,x){var D,R={},z=rd(Object.keys(Z));try{for(z.s();!(D=z.n()).done;){var na=D.value,sa=xl[na];null!=sa&&sa[x]&&(R[na]=Z[na])}}catch(ha){z.e(ha)}finally{z.f()}return R},{min:Wl,PI:nn}=Math,Gm=nn+1E-4,zj=Ij(),Sl=function(Z,x,D){switch(D.globalAlpha=Z.opacity/100,Z.type){case "rectangle":case "diamond":case "ellipse":D.lineJoin="round";D.lineCap="round";x.draw(kh.get(Z));break;case "arrow":case "line":D.lineJoin="round";D.lineCap="round";kh.get(Z).forEach(function(va){x.draw(va)});break;
case "freedraw":D.save();D.fillStyle=Z.strokeColor;var R=Oh.get(Z);D.fillStyle=Z.strokeColor;D.fill(R);D.restore();break;default:if(!Yg(Z))throw Error("Unimplemented type ".concat(Z.type));var z=ik.test(Z.text);(R=z&&!D.canvas.isConnected)&&document.body.appendChild(D.canvas);D.canvas.setAttribute("dir",z?"rtl":"ltr");D.save();D.font=jk(Z);D.fillStyle=Z.strokeColor;D.textAlign=Z.textAlign;z=Z.text.replace(/\r\n?/g,"\n").split("\n");var na=Z.height/z.length,sa=Z.height-Z.baseline;Z="center"===Z.textAlign?
Z.width/2:"right"===Z.textAlign?Z.width:0;for(var ha=0;ha<z.length;ha++)D.fillText(z[ha],Z,(ha+1)*na-sa);D.restore();R&&D.canvas.remove()}D.globalAlpha=1},Xl=new WeakMap,kh=new WeakMap,Yf=function(Z){var x={seed:Z.seed,strokeLineDash:"dashed"===Z.strokeStyle?[8,8+Z.strokeWidth]:"dotted"===Z.strokeStyle?[1.5,6+Z.strokeWidth]:void 0,disableMultiStroke:"solid"!==Z.strokeStyle,strokeWidth:"solid"!==Z.strokeStyle?Z.strokeWidth+.5:Z.strokeWidth,fillWeight:Z.strokeWidth/2,hachureGap:4*Z.strokeWidth,roughness:Z.roughness,
stroke:Z.strokeColor,preserveVertices:1<arguments.length&&void 0!==arguments[1]&&arguments[1]};switch(Z.type){case "rectangle":case "diamond":case "ellipse":return x.fillStyle=Z.fillStyle,x.fill="transparent"===Z.backgroundColor?void 0:Z.backgroundColor,"ellipse"===Z.type&&(x.curveFitting=1),x;case "line":return qj(Z.points)&&(x.fillStyle=Z.fillStyle,x.fill="transparent"===Z.backgroundColor?void 0:Z.backgroundColor),x;case "freedraw":case "arrow":return x;default:throw Error("Unimplemented type ".concat(Z.type));
}},hi=function(Z,x){var D=kh.get(Z)||null;if(!D){switch(Xl.delete(Z),Z.type){case "rectangle":if("round"===Z.strokeSharpness){var R=Z.width;D=Z.height;var z=.25*Math.min(R,D);D=x.path("M ".concat(z," 0 L ").concat(R-z," 0 Q ").concat(R," 0, ").concat(R," ").concat(z," L ").concat(R," ").concat(D-z," Q ").concat(R," ").concat(D,", ").concat(R-z," ").concat(D," L ").concat(z," ").concat(D," Q 0 ").concat(D,", 0 ").concat(D-z," L 0 ").concat(z," Q 0 0, ").concat(z," 0"),Yf(Z,!0))}else D=x.rectangle(0,
0,Z.width,Z.height,Yf(Z));break;case "diamond":R=ia(function(Aa){var Ba=Math.floor(Aa.width/2)+1,Ha=Math.floor(Aa.height/2)+1;return[Ba,0,Aa.width,Ha,Ba,Aa.height,0,Ha]}(Z),8);D=x.polygon([[R[0],R[1]],[R[2],R[3]],[R[4],R[5]],[R[6],R[7]]],Yf(Z));break;case "ellipse":D=x.ellipse(Z.width/2,Z.height/2,Z.width,Z.height,Yf(Z));break;case "line":case "arrow":var na=Yf(Z);D=Z.points.length?Z.points:[[0,0]];if(D="sharp"===Z.strokeSharpness?na.fill?[x.polygon(D,na)]:[x.linearPath(D,na)]:[x.curve(D,na)],"arrow"===
Z.type){var sa=Z.startArrowhead;sa=void 0===sa?null:sa;var ha=Z.endArrowhead;ha=void 0===ha?"arrow":ha;var va=function(Aa,Ba,Ha,Va){Ba=function(Rb,ic,mc,Sc){ic=Jk(ic[0]);if(1>ic.length)return null;var Xc="start"===mc?1:ic.length-1,Pc=ic[Xc].data,Yc=[Pc[4],Pc[5]],Bd=[Pc[2],Pc[3]],Xd=[Pc[0],Pc[1]];ic=ic[Xc-1];var kd=[0,0];"move"===ic.op?kd=ic.data:"bcurveTo"===ic.op&&(kd=[ic.data[4],ic.data[5]]);Xc=function(pf,ye){return Math.pow(1-pf,3)*Yc[ye]+3*pf*Math.pow(1-pf,2)*Bd[ye]+3*Math.pow(pf,2)*(1-pf)*Xd[ye]+
kd[ye]*Math.pow(pf,3)};ic=ia("start"===mc?kd:Yc,2);mc=ic[0];ic=ic[1];Pc=[Xc(.3,0),Xc(.3,1)];Xc=Pc[0];Pc=Pc[1];var qd=Math.hypot(mc-Xc,ic-Pc);Xc=(mc-Xc)/qd;Pc=(ic-Pc)/qd;qd={arrow:30,bar:15,dot:15}[Sc];var Hd=0;if("arrow"===Sc){var He=ia(Rb.points[Rb.points.length-1],2);Hd=He[0];He=He[1];var Tg=ia(1<Rb.points.length?Rb.points[Rb.points.length-2]:[0,0],2);Hd=Math.hypot(Hd-Tg[0],He-Tg[1])}else for(He=0;He<Rb.points.length;He++){var ni=ia(Rb.points[He-1]||[0,0],2);Tg=ni[0];ni=ni[1];var Bi=ia(Rb.points[He],
2);Hd+=Math.hypot(Bi[0]-Tg,Bi[1]-ni)}qd=Math.min(qd,Hd/2);Xc=mc-Xc*qd;Pc=ic-Pc*qd;if("dot"===Sc)return[mc,ic,Math.hypot(Pc-ic,Xc-mc)+Rb.strokeWidth];Sc={arrow:20,bar:90}[Sc];qd=ia(Jf(Xc,Pc,mc,ic,-Sc*Math.PI/180),2);Rb=qd[0];qd=qd[1];Sc=ia(Jf(Xc,Pc,mc,ic,Sc*Math.PI/180),2);return[mc,ic,Rb,qd,Sc[0],Sc[1]]}(Aa,Ba,Ha,Va);if(null===Ba)return[];if("dot"===Va)return Va=ia(Ba,3),[x.circle(Va[0],Va[1],Va[2],yg(yg({},na),{},{fill:Aa.strokeColor,fillStyle:"solid",stroke:"none"}))];var Ya=ia(Ba,6);Va=Ya[0];Ba=
Ya[1];Ha=Ya[2];var ob=Ya[3],Bb=Ya[4];Ya=Ya[5];"dotted"===Aa.strokeStyle?(Aa=[1.5,6+(Aa.strokeWidth-1)],na.strokeLineDash=[Aa[0],Aa[1]-1]):delete na.strokeLineDash;return[x.line(Ha,ob,Va,Ba,na),x.line(Bb,Ya,Va,Ba,na)]};null!==sa&&(sa=va(Z,D,"start",sa),(z=D).push.apply(z,ja(sa)));null!==ha&&(z=va(Z,D,"end",ha),(R=D).push.apply(R,ja(z)))}break;case "freedraw":xg(Z);D=[];break;case "text":D=[]}kh.set(Z,D)}},gh=function(Z,x){var D=x?x.zoom:zj.zoom,R=Xl.get(Z);x=R&&R.canvasZoom!==D.value&&!(null!=x&&x.shouldCacheIgnoreZoom);
if(!R||x){R=document.createElement("canvas");x=R.getContext("2d");var z="freedraw"===Z.type?12*Z.strokeWidth:20,na=0,sa=0;if(Dg(Z)||ki(Z)){var ha=ia(Vf(Z),4);na=ha[0];sa=ha[1];var va=ha[2];ha=ha[3];na=Math.floor(na);va=Math.ceil(va);sa=Math.floor(sa);ha=Math.ceil(ha);R.width=Math.abs(na-va)*window.devicePixelRatio*D.value+z*D.value*2;R.height=Math.abs(sa-ha)*window.devicePixelRatio*D.value+z*D.value*2;na=Z.x>na?Math.floor(Math.abs(Z.x-na))*window.devicePixelRatio*D.value:0;sa=Z.y>sa?Math.floor(Math.abs(Z.y-
sa))*window.devicePixelRatio*D.value:0;x.translate(na,sa)}else R.width=Z.width*window.devicePixelRatio*D.value+z*D.value*2,R.height=Z.height*window.devicePixelRatio*D.value+z*D.value*2;x.save();x.translate(z*D.value,z*D.value);x.scale(window.devicePixelRatio*D.value,window.devicePixelRatio*D.value);z=Bj.canvas(R);D=(Sl(Z,z,x),x.restore(),{element:Z,canvas:R,canvasZoom:D.value,canvasOffsetX:na,canvasOffsetY:sa});return Xl.set(Z,D),D}return R},Ek=function(Z,x,D,R){x=Z.element;var z="freedraw"===x.type?
12*x.strokeWidth:20,na=ia(Vf(x),4),sa=na[0],ha=na[1],va=na[2];na=na[3];ki(x)&&(sa=Math.floor(sa),va=Math.ceil(va),ha=Math.floor(ha),na=Math.ceil(na));var Aa=((sa+va)/2+R.scrollX)*window.devicePixelRatio;R=((ha+na)/2+R.scrollY)*window.devicePixelRatio;D.save();D.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);D.translate(Aa,R);D.rotate(x.angle);D.drawImage(Z.canvas,-(va-sa)/2*window.devicePixelRatio-z*Z.canvasZoom/Z.canvasZoom,-(na-ha)/2*window.devicePixelRatio-z*Z.canvasZoom/Z.canvasZoom,
Z.canvas.width/Z.canvasZoom,Z.canvas.height/Z.canvasZoom);D.restore()},lh=function(Z,x,D,R,z){var na=x.generator;switch(Z.type){case "selection":D.save();D.translate(Z.x+z.scrollX,Z.y+z.scrollY);D.fillStyle="rgba(0, 0, 255, 0.10)";D.fillRect(0,0,Z.width,Z.height);D.restore();break;case "freedraw":if(hi(Z,na),R)Z=gh(Z,z),Ek(Z,0,D,z);else{na=ia(Vf(Z),4);var sa=na[0];R=na[1];var ha=na[2],va=na[3];na=(sa+ha)/2+z.scrollX;z=(R+va)/2+z.scrollY;sa=(ha-sa)/2-(Z.x-sa);R=(va-R)/2-(Z.y-R);D.save();D.translate(na,
z);D.rotate(Z.angle);D.translate(-sa,-R);Sl(Z,x,D);D.restore()}break;case "rectangle":case "diamond":case "ellipse":case "line":case "arrow":case "text":(hi(Z,na),R)?(Z=gh(Z,z),Ek(Z,0,D,z)):(na=ia(Vf(Z),4),sa=na[0],R=na[1],ha=na[2],va=na[3],na=(sa+ha)/2+z.scrollX,z=(R+va)/2+z.scrollY,sa=(ha-sa)/2-(Z.x-sa),R=(va-R)/2-(Z.y-R),D.save(),D.translate(na,z),D.rotate(Z.angle),D.translate(-sa,-R),Sl(Z,x,D),D.restore());break;default:throw Error("Unimplemented type ".concat(Z.type));}},Li=function(Z,x,D){if(void 0===
D)return Z.draw(x);x={sets:x.sets,shape:x.shape,options:yg(yg({},x.options),{},{fixedDecimalPlaceDigits:D})};return Z.draw(x)},Bf=function(Z,x,D,R,z){var na=ia(Vf(Z),4),sa=na[0],ha=na[1],va=(na[2]-sa)/2-(Z.x-sa),Aa=(na[3]-ha)/2-(Z.y-ha),Ba=180*Z.angle/Math.PI;na=x.generator;switch(Z.type){case "selection":throw Error("Selection rendering is not supported for SVG");case "rectangle":case "diamond":case "ellipse":hi(Z,na);na=Li(x,kh.get(Z),yc.zK);sa=Z.opacity/100;1!==sa&&(na.setAttribute("stroke-opacity",
"".concat(sa)),na.setAttribute("fill-opacity","".concat(sa)));na.setAttribute("stroke-linecap","round");na.setAttribute("transform","translate(".concat(R||0," ").concat(z||0,") rotate(").concat(Ba," ").concat(va," ").concat(Aa,")"));D.appendChild(na);break;case "line":case "arrow":hi(Z,na);var Ha=D.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g"),Va=Z.opacity/100;Ha.setAttribute("stroke-linecap","round");kh.get(Z).forEach(function(Sc){Sc=Li(x,Sc,yc.zK);1!==Va&&(Sc.setAttribute("stroke-opacity",
"".concat(Va)),Sc.setAttribute("fill-opacity","".concat(Va)));Sc.setAttribute("transform","translate(".concat(R||0," ").concat(z||0,") rotate(").concat(Ba," ").concat(va," ").concat(Aa,")"));"line"===Z.type&&qj(Z.points)&&"transparent"!==Z.backgroundColor&&Sc.setAttribute("fill-rule","evenodd");Ha.appendChild(Sc)});D.appendChild(Ha);break;case "freedraw":xg(Z);sa=Z.opacity/100;na=D.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");1!==sa&&(na.setAttribute("stroke-opacity","".concat(sa)),
na.setAttribute("fill-opacity","".concat(sa)));na.setAttribute("transform","translate(".concat(R||0," ").concat(z||0,") rotate(").concat(Ba," ").concat(va," ").concat(Aa,")"));sa=D.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");na.setAttribute("stroke","none");na.setAttribute("fill",Z.strokeColor);sa.setAttribute("d",Se(Z));na.appendChild(sa);D.appendChild(na);break;default:if(!Yg(Z))throw Error("Unimplemented type ".concat(Z.type));sa=Z.opacity/100;na=D.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
"g");1!==sa&&(na.setAttribute("stroke-opacity","".concat(sa)),na.setAttribute("fill-opacity","".concat(sa)));na.setAttribute("transform","translate(".concat(R||0," ").concat(z||0,") rotate(").concat(Ba," ").concat(va," ").concat(Aa,")"));sa=Z.text.replace(/\r\n?/g,"\n").split("\n");ha=Z.height/sa.length;for(var Ya=Z.height-Z.baseline,ob="center"===Z.textAlign?Z.width/2:"right"===Z.textAlign?Z.width:0,Bb=ik.test(Z.text)?"rtl":"ltr",Rb="center"===Z.textAlign?"middle":"right"===Z.textAlign||"rtl"===
Bb?"end":"start",ic=0;ic<sa.length;ic++){var mc=D.ownerDocument.createElementNS("http://www.w3.org/2000/svg","text");mc.textContent=sa[ic];mc.setAttribute("x","".concat(ob));mc.setAttribute("y","".concat((ic+1)*ha-Ya));mc.setAttribute("font-family",mm(Z));mc.setAttribute("font-size","".concat(Z.fontSize,"px"));mc.setAttribute("fill",Z.strokeColor);mc.setAttribute("text-anchor",Rb);mc.setAttribute("style","white-space: pre;");mc.setAttribute("direction",Bb);na.appendChild(mc)}D.appendChild(na)}},Oh=
new WeakMap([]),Ue=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,Ph=function(){function Z(){q(this,Z);this.callbacks=new Set;this.nonDeletedElements=[];this.elements=[];this.elementsMap=new Map}return y(Z,[{key:"getElementsIncludingDeleted",value:function(){return this.elements}},{key:"getElements",value:function(){return this.nonDeletedElements}},{key:"getElement",value:function(x){return this.elementsMap.get(x)||null}},{key:"getNonDeletedElement",value:function(x){return(x=this.getElement(x))&&
!x.isDeleted?x:null}},{key:"getNonDeletedElements",value:function(x){var D=this,R=[];return x.forEach(function(z){z=D.getNonDeletedElement(z);null!=z&&R.push(z)}),R}},{key:"replaceAllElements",value:function(x){var D=this;this.elements=x;this.elementsMap.clear();x.forEach(function(R){D.elementsMap.set(R.id,R);Z.mapElementToScene(R,D)});this.nonDeletedElements=oe(this.elements);this.informMutation()}},{key:"informMutation",value:function(){for(var x=0,D=Array.from(this.callbacks);x<D.length;x++)(0,
D[x])()}},{key:"addCallback",value:function(x){var D=this;if(this.callbacks.has(x))throw Error();return this.callbacks.add(x),function(){if(!D.callbacks.has(x))throw Error();D.callbacks.delete(x)}}},{key:"destroy",value:function(){var x=this;Z.sceneMapById.forEach(function(D,R){D===x&&Z.sceneMapById.delete(R)});this.callbacks.clear()}}],[{key:"mapElementToScene",value:function(x,D){"string"==typeof x?this.sceneMapById.set(x,D):this.sceneMapByElement.set(x,D)}},{key:"getScene",value:function(x){return"string"==
typeof x?this.sceneMapById.get(x)||null:this.sceneMapByElement.get(x)||null}}]),Z}();Ph.sceneMapByElement=new WeakMap;Ph.sceneMapById=new Map;var Jj=new pi(Date.now()),yl=function(){return Math.floor(Jj.next()*Math.pow(2,31))},ke=function(Z,x){var D,R=!1,z=x.points,na;for(na in void 0!==z&&(x=rb(rb({},function(Ya){var ob=Ya.map(function(Bb){return Bb[0]});Ya=Ya.map(function(Bb){return Bb[1]});return{width:Math.max.apply(Math,ja(ob))-Math.min.apply(Math,ja(ob)),height:Math.max.apply(Math,ja(Ya))-Math.min.apply(Math,
ja(Ya))}}(z)),x)),x){var sa=x[na];if(void 0!==sa&&(Z[na]!==sa||"object"===G(sa)&&null!==sa&&"groupIds"!==na)){if("points"===na){var ha=Z[na],va=sa;if(ha.length===va.length){for(var Aa=!1,Ba=ha.length;--Ba;){var Ha=ha[Ba],Va=va[Ba];if(Ha[0]!==Va[0]||Ha[1]!==Va[1]){Aa=!0;break}}if(!Aa)continue}}Z[na]=sa;R=!0}}R&&(void 0===x.height&&void 0===x.width&&void 0===z||kh.delete(Z),Z.version++,Z.versionNonce=yl(),null===(D=Ph.getScene(Z))||void 0===D||D.informMutation())},cf=function(Z,x){var D=!1,R;for(R in x){var z=
x[R];void 0!==z&&(Z[R]!==z||"object"===G(z)&&null!==z&&"groupIds"!==R)&&(D=!0)}return D?rb(rb(rb({},Z),x),{},{version:Z.version+1,versionNonce:yl()}):Z},vg=function(Z,x){return Z.version=(null!=x?x:Z.version)+1,Z.versionNonce=yl(),Z},Kj=function(Z){return Dg(Z)||ki(Z)?2>Z.points.length:0===Z.width&&0===Z.height},mk=function(Z,x,D){var R=Math.abs(x),z=Math.abs(D);"line"===Z||"arrow"===Z||"freedraw"===Z?(Z=Math.round(Math.atan(z/R)/yc.ay)*yc.ay,0===Z?D=0:Z===Math.PI/2?x=0:D=Math.round(R*Math.tan(Z))*
Math.sign(D)||D):"selection"!==Z&&(D=R*Math.sign(D));return{width:x,height:D}},Rj=function(Z){var x={width:Z.width,height:Z.height,x:Z.x,y:Z.y};if(0>Z.width){var D=Math.abs(Z.width);x.width=D;x.x=Z.x-D}0>Z.height&&(D=Math.abs(Z.height),x.height=D,x.y=Z.y-D);return x},Qf=function(Z,x,D){D=D.filter(function(R){return R.groupIds.includes(Z)});return 2>D.length?x.selectedGroupIds[Z]||x.editingGroupId===Z?rc(rc({},x),{},{selectedGroupIds:rc(rc({},x.selectedGroupIds),{},da({},Z,!1)),editingGroupId:null}):
x:rc(rc({},x),{},{selectedGroupIds:rc(rc({},x.selectedGroupIds),{},da({},Z,!0)),selectedElementIds:rc(rc({},x.selectedElementIds),Object.fromEntries(D.map(function(R){return[R.id,!0]})))})},dh=function(Z,x){return x.groupIds.filter(function(D){return D!==Z.editingGroupId}).find(function(D){return Z.selectedGroupIds[D]})},vi=function(Z){return Object.entries(Z.selectedGroupIds).filter(function(x){x=ia(x,2);x[0];return x[1]}).map(function(x){x=ia(x,2);var D=x[0];x[1];return D})},Me=function(Z,x){var D=
rc(rc({},Z),{},{selectedGroupIds:{}}),R=Sf(x,Z);if(!R.length)return rc(rc({},D),{},{editingGroupId:null});var z;R=kb(R);try{for(R.s();!(z=R.n()).done;){var na=z.value.groupIds;if(Z.editingGroupId){var sa=na.indexOf(Z.editingGroupId);-1<sa&&(na=na.slice(0,sa))}0<na.length&&(D=Qf(na[na.length-1],D,x))}}catch(ha){R.e(ha)}finally{R.f()}return D},li=function(Z,x){return Z.filter(function(D){return D.groupIds.includes(x)})},gj="x y strokeColor backgroundColor fillStyle strokeWidth strokeStyle roughness opacity width height angle groupIds strokeSharpness boundElementIds".split(" "),
xm=function(Z,x){var D,R,z=x.x,na=x.y,sa=x.strokeColor,ha=x.backgroundColor,va=x.fillStyle,Aa=x.strokeWidth,Ba=x.strokeStyle,Ha=x.roughness,Va=x.opacity,Ya=x.width;Ya=void 0===Ya?0:Ya;var ob=x.height;ob=void 0===ob?0:ob;var Bb=x.angle;Bb=void 0===Bb?0:Bb;var Rb=x.groupIds;Rb=void 0===Rb?[]:Rb;var ic=x.strokeSharpness,mc=x.boundElementIds;mc=void 0===mc?null:mc;x=Za(x,gj);return{id:x.id||dk(),type:Z,x:z,y:na,width:Ya,height:ob,angle:Bb,strokeColor:sa,backgroundColor:ha,fillStyle:va,strokeWidth:Aa,
strokeStyle:Ba,roughness:Ha,opacity:Va,groupIds:Rb,strokeSharpness:ic,seed:null!==(D=x.seed)&&void 0!==D?D:yl(),version:x.version||1,versionNonce:null!==(R=x.versionNonce)&&void 0!==R?R:0,isDeleted:!1,boundElementIds:mc}},xf=function(Z){return xm(Z.type,Z)},kl=function(Z,x){return{x:"center"===Z.textAlign?x.width/2:"right"===Z.textAlign?x.width:0,y:"middle"===Z.verticalAlign?x.height/2:0}},Eg=function(Z){var x=Vl(Z.text,jk(Z)),D=kl(Z,x);return cf(Tc(Tc({},xm("text",Z)),{},{text:Z.text,fontSize:Z.fontSize,
fontFamily:Z.fontFamily,textAlign:Z.textAlign,verticalAlign:Z.verticalAlign,x:Z.x-D.x,y:Z.y-D.y,width:x.width,height:x.height,baseline:x.baseline}),{})},Qg=function(Z){return Tc(Tc({},xm(Z.type,Z)),{},{points:Z.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:Z.startArrowhead,endArrowhead:Z.endArrowhead})},Wf=function D(x){var R=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if(null==x||"object"!==G(x))return x;if("[object Object]"===Object.prototype.toString.call(x)){var z=
"function"==typeof x.constructor?Object.create(Object.getPrototypeOf(x)):{},na;for(na in x)x.hasOwnProperty(na)&&(0!==R||"shape"!==na&&"canvas"!==na)&&(z[na]=D(x[na],R+1));return z}if(Array.isArray(x)){z=x.length;for(na=Array(z);z--;)na[z]=D(x[z],R+1);return na}return x},Xj=function(x,D,R,z){R=Wf(R);return R.id=dk(),R.seed=yl(),R.groupIds=function(na,sa,ha){var va=ja(na);sa=sa?na.indexOf(sa):-1;na=-1<sa?sa:na.length;for(sa=0;sa<na;sa++)va[sa]=ha(va[sa]);return va}(R.groupIds,x,function(na){return D.has(na)||
D.set(na,dk()),D.get(na)}),z&&(R=Object.assign(R,z)),R},Qh={mouse:8,pen:16,touch:28},sj={e:!0,s:!0,n:!0,w:!0},Nm={e:!0,s:!0,n:!0,w:!0},Qj={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Uf={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},af=function(x,D,R,z,na,sa,ha){x=ia(Jf(x+R/2,D+z/2,na,sa,ha),2);return[x[0]-R/2,x[1]-z/2,R,z]},Jg=function(x,D,R,z){var na=ia(x,4),sa=na[0],ha=na[1],va=na[2];na=na[3];var Aa=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},Ba=Qh[z],Ha=Ba/R.value,Va=Ba/R.value,Ya=Ba/R.value,ob=Ba/R.value,
Bb=va-sa,Rb=na-ha,ic=(sa+va)/2,mc=(ha+na)/2,Sc=4/R.value;Ba=(Ba-8)/(2*R.value);var Xc={nw:Aa.nw?void 0:af(sa-Sc-Ya+Ba,ha-Sc-ob+Ba,Ha,Va,ic,mc,D),ne:Aa.ne?void 0:af(va+Sc-Ba,ha-Sc-ob+Ba,Ha,Va,ic,mc,D),sw:Aa.sw?void 0:af(sa-Sc-Ya+Ba,na+Sc-Ba,Ha,Va,ic,mc,D),se:Aa.se?void 0:af(va+Sc-Ba,na+Sc-Ba,Ha,Va,ic,mc,D),rotation:Aa.rotation?void 0:af(sa+Bb/2-Ha/2,ha-Sc-ob+Ba-16/R.value,Ha,Va,ic,mc,D)},Pc=5*Qh.mouse/R.value;return Math.abs(Bb)>Pc&&(Aa.n||(Xc.n=af(sa+Bb/2-Ha/2,ha-Sc-ob+Ba,Ha,Va,ic,mc,D)),Aa.s||(Xc.s=
af(sa+Bb/2-Ha/2,na+Sc-Ba,Ha,Va,ic,mc,D))),Math.abs(Rb)>Pc&&(Aa.w||(Xc.w=af(sa-Sc-Ya+Ba,ha+Rb/2-Va/2,Ha,Va,ic,mc,D)),Aa.e||(Xc.e=af(va+Sc-Ba,ha+Rb/2-Va/2,Ha,Va,ic,mc,D))),Xc},Tk=function(x,D){var R=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"mouse",z={};if("arrow"===x.type||"line"===x.type||"freedraw"===x.type){if(2===x.points.length){var na=ia(x.points,2)[1];0===na[0]||0===na[1]?z=Uf:0<na[0]&&0>na[1]?z=Qj:0<na[0]&&0<na[1]?z=Uf:0>na[0]&&0<na[1]?z=Qj:0>na[0]&&0>na[1]&&(z=Uf)}}else"text"===
x.type&&(z=Nm);return Jg(Vf(x),x.angle,D,R,z)},uh=function(x,D){return[0,0,0,0,D,x,1,0]},vh=function(){var x=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,D=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,R=[0,0,0,0,0,0,0,0];if(0>D||7<D)throw Error("Expected `index` betwen 0 and 7, got `".concat(D,"`"));return 0!==x&&(R[D]=x),R},vk=function(x){return[x[0],x[1],x[2],x[3],-x[4],-x[5],-x[6],-x[7]]},ll=function(x,D){return"number"==typeof D?[x[0]-D,x[1],x[2],x[3],x[4],x[5],x[6],x[7]]:
[x[0]-D[0],x[1]-D[1],x[2]-D[2],x[3]-D[3],x[4]-D[4],x[5]-D[5],x[6]-D[6],x[7]-D[7]]},Vg=function(x,D){return"number"==typeof D?[x[0]*D,x[1]*D,x[2]*D,x[3]*D,x[4]*D,x[5]*D,x[6]*D,x[7]*D]:[D[0]*x[0]+D[2]*x[2]+D[3]*x[3]-D[6]*x[6],D[1]*x[0]+D[0]*x[1]-D[4]*x[2]+D[5]*x[3]+D[2]*x[4]-D[3]*x[5]-D[7]*x[6]-D[6]*x[7],D[2]*x[0]+D[0]*x[2]-D[6]*x[3]+D[3]*x[6],D[3]*x[0]+D[6]*x[2]+D[0]*x[3]-D[2]*x[6],D[4]*x[0]+D[2]*x[1]-D[1]*x[2]+D[7]*x[3]+D[0]*x[4]+D[6]*x[5]-D[5]*x[6]+D[3]*x[7],D[5]*x[0]-D[3]*x[1]+D[7]*x[2]+D[1]*x[3]-
D[6]*x[4]+D[0]*x[5]+D[4]*x[6]+D[2]*x[7],D[6]*x[0]+D[3]*x[2]-D[2]*x[3]+D[0]*x[6],D[7]*x[0]+D[6]*x[1]+D[5]*x[2]+D[4]*x[3]+D[3]*x[4]+D[2]*x[5]+D[1]*x[6]+D[0]*x[7]]},Ki=function(x,D){return[ai(x,D),x[1]*D[7]+x[4]*D[5]-x[5]*D[4]+x[7]*D[1],x[2]*D[7]-x[4]*D[6]+x[6]*D[4]+x[7]*D[2],x[3]*D[7]+x[5]*D[6]-x[6]*D[5]+x[7]*D[3],x[4]*D[7]+x[7]*D[4],x[5]*D[7]+x[7]*D[5],x[6]*D[7]+x[7]*D[6],x[7]*D[7]]},ai=function(x,D){return x[0]*D[7]+x[1]*D[6]+x[2]*D[5]+x[3]*D[4]+x[4]*D[3]+x[5]*D[2]+x[6]*D[1]+x[7]*D[0]},lk=function(x){return Math.sqrt(Math.abs(x[0]*
x[0]-x[2]*x[2]-x[3]*x[3]+x[6]*x[6]))},Lf=function(x){var D=lk(x);return 0===D||1===D?x:Vg(x,(0>x[6]?-1:1)/D)},yf=(vh(1,1),vh(1,2),vh(1,3),vh(1,4),vh(1,5),vh(1,6),vh(1,7),function(x,D,R){return Lf([0,R,x,D,0,0,0,0])}),Di=function(x,D){return R=x,[(z=D)[0]*R[0]+z[2]*R[2]+z[3]*R[3]-z[6]*R[6],z[1]*R[0]+z[0]*R[1]-z[4]*R[2]+z[5]*R[3]+z[2]*R[4]-z[3]*R[5]-z[7]*R[6]-z[6]*R[7],z[2]*R[0]+z[0]*R[2]-z[6]*R[3]+z[3]*R[6],z[3]*R[0]+z[6]*R[2]+z[0]*R[3]-z[2]*R[6],z[4]*R[0]+z[7]*R[3]+z[0]*R[4]+z[3]*R[7],z[5]*R[0]+z[7]*
R[2]+z[0]*R[5]+z[2]*R[7],z[6]*R[0]+z[0]*R[6],z[7]*R[0]+z[0]*R[7]];var R,z},th=function(x){x=ia(x,2);return[0,0,0,0,x[1],x[0],1,0]},Zh=function(x){return[x[5],x[4]]},Nk=function(x,D){return R=Vg(x,Math.sin(D/2)),z=Math.cos(D/2),"number"==typeof z?[R[0]+z,R[1],R[2],R[3],R[4],R[5],R[6],R[7]]:[R[0]+z[0],R[1]+z[1],R[2]+z[2],R[3]+z[3],R[4]+z[4],R[5]+z[5],R[6]+z[6],R[7]+z[7]];var R,z},Ch=function(x,D){return Lf(Vg(Vg(x,D),vk(x)))},Xi=function(x,D,R,z){var na=10/D.zoom.value;return!Ok(x,D,[R,z])&&eg(x,[R,
z],na)},Ok=function(x,D,R){D=10/D.zoom.value;if("text"===x.type)var z=zk;else"arrow"===x.type?z=!1:"freedraw"===x.type?z=!0:(z="transparent"!==x.backgroundColor,z="line"===x.type?z&&qj(x.points):z),z=z?wk:gm;return hj({element:x,point:R,threshold:D,check:z})},eg=function(x,D,R){D=ia(D,2);var z=D[0],na=D[1],sa=ia(Vf(x),4);D=sa[0];var ha=sa[1],va=sa[2];sa=sa[3];z=ia(Jf(z,na,(D+va)/2,(ha+sa)/2,-x.angle),2);x=z[0];z=z[1];return x>D-R&&x<va+R&&z>ha-R&&z<sa+R},Uk=function(x,D){var R=D.x;D=D.y;var z=Rh(x,
x.width,x.height);return hj({element:x,point:[R,D],threshold:z,check:bi})},Rh=function(x,D,R){return Math.max(16,Math.min(.25*("diamond"===x.type?1/Math.sqrt(2):1)*Math.min(D,R),32))},hj=function(x){switch(x.element.type){case "rectangle":case "text":case "diamond":case "ellipse":var D=ml(x.element,x.point);return x.check(D,x.threshold);case "freedraw":if(D=!!x.check(xk(x.element,x.point),x.threshold))a:{D=x.element;var R=x.point;x=x.threshold;if(0===D.angle){var z=R[0]-D.x;R=R[1]-D.y}else{z=ia(Vf(D),
4);var na=z[0],sa=z[1];R=Df(R,[na+(z[2]-na)/2,sa+(z[3]-sa)/2],-D.angle);z=R[0]-D.x;R=R[1]-D.y}sa=ia(D.points,2);na=sa[0];sa=sa[1];if(2===D.points.length)D=Math.hypot(z-na[0],R-na[1])<x||Math.hypot(z-sa[0],R-sa[1])<x;else{for(var ha=1;ha<D.points.length-1;ha++){var va=[sa[0]-na[0],sa[1]-na[1]];var Aa=Math.hypot(va[1],va[0]);va=[va[0]/Aa,va[1]/Aa];var Ba=[z-na[0],R-na[1]];Ba=(Ba[0]*va[0]+Ba[1]*va[1])/Math.hypot(va[1],va[0]);va=[na[0]+va[0]*Ba,na[1]+va[1]*Ba];Ba=Math.hypot(na[0]-va[0],na[1]-va[1]);var Ha=
Math.hypot(sa[0]-va[0],sa[1]-va[1]);if(va=Ha<Ba&&Ba>Aa?sa:Ba<Ha&&Ha>Aa?na:va,Math.hypot(R-va[1],z-va[0])<x){D=!0;break a}na=sa;sa=D.points[ha+1]}D=!1}}return D;case "arrow":case "line":return Ne(x);case "selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},ml=function(x,D){switch(x.type){case "rectangle":case "text":return xk(x,D);case "diamond":var R=ia(Jl(x,D),4);x=R[1];D=R[2];R=R[3];D=yf(R,D,-R*D);return ai(x,D);case "ellipse":return x=ia(nl(x,D),2),
D=x[1],-Math.sign(D[1])*ai(x[0],D)}},zk=function(x,D){return 0>x},wk=function(x,D){return x<D},gm=function(x,D){return Math.abs(x)<D},bi=function(x,D){return 0<=x&&x<D},xk=function(x,D){var R=ia(Jl(x,D),4),z=R[1],na=R[2];x=Math;D=x.max;R=yf(0,1,-R[3]);R=ai(z,R);na=yf(1,0,-na);z=ai(z,na);return D.call(x,R,z)},nl=function(x,D){D=ia(Jl(x,D),4);x=D[1];var R=D[2],z=D[3];D=ia(Zh(x),2);var na=D[0],sa=D[1],ha=.707,va=.707;[0,1,2,3].forEach(function(Aa){Aa=(R*R-z*z)*Math.pow(ha,3)/R;var Ba=(z*z-R*R)*Math.pow(va,
3)/z,Ha=na-Aa,Va=sa-Ba,Ya=Math.hypot(z*va-Ba,R*ha-Aa),ob=Math.hypot(Va,Ha);ha=Math.min(1,Math.max(0,(Ha*Ya/ob+Aa)/R));va=Math.min(1,Math.max(0,(Va*Ya/ob+Ba)/z));Aa=Math.hypot(va,ha);ha/=Aa;va/=Aa});D=uh(R*ha,z*va);return[x,Di(Lf(Ki(D,x)),D)]},Ne=function(x){var D=x.element,R=x.threshold;if(!kh.get(D))return!1;var z=ia(Jl(x.element,x.point),4),na=z[0],sa=z[1],ha=z[2];z=yf(0,1,-z[3]);ha=yf(1,0,-ha);if(!wk(ai(sa,z),R)||!wk(ai(sa,ha),R))return!1;na=ia(Zh(na),2);var va=na[0],Aa=na[1];na=kh.get(D);return x.check===
wk&&na.some(function(Ba){var Ha=D.strokeSharpness;var Va,Ya=[],ob=!1;Ba=Fd(Jk(Ba));try{for(Ba.s();!(Va=Ba.n()).done;){var Bb=Va.value;"move"===Bb.op?(ob=!ob)&&Ya.push([Bb.data[0],Bb.data[1]]):"bcurveTo"===Bb.op&&ob&&(Ya.push([Bb.data[0],Bb.data[1]]),Ya.push([Bb.data[2],Bb.data[3]]),Ya.push([Bb.data[4],Bb.data[5]]))}}catch(Rb){Ba.e(Rb)}finally{Ba.f()}4<=Ya.length?"sharp"===Ha?Ha=ek(Ya,va,Aa):(Ha=Ub(Ya,10,5),Ha=ek(Ha,va,Aa)):Ha=!1;return Ha})?!0:na.some(function(Ba){return tj(Ba,va,Aa,R)})},Jl=function(x,
D){var R=th(D);D=Vf(x);var z=uj(D),na=Nk(z,x.angle);R=Ch(na,R);z=ll(R,[0,0,0,0,z[4],z[5],0,0]);z=[0,0,0,0,Math.abs(z[4]),Math.abs(z[5]),1,0];x=ll(R,[0,0,0,0,x.y,x.x,0,0]);D=ia(D,4);return[x,z,(D[2]-D[0])/2,(D[3]-D[1])/2]},fm=function(x){var D=Vf(x);D=uj(D);x=Nk(D,x.angle);D=[0,0,0,0,D[4],D[5],0,0];D=vk([1,0,0,0,-.5*D[5],.5*D[4],0,0]);return Vg(D,x)},uj=function(x){x=ia(x,4);return uh((x[0]+x[2])/2,(x[1]+x[3])/2)},ij=function(x,D,R){var z=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;switch(x.type){case "rectangle":case "text":case "diamond":var na=
Sh(x);var sa=na.flatMap(function(ha,va){va=ia([ha,na[(va+1)%4]],2);ha=va[0];va=va[1];var Aa=[0,0,0,0,va[4]-ha[4],va[5]-ha[5],0,0];var Ba=Math.sqrt(Math.abs(Aa[7]*Aa[7]-Aa[5]*Aa[5]-Aa[4]*Aa[4]+Aa[1]*Aa[1]));Aa=0===Ba||1===Ba?Aa:Vg(Aa,1/Ba);Ba=.5*z;Aa=[1,0,0,0,Ba*Aa[4],Ba*Aa[5],0,0];ha=[Ch(Aa,ha),Ch(Aa,va)];va=ia(ha,2);ha=va[0];va=va[1];if(0<=ai(ha,D)*ai(va,D))var Ha=[];else{a:{ha=Lf(Ki(va,ha));ha=Lf((Ha=D,[(Va=ha)[0]*Ha[0],Va[1]*Ha[0]+Va[0]*Ha[1],Va[2]*Ha[0]+Va[0]*Ha[2],Va[3]*Ha[0]+Va[0]*Ha[3],Va[4]*
Ha[0]+Va[2]*Ha[1]-Va[1]*Ha[2]+Va[0]*Ha[4],Va[5]*Ha[0]-Va[3]*Ha[1]+Va[1]*Ha[3]+Va[0]*Ha[5],Va[6]*Ha[0]+Va[3]*Ha[2]-Va[2]*Ha[3]+Va[0]*Ha[6],Va[7]*Ha[0]+Va[6]*Ha[1]+Va[5]*Ha[2]+Va[4]*Ha[3]+Va[3]*Ha[4]+Va[2]*Ha[5]+Va[1]*Ha[6]]));break a;var Va}Ha=[ha]}return Ha}).concat(na.flatMap(function(ha){if(0===z)var va=0===ai(D,ha)?[ha]:[];else{va=D[2];var Aa=D[3],Ba=D[1],Ha=ia(Zh(ha),2);ha=Ha[0];var Va=Ha[1];Ha=va*va+Aa*Aa;var Ya=z*z*Ha-Math.pow(va*ha+Aa*Va+Ba,2);if(0===Ha||0>=Ya)va=[];else{Ya=Math.sqrt(Ya);var ob=
ha*Aa*Aa-Va*va*Aa-va*Ba;Ba=Va*va*va-ha*va*Aa-Aa*Ba;va=[uh((ob+Aa*Ya)/Ha,(Ba-va*Ya)/Ha),uh((ob-Aa*Ya)/Ha,(Ba+va*Ya)/Ha)]}}return va}));break;case "ellipse":sa=Hh(x,z,D)}if(2>sa.length)return[];sa=sa.sort(function(ha,va){return lk(Ki(ha,R))-lk(Ki(va,R))});return[sa[0],sa[sa.length-1]]},Sh=function(x){var D=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,R=D*x.width/2;D=D*x.height/2;switch(x.type){case "rectangle":case "text":return[uh(R,D),uh(R,-D),uh(-R,-D),uh(-R,D)];case "diamond":return[uh(0,
D),uh(R,0),uh(0,-D),uh(-R,0)]}},Hh=function(x,D,R){var z=x.width/2+D;x=x.height/2+D;D=R[2];var na=R[3],sa=R[1];R=z*z*D*D+x*x*na*na;var ha=R-sa*sa;if(0===R||0>=ha)return[];ha=Math.sqrt(ha);var va=-z*z*D*sa;sa*=-x*x*na;return[uh((va+z*x*na*ha)/R,(sa-z*x*D*ha)/R),uh((va-z*x*na*ha)/R,(sa+z*x*D*ha)/R)]},wi=function(x,D,R){var z=Math.sign(D),na=0,sa=null;return Sh(x,Math.abs(D)).forEach(function(ha){var va=z*Lf(Ki(ha,R))[1];va>na&&(na=va,sa=ha)}),sa},tj=function(x,D,R,z){var na=[0,0];return Jk(x).some(function(sa,
ha){ha=sa.op;var va=sa.data;if("move"===ha)na=va;else if("bcurveTo"===ha){sa=[va[0],va[1]];ha=[va[2],va[3]];va=[va[4],va[5]];var Aa=na;return na=va,function(Ba,Ha,Va,Ya,ob,Bb){var Rb=ia(ob,2);ob=Rb[0];Rb=Rb[1];for(var ic=function(Pc,Yc){return Math.pow(1-Pc,3)*Ya[Yc]+3*Pc*Math.pow(1-Pc,2)*Va[Yc]+3*Math.pow(Pc,2)*(1-Pc)*Ha[Yc]+Ba[Yc]*Math.pow(Pc,3)},mc=0;1>=mc;){var Sc=ic(mc,0),Xc=ic(mc,1);if(Math.sqrt(Math.pow(Sc-ob,2)+Math.pow(Xc-Rb,2))<Bb)return!0;mc+=.01}return!1}(Aa,sa,ha,va,[D,R],z)}return!1})},
yk=["rotation"],Sj=function(x,D,R){return D>=x[0]&&D<=x[0]+x[2]&&R>=x[1]&&R<=x[1]+x[3]},fh=function(x,D,R,z,na,sa){return x.reduce(function(ha,va){return ha?ha:(ha=function(Aa,Ba,Ha,Va,Ya,ob){if(!Ba.selectedElementIds[Aa.id])return!1;Aa=Tk(Aa,Ya,ob);Ba=Aa.rotation;var Bb=Za(Aa,yk);if(Ba&&Sj(Ba,Ha,Va))return"rotation";Aa=Object.keys(Bb).filter(function(Rb){Rb=Bb[Rb];return!!Rb&&Sj(Rb,Ha,Va)});return 0<Aa.length&&Aa[0]}(va,D,R,z,na,sa))?{element:va,transformHandleType:ha}:null},null)},jj=function(x,
D,R,z,na){x=ia(x,4);var sa=Jg([x[0],x[1],x[2],x[3]],0,z,na,sj);return Object.keys(sa).find(function(ha){return(ha=sa[ha])&&Sj(ha,D,R)})||!1},id=["ns","nesw","ew","nwse"],le=function(x){var D=x.element,R=D&&-1==Math.sign(D.height)*Math.sign(D.width),z=null;switch(x.transformHandleType){case "n":case "s":z="ns";break;case "w":case "e":z="ew";break;case "nw":case "se":z=R?"nesw":"nwse";break;case "ne":case "sw":z=R?"nwse":"nesw";break;case "rotation":return"grab"}z&&D&&(x=z,D=D.angle,R=id.indexOf(x),
0<=R&&(x=id[(R+Math.round(D/(Math.PI/4)))%id.length]),z=x);return z?"".concat(z,"-resize"):""},dd=function(){function x(D,R){q(this,x);this.elementId=D.id;Ph.mapElementToScene(this.elementId,R);x.normalizePoints(D);this.lastUncommittedPoint=this.activePointIndex=null;this.isDragging=!1;this.pointerOffset={x:0,y:0};this.endBindingElement=this.startBindingElement="keep"}return y(x,null,[{key:"getElement",value:function(D){var R;return(null===(R=Ph.getScene(D))||void 0===R?void 0:R.getNonDeletedElement(D))||
null}},{key:"handlePointDragging",value:function(D,R,z,na,sa){if(!D.editingLinearElement)return!1;var ha=D.editingLinearElement,va=ha.activePointIndex,Aa=ha.isDragging,Ba=x.getElement(ha.elementId);return Ba?null!=va&&-1<va?(!1===Aa&&R({editingLinearElement:vc(vc({},ha),{},{isDragging:!0})}),D=x.createPointAt(Ba,z-ha.pointerOffset.x,na-ha.pointerOffset.y,D.gridSize),x.movePoint(Ba,va,D),Xg(Ba)&&sa(Ba,0===va?"start":"end"),!0):!1:!1}},{key:"handlePointerUp",value:function(D,R,z){D=R.activePointIndex;
var na=R.isDragging,sa=x.getElement(R.elementId);if(!sa)return R;var ha={};!na||0!==D&&D!==sa.points.length-1||(qj(sa.points,z.zoom.value)&&x.movePoint(sa,D,0===D?sa.points[sa.points.length-1]:sa.points[0]),ha=da({},0===D?"startBindingElement":"endBindingElement",z.isBindingEnabled?hg(Hj(x.getPointAtIndexGlobalCoordinates(sa,D)),Ph.getScene(sa)):null));return vc(vc(vc({},R),ha),{},{isDragging:!1,pointerOffset:{x:0,y:0}})}},{key:"handlePointerDown",value:function(D,R,z,na,sa){var ha={didAddPoint:!1,
hitElement:null};if(!R.editingLinearElement)return ha;var va=x.getElement(R.editingLinearElement.elementId);if(!va)return ha;if(D.altKey)return null==R.editingLinearElement.lastUncommittedPoint&&ke(va,{points:[].concat(ja(va.points),[x.createPointAt(va,sa.x,sa.y,R.gridSize)])}),na.resumeRecording(),z({editingLinearElement:vc(vc({},R.editingLinearElement),{},{activePointIndex:va.points.length-1,lastUncommittedPoint:null,endBindingElement:hg(sa,Ph.getScene(va))})}),ha.didAddPoint=!0,ha;D=x.getPointIndexUnderCursor(va,
R.zoom,sa.x,sa.y);if(-1<D)ha.hitElement=va;else{var Aa=R.editingLinearElement;na=Aa.startBindingElement;Aa=Aa.endBindingElement;R.isBindingEnabled&&Xg(va)&&Md(va,na,Aa)}Aa=ia(Vf(va),4);na=(Aa[0]+Aa[2])/2;Aa=(Aa[1]+Aa[3])/2;va=-1<D&&Jf(va.x+va.points[D][0],va.y+va.points[D][1],na,Aa,va.angle);return z({editingLinearElement:vc(vc({},R.editingLinearElement),{},{activePointIndex:-1<D?D:null,pointerOffset:va?{x:sa.x-va[0],y:sa.y-va[1]}:{x:0,y:0}})}),ha}},{key:"handlePointerMove",value:function(D,R,z,na,
sa){var ha=na.lastUncommittedPoint,va=x.getElement(na.elementId);if(!va)return na;var Aa=va.points,Ba=Aa[Aa.length-1];if(!D.altKey)return Ba===ha&&x.movePoint(va,Aa.length-1,"delete"),vc(vc({},na),{},{lastUncommittedPoint:null});D=x.createPointAt(va,R-na.pointerOffset.x,z-na.pointerOffset.y,sa);return Ba===ha?x.movePoint(va,va.points.length-1,D):x.movePoint(va,"new",D),vc(vc({},na),{},{lastUncommittedPoint:va.points[va.points.length-1]})}},{key:"getPointsGlobalCoordinates",value:function(D){var R=
ia(Vf(D),4),z=(R[0]+R[2])/2,na=(R[1]+R[3])/2;return D.points.map(function(sa){sa=ia(Jf(D.x+sa[0],D.y+sa[1],z,na,D.angle),2);return[sa[0],sa[1]]})}},{key:"getPointAtIndexGlobalCoordinates",value:function(D,R){var z=0>R?D.points.length+R:R;R=ia(Vf(D),4);z=D.points[z];return Jf(D.x+z[0],D.y+z[1],(R[0]+R[2])/2,(R[1]+R[3])/2,D.angle)}},{key:"pointFromAbsoluteCoords",value:function(D,R){var z=ia(Vf(D),4);R=ia(Jf(R[0],R[1],(z[0]+z[2])/2,(z[1]+z[3])/2,-D.angle),2);return[R[0]-D.x,R[1]-D.y]}},{key:"getPointIndexUnderCursor",
value:function(D,R,z,na){D=this.getPointsGlobalCoordinates(D);for(var sa=D.length;-1<--sa;){var ha=D[sa];if(Math.hypot(ha[0]-z,ha[1]-na)*R.value<this.POINT_HANDLE_SIZE/2+1)return sa}return-1}},{key:"createPointAt",value:function(D,R,z,na){R=Dh(R,z,na);z=ia(Vf(D),4);R=ia(Jf(R[0],R[1],(z[0]+z[2])/2,(z[1]+z[3])/2,-D.angle),2);return[R[0]-D.x,R[1]-D.y]}},{key:"getNormalizedPoints",value:function(D){var R=D.points,z=R[0][0],na=R[0][1];return{points:R.map(function(sa,ha){return[sa[0]-z,sa[1]-na]}),x:D.x+
z,y:D.y+na}}},{key:"normalizePoints",value:function(D){ke(D,x.getNormalizedPoints(D))}},{key:"movePointByOffset",value:function(D,R,z){var na=ia(D.points[R],2);x.movePoint(D,R,[na[0]+z.x,na[1]+z.y])}},{key:"movePoint",value:function(D,R,z,na){var sa=D.points,ha=0,va=0;if("delete"===z){if("new"===R)throw Error("invalid args in movePoint");(z=sa.slice()).splice(R,1);0===R&&(ha=z[0][0],va=z[0][1],z=z.map(function(Va,Ya){return 0===Ya?[0,0]:[Va[0]-ha,Va[1]-va]}))}else if("new"===R)z=[].concat(ja(sa),
[z]);else{var Aa=z[0]-sa[R][0],Ba=z[1]-sa[R][1];z=sa.map(function(Va,Ya){return Ya===R?0===Ya?(ha=Aa,va=Ba,Va):(ha=0,va=0,[Va[0]+Aa,Va[1]+Ba]):ha||va?[Va[0]-ha,Va[1]-va]:Va})}var Ha=ul(D,z,D.strokeSharpness||"round");sa=ul(D,sa,D.strokeSharpness||"round");sa=Jf(ha,va,(sa[0]+sa[2])/2-(Ha[0]+Ha[2])/2,(sa[1]+sa[3])/2-(Ha[1]+Ha[3])/2,D.angle);ke(D,vc(vc({},na),{},{points:z,x:D.x+sa[0],y:D.y+sa[1]}))}}]),x}();dd.POINT_HANDLE_SIZE=20;var Md=function(x,D,R){var z=new Set,na=new Set;fi(x,D,R,"start",z,na);
fi(x,R,D,"end",z,na);D=Array.from(na).filter(function(sa){return!z.has(sa)});Ph.getScene(x).getNonDeletedElements(D).forEach(function(sa){var ha;ke(sa,{boundElementIds:null===(ha=sa.boundElementIds)||void 0===ha?void 0:ha.filter(function(va){return va!==x.id})})})},fi=function(x,D,R,z,na,sa){"keep"!==D&&(null!=D?null!=R&&("keep"===R?pd(x,D,z):"start"!==z&&R.id===D.id)||(Ti(x,D,z),na.add(D.id)):(D="start"===z?"startBinding":"endBinding",R=x[D],x=null==R?null:(ke(x,da({},D,null)),R.elementId),null!=
x&&sa.add(x)))},If=function(x){x.forEach(function(D){Xg(D)?Md(D,de(D,"start"),de(D,"end")):Ze(D)&&Th(D)})},Th=function(x){zf(x).forEach(function(D){D=ia(D,2);var R=D[1];return Md(D[0],"end"===R?"keep":x,"start"===R?"keep":x)})},ng=function(x,D,R,z){null!=D.startBoundElement&&Ti(x,D.startBoundElement,"start");D=hg(z,R);null==D||pd(x,D,"end")||Ti(x,D,"end")},Ti=function(x,D,R){var z;ke(x,da({},"start"===R?"startBinding":"endBinding",function(na){for(var sa=1;sa<arguments.length;sa++){var ha=null!=arguments[sa]?
arguments[sa]:{};sa%2?$b(Object(ha),!0).forEach(function(va){da(na,va,ha[va])}):Object.getOwnPropertyDescriptors?Object.defineProperties(na,Object.getOwnPropertyDescriptors(ha)):$b(Object(ha)).forEach(function(va){Object.defineProperty(na,va,Object.getOwnPropertyDescriptor(ha,va))})}return na}({elementId:D.id},fd(x,D,R))));ke(D,{boundElementIds:Array.from(new Set([].concat(ja(null!==(z=D.boundElementIds)&&void 0!==z?z:[]),[x.id])))})},pd=function(x,D,R){R=x["start"===R?"endBinding":"startBinding"];
return(null==R?void 0:R.elementId)===D.id&&3>x.points.length},yd=function(x){x.forEach(function(D){Xg(D)&&Md(D,null,null)})},hg=function(x,D){return ka(D.getElements(),function(R){return Ze(R)&&Uk(R,x)})},fd=function(x,D,R){var z="start"===R?-1:1;R=-1===z?0:x.points.length-1;z=R-z;R=dd.getPointAtIndexGlobalCoordinates(x,R);z=dd.getPointAtIndexGlobalCoordinates(x,z);a:{x=fm(D);z=Ch(x,th(z));x=Ch(x,th(R));var na=Lf(Ki(x,z));x=D.height/D.width;z=D.width/2;var sa=D.height/2,ha=na[2],va=na[3];na=na[1];
var Aa=Math.abs(va),Ba=Math.abs(ha);switch(D.type){case "rectangle":case "text":x=na/(z*(Ba+x*Aa));break a;case "diamond":x=Aa<Ba?na/(Ba*z):na/(Aa*sa);break a;case "ellipse":x=na/(z*Math.sqrt(Math.pow(ha,2)+Math.pow(x,2)*Math.pow(va,2)));break a}x=void 0}return{focus:x,gap:Math.max(1,ml(D,R))}},Ei=function(x,D){var R,z=null!==(R=x.boundElementIds)&&void 0!==R?R:[];if(0!==z.length){D=null!=D?D:{};var na=D.newSize,sa=Kl(D.simultaneouslyUpdated);Ph.getScene(x).getNonDeletedElements(z).forEach(function(ha){var va,
Aa;if((null===(va=ha.startBinding)||void 0===va?void 0:va.elementId)===x.id||(null===(Aa=ha.endBinding)||void 0===Aa?void 0:Aa.elementId)===x.id)va=eh(x,ha.startBinding,na),Aa=eh(x,ha.endBinding,na),sa.has(ha.id)?ke(ha,{startBinding:va,endBinding:Aa}):(vj(ha,"start",va,x),vj(ha,"end",Aa,x))})}},Kl=function(x){return new Set((x||[]).map(function(D){return D.id}))},vj=function(x,D,R,z){if(!(null==R||R.elementId!==z.id&&2<x.points.length)){var na=Ph.getScene(x).getElement(R.elementId);if(null!=na){var sa=
"start"===D?-1:1;z=-1===sa?0:x.points.length-1;var ha=dd.getPointAtIndexGlobalCoordinates(x,z-sa);sa=function(va,Aa,Ba){if(0===Aa){var Ha=Vf(va);Ha=uj(Ha);return Zh(Ha)}Ha=fm(va);Ba=Ch(Ha,th(Ba));Ha=vk(Ha);switch(va.type){case "rectangle":case "text":case "diamond":var Va=wi(va,Aa,Ba);break;case "ellipse":var Ya=Math.abs(Aa);Va=va.width*Ya/2;va=va.height*Ya/2;Aa=Math.sign(Aa);Ya=ia(Zh(Ba),2);Ba=Ya[0];Ya=Ya[1];Ya=0===Ya?1E-4:Ya;var ob=Math.pow(Ba,2)*Math.pow(va,2)+Math.pow(Ya,2)*Math.pow(Va,2);Aa=
(-Ba*Math.pow(va,2)+Aa*Ya*Math.sqrt(Math.max(0,ob-Math.pow(Va,2)*Math.pow(va,2))))/ob;Ba=(-Aa*Ba-1)/Ya;Va=-Math.pow(Va,2)*Aa/(Math.pow(Ba,2)*Math.pow(va,2)+Math.pow(Aa,2)*Math.pow(Va,2));Va=uh(Va,(-Aa*Va-1)/Ba)}return Zh(Ch(Ha,Va))}(na,R.focus,ha);0===R.gap?na=sa:(na=function(va,Aa,Ba){var Ha=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,Va=fm(va),Ya=Ch(Va,th(Aa)),ob=Ch(Va,th(Ba));ob=Lf(Ki(ob,Ya));var Bb=vk(Va);return ij(va,ob,Ya,Ha).map(function(Rb){return Zh(Ch(Bb,Rb))})}(na,ha,sa,R.gap),
na=0===na.length?sa:na[0]);dd.movePoint(x,z,dd.pointFromAbsoluteCoords(x,na),da({},"start"===D?"startBinding":"endBinding",R))}}},eh=function(x,D,R){if(null==D||null==R)return D;var z=D.gap,na=D.focus,sa=R.width;R=R.height;var ha=x.width,va=x.height;return{elementId:D.elementId,gap:Math.max(1,Math.min(Rh(x,sa,R),z*(sa<R?sa/ha:R/va))),focus:na}},zg=function(x){return[de(x,"start"),de(x,"end")].filter(function(D){return null!=D})},de=function(x,D){return hg(Hj(dd.getPointAtIndexGlobalCoordinates(x,
"start"===D?0:-1)),Ph.getScene(x))},zf=function(x){return Ph.getScene(x).getElements().map(function(D){if(!Xg(D))return null;var R=nk(D,"start",x),z=nk(D,"end",x);return R||z?[D,R&&z?"both":R?"start":"end",x]:null}).filter(function(D){return null!=D})},nk=function(x,D,R){return null==x["start"===D?"startBinding":"endBinding"]&&!pd(x,R,D)&&Uk(R,Hj(dd.getPointAtIndexGlobalCoordinates(x,"start"===D?0:-1)))},Tj=function(x,D,R,z){var na=new Set,sa=new Set,ha="duplicatesServeAsOld"===z;D.forEach(function(va){var Aa=
va.boundElementIds;if(null!=Aa&&0<Aa.length&&(Aa.forEach(function(Ba){ha&&!R.has(Ba)&&na.add(Ba)}),sa.add(R.get(va.id))),Xg(va))null!=va.startBinding&&(Aa=va.startBinding.elementId,ha&&!R.has(Aa)&&sa.add(Aa)),null!=va.endBinding&&(Aa=va.endBinding.elementId,ha&&!R.has(Aa)&&sa.add(Aa)),null==va.startBinding&&null==va.endBinding||na.add(R.get(va.id))});x.filter(function(va){return na.has(va.id)}).forEach(function(va){var Aa=va.endBinding;ke(va,{startBinding:pe(va.startBinding,R),endBinding:pe(Aa,R)})});
x.filter(function(va){return sa.has(va.id)}).forEach(function(va){var Aa=va.boundElementIds;null!=Aa&&0<Aa.length&&ke(va,{boundElementIds:Aa.map(function(Ba){var Ha;return null!==(Ha=R.get(Ba))&&void 0!==Ha?Ha:Ba})})})},pe=function(x,D){var R;if(null==x)return null;var z=x.elementId;return{focus:x.focus,gap:x.gap,elementId:null!==(R=D.get(z))&&void 0!==R?R:z}},Ll=function(x,D){var R=new Set(D.map(function(na){return na.id})),z=new Set;D.forEach(function(na){var sa;Ze(na)&&(null===(sa=na.boundElementIds)||
void 0===sa||sa.forEach(function(ha){R.has(ha)||z.add(ha)}))});x.filter(function(na){return z.has(na.id)}).forEach(function(na){var sa=na.endBinding;ke(na,{startBinding:bj(na.startBinding,R),endBinding:bj(sa,R)})})},bj=function(x,D){return null==x||D.has(x.elementId)?null:x},fe=function(x){return x>=2*Math.PI?x-2*Math.PI:x},ok=function(x,D,R){return Dg(x)||ki(x)?{points:lm(0,D,lm(1,R,x.points))}:{}},fg=function(x,D,R){D=D/x.width*x.fontSize;if(1>D)return null;x=Vl(x.text,jk({fontSize:D,fontFamily:x.fontFamily}));
return{size:D,baseline:x.baseline+(R-x.height)}},Gi=function(x,D,R,z,na,sa,ha){var va=ia(Re(x,x.width,x.height),4),Aa=[va[0],va[1]],Ba=[va[2],va[3]];va=[(Aa[0]+Ba[0])/2,(Aa[1]+Ba[1])/2];var Ha=Df([sa,ha],va,-x.angle);sa=ia(Re(R,R.width,R.height),4);var Va=sa[2]-sa[0],Ya=sa[3]-sa[1];sa=(Ba[0]-Aa[0])/Va;ha=(Ba[1]-Aa[1])/Ya;z.includes("e")&&(sa=(Ha[0]-Aa[0])/Va);z.includes("s")&&(ha=(Ha[1]-Aa[1])/Ya);z.includes("w")&&(sa=(Ba[0]-Ha[0])/Va);z.includes("n")&&(ha=(Ba[1]-Ha[1])/Ya);Ha=x.width;Va=x.height;
sa*=R.width;ha*=R.height;if(na&&(sa=2*sa-Ha,ha=2*ha-Va),D){Ya=Math.abs(sa)/Ha;var ob=Math.abs(ha)/Va;if(1===z.length&&(ha*=Ya,sa*=ob),2===z.length)Ya=Math.max(Ya,ob),sa=Ha*Ya*Math.sign(sa),ha=Va*Ya*Math.sign(ha)}ob=ia(Re(x,sa,ha),4);Ha=ob[0];Va=ob[1];Ya=ob[2]-Ha;ob=ob[3]-Va;var Bb=[].concat(Aa);if(["n","w","nw"].includes(z)&&(Bb=[Ba[0]-Math.abs(Ya),Ba[1]-Math.abs(ob)]),"ne"===z)Bb=[Aa[0],Ba[1]],Bb=[Bb[0],Bb[1]-Math.abs(ob)];"sw"===z&&(Aa=[Ba[0],Aa[1]],Bb=[Aa[0]-Math.abs(Ya),Aa[1]]);D&&(["s","n"].includes(z)&&
(Bb[0]=va[0]-Ya/2),["e","w"].includes(z)&&(Bb[1]=va[1]-ob/2));0>sa&&(z.includes("e")&&(Bb[0]-=Math.abs(Ya)),z.includes("w")&&(Bb[0]+=Math.abs(Ya)));0>ha&&(z.includes("s")&&(Bb[1]-=Math.abs(ob)),z.includes("n")&&(Bb[1]+=Math.abs(ob)));na&&(Bb[0]=va[0]-Math.abs(Ya)/2,Bb[1]=va[1]-Math.abs(ob)/2);D=x.angle;z=Df(Bb,va,D);va=Df([Bb[0]+Math.abs(Ya)/2,Bb[1]+Math.abs(ob)/2],va,D);Bb=Df(z,va,-D);va=ok(x,sa,ha);D=ja(Bb);D[0]+=x.x-Ha;D[1]+=x.y-Va;x=hd({width:Math.abs(sa),height:Math.abs(ha),x:D[0],y:D[1]},va);
0!==x.width&&0!==x.height&&Number.isFinite(x.x)&&Number.isFinite(x.y)&&(Ei(R,{newSize:{width:x.width,height:x.height}}),ke(R,x))},Hm=function(x,D,R,z){var na=ia(Bg(x),4),sa=na[0],ha=na[1],va=na[2],Aa=na[3];switch(D){case "se":var Ba=Math.max((R-sa)/(va-sa),(z-ha)/(Aa-ha));var Ha=function(Ya,ob,Bb){var Rb=ia(ob,2);ob=Rb[0];Rb=Rb[1];Bb=ia(Bb,2);return{x:Ya.x+(ob-sa)*(Ba-1)+ob-Bb[0],y:Ya.y+(Rb-ha)*(Ba-1)+Rb-Bb[1]}};break;case "nw":Ba=Math.max((va-R)/(va-sa),(Aa-z)/(Aa-ha));Ha=function(Ya,ob,Bb){var Rb=
ia(ob,4);ob=Rb[2];Rb=Rb[3];Bb=ia(Bb,4);return{x:Ya.x-(va-ob)*(Ba-1)+ob-Bb[2],y:Ya.y-(Aa-Rb)*(Ba-1)+Rb-Bb[3]}};break;case "ne":Ba=Math.max((R-sa)/(va-sa),(Aa-z)/(Aa-ha));Ha=function(Ya,ob,Bb){var Rb=ia(ob,4);ob=Rb[0];Rb=Rb[3];Bb=ia(Bb,4);return{x:Ya.x+(ob-sa)*(Ba-1)+ob-Bb[0],y:Ya.y-(Aa-Rb)*(Ba-1)+Rb-Bb[3]}};break;case "sw":Ba=Math.max((va-R)/(va-sa),(z-ha)/(Aa-ha)),Ha=function(Ya,ob,Bb){var Rb=ia(ob,3);ob=Rb[1];Rb=Rb[2];Bb=ia(Bb,3);return{x:Ya.x-(va-Rb)*(Ba-1)+Rb-Bb[2],y:Ya.y+(ob-ha)*(Ba-1)+ob-Bb[1]}}}if(0<
Ba){var Va=x.reduce(function(Ya,ob){if(!Ya)return Ya;var Bb=ob.width*Ba,Rb=ob.height*Ba,ic={};if("text"===ob.type){ic=fg(ob,Bb,Rb);if(null===ic)return null;ic={fontSize:ic.size,baseline:ic.baseline}}var mc=Vf(ob),Sc=ok(ob,Bb,Rb);Ei(ob,{newSize:{width:Bb,height:Rb},simultaneouslyUpdated:x});var Xc=Re(hd(hd({},ob),Sc),Bb,Rb);mc=Ha(ob,mc,Xc);ob=mc.x;mc=mc.y;return[].concat(ja(Ya),[hd(hd({width:Bb,height:Rb,x:ob,y:mc},Sc),ic)])},[]);Va&&x.forEach(function(Ya,ob){ke(Ya,Va[ob])})}},Ck=function(x,D,R,z,
na,sa,ha){var va=5*Math.PI/2+Math.atan2(z-ha,R-sa);na&&(va+=yc.ay/2,va-=va%yc.ay);D.forEach(function(Aa,Ba){var Ha,Va,Ya=ia(Vf(Aa),4);Ba=(Ya[0]+Ya[2])/2;Ya=(Ya[1]+Ya[3])/2;var ob=null!==(Ha=null===(Va=x.originalElements.get(Aa.id))||void 0===Va?void 0:Va.angle)&&void 0!==Ha?Ha:Aa.angle;Ha=ia(Jf(Ba,Ya,sa,ha,va+ob-Aa.angle),2);ke(Aa,{x:Aa.x+(Ha[0]-Ba),y:Aa.y+(Ha[1]-Ya),angle:fe(va+ob)})})},Pk=function(x,D,R,z,na,sa,ha,va,Aa,Ba){Aa&&(D=mk(D,ha,sa<z?-va:va),ha=D.width,0>(va=D.height)&&(va=-va));na=na<
R?R-ha:R;sa=sa<z?z-va:z;Ba&&(na=R-(ha+=ha)/2,sa=z-(va+=va)/2);0!==ha&&0!==va&&ke(x,{x:na,y:sa,width:ha,height:va})},Bk=function(x){return x.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n")},Lj=function(x){var D=Vl(x.text,jk(x));ke(x,{width:D.width,height:D.height,baseline:D.baseline})},xh=function(x,D){return!(x.viewModeEnabled||!x.editingElement&&!Sf(D,x).length&&"selection"===x.elementType)},al=function(x){return x.reduce(function(D,R){return D[R.id]=R,D},{})},Uj=function(x){return x.reduce(function(D,
R){return D+R.version},0)},oe=function(x){return x.filter(function(D){return!D.isDeleted})},Ml=function(x){return oe(x).map(function(D){return oj(D.type)?tb(tb({},D),{},{lastCommittedPoint:null}):D})},sh=function(x,D,R,z){var na=z.scrollX,sa=z.scrollY,ha=z.zoom;if(0===x.length)return{horizontal:null,vertical:null};z=ia(Bg(x),4);var va=z[0],Aa=z[1];x=z[2];z=z[3];var Ba=D/ha.value,Ha=R/ha.value,Va=D-Ba,Ya=R-Ha;ha=parseInt(Gj("sat"));var ob=parseInt(Gj("sab")),Bb=parseInt(Gj("sal")),Rb=parseInt(Gj("sar")),
ic=Cg.rtl;na=Va/2-na+Bb;sa=Ya/2-sa+ha;Ba=na+Ba-Rb;Ha=sa+Ha-ob;va=Math.min(va,na);Aa=Math.min(Aa,sa);x=Math.max(x,Ba);z=Math.max(z,Ha);return{horizontal:na===va&&Ba===x?null:{x:Math.max(Bb,4)+(na-va)/(x-va)*D,y:R-6-Math.max(4,ob),width:(Ba-na)/(x-va)*D-Math.max(8,Bb+Rb),height:6},vertical:sa===Aa&&Ha===z?null:{x:ic?Math.max(Bb,4):D-6-Math.max(Rb,4),y:(sa-Aa)/(z-Aa)*R+Math.max(ha,4),width:6,height:(Ha-sa)/(z-Aa)*R-Math.max(8,ha+ob)}}},Zg=function(x,D,R){var z=ia([x.horizontal,x.vertical].map(function(na){return null!=
na&&na.x<=D&&D<=na.x+na.width&&na.y<=R&&R<=na.y+na.height}),2);x=z[0];z=z[1];return{isOverEither:x||z,isOverHorizontal:x,isOverVertical:z}},wh=function(x,D){return x.some(function(R){return D.selectedElementIds[R.id]})},Sf=function(x,D){return x.filter(function(R){return D.selectedElementIds[R.id]})},Kh=function(x,D){return D.editingElement?[D.editingElement]:Sf(x,D)},Be=function(x){var D=x.scenePoint,R=x.viewportDimensions;x=x.zoom;return{scrollX:R.width/2*(1/x.value)-D.x-1/x.value*x.translation.x,
scrollY:R.height/2*(1/x.value)-D.y-1/x.value*x.translation.y}},Fg=function(x,D,R){if(!(x=function(ha){return ha.filter(function(va){return!va.isDeleted&&!Kj(va)})}(x)).length)return{scrollX:0,scrollY:0};var z=ia(Bg(x),4);R=z[0];var na=z[1],sa=z[2];z=z[3];(function(ha,va,Aa){va=ia(Aa,4);Aa=va[2];var Ba=va[3],Ha=hk({sceneX:va[0],sceneY:va[1]},ha);va=Ha.x;Ha=Ha.y;Aa=hk({sceneX:Aa,sceneY:Ba},ha);Ba=Aa.y;return Aa.x-va>ha.width||Ba-Ha>ha.height})(D,0,[R,na,sa,z])&&(x=function(ha,va){if(!ha.length)return[0,
0,0,0];var Aa=1/0,Ba=ha[0];return ha.forEach(function(Ha){var Va=ia(gk(Ha),4);Va=Math.hypot(va.x-(Va[0]+Va[2])/2,va.y-(Va[1]+Va[3])/2);Va<Aa&&(Aa=Va,Ba=Ha)}),gk(Ba)}(x,hh({clientX:D.scrollX,clientY:D.scrollY},D)),x=ia(x,4),R=x[0],na=x[1],sa=x[2],z=x[3]);return Be({scenePoint:{x:(R+sa)/2,y:(na+z)/2},viewportDimensions:{width:D.width,height:D.height},zoom:D.zoom})},Qk=function(x){return"rectangle"===x||"ellipse"===x||"diamond"===x||"line"===x},Vk=function(x){return"rectangle"===x||"ellipse"===x||"diamond"===
x||"freedraw"===x||"arrow"===x||"line"===x},r=function(x){return"rectangle"===x||"ellipse"===x||"diamond"===x||"arrow"===x||"line"===x},I=function(x){return"rectangle"===x||"arrow"===x||"line"===x},ka=function(x,D){for(var R=null,z=x.length-1;0<=z;--z){var na=x[z];if(!na.isDeleted&&D(na)){R=na;break}}return R},ea=function(x,D,R){var z=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:x,translation:{x:z.x-R.left-x/D.value*(z.x-R.left-D.translation.x),y:z.y-R.top-x/D.value*
(z.y-R.top-D.translation.y)}}},ra=function(x){x=parseFloat(x.toFixed(2));return Math.max(.1,Math.min(x,10))},Ga=(e(5422),ce().forwardRef(function(x,D){var R=Ip().id,z=ce().useRef(null);ce().useImperativeHandle(D,function(){return z.current});D="ToolIcon_size_".concat(x.size);return"button"===x.type||"icon"===x.type?(0,Sa.jsxs)("button",{className:Dc("ToolIcon_type_button",D,x.className,x.visible&&!x.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!x.hidden,"ToolIcon--selected":x.selected,
"ToolIcon--plain":"icon"===x.type}),"data-testid":x["data-testid"],hidden:x.hidden,title:x.title,"aria-label":x["aria-label"],type:"button",onClick:x.onClick,ref:z,children:[(x.icon||x.label)&&(0,Sa.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[x.icon||x.label,x.keyBindingLabel&&(0,Sa.jsx)("span",{className:"ToolIcon__keybinding",children:x.keyBindingLabel})]}),x.showAriaLabel&&(0,Sa.jsx)("div",{className:"ToolIcon__label",children:x["aria-label"]}),x.children]}):(0,Sa.jsxs)("label",
{className:Dc("ToolIcon",x.className),title:x.title,children:[(0,Sa.jsx)("input",{className:"ToolIcon_type_radio ".concat(D),type:"radio",name:x.name,"aria-label":x["aria-label"],"aria-keyshortcuts":x["aria-keyshortcuts"],"data-testid":x["data-testid"],id:"".concat(R,"-").concat(x.id),onChange:x.onChange,checked:x.checked,ref:z}),(0,Sa.jsxs)("div",{className:"ToolIcon__icon",children:[x.icon,x.keyBindingLabel&&(0,Sa.jsx)("span",{className:"ToolIcon__keybinding",children:x.keyBindingLabel})]})]})}));
Ga.defaultProps={visible:!0,className:"",size:"medium"};var Qa=function(x){return"light"===x?mf.orange[4]:mf.orange[9]},Pa=function(x){return"light"===x?mf.black:mf.gray[4]},fb=function(x){var D=1<arguments.length&&void 0!==arguments[1]?arguments[1]:512;D="number"==typeof D?{width:D}:D;var R=D.width;R=void 0===R?512:R;var z=D.height;z=void 0===z?R:z;var na=D.mirror;D=D.style;return(0,Sa.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(R," ").concat(z),className:Dc({"rtl-mirror":na}),
style:D,children:"string"==typeof x?(0,Sa.jsx)("path",{fill:"currentColor",d:x}):x})},Jb=fb((0,Sa.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Kb=fb("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}),Ac=fb("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}),Cc=fb("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}),pc=fb("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}),ld=fb("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}),be=fb("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}),df=fb("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"),
Eh=fb("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}),Le=fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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,Sa.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}),Hf=fb("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}),Ag=
fb("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}),Gg=fb("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}),rg=fb("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"),
Ke=fb("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"),ig=fb("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}),Xf=fb("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}),bg=fb("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}),Fh=(fb("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}),fb("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}),fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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,Sa.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}),fb((0,Sa.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}),ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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:Pa(x),stroke:Pa(x),strokeWidth:"2"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24,mirror:!0})})),
Pg=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"}),(0,Sa.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:Pa(x),stroke:Pa(x),strokeWidth:"2"})]}),
{width:24,mirror:!0})}),Fi=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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:Pa(x),stroke:Pa(x),strokeWidth:"2"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24,
mirror:!0})}),Ak=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"}),(0,Sa.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:Pa(x),stroke:Pa(x),strokeWidth:"2"})]}),{width:24,mirror:!0})}),
Lk=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M 2,5 H 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),
strokeWidth:"2"})]}),{width:24,mirror:!0})}),wl=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M 2,19 H 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24,mirror:!0})}),Wo=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M 5,2 V 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24})}),Fm=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M 19,2 V 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24})}),Cf=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M19 5V19M5 5V19",stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24})}),Nn=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,
Sa.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeLinecap:"round"}),(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"})]}),{width:24})}),kj=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"}),(0,Sa.jsx)("path",{d:"M 2,12 H 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})}),xn=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.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(x),stroke:Qa(x),strokeWidth:"2"}),(0,Sa.jsx)("path",{d:"M 12,2 V 22",fill:Pa(x),stroke:Pa(x),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})}),ym=fb("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}),Om=(fb("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"),fb("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"),fb("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})),yn=fb("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}),Wk=fb("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}),hm=(fb("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}),fb("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})),Yi=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M25 26H111V111H25",fill:Pa(x)}),(0,Sa.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:Pa(x),strokeWidth:"2"}),(0,Sa.jsx)("path",{d:"M100 100H160V160H100",fill:Pa(x)}),(0,Sa.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:Pa(x),strokeWidth:"2"}),(0,
Sa.jsxs)("g",{fill:"light"===x?mf.white:"#1e1e1e",stroke:Pa(x),strokeWidth:"6",children:[(0,Sa.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})}),wj=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{d:"M25 26H111V111H25",fill:Pa(x)}),
(0,Sa.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:Pa(x),strokeWidth:"2"}),(0,Sa.jsx)("path",{d:"M100 100H160V160H100",fill:Pa(x)}),(0,Sa.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:Pa(x),strokeWidth:"2"}),(0,Sa.jsxs)("g",{fill:"light"===x?mf.white:"#1e1e1e",stroke:Pa(x),strokeWidth:"6",children:[(0,Sa.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,Sa.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),
{width:182,height:182,mirror:!0})}),im=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x)}),{width:40,height:20})}),Qm=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)("g",{fill:Pa(x),fillRule:"evenodd",clipRule:"evenodd",
children:[(0,Sa.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,Sa.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})}),Cm=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:Pa(x)}),{width:40,height:20})}),bo=ce().memo(function(x){var D=x.theme;x=x.strokeWidth;return fb((0,Sa.jsx)("path",{d:"M6 10H32",stroke:Pa(D),strokeWidth:x,strokeLinecap:"round",fill:"none"}),{width:40,height:20})}),Bn=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{d:"M6 10H34",stroke:Pa(x),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),co=ce().memo(function(x){x=
x.theme;return fb((0,Sa.jsx)("path",{d:"M6 10H34",stroke:Pa(x),strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),Fj=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{d:"M6 10H36",stroke:Pa(x),strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})}),Zo=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),lo=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,
mirror:!0})}),jm=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),en=ce().memo(function(x){x=
x.theme;return fb((0,Sa.jsx)("path",{d:"M10 17L10 5L35 5",stroke:Pa(x),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),fn=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:Pa(x),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})}),ao=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{d:"M6 10H34",stroke:Pa(x),strokeWidth:2,fill:"none"}),{width:40,height:20})}),zn=ce().memo(function(x){var D=
x.theme;x=x.flip;x=void 0!==x&&x;return fb((0,Sa.jsxs)("g",{transform:x?"translate(40, 0) scale(-1, 1)":"",stroke:Pa(D),strokeWidth:2,fill:"none",children:[(0,Sa.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,Sa.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})}),An=ce().memo(function(x){var D=x.theme;x=x.flip;x=void 0!==x&&x;return fb((0,Sa.jsxs)("g",{stroke:Pa(D),fill:Pa(D),transform:x?"translate(40, 0) scale(-1, 1)":"",children:[(0,Sa.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),
(0,Sa.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})}),Kn=ce().memo(function(x){var D=x.theme;x=x.flip;x=void 0!==x&&x;return fb((0,Sa.jsx)("g",{transform:x?"translate(40, 0) scale(-1, 1)":"",children:(0,Sa.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:Pa(D),strokeWidth:2,fill:"none"})}),{width:40,height:20})}),Mk=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{fill:Pa(x),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})}),Nl=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{fill:Pa(x),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})}),Cn=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{fill:Pa(x),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})}),eo=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{fill:Pa(x),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})}),On=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)("path",{fill:Pa(x),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})}),pj=ce().memo(function(x){x=x.theme;return fb((0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("path",{fill:Pa(x),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,Sa.jsx)("path",{fill:Pa(x),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})}),io=
ce().memo(function(x){x=x.theme;return fb((0,Sa.jsx)(Sa.Fragment,{children:(0,Sa.jsx)("path",{fill:Pa(x),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})}),Dn=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x),strokeLinecap:"round"}),{width:448,height:512})}),gn=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x)}),{width:448,height:512})}),Am=ce().memo(function(x){x=x.theme;return fb((0,Sa.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:Pa(x),strokeLinecap:"round"}),{width:448,height:512})}),zm=[],we=function(x){return zm=zm.concat(x),x},Uo=function(x,D){return x.editingGroupId&&(D=li(oe(D),x.editingGroupId),D.length)?mb(mb({},x),{},{selectedElementIds:da({},D[0].id,!0)}):x},hn=we({name:"deleteSelectedElements",perform:function(x,D){if(D.editingLinearElement){var R=D.editingLinearElement,z=R.activePointIndex,na=R.startBindingElement,sa=R.endBindingElement,ha=dd.getElement(R.elementId);if(!ha)return!1;if(null==z||-1===z||2>ha.points.length)return x=
x.filter(function(va){return va.id!==ha.id}),{elements:x,appState:mb(mb({},Uo(D,x)),{},{editingLinearElement:null}),commitToHistory:!1};R={startBindingElement:0===z?null:na,endBindingElement:z===ha.points.length-1?null:sa};return dd.movePoint(ha,z,"delete"),{elements:x,appState:mb(mb({},D),{},{editingLinearElement:mb(mb(mb({},D.editingLinearElement),R),{},{activePointIndex:0<z?z-1:0})}),commitToHistory:!0}}R=function(va,Aa){return{elements:va.map(function(Ba){return Aa.selectedElementIds[Ba.id]?cf(Ba,
{isDeleted:!0}):Ba}),appState:mb(mb({},Aa),{},{selectedElementIds:{}})}}(x,D);z=R.elements;R=R.appState;return Ll(z,x.filter(function(va){return D.selectedElementIds[va.id]})),{elements:z,appState:mb(mb({},R=Uo(R,z)),{},{elementType:"selection",multiElement:null}),commitToHistory:wh(oe(x),D)}},contextItemLabel:"labels.delete",keyTest:function(x){return"Backspace"===x.key||"Delete"===x.key},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:be,
title:Wb("labels.delete"),"aria-label":Wb("labels.delete"),onClick:function(){return z(null)},visible:wh(oe(D),R)})}}),En=function(x,D){for(var R=[],z=[],na=null,sa=-1;++sa<x.length;)D.selectedElementIds[x[sa].id]?(z.length&&(R=R.concat(z),z=[]),R.push(sa),na=sa+1):x[sa].isDeleted&&na===sa?(na=sa+1,z.push(sa)):z=[];return R},fo=function(x,D,R,z){var na=D[R],sa=function(ha){return!ha.isDeleted&&(!x.editingGroupId||ha.groupIds.includes(x.editingGroupId))};R="left"===z?function(ha,va){var Aa=2<arguments.length&&
void 0!==arguments[2]?arguments[2]:ha.length-1;0>Aa&&(Aa=ha.length+Aa);for(Aa=Math.min(ha.length-1,Math.max(Aa,0))+1;-1<--Aa;)if(va(ha[Aa],Aa,ha))return Aa;return-1}(D,sa,Math.max(0,R-1)):function(ha,va){var Aa=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;0>Aa&&(Aa=ha.length+Aa);for(Aa=Math.min(ha.length,Math.max(Aa,0))-1;++Aa<ha.length;)if(va(ha[Aa],Aa,ha))return Aa;return-1}(D,sa,R+1);sa=D[R];if(!sa)return-1;if(x.editingGroupId){if((null==na?void 0:na.groupIds.join(""))===(null==sa?
void 0:sa.groupIds.join("")))return R;if(null==sa||!sa.groupIds.includes(x.editingGroupId))return-1}if(!sa.groupIds.length)return R;na=x.editingGroupId?sa.groupIds[sa.groupIds.indexOf(x.editingGroupId)-1]:sa.groupIds[sa.groupIds.length-1];na=li(D,na);return na.length?"left"===z?D.indexOf(na[0]):D.indexOf(na[na.length-1]):R},Vo=function(x,D){return D.reduce(function(R,z){z=x[z];return R[z.id]=z,R},{})},kn=function(x,D,R){var z,na=En(D,x),sa=Vo(D,na),ha=(z=0,na.reduce(function(va,Aa,Ba){return 0<Ba&&
na[Ba-1]!==Aa-1&&(z=++z),(va[z]||(va[z]=[])).push(Aa),va},[]));return"right"===R&&(ha=ha.reverse()),ha.forEach(function(va,Aa){Aa=va[0];va=va[va.length-1];var Ba="left"===R?Aa:va,Ha=fo(x,D,Ba,R);if(-1!==Ha&&Ba!==Ha){Ba="left"===R?D.slice(0,Ha):D.slice(0,Aa);var Va=D.slice(Aa,va+1);Aa="left"===R?D.slice(Ha,Aa):D.slice(va+1,Ha+1);va="left"===R?D.slice(va+1):D.slice(Ha+1);D="left"===R?[].concat(ja(Ba),ja(Va),ja(Aa),ja(va)):[].concat(ja(Ba),ja(Aa),ja(Va),ja(va))}}),D.map(function(va){return sa[va.id]?
vg(va):va})},pl=function(x,D,R){var z=En(x,D),na=Vo(x,z),sa=[];if("left"===R){if(D.editingGroupId){D=li(x,D.editingGroupId);if(!D.length)return x;var ha=x.indexOf(D[0])}else ha=0;D=z[z.length-1]}else{if(D.editingGroupId){D=li(x,D.editingGroupId);if(!D.length)return x;D=x.indexOf(D[D.length-1])}else D=x.length-1;ha=z[0]}for(var va=ha;va<D+1;va++)z.includes(va)||sa.push(x[va]);z=Object.values(na).map(function(Aa){return vg(Aa)});na=x.slice(0,ha);x=x.slice(D+1);return"left"===R?[].concat(ja(na),ja(z),
sa,ja(x)):[].concat(ja(na),sa,ja(z),ja(x))},Gn=we({name:"sendBackward",perform:function(x,D){return{elements:kn(D,x,"left"),appState:D,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(x){return x[Af]&&!x.shiftKey&&"BracketLeft"===x.code},PanelComponent:function(x){var D=x.updateData;x=x.appState;return(0,Sa.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return D(null)},title:"".concat(Wb("labels.sendBackward")," — ").concat(Vd("CtrlOrCmd+[")),
children:(0,Sa.jsx)(Pg,{theme:x.theme})})}}),Fn=we({name:"bringForward",perform:function(x,D){return{elements:kn(D,x,"right"),appState:D,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(x){return x[Af]&&!x.shiftKey&&"BracketRight"===x.code},PanelComponent:function(x){var D=x.updateData;x=x.appState;return(0,Sa.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return D(null)},title:"".concat(Wb("labels.bringForward")," — ").concat(Vd("CtrlOrCmd+]")),
children:(0,Sa.jsx)(Fh,{theme:x.theme})})}}),ji=we({name:"sendToBack",perform:function(x,D){return{elements:pl(x,D,"left"),appState:D,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(x){return xi?x[Af]&&x.altKey&&"BracketLeft"===x.code:x[Af]&&x.shiftKey&&"BracketLeft"===x.code},PanelComponent:function(x){var D=x.updateData;x=x.appState;return(0,Sa.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return D(null)},title:"".concat(Wb("labels.sendToBack"),
" — ").concat(Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,Sa.jsx)(Ak,{theme:x.theme})})}}),rl=we({name:"bringToFront",perform:function(x,D){return{elements:pl(x,D,"right"),appState:D,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(x){return xi?x[Af]&&x.altKey&&"BracketRight"===x.code:x[Af]&&x.shiftKey&&"BracketRight"===x.code},PanelComponent:function(x){var D=x.updateData;x=x.appState;return(0,Sa.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(R){return D(null)},
title:"".concat(Wb("labels.bringToFront")," — ").concat(Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,Sa.jsx)(Fi,{theme:x.theme})})}}),Ql=we({name:"selectAll",perform:function(x,D){return!D.editingLinearElement&&{appState:Me(vd(vd({},D),{},{editingGroupId:null,selectedElementIds:x.reduce(function(R,z){return z.isDeleted||(R[z.id]=!0),R},{})}),oe(x)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(x){return x[Af]&&"a"===x.key}}),Zk=we({name:"duplicateSelection",
perform:function(x,D){if(D.editingLinearElement){var R=D.editingLinearElement,z=R.activePointIndex;R=dd.getElement(R.elementId);if(!R||null===z)return!1;var na=R.points,sa=na[z],ha=na[z+1];return ke(R,{points:[].concat(ja(na.slice(0,z+1)),[ha?[(sa[0]+ha[0])/2,(sa[1]+ha[1])/2]:[sa[0]+30,sa[1]+30]],ja(na.slice(z+1)))}),{appState:Zd(Zd({},D),{},{editingLinearElement:Zd(Zd({},D.editingLinearElement),{},{activePointIndex:z+1})}),elements:x,commitToHistory:!0}}return Zd(Zd({},P(x,D)),{},{commitToHistory:!0})},
contextItemLabel:"labels.duplicateSelection",keyTest:function(x){return x[Af]&&"d"===x.key},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:Wk,title:"".concat(Wb("labels.duplicateSelection")," — ").concat(Vd("CtrlOrCmd+D")),"aria-label":Wb("labels.duplicateSelection"),onClick:function(){return z(null)},visible:wh(oe(D),R)})}}),P=function(x,D){for(var R=new Map,z=[],na=[],sa=new Map,ha=function(Va){var Ya=Xj(D.editingGroupId,R,Va,{x:Va.x+
yc.k/2,y:Va.y+yc.k/2});return sa.set(Va.id,Ya.id),na.push(Va),z.push(Ya),Ya},va=[],Aa=0;Aa<x.length;){var Ba=x[Aa];if(D.selectedElementIds[Ba.id]){if(Ba.groupIds.length){var Ha=dh(D,Ba);if(Ha){Ba=li(x,Ha);va.push.apply(va,ja(Ba).concat(ja(Ba.map(function(Va){return ha(Va)}))));Aa+=Ba.length;continue}}va.push(Ba,ha(Ba))}else va.push(Ba);Aa++}return Tj(va,na,sa),{elements:va,appState:Me(Zd(Zd({},D),{},{selectedGroupIds:{},selectedElementIds:z.reduce(function(Va,Ya){return Va[Ya.id]=!0,Va},{})}),oe(va))}},
la=function(x){var D=x.options,R=x.value,z=x.onChange,na=x.group;return(0,Sa.jsx)("div",{className:"buttonList buttonListIcon",children:D.map(function(sa){return(0,Sa.jsxs)("label",{className:Dc({active:R===sa.value}),title:sa.text,children:[(0,Sa.jsx)("input",{type:"radio",name:na,onChange:function(){return z(sa.value)},checked:R===sa.value}),sa.icon]},sa.text)})})},Fa=(e(4301),function(x){var D=x.children,R=x.left,z=x.top,na=x.onCloseRequest;x=x.fitInViewport;var sa=void 0!==x&&x,ha=(0,ue.useRef)(null);
return(0,ue.useLayoutEffect)(function(){if(sa&&ha.current){var va=ha.current,Aa=va.getBoundingClientRect(),Ba=Aa.y,Ha=Aa.width,Va=Aa.height,Ya=window.innerWidth;Aa.x+Ha>Ya&&(va.style.left="".concat(Ya-Ha,"px"));Aa=window.innerHeight;Ba+Va>Aa&&(va.style.top="".concat(Aa-Va,"px"))}},[sa]),(0,ue.useEffect)(function(){if(na){var va=function(Aa){var Ba;null!==(Ba=ha.current)&&void 0!==Ba&&Ba.contains(Aa.target)||(0,rh.unstable_batchedUpdates)(function(){return na(Aa)})};return document.addEventListener("pointerdown",
va,!1),function(){return document.removeEventListener("pointerdown",va,!1)}}},[na]),(0,Sa.jsx)("div",{className:"popover",style:{top:z,left:R},ref:ha,children:D})}),gb=(e(4220),function(x){var D=(new Option).style;return D.color=x,!!D.color}),zb=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Nb=function(x){var D=x.colors,R=x.color,z=x.onChange,na=x.onClose,sa=x.label,ha=x.showInput,va=void 0===ha||ha;x=x.type;var Aa=ce().useRef(),Ba=ce().useRef(),Ha=ce().useRef(),Va=ce().useRef();
ce().useEffect(function(){Ba.current?Ba.current.focus():Va.current?Va.current.focus():Ha.current&&Ha.current.focus()},[]);return(0,Sa.jsxs)("div",{className:"color-picker color-picker-type-".concat(x),role:"dialog","aria-modal":"true","aria-label":Wb("labels.colorPicker"),onKeyDown:function(Ya){if("Tab"===Ya.key){var ob,Bb=document.activeElement;if(Ya.shiftKey)Bb===Aa.current&&(null===(ob=Va.current)||void 0===ob||ob.focus(),Ya.preventDefault());else if(Bb===Va.current){var Rb;null===(Rb=Aa.current)||
void 0===Rb||Rb.focus();Ya.preventDefault()}}else oh(Ya.key)?(ob=Cg.rtl,Bb=Array.prototype.indexOf.call(Ha.current.children,document.activeElement),-1!==Bb&&(Rb=Ha.current.children.length-(va?1:0),Ha.current.children[Ya.key===(ob?"ArrowLeft":"ArrowRight")?(Bb+1)%Rb:Ya.key===(ob?"ArrowRight":"ArrowLeft")?(Rb+Bb-1)%Rb:"ArrowDown"===Ya.key?(Bb+5)%Rb:"ArrowUp"===Ya.key?(Rb+Bb-5)%Rb:Bb].focus()),Ya.preventDefault()):zb.includes(Ya.key.toLowerCase())&&!Dj(Ya.target)?(ob=zb.indexOf(Ya.key.toLowerCase()),
Ha.current.children[ob].focus(),Ya.preventDefault()):"Escape"!==Ya.key&&"Enter"!==Ya.key||(Ya.preventDefault(),na());Ya.nativeEvent.stopImmediatePropagation();Ya.stopPropagation()},children:[(0,Sa.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,Sa.jsx)("div",{className:"color-picker-triangle"}),(0,Sa.jsxs)("div",{className:"color-picker-content",ref:function(Ya){Ya&&(Ha.current=Ya)},tabIndex:0,children:[D.map(function(Ya,ob){var Bb=Ya.replace("#","");return(0,Sa.jsxs)("button",
{className:"color-picker-swatch",onClick:function(Rb){Rb.currentTarget.focus();z(Ya)},title:"".concat(Wb("colors.".concat(Bb))).concat(Ri(Ya)?"":" (".concat(Ya,")")," — ").concat(zb[ob].toUpperCase()),"aria-label":Wb("colors.".concat(Bb)),"aria-keyshortcuts":zb[ob],style:{color:Ya},ref:function(Rb){Rb&&0===ob&&(Aa.current=Rb);Rb&&Ya===R&&(Ba.current=Rb)},onFocus:function(){z(Ya)},children:[Ri(Ya)?(0,Sa.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,Sa.jsx)("span",{className:"color-picker-keybinding",
children:zb[ob]})]},Ya)}),va&&(0,Sa.jsx)(sc,{color:R,label:sa,onChange:function(Ya){z(Ya)},ref:Va})]})]})},sc=ce().forwardRef(function(x,D){var R=x.color,z=x.onChange;x=x.label;var na=ia(ce().useState(R),2),sa=na[0],ha=na[1],va=ce().useRef(null);ce().useEffect(function(){ha(R)},[R]);ce().useImperativeHandle(D,function(){return va.current});var Aa=ce().useCallback(function(Ba){Ba=Ba.toLowerCase();var Ha;(Ha=Ri(Ba)||gb(Ba)?Ba:gb("#".concat(Ba))?"#".concat(Ba):null)&&z(Ha);ha(Ba)},[z]);return(0,Sa.jsxs)("label",
{className:"color-input-container",children:[(0,Sa.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,Sa.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":x,onChange:function(Ba){return Aa(Ba.target.value)},value:(sa||"").replace(/^#/,""),onBlur:function(){return ha(R)},ref:va})]})}),Fc=function(x){var D=x.type,R=x.color,z=x.onChange,na=x.label,sa=x.isActive,ha=x.setActive,va=ce().useRef(null);return(0,Sa.jsxs)("div",{children:[(0,Sa.jsxs)("div",{className:"color-picker-control-container",
children:[(0,Sa.jsx)("button",{className:"color-picker-label-swatch","aria-label":na,style:R?{"--swatch-color":R}:void 0,onClick:function(){return ha(!sa)},ref:va}),(0,Sa.jsx)(sc,{color:R,label:na,onChange:function(Aa){z(Aa)}})]}),(0,Sa.jsx)(ce().Suspense,{fallback:"",children:sa?(0,Sa.jsx)(Fa,{onCloseRequest:function(Aa){return Aa.target!==va.current&&ha(!1)},children:(0,Sa.jsx)(Nb,{colors:ri[D],color:R||null,onChange:function(Aa){z(Aa)},onClose:function(){var Aa;ha(!1);null===(Aa=va.current)||void 0===
Aa||Aa.focus()},label:na,showInput:!1,type:D})}):null})]})};e(7117);var Oc=function(x,D,R){return x.map(function(z){var na;return D.selectedElementIds[z.id]||z.id===(null===(na=D.editingElement)||void 0===na?void 0:na.id)?R(z):z})},ad=function(x,D,R,z){var na,sa,ha=D.editingElement;x=oe(x);return null!==(na=null!==(sa=ha&&R(ha))&&void 0!==sa?sa:wh(x,D)?function(va,Aa,Ba){va=Array.from(new Set(Sf(va,Aa).map(function(Ha){return Ba(Ha)})));return 1===va.length?va[0]:null}(x,D,R):z)&&void 0!==na?na:null},
zd=(we({name:"changeStrokeColor",perform:function(x,D,R){return od(od({},R.currentItemStrokeColor&&{elements:Oc(x,D,function(z){return cf(z,{strokeColor:R.currentItemStrokeColor})})}),{},{appState:od(od({},D),R),commitToHistory:!!R.currentItemStrokeColor})},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("h3",{"aria-hidden":"true",children:Wb("labels.stroke")}),(0,Sa.jsx)(Fc,{type:"elementStroke",label:Wb("labels.stroke"),
color:ad(D,R,function(na){return na.strokeColor},R.currentItemStrokeColor),onChange:function(na){return z({currentItemStrokeColor:na})},isActive:"strokeColorPicker"===R.openPopup,setActive:function(na){return z({openPopup:na?"strokeColorPicker":null})}})]})}}),we({name:"changeBackgroundColor",perform:function(x,D,R){return od(od({},R.currentItemBackgroundColor&&{elements:Oc(x,D,function(z){return cf(z,{backgroundColor:R.currentItemBackgroundColor})})}),{},{appState:od(od({},D),R),commitToHistory:!!R.currentItemBackgroundColor})},
PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("h3",{"aria-hidden":"true",children:Wb("labels.background")}),(0,Sa.jsx)(Fc,{type:"elementBackground",label:Wb("labels.background"),color:ad(D,R,function(na){return na.backgroundColor},R.currentItemBackgroundColor),onChange:function(na){return z({currentItemBackgroundColor:na})},isActive:"backgroundColorPicker"===R.openPopup,setActive:function(na){return z({openPopup:na?"backgroundColorPicker":
null})}})]})}}),we({name:"changeFillStyle",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return cf(z,{fillStyle:R})}),appState:od(od({},D),{},{currentItemFillStyle:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.fill")}),(0,Sa.jsx)(la,{options:[{value:"hachure",text:Wb("labels.hachure"),icon:(0,Sa.jsx)(im,{theme:R.theme})},{value:"cross-hatch",text:Wb("labels.crossHatch"),
icon:(0,Sa.jsx)(Qm,{theme:R.theme})},{value:"solid",text:Wb("labels.solid"),icon:(0,Sa.jsx)(Cm,{theme:R.theme})}],group:"fill",value:ad(D,R,function(na){return na.fillStyle},R.currentItemFillStyle),onChange:function(na){z(na)}})]})}}),we({name:"changeStrokeWidth",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return cf(z,{strokeWidth:R})}),appState:od(od({},D),{},{currentItemStrokeWidth:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,
Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.strokeWidth")}),(0,Sa.jsx)(la,{group:"stroke-width",options:[{value:1,text:Wb("labels.thin"),icon:(0,Sa.jsx)(bo,{theme:R.theme,strokeWidth:2})},{value:2,text:Wb("labels.bold"),icon:(0,Sa.jsx)(bo,{theme:R.theme,strokeWidth:6})},{value:4,text:Wb("labels.extraBold"),icon:(0,Sa.jsx)(bo,{theme:R.theme,strokeWidth:10})}],value:ad(D,R,function(na){return na.strokeWidth},R.currentItemStrokeWidth),onChange:function(na){return z(na)}})]})}}),
we({name:"changeSloppiness",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return cf(z,{seed:yl(),roughness:R})}),appState:od(od({},D),{},{currentItemRoughness:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.sloppiness")}),(0,Sa.jsx)(la,{group:"sloppiness",options:[{value:0,text:Wb("labels.architect"),icon:(0,Sa.jsx)(Zo,{theme:R.theme})},{value:1,text:Wb("labels.artist"),
icon:(0,Sa.jsx)(lo,{theme:R.theme})},{value:2,text:Wb("labels.cartoonist"),icon:(0,Sa.jsx)(jm,{theme:R.theme})}],value:ad(D,R,function(na){return na.roughness},R.currentItemRoughness),onChange:function(na){return z(na)}})]})}}),we({name:"changeStrokeStyle",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return cf(z,{strokeStyle:R})}),appState:od(od({},D),{},{currentItemStrokeStyle:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,
Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.strokeStyle")}),(0,Sa.jsx)(la,{group:"strokeStyle",options:[{value:"solid",text:Wb("labels.strokeStyle_solid"),icon:(0,Sa.jsx)(Bn,{theme:R.theme})},{value:"dashed",text:Wb("labels.strokeStyle_dashed"),icon:(0,Sa.jsx)(co,{theme:R.theme})},{value:"dotted",text:Wb("labels.strokeStyle_dotted"),icon:(0,Sa.jsx)(Fj,{theme:R.theme})}],value:ad(D,R,function(na){return na.strokeStyle},R.currentItemStrokeStyle),onChange:function(na){return z(na)}})]})}}),
we({name:"changeOpacity",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return cf(z,{opacity:R})}),appState:od(od({},D),{},{currentItemOpacity:R}),commitToHistory:!0}},PanelComponent:function(x){var D,R=x.elements,z=x.appState,na=x.updateData;return(0,Sa.jsxs)("label",{className:"control-label",children:[Wb("labels.opacity"),(0,Sa.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(sa){return na(+sa.target.value)},onWheel:function(sa){sa.stopPropagation();var ha=+sa.target.value;
0>sa.deltaY&&100>ha?na(ha+10):0<sa.deltaY&&0<ha&&na(ha-10)},value:null!==(D=ad(R,z,function(sa){return sa.opacity},z.currentItemOpacity))&&void 0!==D?D:void 0})]})}}),we({name:"changeFontSize",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return Yg(z)?(z=cf(z,{fontSize:R}),Lj(z),z):z}),appState:od(od({},D),{},{currentItemFontSize:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",
{children:Wb("labels.fontSize")}),(0,Sa.jsx)(la,{group:"font-size",options:[{value:16,text:Wb("labels.small"),icon:(0,Sa.jsx)(Mk,{theme:R.theme})},{value:20,text:Wb("labels.medium"),icon:(0,Sa.jsx)(Nl,{theme:R.theme})},{value:28,text:Wb("labels.large"),icon:(0,Sa.jsx)(Cn,{theme:R.theme})},{value:36,text:Wb("labels.veryLarge"),icon:(0,Sa.jsx)(eo,{theme:R.theme})}],value:ad(D,R,function(na){return Yg(na)&&na.fontSize},R.currentItemFontSize||yc.n5),onChange:function(na){return z(na)}})]})}}),we({name:"changeFontFamily",
perform:function(x,D,R){return{elements:Oc(x,D,function(z){return Yg(z)?(z=cf(z,{fontFamily:R}),Lj(z),z):z}),appState:od(od({},D),{},{currentItemFontFamily:R}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;x=[{value:yc.ut.Virgil,text:Wb("labels.handDrawn"),icon:(0,Sa.jsx)(On,{theme:R.theme})},{value:yc.ut.Helvetica,text:Wb("labels.normal"),icon:(0,Sa.jsx)(pj,{theme:R.theme})},{value:yc.ut.Cascadia,text:Wb("labels.code"),icon:(0,Sa.jsx)(io,{theme:R.theme})}];
return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.fontFamily")}),(0,Sa.jsx)(la,{group:"font-family",options:x,value:ad(D,R,function(na){return Yg(na)&&na.fontFamily},R.currentItemFontFamily||yc.rk),onChange:function(na){return z(na)}})]})}}),we({name:"changeTextAlign",perform:function(x,D,R){return{elements:Oc(x,D,function(z){return Yg(z)?(z=cf(z,{textAlign:R}),Lj(z),z):z}),appState:od(od({},D),{},{currentItemTextAlign:R}),commitToHistory:!0}},PanelComponent:function(x){var D=
x.elements,R=x.appState,z=x.updateData;return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.textAlign")}),(0,Sa.jsx)(la,{group:"text-align",options:[{value:"left",text:Wb("labels.left"),icon:(0,Sa.jsx)(Dn,{theme:R.theme})},{value:"center",text:Wb("labels.center"),icon:(0,Sa.jsx)(gn,{theme:R.theme})},{value:"right",text:Wb("labels.right"),icon:(0,Sa.jsx)(Am,{theme:R.theme})}],value:ad(D,R,function(na){return Yg(na)&&na.textAlign},R.currentItemTextAlign),onChange:function(na){return z(na)}})]})}}),
we({name:"changeSharpness",perform:function(x,D,R){var z=Kh(oe(x),D),na=z.length?z.every(function(sa){return!Dg(sa)}):!oj(D.elementType);z=z.length?z.every(Dg):oj(D.elementType);return{elements:Oc(x,D,function(sa){return cf(sa,{strokeSharpness:R})}),appState:od(od({},D),{},{currentItemStrokeSharpness:na?R:D.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:z?R:D.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;
return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.edges")}),(0,Sa.jsx)(la,{group:"edges",options:[{value:"sharp",text:Wb("labels.sharp"),icon:(0,Sa.jsx)(en,{theme:R.theme})},{value:"round",text:Wb("labels.round"),icon:(0,Sa.jsx)(fn,{theme:R.theme})}],value:ad(D,R,function(na){return na.strokeSharpness},I(R.elementType)&&(oj(R.elementType)?R.currentItemLinearStrokeSharpness:R.currentItemStrokeSharpness)||null),onChange:function(na){return z(na)}})]})}}),we({name:"changeArrowhead",
perform:function(x,D,R){return{elements:Oc(x,D,function(z){if(Dg(z)){var na=R.position,sa=R.type;if("start"===na)return cf(z,{startArrowhead:sa});if("end"===na)return cf(z,{endArrowhead:sa})}return z}),appState:od(od({},D),{},da({},"start"===R.position?"currentItemStartArrowhead":"currentItemEndArrowhead",R.type)),commitToHistory:!0}},PanelComponent:function(x){var D=x.elements,R=x.appState,z=x.updateData;x=Cg.rtl;return(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.arrowheads")}),
(0,Sa.jsxs)("div",{className:"iconSelectList",children:[(0,Sa.jsx)(qc,{label:"arrowhead_start",options:[{value:null,text:Wb("labels.arrowhead_none"),icon:(0,Sa.jsx)(ao,{theme:R.theme}),keyBinding:"q"},{value:"arrow",text:Wb("labels.arrowhead_arrow"),icon:(0,Sa.jsx)(zn,{theme:R.theme,flip:!x}),keyBinding:"w"},{value:"bar",text:Wb("labels.arrowhead_bar"),icon:(0,Sa.jsx)(Kn,{theme:R.theme,flip:!x}),keyBinding:"e"},{value:"dot",text:Wb("labels.arrowhead_dot"),icon:(0,Sa.jsx)(An,{theme:R.theme,flip:!x}),
keyBinding:"r"}],value:ad(D,R,function(na){return Dg(na)&&"arrow"===na.type?na.startArrowhead:R.currentItemStartArrowhead},R.currentItemStartArrowhead),onChange:function(na){return z({position:"start",type:na})}}),(0,Sa.jsx)(qc,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:Wb("labels.arrowhead_none"),keyBinding:"q",icon:(0,Sa.jsx)(ao,{theme:R.theme})},{value:"arrow",text:Wb("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,Sa.jsx)(zn,{theme:R.theme,flip:x})},{value:"bar",text:Wb("labels.arrowhead_bar"),
keyBinding:"e",icon:(0,Sa.jsx)(Kn,{theme:R.theme,flip:x})},{value:"dot",text:Wb("labels.arrowhead_dot"),keyBinding:"r",icon:(0,Sa.jsx)(An,{theme:R.theme,flip:x})}],value:ad(D,R,function(na){return Dg(na)&&"arrow"===na.type?na.endArrowhead:R.currentItemEndArrowhead},R.currentItemEndArrowhead),onChange:function(na){return z({position:"end",type:na})}})]})]})}}),function(x){var D=x.title||("dark"===x.value?Wb("buttons.lightMode"):Wb("buttons.darkMode"));return(0,Sa.jsx)(Ga,{type:"icon",icon:"light"===
x.value?ee.MOON:ee.SUN,title:D,"aria-label":D,onClick:function(){return x.onChange("dark"===x.value?"light":"dark")},"data-testid":"toggle-dark-mode"})}),ee={SUN:(0,Sa.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,Sa.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,Sa.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,Sa.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"})})},re=(e(6781),function(){var x=document.querySelector(".excalidraw-tooltip");
if(x)return x;x=document.createElement("div");return document.body.appendChild(x),x.classList.add("excalidraw-tooltip"),x}),uf=function(x){var D=x.children,R=x.label;x=x.long;var z=void 0!==x&&x;return(0,ue.useEffect)(function(){return function(){return re().classList.remove("excalidraw-tooltip--visible")}},[]),(0,Sa.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(na){var sa=na.currentTarget;na=re();na.classList.add("excalidraw-tooltip--visible");na.style.minWidth=z?"50ch":
"10ch";na.style.maxWidth=z?"50ch":"15ch";na.textContent=R;var ha=sa.getBoundingClientRect(),va=ha.x;sa=ha.bottom;var Aa=ha.top,Ba=ha.width;ha=na.getBoundingClientRect();var Ha=ha.width;ha=ha.height;var Va=window.innerWidth;va=va+Ba/2-Ha/2;Ha=va+Ha>=Va?va+Ha-Va:0;Ba=sa+5;Object.assign(na.style,{top:"".concat(Ba-(Ba+ha>=window.innerHeight?sa-Aa+ha+10:0),"px"),left:"".concat(va-Ha,"px")})},onPointerLeave:function(){return re().classList.remove("excalidraw-tooltip--visible")},children:D})};we({name:"changeViewBackgroundColor",
perform:function(x,D,R){return{appState:Rd(Rd({},D),R),commitToHistory:!!R.viewBackgroundColor}},PanelComponent:function(x){var D=x.appState,R=x.updateData;return(0,Sa.jsx)("div",{style:{position:"relative"},children:(0,Sa.jsx)(Fc,{label:Wb("labels.canvasBackground"),type:"canvasBackground",color:D.viewBackgroundColor,onChange:function(z){return R({viewBackgroundColor:z})},isActive:"canvasColorPicker"===D.openPopup,setActive:function(z){return R({openPopup:z?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}});
we({name:"clearCanvas",perform:function(x,D){return{elements:x.map(function(R){return cf(R,{isDeleted:!0})}),appState:Rd(Rd({},Ij()),{},{theme:D.theme,elementLocked:D.elementLocked,exportBackground:D.exportBackground,exportEmbedScene:D.exportEmbedScene,gridSize:D.gridSize,showStats:D.showStats,pasteDialog:D.pasteDialog}),commitToHistory:!0}},PanelComponent:function(x){var D=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:be,title:Wb("buttons.clearReset"),"aria-label":Wb("buttons.clearReset"),
showAriaLabel:om(),onClick:function(){window.confirm(Wb("alerts.clearReset"))&&D(null)},"data-testid":"clear-canvas-button"})}});we({name:"zoomIn",perform:function(x,D){x=ea(ra(D.zoom.value+yc.V4),D.zoom,{left:D.offsetLeft,top:D.offsetTop},{x:D.width/2,y:D.height/2});return{appState:Rd(Rd({},D),{},{zoom:x}),commitToHistory:!1}},PanelComponent:function(x){var D=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:Ag,title:"".concat(Wb("buttons.zoomIn")," — ").concat(Vd("CtrlOrCmd++")),"aria-label":Wb("buttons.zoomIn"),
onClick:function(){D(null)},size:"small"})},keyTest:function(x){return("Equal"===x.code||"NumpadAdd"===x.code)&&(x[Af]||x.shiftKey)}});we({name:"zoomOut",perform:function(x,D){x=ea(ra(D.zoom.value-yc.V4),D.zoom,{left:D.offsetLeft,top:D.offsetTop},{x:D.width/2,y:D.height/2});return{appState:Rd(Rd({},D),{},{zoom:x}),commitToHistory:!1}},PanelComponent:function(x){var D=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:Gg,title:"".concat(Wb("buttons.zoomOut")," — ").concat(Vd("CtrlOrCmd+-")),"aria-label":Wb("buttons.zoomOut"),
onClick:function(){D(null)},size:"small"})},keyTest:function(x){return("Minus"===x.code||"NumpadSubtract"===x.code)&&(x[Af]||x.shiftKey)}});we({name:"resetZoom",perform:function(x,D){return{appState:Rd(Rd({},D),{},{zoom:ea(1,D.zoom,{left:D.offsetLeft,top:D.offsetTop},{x:D.width/2,y:D.height/2})}),commitToHistory:!1}},PanelComponent:function(x){var D=x.updateData;x=x.appState;return(0,Sa.jsx)(uf,{label:Wb("buttons.resetZoom"),children:(0,Sa.jsxs)(Ga,{type:"button",className:"reset-zoom-button",title:Wb("buttons.resetZoom"),
"aria-label":Wb("buttons.resetZoom"),onClick:function(){D(null)},size:"small",children:[(100*x.zoom.value).toFixed(0),"%"]})})},keyTest:function(x){return("Digit0"===x.code||"Numpad0"===x.code)&&(x[Af]||x.shiftKey)}});var lf=function(x,D,R){x=oe(x);var z=Sf(x,D);R=R&&0<z.length?Bg(z):Bg(x);x=D.width;z=D.height;var na=ia(R,4);x=ea(Math.min(Math.max(Math.floor(Math.min(x/(na[2]-na[0]),z/(na[3]-na[1]))/yc.V4)*yc.V4,yc.V4),1),D.zoom,{left:D.offsetLeft,top:D.offsetTop});z=ia(R,4);R=(z[0]+z[2])/2;z=(z[1]+
z[3])/2;return{appState:Rd(Rd(Rd({},D),Be({scenePoint:{x:R,y:z},viewportDimensions:{width:D.width,height:D.height},zoom:x})),{},{zoom:x}),commitToHistory:!1}};we({name:"zoomToSelection",perform:function(x,D){return lf(x,D,!0)},keyTest:function(x){return"Digit2"===x.code&&x.shiftKey&&!x.altKey&&!x[Af]}});we({name:"zoomToFit",perform:function(x,D){return lf(x,D,!1)},keyTest:function(x){return"Digit1"===x.code&&x.shiftKey&&!x.altKey&&!x[Af]}});we({name:"toggleTheme",perform:function(x,D,R){return{appState:Rd(Rd({},
D),{},{theme:R||("light"===D.theme?"dark":"light")}),commitToHistory:!1}},PanelComponent:function(x){var D=x.appState,R=x.updateData;return(0,Sa.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,Sa.jsx)(zd,{value:D.theme,onChange:function(z){R(z)}})})},keyTest:function(x){return x.altKey&&x.shiftKey&&"KeyD"===x.code}});var Yh,Tl,yi,$f=we({name:"finalize",perform:function(x,D,R,z){var na;R=z.canvas;z=z.focusContainer;if(D.editingLinearElement){var sa=D.editingLinearElement,ha=sa.startBindingElement,
va=sa.endBindingElement,Aa=dd.getElement(sa.elementId);if(Aa)return Xg(Aa)&&Md(Aa,ha,va),{elements:2>Aa.points.length||Kj(Aa)?x.filter(function(Va){return Va.id!==Aa.id}):void 0,appState:Ia(Ia({},D),{},{editingLinearElement:null}),commitToHistory:!0}}window.document.activeElement instanceof HTMLElement&&z();if(z=D.multiElement?D.multiElement:"freedraw"===(null===(na=D.editingElement)||void 0===na?void 0:na.type)?D.editingElement:null){"freedraw"!==z.type&&"touch"!==D.lastPointerDownWith&&(na=z.points,
(sa=z.lastCommittedPoint)&&na[na.length-1]===sa||ke(z,{points:z.points.slice(0,-1)}));Kj(z)&&(x=x.slice(0,-1));na=qj(z.points,D.zoom.value);if(("line"===z.type||"freedraw"===z.type)&&na){var Ba=z.points,Ha=Ba[0];ke(z,{points:Ba.map(function(Va,Ya){return Ya===Ba.length-1?[Ha[0],Ha[1]]:Va})})}Xg(z)&&!na&&1<z.points.length&&(sa=ia(dd.getPointAtIndexGlobalCoordinates(z,-1),2),na=sa[0],sa=sa[1],ng(z,D,Ph.getScene(z),{x:na,y:sa}));D.elementLocked||"freedraw"===D.elementType||(D.selectedElementIds[z.id]=
!0)}return(D.elementLocked||"freedraw"===D.elementType)&&z||Pi(R),{elements:x,appState:Ia(Ia({},D),{},{elementType:(D.elementLocked||"freedraw"===D.elementType)&&z?D.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:z&&!D.elementLocked&&"freedraw"!==D.elementType?Ia(Ia({},D.selectedElementIds),{},da({},z.id,!0)):D.selectedElementIds}),commitToHistory:"freedraw"===D.elementType}},keyTest:function(x,D){return"Escape"===
x.key&&(null!==D.editingLinearElement||!D.draggingElement&&null===D.multiElement)||("Escape"===x.key||"Enter"===x.key)&&null!==D.multiElement},PanelComponent:function(x){var D=x.appState;x=x.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:rg,title:Wb("buttons.done"),"aria-label":Wb("buttons.done"),onClick:x,visible:null!=D.multiElement})}}),Lh="undefined"!=typeof l&&null!==(Yh=l.env)&&void 0!==Yh&&Yh.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(x,D,R,z){window.gtag("event",
D,{event_category:x,event_label:R,value:z})}:("undefined"!=typeof l&&null!==(Tl=l.env)&&void 0!==Tl&&Tl.JEST_WORKER_ID,function(x,D,R,z){}),Kk=(e(518),e(9966),function(x){var D=Ip().id,R=ia((0,ue.useState)(x.value),2),z=R[0],na=R[1];return(0,Sa.jsxs)("div",{className:"ProjectName",children:[(0,Sa.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(x.label).concat(x.isNameEditable?"":":")}),x.isNameEditable?(0,Sa.jsx)("input",{className:"TextInput",onBlur:function(sa){var ha;
a:{for(ha=sa.target.parentElement;ha;){if(-1<ha.tabIndex){ha=void ha.focus();break a}ha=ha.parentElement}ha=void 0}!ha;sa=sa.target.value;sa!==x.value&&x.onChange(sa)},onKeyDown:function(sa){"Enter"!==sa.key||(sa.preventDefault(),sa.nativeEvent.isComposing||229===sa.keyCode)||sa.currentTarget.blur()},id:"".concat(D,"-filename"),value:z,onChange:function(sa){return na(sa.target.value)}}):(0,Sa.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(D,"-filename"),children:x.value})]})}),
Dm=function(x,D){if(null!=D&&D.collaborators&&(D=D.collaborators.get(x),null!=D&&D.color))return D.color;x=x.split("").reduce(function(z,na){return z+na.charCodeAt(0)},0);D=ri.elementBackground.slice(1);var R=ri.elementStroke.slice(1);return{background:D[x%D.length],stroke:R[x%R.length]}};!function(x){x.ACTIVE="active";x.AWAY="away";x.IDLE="idle"}(yi||(yi={}));var Ln=function(){var x=document.createElement("canvas").getContext("2d");return x?(x.fillStyle="#f00",x.textBaseline="top",x.font="32px Arial",
x.fillText("\ud83d\ude00",0,0),0!==x.getImageData(12,12,1,1).data[0]):!1}(),Rm=function(x,D,R,z,na,sa,ha,va){var Aa=8<arguments.length&&void 0!==arguments[8]&&arguments[8];x.save();x.translate(sa,ha);x.rotate(va);Aa&&x.fillRect(D-sa,R-ha,z,na);x.strokeRect(D-sa,R-ha,z,na);x.restore()},on=function(x,D,R,z){x.beginPath();x.arc(D,R,z,0,2*Math.PI);x.fill();x.stroke()},Kf=function(x,D,R,z,na,sa){x.save();x.strokeStyle="rgba(0,0,0,0.1)";x.beginPath();for(var ha=R;ha<R+na+2*D;ha+=D)x.moveTo(ha,z-D),x.lineTo(ha,
z+sa+2*D);for(ha=z;ha<z+sa+2*D;ha+=D)x.moveTo(R-D,ha),x.lineTo(R+na+2*D,ha);x.stroke();x.restore()},Hk=function(x,D,R,z){x.save();x.translate(R.scrollX,R.scrollY);x.lineWidth=1/R.zoom.value;dd.getPointsGlobalCoordinates(z).forEach(function(na,sa){var ha;x.strokeStyle="red";x.setLineDash([]);x.fillStyle=(null===(ha=D.editingLinearElement)||void 0===ha?void 0:ha.activePointIndex)===sa?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";on(x,na[0],na[1],dd.POINT_HANDLE_SIZE/2/R.zoom.value)});x.restore()},
Si=function(x,D,R,z,na,sa,ha){var va=7<arguments.length&&void 0!==arguments[7]?arguments[7]:{},Aa=va.renderScrollbars;Aa=void 0===Aa||Aa;var Ba=va.renderSelection;Ba=void 0===Ba||Ba;var Ha=va.renderOptimizations,Va=void 0!==Ha&&Ha;va=va.renderGrid;va=void 0===va||va;if(null===sa)return{atLeastOneVisibleElement:!1};var Ya=sa.getContext("2d");Ya.setTransform(1,0,0,1,0,0);Ya.save();Ya.scale(z,z);var ob=sa.width/z,Bb=sa.height/z;(ha.exportWithDarkMode&&(Ya.filter=yc.ZF),"string"==typeof ha.viewBackgroundColor)?
(("transparent"===ha.viewBackgroundColor||5===ha.viewBackgroundColor.length||9===ha.viewBackgroundColor.length||/(hsla|rgba)\(/.test(ha.viewBackgroundColor))&&Ya.clearRect(0,0,ob,Bb),Ya.save(),Ya.fillStyle=ha.viewBackgroundColor,Ya.fillRect(0,0,ob,Bb),Ya.restore()):Ya.clearRect(0,0,ob,Bb);Ha=ha.zoom.translation.x;var Rb=ha.zoom.translation.y;Ya.save();Ya.translate(Ha,Rb);Ya.scale(ha.zoom.value,ha.zoom.value);va&&D.gridSize&&Kf(Ya,D.gridSize,-Math.ceil(Ha/ha.zoom.value/D.gridSize)*D.gridSize+ha.scrollX%
D.gridSize,-Math.ceil(Rb/ha.zoom.value/D.gridSize)*D.gridSize+ha.scrollY%D.gridSize,ob/ha.zoom.value,Bb/ha.zoom.value);var ic;va=x.filter(function(kd){var qd={zoom:ha.zoom,offsetLeft:D.offsetLeft,offsetTop:D.offsetTop,scrollX:ha.scrollX,scrollY:ha.scrollY},Hd=ia(gk(kd),4);kd=Hd[0];var He=Hd[1],Tg=Hd[2];Hd=Hd[3];var ni=hh({clientX:qd.offsetLeft,clientY:qd.offsetTop},qd);qd=hh({clientX:qd.offsetLeft+ob,clientY:qd.offsetTop+Bb},qd);return ni.x<=Tg&&ni.y<=Hd&&qd.x>=kd&&qd.y>=He});(va.forEach(function(kd){try{lh(kd,
na,Ya,Va,ha)}catch(qd){console.error(qd)}}),D.editingLinearElement)&&(Ha=dd.getElement(D.editingLinearElement.elementId))&&Hk(Ya,D,ha,Ha);if(R)try{lh(R,na,Ya,Va,ha)}catch(kd){console.error(kd)}if(D.isBindingEnabled&&D.suggestedBindings.filter(function(kd){return null!=kd}).forEach(function(kd){var qd=Array.isArray(kd)?zq:Mn;Ya.save();Ya.translate(ha.scrollX,ha.scrollY);qd(Ya,kd);Ya.restore()}),Ba&&!D.multiElement&&!D.editingLinearElement){var mc,Sc=x.reduce(function(kd,qd){var Hd=[];if(D.selectedElementIds[qd.id]&&
null==dh(D,qd)&&Hd.push(mf.black),ha.remoteSelectedElementIds[qd.id]&&Hd.push.apply(Hd,ja(ha.remoteSelectedElementIds[qd.id].map(function(Tg){return Dm(Tg,D).background}))),Hd.length){var He=ia(Vf(qd),4);kd.push({angle:qd.angle,elementX1:He[0],elementY1:He[1],elementX2:He[2],elementY2:He[3],selectionColors:Hd})}return kd},[]);Ba=function(kd){kd=li(x,kd);kd=ia(Bg(kd),4);Sc.push({angle:0,elementX1:kd[0],elementX2:kd[2],elementY1:kd[1],elementY2:kd[3],selectionColors:[mf.black]})};Ha=cb(vi(D));try{for(Ha.s();!(mc=
Ha.n()).done;)Ba(mc.value)}catch(kd){Ha.e(kd)}finally{Ha.f()}D.editingGroupId&&Ba(D.editingGroupId);Sc.forEach(function(kd){var qd=kd.angle,Hd=kd.elementX1,He=kd.elementY1,Tg=kd.selectionColors,ni=kd.elementX2-Hd;kd=kd.elementY2-He;var Bi=4/ha.zoom.value,pf=8/ha.zoom.value,ye=4/ha.zoom.value;Ya.save();Ya.translate(ha.scrollX,ha.scrollY);Ya.lineWidth=1/ha.zoom.value;for(var Mg=Tg.length,Wi=0;Wi<Mg;++Wi)Ya.strokeStyle=Tg[Wi],Ya.setLineDash([pf,ye+(pf+ye)*(Mg-1)]),Ya.lineDashOffset=(pf+ye)*Wi,Rm(Ya,
Hd-Bi,He-Bi,ni+2*Bi,kd+2*Bi,Hd+ni/2,He+kd/2,qd);Ya.restore()});Ba=Sf(x,D);if(Ya.save(),Ya.translate(ha.scrollX,ha.scrollY),1===Ba.length)Ya.fillStyle=mf.white,mc=Tk(Ba[0],ha.zoom,"mouse"),D.viewModeEnabled||Ej(Ya,ha,mc,Ba[0].angle);else if(1<Ba.length&&!D.isRotating){mc=4/ha.zoom.value;Ya.fillStyle=mf.white;Ba=Bg(Ba);var Xc=ia(Ba,4);Ba=Xc[0];Ha=Xc[1];Rb=Xc[2];Xc=Xc[3];var Pc=Ya.getLineDash();Ya.setLineDash([2/ha.zoom.value]);var Yc=Ya.lineWidth;Ya.lineWidth=1/ha.zoom.value;Rm(Ya,Ba-mc,Ha-mc,Rb-Ba+
2*mc,Xc-Ha+2*mc,(Ba+Rb)/2,(Ha+Xc)/2,0);Ya.lineWidth=Yc;Ya.setLineDash(Pc);mc=Jg([Ba,Ha,Rb,Xc],0,ha.zoom,"mouse",sj);Ej(Ya,ha,mc,0)}Ya.restore()}for(var Bd in Ya.restore(),ha.remotePointerViewportCoords){mc=ha.remotePointerViewportCoords[Bd];Ha=mc.x;Rb=mc.y;Ha-=D.offsetLeft;Rb-=D.offsetTop;Xc=0>Ha||Ha>ob-9||0>Rb||Rb>Bb-14;Ha=Math.max(Ha,0);Ha=Math.min(Ha,ob-9);Rb=Math.max(Rb,0);Rb=Math.min(Rb,Bb-14);Ba=Dm(Bd,D);mc=Ba.background;Ba=Ba.stroke;Ya.save();Ya.strokeStyle=Ba;Ya.fillStyle=mc;Pc=ha.remotePointerUserStates[Bd];
(Xc||Pc===yi.AWAY)&&(Ya.globalAlpha=.48);ha.remotePointerButton&&"down"===ha.remotePointerButton[Bd]&&(Ya.beginPath(),Ya.arc(Ha,Rb,15,0,2*Math.PI,!1),Ya.lineWidth=3,Ya.strokeStyle="#ffffff88",Ya.stroke(),Ya.closePath(),Ya.beginPath(),Ya.arc(Ha,Rb,15,0,2*Math.PI,!1),Ya.lineWidth=1,Ya.strokeStyle=Ba,Ya.stroke(),Ya.closePath());Ya.beginPath();Ya.moveTo(Ha,Rb);Ya.lineTo(Ha+1,Rb+14);Ya.lineTo(Ha+4,Rb+9);Ya.lineTo(Ha+9,Rb+10);Ya.lineTo(Ha,Rb);Ya.fill();Ya.stroke();Yc=ha.remotePointerUsernames[Bd];var Xd=
"";Pc===yi.AWAY?Xd=Ln?"⚫️":" (".concat(yi.AWAY,")"):Pc===yi.IDLE?Xd=Ln?"\ud83d\udca4":" (".concat(yi.IDLE,")"):Pc===yi.ACTIVE&&(Xd=Ln?"\ud83d\udfe2":"");Pc="".concat(Yc?"".concat(Yc," "):"").concat(Xd);!Xc&&Pc&&(Ha+=9,Rb+=14,Xc=Ya.measureText(Pc),Yc=Xc.actualBoundingBoxDescent+Xc.actualBoundingBoxAscent,Ya.fillStyle=Ba,Ya.fillRect(Ha-1,Rb-1,Xc.width+8+2,Yc+8+2),Ya.fillStyle=mc,Ya.fillRect(Ha,Rb,Xc.width+8,Yc+8),Ya.fillStyle=mf.white,Ya.fillText(Pc,Ha+4,Rb+4+Xc.actualBoundingBoxAscent));Ya.restore();
Ya.closePath()}return Aa&&(ic=sh(x,ob,Bb,ha),Ya.save(),Ya.fillStyle="rgba(0,0,0,0.3)",Ya.strokeStyle="rgba(255,255,255,0.8)",[ic.horizontal,ic.vertical].forEach(function(kd){if(kd){var qd=kd.x,Hd=kd.y,He=kd.width;kd=kd.height;Ya.beginPath();Ya.moveTo(qd+3,Hd);Ya.lineTo(qd+He-3,Hd);Ya.quadraticCurveTo(qd+He,Hd,qd+He,Hd+3);Ya.lineTo(qd+He,Hd+kd-3);Ya.quadraticCurveTo(qd+He,Hd+kd,qd+He-3,Hd+kd);Ya.lineTo(qd+3,Hd+kd);Ya.quadraticCurveTo(qd,Hd+kd,qd,Hd+kd-3);Ya.lineTo(qd,Hd+3);Ya.quadraticCurveTo(qd,Hd,
qd+3,Hd);Ya.closePath();Ya.fill();Ya.stroke()}}),Ya.restore()),Ya.restore(),{atLeastOneVisibleElement:0<va.length,scrollBars:ic}},Ej=function(x,D,R,z){Object.keys(R).forEach(function(na){var sa=R[na];void 0!==sa&&(x.save(),x.lineWidth=1/D.zoom.value,"rotation"===na?on(x,sa[0]+sa[2]/2,sa[1]+sa[3]/2,sa[2]/2):Rm(x,sa[0],sa[1],sa[2],sa[3],sa[0]+sa[2]/2,sa[1]+sa[3]/2,z,!0),x.restore())})},Mn=function(x,D){var R=ia(Vf(D),4),z=R[0],na=R[1],sa=R[2]-z;R=R[3]-na;var ha=Rh(D,sa,R);x.strokeStyle="rgba(0,0,0,.05)";
x.lineWidth=ha-4;ha=2+ha/2;switch(D.type){case "rectangle":case "text":Rm(x,z-ha,na-ha,sa+2*ha,R+2*ha,z+sa/2,na+R/2,D.angle);break;case "diamond":var va=Math.hypot(sa,R);!function(Aa,Ba,Ha,Va,Ya,ob){Aa.save();Aa.translate(Va,Ya);Aa.rotate(ob);Aa.beginPath();Aa.moveTo(0,Ha/2);Aa.lineTo(Ba/2,0);Aa.lineTo(0,-Ha/2);Aa.lineTo(-Ba/2,0);Aa.closePath();Aa.stroke();Aa.restore()}(x,sa+ha*va/R*2,R+ha*va/sa*2,z+sa/2,na+R/2,D.angle);break;case "ellipse":!function(Aa,Ba,Ha,Va,Ya,ob){Aa.beginPath();Aa.ellipse(Va,
Ya,Ba/2,Ha/2,ob,0,2*Math.PI);Aa.stroke()}(x,sa+2*ha,R+2*ha,z+sa/2,na+R/2,D.angle)}},zq=function(x,D){var R=ia(D,3),z=R[0];D=R[1];R=R[2];var na=Rh(R,R.width,R.height);x.strokeStyle="rgba(0,0,0,0)";x.fillStyle="rgba(0,0,0,.05)";("both"===D?[0,-1]:"start"===D?[0]:[-1]).forEach(function(sa){sa=ia(dd.getPointAtIndexGlobalCoordinates(z,sa),2);on(x,sa[0],sa[1],na)})},Cj=function(x,D,R){var z=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},na=z.offsetX,sa=void 0===na?0:na;z=z.offsetY;var ha=void 0===
z?0:z;R&&x.forEach(function(va){if(!va.isDeleted)try{Bf(va,D,R,va.x+sa,va.y+ha)}catch(Aa){console.error(Aa)}})},nm=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})();const ho=nm?e.e(736).then(e.bind(e,6629)):e.e(736).then(e.bind(e,3112));nm?e.e(736).then(e.bind(e,5756)):e.e(736).then(e.bind(e,8396));const To=nm?e.e(736).then(e.bind(e,4868)):e.e(736).then(e.bind(e,6882));var mn=function(x){function D(){var z,
na=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",sa=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return q(this,D),(z=R.call(this)).name=sa,z.message=na,z}M(D,x);var R=Bc(D);return D}(xc(Error)),yq=function(x){function D(){var z=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return q(this,D),R.call(this,z,"AbortError")}M(D,x);var R=Bc(D);return D}(xc(DOMException)),xq={jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",
json:"application/json",excalidraw:yc.LO.excalidraw,excalidrawlib:yc.LO.excalidrawlib},Bp=function(x){var D,R,z,na=null===(D=x.extensions)||void 0===D?void 0:D.reduce(function(sa,ha){return sa.push(xq[ha]),sa},[]);D=null===(R=x.extensions)||void 0===R?void 0:R.reduce(function(sa,ha){return"jpg"===ha?sa.concat(".jpg",".jpeg"):sa.concat(".".concat(ha))},[]);return async function(...sa){return(await ho).default(...sa)}({description:x.description,extensions:D,mimeTypes:na,multiple:null!==(z=x.multiple)&&
void 0!==z&&z,legacySetup:function(sa,ha,va){var Aa=Sm(ha,500),Ba=function(){Ha();document.addEventListener(yc.Ks.KEYUP,Aa);document.addEventListener(yc.Ks.POINTER_UP,Aa);Aa()},Ha=function(){var Ya;null!==(Ya=va.files)&&void 0!==Ya&&Ya.length&&(Ya=x.multiple?ja(va.files):va.files[0],sa(Ya))};requestAnimationFrame(function(){window.addEventListener(yc.Ks.FOCUS,Ba)});var Va=window.setInterval(function(){Ha()},500);return function(Ya){clearInterval(Va);Aa.cancel();window.removeEventListener(yc.Ks.FOCUS,
Ba);document.removeEventListener(yc.Ks.KEYUP,Aa);document.removeEventListener(yc.Ks.POINTER_UP,Aa);Ya&&(console.warn("Opening the file was canceled (legacy-fs)."),Ya(new yq))}}})},go=function(x,D){return async function(...R){return(await To).default(...R)}(x,{fileName:"".concat(D.name,".").concat(D.extension),description:D.description,extensions:[".".concat(D.extension)]},D.fileHandle)},Fe={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,arrow:!0,freedraw:!0},In=function(x,D){var R,
z,na,sa,ha,va,Aa,Ba,Ha,Va,Ya,ob;x={type:D.type||x.type,version:x.version||1,versionNonce:null!==(R=x.versionNonce)&&void 0!==R?R:0,isDeleted:null!==(z=x.isDeleted)&&void 0!==z&&z,id:x.id||dk(),fillStyle:x.fillStyle||"hachure",strokeWidth:x.strokeWidth||1,strokeStyle:null!==(na=x.strokeStyle)&&void 0!==na?na:"solid",roughness:null!==(sa=x.roughness)&&void 0!==sa?sa:1,opacity:null==x.opacity?100:x.opacity,angle:x.angle||0,x:null!==(ha=null!==(va=D.x)&&void 0!==va?va:x.x)&&void 0!==ha?ha:0,y:null!==
(Aa=null!==(Ba=D.y)&&void 0!==Ba?Ba:x.y)&&void 0!==Aa?Aa:0,strokeColor:x.strokeColor,backgroundColor:x.backgroundColor,width:x.width||0,height:x.height||0,seed:null!==(Ha=x.seed)&&void 0!==Ha?Ha:1,groupIds:null!==(Va=x.groupIds)&&void 0!==Va?Va:[],strokeSharpness:null!==(Ya=x.strokeSharpness)&&void 0!==Ya?Ya:oj(x.type)?"round":"sharp",boundElementIds:null!==(ob=x.boundElementIds)&&void 0!==ob?ob:[]};return Ud(Ud(Ud({},x),Rj(x)),D)},wq=function(x){var D;switch(x.type){case "text":var R=x.fontSize,
z=x.fontFamily;"font"in x&&(R=ia(x.font.split(" "),2),z=R[1],R=parseInt(R[0],10),z=Object.keys(yc.ut).includes(z)?yc.ut[z]:yc.rk);return In(x,{fontSize:R,fontFamily:z,text:null!==(D=x.text)&&void 0!==D?D:"",baseline:x.baseline,textAlign:x.textAlign||yc.Hg,verticalAlign:x.verticalAlign||yc.hs});case "freedraw":return In(x,{points:x.points,lastCommittedPoint:null,simulatePressure:x.simulatePressure,pressures:x.pressures});case "line":case "draw":case "arrow":D=x.startArrowhead;D=void 0===D?null:D;R=
x.endArrowhead;R=void 0===R?"arrow"===x.type?"arrow":null:R;z=x.x;var na=x.y,sa=!Array.isArray(x.points)||2>x.points.length?[[0,0],[x.width,x.height]]:x.points;if(0!==sa[0][0]||0!==sa[0][1])na=dd.getNormalizedPoints(x),sa=na.points,z=na.x,na=na.y;return In(x,{type:"draw"===x.type?"line":x.type,startBinding:x.startBinding,endBinding:x.endBinding,lastCommittedPoint:null,startArrowhead:D,endArrowhead:R,points:sa,x:z,y:na});case "ellipse":case "rectangle":case "diamond":return In(x,{})}},sl=function(x,
D){var R=D?al(D):null;return(x||[]).reduce(function(z,na){if("selection"!==na.type&&!Kj(na)){var sa=wq(na);sa&&((na=null==R?void 0:R[na.id])&&na.version>sa.version&&(sa=vg(sa,na.version)),z.push(sa))}return z},[])},Um=function(x,D){x=x||{};var R,z=Ij(),na={},sa=Nc(Object.entries(z));try{for(sa.s();!(R=sa.n()).done;){var ha=ia(R.value,2),va=ha[0],Aa=ha[1],Ba=x[va],Ha=D?D[va]:void 0;na[va]=void 0!==Ba?Ba:void 0!==Ha?Ha:Aa}}catch(Va){sa.e(Va)}finally{sa.f()}return Ud(Ud({},na),{},{elementType:Fe[na.elementType]?
na.elementType:"selection",zoom:"number"==typeof x.zoom?{value:x.zoom,translation:z.zoom.translation}:x.zoom||z.zoom})},Tm=function(x,D,R){return{elements:sl(null==x?void 0:x.elements,R),appState:Um(null==x?void 0:x.appState,D||null)}},ko=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na;return Yd().wrap(function(sa){for(;;)switch(sa.prev=sa.next){case 0:if("image/png"!==R.type){sa.next=18;break}return sa.prev=1,sa.next=4,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 4:return sa.next=
6,sa.sent.decodePngMetadata(R);case 6:return sa.abrupt("return",sa.sent);case 9:if(sa.prev=9,sa.t0=sa.catch(1),"INVALID"!==sa.t0.message){sa.next=15;break}throw Error(Wb("alerts.imageDoesNotContainScene"));case 15:throw Error(Wb("alerts.cannotRestoreFromImage"));case 16:sa.next=43;break;case 18:if(!("text"in Blob)){sa.next=24;break}return sa.next=21,R.text();case 21:na=sa.sent;sa.next=27;break;case 24:return sa.next=26,new Promise(function(ha){var va=new FileReader;va.readAsText(R,"utf8");va.onloadend=
function(){va.readyState===FileReader.DONE&&ha(va.result)}});case 26:na=sa.sent;case 27:if("image/svg+xml"!==R.type){sa.next=43;break}return sa.prev=28,sa.next=31,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 31:return sa.next=33,sa.sent.decodeSvgMetadata({svg:na});case 33:return sa.abrupt("return",sa.sent);case 36:if(sa.prev=36,sa.t1=sa.catch(28),"INVALID"!==sa.t1.message){sa.next=42;break}throw Error(Wb("alerts.imageDoesNotContainScene"));case 42:throw Error(Wb("alerts.cannotRestoreFromImage"));
case 43:return sa.abrupt("return",na);case 44:case "end":return sa.stop()}},z,null,[[1,9],[28,36]])}));return function(R){return x.apply(this,arguments)}}(),Fp=function(x){var D;return x&&(null===(D=x.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===D?void 0:D[1])||null},Yo=function(x){x=Fp(x);return"png"===x||"svg"===x},vl=function(){var x=(0,ff.Z)(Yd().mark(function sa(R,z,na){var ha,va,Aa;return Yd().wrap(function(Ba){for(;;)switch(Ba.prev=Ba.next){case 0:return Ba.next=2,ko(R);case 2:ha=
Ba.sent;Ba.prev=3;var Ha=va=JSON.parse(ha);if((null==Ha?void 0:Ha.type)===yc.r8.excalidraw&&(!Ha.elements||Array.isArray(Ha.elements)&&(!Ha.appState||"object"===G(Ha.appState)))){Ba.next=7;break}throw Error(Wb("alerts.couldNotLoadInvalidFile"));case 7:return Aa=Tm({elements:Ml(va.elements||[]),appState:ge(ge({theme:null==z?void 0:z.theme,fileHandle:R.handle||null},fk(va.appState||{},"export")),z?Fg(va.elements||[],z):{})},z,na),Ba.abrupt("return",Aa);case 11:throw Ba.prev=11,Ba.t0=Ba.catch(3),console.error(Ba.t0.message),
Error(Wb("alerts.couldNotLoadInvalidFile"));case 15:case "end":return Ba.stop()}},sa,null,[[3,11]])}));return function(R,z,na){return x.apply(this,arguments)}}(),jo=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na,sa;return Yd().wrap(function(ha){for(;;)switch(ha.prev=ha.next){case 0:return ha.next=2,ko(R);case 2:if(na=ha.sent,(sa=JSON.parse(na)).type===yc.r8.excalidrawLibrary){ha.next=6;break}throw Error(Wb("alerts.couldNotLoadInvalidFile"));case 6:return ha.abrupt("return",sa);case 7:case "end":return ha.stop()}},
z)}));return function(R){return x.apply(this,arguments)}}(),Dp=function(){var x=(0,ff.Z)(Yd().mark(function z(R){return Yd().wrap(function(na){for(;;)switch(na.prev=na.next){case 0:return na.abrupt("return",new Promise(function(sa,ha){try{R.toBlob(function(va){if(!va)return ha(new mn(Wb("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));sa(va)})}catch(va){ha(va)}}));case 1:case "end":return na.stop()}},z)}));return function(R){return x.apply(this,arguments)}}(),Jn=function(x,D){x={type:yc.r8.excalidraw,
version:2,source:yc.pb,elements:Ml(x),appState:fk(D,"export")};return JSON.stringify(x,null,2)},Em=function(){var x=(0,ff.Z)(Yd().mark(function na(R,z){var sa,ha,va;return Yd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:return sa=Jn(R,z),ha=new Blob([sa],{type:yc.LO.excalidraw}),Aa.next=4,go(ha,{name:z.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Yo(z.fileHandle)?null:z.fileHandle});case 4:return va=Aa.sent,Aa.abrupt("return",{fileHandle:va});case 6:case "end":return Aa.stop()}},
na)}));return function(R,z){return x.apply(this,arguments)}}(),Cp=function(){var x=(0,ff.Z)(Yd().mark(function na(R,z){var sa;return Yd().wrap(function(ha){for(;;)switch(ha.prev=ha.next){case 0:return ha.next=2,Bp({description:"Excalidraw files"});case 2:return sa=ha.sent,ha.abrupt("return",vl(sa,R,z));case 4:case "end":return ha.stop()}},na)}));return function(R,z){return x.apply(this,arguments)}}(),Xo=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na,sa,ha;return Yd().wrap(function(va){for(;;)switch(va.prev=
va.next){case 0:return va.next=2,R.loadLibrary();case 2:return na=va.sent,sa={type:yc.r8.excalidrawLibrary,version:1,source:yc.pb,library:na},ha=JSON.stringify(sa,null,2),va.next=7,go(new Blob([ha],{type:yc.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"});case 7:case "end":return va.stop()}},z)}));return function(R){return x.apply(this,arguments)}}(),Ep=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na;return Yd().wrap(function(sa){for(;;)switch(sa.prev=
sa.next){case 0:return sa.next=2,Bp({description:"Excalidraw library files"});case 2:return na=sa.sent,sa.next=5,R.importLibrary(na);case 5:case "end":return sa.stop()}},z)}));return function(R){return x.apply(this,arguments)}}(),Aq=function(x,D,R){var z=R.exportBackground,na=R.exportPadding;na=void 0===na?yc.qy:na;var sa=R.viewBackgroundColor,ha=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(Ha,Va){var Ya=document.createElement("canvas");return Ya.width=Ha*D.exportScale,Ya.height=
Va*D.exportScale,{canvas:Ya,scale:D.exportScale}},va=zp(x,na),Aa=ia(va,4);va=Aa[0];var Ba=Aa[1];Aa=ha(Aa[2],Aa[3]);ha=Aa.canvas;Aa=Aa.scale;return Si(x,D,null,void 0===Aa?1:Aa,Bj.canvas(ha),ha,{viewBackgroundColor:z?sa:null,exportWithDarkMode:D.exportWithDarkMode,scrollX:-va+na,scrollY:-Ba+na,zoom:Ij().zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{}},{renderScrollbars:!1,renderSelection:!1,renderOptimizations:!1,
renderGrid:!1}),ha},Ap=function(){var x=(0,ff.Z)(Yd().mark(function na(R,z){var sa,ha,va,Aa,Ba,Ha,Va,Ya,ob,Bb,Rb,ic,mc,Sc,Xc,Pc;return Yd().wrap(function(Yc){for(;;)switch(Yc.prev=Yc.next){case 0:if(sa=z.exportPadding,ha=void 0===sa?yc.qy:sa,va=z.viewBackgroundColor,Aa=z.exportScale,Ba=void 0===Aa?1:Aa,Ha=z.exportEmbedScene,Va="",!Ha){Yc.next=14;break}return Yc.prev=3,Yc.next=6,Promise.all([e.e(736),e.e(9)]).then(e.bind(e,8527));case 6:return Yc.next=8,Yc.sent.encodeSvgMetadata({text:Jn(R,z)});case 8:Va=
Yc.sent;Yc.next=14;break;case 11:Yc.prev=11,Yc.t0=Yc.catch(3),console.error(Yc.t0);case 14:return Ya=zp(R,ha),ob=ia(Ya,4),Bb=ob[0],Rb=ob[1],ic=ob[2],mc=ob[3],(Sc=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("version","1.1"),Sc.setAttribute("xmlns","http://www.w3.org/2000/svg"),Sc.setAttribute("viewBox","0 0 ".concat(ic," ").concat(mc)),Sc.setAttribute("width","".concat(ic*Ba)),Sc.setAttribute("height","".concat(mc*Ba)),z.exportWithDarkMode&&Sc.setAttribute("filter",yc.ZF),
Sc.innerHTML="\n ".concat("\x3c!-- svg-source:excalidraw --\x3e","\n ").concat(Va,'\n \x3cdefs\x3e\n \x3cstyle\x3e\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 \x3c/style\x3e\n \x3c/defs\x3e\n '),z.exportBackground&&va&&((Xc=Sc.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",
"0"),Xc.setAttribute("y","0"),Xc.setAttribute("width","".concat(ic)),Xc.setAttribute("height","".concat(mc)),Xc.setAttribute("fill",va),Sc.appendChild(Xc)),Pc=Bj.svg(Sc),Cj(R,Pc,Sc,{offsetX:-Bb+ha,offsetY:-Rb+ha}),Yc.abrupt("return",Sc);case 27:case "end":return Yc.stop()}},na,null,[[3,11]])}));return function(R,z){return x.apply(this,arguments)}}(),zp=function(x,D){x=ia(Bg(x),4);var R=x[0],z=x[1];return[R,z,Math.abs(R-x[2])+2*D,Math.abs(z-x[3])+D+D]},So=function(x){return(x=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(x))?
parseFloat(x[1].replace(/,/g,"")):null},vq=function(x,D){return x.slice(1).every(function(R){return null!==So(R[D])})},or=function(x){var D=x[0].length;if(2<D)return{type:"NOT_SPREADSHEET",reason:"More than 2 columns"};if(1===D){if(!vq(x,0))return{type:"NOT_SPREADSHEET",reason:"Value is not numeric"};D=null===So(x[0][0]);var R=(D?x.slice(1):x).map(function(sa){return So(sa[0])});return 2>R.length?{type:"NOT_SPREADSHEET",reason:"Less than two rows"}:{type:"VALID_SPREADSHEET",spreadsheet:{title:D?x[0][0]:
null,labels:null,values:R}}}var z=vq(x,0)?0:1;if(!vq(x,z))return{type:"NOT_SPREADSHEET",reason:"Value is not numeric"};var na=(z+1)%2;R=(D=null===So(x[0][z]))?x.slice(1):x;return 2>R.length?{type:"NOT_SPREADSHEET",reason:"Less than 2 rows"}:{type:"VALID_SPREADSHEET",spreadsheet:{title:D?x[0][z]:null,labels:R.map(function(sa){return sa[na]}),values:R.map(function(sa){return So(sa[z])})}}},pn=ri.elementBackground.slice(2,ri.elementBackground.length),Yl={fillStyle:"hachure",fontFamily:yc.rk,fontSize:yc.n5,
opacity:100,roughness:1,strokeColor:ri.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},$o=function(x){return{chartWidth:44*x.values.length+12,chartHeight:280}},H=function(x,D,R,z,na,sa){var ha=$o(x),va=ha.chartWidth,Aa=ha.chartHeight;ha=x.title?Eg(fa(fa({backgroundColor:na,groupIds:[z]},Yl),{},{text:x.title,x:D+va/2,y:R-256-24-yc.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null;sa=sa?xf(fa(fa({backgroundColor:na,groupIds:[z]},
Yl),{},{type:"rectangle",x:D,y:R-Aa,width:va,height:Aa,strokeColor:ri.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[].concat(ja(sa?[sa]:[]),ja(ha?[ha]:[]),ja(function(Ba,Ha,Va,Ya,ob){var Bb;return(null===(Bb=Ba.labels)||void 0===Bb?void 0:Bb.map(function(Rb,ic){return Eg(fa(fa({groupIds:[Ya],backgroundColor:ob},Yl),{},{text:8<Rb.length?"".concat(Rb.slice(0,5),"..."):Rb,x:Ha+44*ic+24,y:Va+6,width:32,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))}))||[]}(x,D,R,z,na)),
ja(function(Ba,Ha,Va,Ya,ob){var Bb=Eg(fa(fa({groupIds:[Ya],backgroundColor:ob},Yl),{},{x:Ha-12,y:Va-12,text:"0",textAlign:"right"}));return[Bb,Eg(fa(fa({groupIds:[Ya],backgroundColor:ob},Yl),{},{x:Ha-12,y:Va-256-Bb.height/2,text:Math.max.apply(Math,ja(Ba.values)).toLocaleString(),textAlign:"right"}))]}(x,D,R,z,na)),ja(function(Ba,Ha,Va,Ya,ob){var Bb=$o(Ba);Ba=Bb.chartWidth;Bb=Bb.chartHeight;return[Qg(fa(fa({backgroundColor:ob,groupIds:[Ya]},Yl),{},{type:"line",x:Ha,y:Va,startArrowhead:null,endArrowhead:null,
width:Ba,points:[[0,0],[Ba,0]]})),Qg(fa(fa({backgroundColor:ob,groupIds:[Ya]},Yl),{},{type:"line",x:Ha,y:Va,startArrowhead:null,endArrowhead:null,height:Bb,points:[[0,0],[0,-Bb]]})),Qg(fa(fa({backgroundColor:ob,groupIds:[Ya]},Yl),{},{type:"line",x:Ha,y:Va-256-12,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:Ba,opacity:50,points:[[0,0],[Ba,0]]}))]}(x,D,R,z,na)))},S=function(x,D,R,z){return"line"===x?function(na,sa,ha){var va,Aa=Math.max.apply(Math,ja(na.values)),Ba=dk(),Ha=pn[Math.floor(Math.random()*
pn.length)],Va=0,Ya=[],ob=kg(na.values);try{for(ob.s();!(va=ob.n()).done;)Ya.push([44*Va,-va.value/Aa*256]),Va++}catch(Rb){ob.e(Rb)}finally{ob.f()}va=Math.max.apply(Math,ja(Ya.map(function(Rb){return Rb[0]})));Va=Math.max.apply(Math,ja(Ya.map(function(Rb){return Rb[1]})));ob=Math.min.apply(Math,ja(Ya.map(function(Rb){return Rb[0]})));var Bb=Math.min.apply(Math,ja(Ya.map(function(Rb){return Rb[1]})));Ya=Qg(fa(fa({backgroundColor:Ha,groupIds:[Ba]},Yl),{},{type:"line",x:sa+12+16,y:ha-12,startArrowhead:null,
endArrowhead:null,height:Va-Bb,width:va-ob,strokeWidth:2,points:Ya}));va=na.values.map(function(Rb,ic){ic=44*ic+6;Rb=-Rb/Aa*256+6;return xf(fa(fa({backgroundColor:Ha,groupIds:[Ba]},Yl),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:sa+ic+16,y:ha+Rb-24,width:12,height:12}))});Va=na.values.map(function(Rb,ic){ic=44*ic+6;Rb=Rb/Aa*256+18;return Qg(fa(fa({backgroundColor:Ha,groupIds:[Ba]},Yl),{},{type:"line",x:sa+ic+16+6,y:ha-Rb,startArrowhead:null,endArrowhead:null,height:Rb,strokeStyle:"dotted",
opacity:50,points:[[0,0],[0,Rb]]}))});return[].concat(ja(H(na,sa,ha,Ba,Ha,"production"===yc.Vi.DEVELOPMENT)),[Ya],ja(Va),ja(va))}(D,R,z):function(na,sa,ha){var va=Math.max.apply(Math,ja(na.values)),Aa=dk(),Ba=pn[Math.floor(Math.random()*pn.length)],Ha=na.values.map(function(Va,Ya){Va=Va/va*256;return xf(fa(fa({backgroundColor:Ba,groupIds:[Aa]},Yl),{},{type:"rectangle",x:sa+44*Ya+12,y:ha-Va-12,width:32,height:Va}))});return[].concat(ja(Ha),ja(H(na,sa,ha,Aa,Ba,"production"===yc.Vi.DEVELOPMENT)))}(D,
R,z)},qa="",Ka=!1,bb="clipboard"in navigator&&"readText"in navigator.clipboard,ub="clipboard"in navigator&&"writeText"in navigator.clipboard,Mb="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,fc=function(){var x=(0,ff.Z)(Yd().mark(function na(R,z){var sa,ha;return Yd().wrap(function(va){for(;;)switch(va.prev=va.next){case 0:return sa={type:yc.r8.excalidrawClipboard,elements:Sf(R,z)},ha=JSON.stringify(sa),qa=ha,va.prev=3,Ka=!1,
va.next=7,We(ha);case 7:va.next=13;break;case 9:va.prev=9,va.t0=va.catch(3),Ka=!0,console.error(va.t0);case 13:case "end":return va.stop()}},na,null,[[3,9]])}));return function(R,z){return x.apply(this,arguments)}}(),Ec=function(){if(!qa)return{};try{return JSON.parse(qa)}catch(x){return console.error(x),{}}},nd=function(x){x=function(D){var R=D.trim().split("\n").map(function(na){return na.trim().split("\t")});if(R.length&&2!==R[0].length&&(R=D.trim().split("\n").map(function(na){return na.trim().split(",")})),
0===R.length)return{type:"NOT_SPREADSHEET",reason:"No values"};var z=R[0].length;if(!R.every(function(na){return na.length===z}))return{type:"NOT_SPREADSHEET",reason:"All rows don't have same number of columns"};D=or(R);return"VALID_SPREADSHEET"!==D.type&&(R=or(function(na){for(var sa=[],ha=0;ha<na[0].length;ha++){for(var va=[],Aa=0;Aa<na.length;Aa++)va.push(na[Aa][ha]);sa.push(va)}return sa}(R)),"VALID_SPREADSHEET"===R.type)?R:D}(x);return"VALID_SPREADSHEET"===x.type?{spreadsheet:x.spreadsheet}:
null},De=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na,sa;return Yd().wrap(function(ha){for(;;)switch(ha.prev=ha.next){case 0:if(ha.prev=0,!R){ha.next=5;break}ha.t0=null===(na=R.clipboardData)||void 0===na?void 0:na.getData("text/plain").trim();ha.next=11;break;case 5:if(ha.t1=bb,!ha.t1){ha.next=10;break}return ha.next=9,navigator.clipboard.readText();case 9:ha.t1=ha.sent;case 10:ha.t0=ha.t1;case 11:return sa=ha.t0,ha.abrupt("return",sa||"");case 15:return ha.prev=15,ha.t2=ha.catch(0),
ha.abrupt("return","");case 18:case "end":return ha.stop()}},z,null,[[0,15]])}));return function(R){return x.apply(this,arguments)}}(),Nf=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na,sa,ha,va;return Yd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:return Aa.next=2,De(R);case 2:if((na=Aa.sent)&&!na.includes("\x3c!-- svg-source:excalidraw --\x3e")){Aa.next=5;break}return Aa.abrupt("return",Ec());case 5:if(!(sa=nd(na))){Aa.next=8;break}return Aa.abrupt("return",sa);case 8:if(ha=
Ec(),Aa.prev=9,va=JSON.parse(na),Ba=va,![yc.r8.excalidraw,yc.r8.excalidrawClipboard].includes(null==Ba?void 0:Ba.type)||!Array.isArray(Ba.elements)){Aa.next=13;break}return Aa.abrupt("return",{elements:va.elements});case 13:return Aa.abrupt("return",ha);case 16:return Aa.prev=16,Aa.t0=Aa.catch(9),Aa.abrupt("return",Ka&&ha.elements?ha:{text:na});case 19:case "end":return Aa.stop()}var Ba},z,null,[[9,16]])}));return function(R){return x.apply(this,arguments)}}(),Pd=function(){var x=(0,ff.Z)(Yd().mark(function z(R){return Yd().wrap(function(na){for(;;)switch(na.prev=
na.next){case 0:return na.next=2,navigator.clipboard.write([new window.ClipboardItem({"image/png":R})]);case 2:case "end":return na.stop()}},z)}));return function(R){return x.apply(this,arguments)}}(),We=function(){var x=(0,ff.Z)(Yd().mark(function z(R){var na;return Yd().wrap(function(sa){for(;;)switch(sa.prev=sa.next){case 0:if(na=!1,!ub){sa.next=11;break}return sa.prev=2,sa.next=5,navigator.clipboard.writeText(R||"");case 5:na=!0;sa.next=11;break;case 8:sa.prev=8,sa.t0=sa.catch(2),console.error(sa.t0);
case 11:var ha;if(!(ha=na)){var va=R||" ",Aa="rtl"===document.documentElement.getAttribute("dir");ha=document.createElement("textarea");ha.style.border="0";ha.style.padding="0";ha.style.margin="0";ha.style.position="absolute";ha.style[Aa?"right":"left"]="-9999px";ha.style.top="".concat(window.pageYOffset||document.documentElement.scrollTop,"px");ha.style.fontSize="12pt";ha.setAttribute("readonly","");ha.value=va;document.body.appendChild(ha);va=!1;try{ha.select(),ha.setSelectionRange(0,ha.value.length),
va=document.execCommand("copy")}catch(Ba){console.error(Ba)}ha=(ha.remove(),va)}if(ha){sa.next=13;break}throw Error("couldn't copy");case 13:case "end":return sa.stop()}},z,null,[[2,8]])}));return function(R){return x.apply(this,arguments)}}(),vf=function(){var x=(0,ff.Z)(Yd().mark(function ha(R,z,na,sa){var va,Aa,Ba,Ha,Va,Ya,ob,Bb,Rb,ic;return Yd().wrap(function(mc){for(;;)switch(mc.prev=mc.next){case 0:if(va=sa.exportBackground,Aa=sa.exportPadding,Ba=void 0===Aa?yc.qy:Aa,Ha=sa.viewBackgroundColor,
Va=sa.name,Ya=sa.fileHandle,ob=void 0===Ya?null:Ya,0!==z.length){mc.next=3;break}throw Error(Wb("alerts.cannotExportEmptyCanvas"));case 3:if("svg"!==R&&"clipboard-svg"!==R){mc.next=17;break}return mc.next=6,Ap(z,{exportBackground:va,exportWithDarkMode:na.exportWithDarkMode,viewBackgroundColor:Ha,exportPadding:Ba,exportScale:na.exportScale,exportEmbedScene:na.exportEmbedScene&&"svg"===R});case 6:if(Bb=mc.sent,"svg"!==R){mc.next=13;break}return mc.next=10,go(new Blob([Bb.outerHTML],{type:"image/svg+xml"}),
{name:Va,extension:"svg",fileHandle:ob});case 10:return mc.abrupt("return",mc.sent);case 13:if("clipboard-svg"!==R){mc.next=17;break}return mc.next=16,We(Bb.outerHTML);case 16:return mc.abrupt("return");case 17:return(Rb=Aq(z,na,{exportBackground:va,viewBackgroundColor:Ha,exportPadding:Ba})).style.display="none",document.body.appendChild(Rb),mc.next=22,Dp(Rb);case 22:if(ic=mc.sent,Rb.remove(),"png"!==R){mc.next=36;break}if(!na.exportEmbedScene){mc.next=31;break}return mc.next=28,Promise.all([e.e(736),
e.e(9)]).then(e.bind(e,8527));case 28:return mc.next=30,mc.sent.encodePngMetadata({blob:ic,metadata:Jn(z,na)});case 30:ic=mc.sent;case 31:return mc.next=33,go(ic,{name:Va,extension:"png",fileHandle:ob});case 33:return mc.abrupt("return",mc.sent);case 36:if("clipboard"!==R){mc.next=47;break}return mc.prev=37,mc.next=40,Pd(ic);case 40:mc.next=47;break;case 42:if(mc.prev=42,mc.t0=mc.catch(37),"CANVAS_POSSIBLY_TOO_BIG"!==mc.t0.name){mc.next=46;break}throw mc.t0;case 46:throw Error(Wb("alerts.couldNotCopyToClipboard"));
case 47:case "end":return mc.stop()}},ha,null,[[37,42]])}));return function(R,z,na,sa){return x.apply(this,arguments)}}(),wf=function(){var x=(0,ff.Z)(Yd().mark(function na(R,z){var sa,ha,va,Aa,Ba,Ha;return Yd().wrap(function(Va){for(;;)switch(Va.prev=Va.next){case 0:if(ha=(sa=z).exportBackground,va=sa.viewBackgroundColor,Aa=sa.name,Ba=sa.fileHandle,Ha=Fp(Ba),Ba&&("png"===(Ya=Ha)||"svg"===Ya)){Va.next=4;break}throw Error("fileHandle should exist and should be of type svg or png when resaving");case 4:return z=
xa(xa({},z),{},{exportEmbedScene:!0}),Va.next=7,vf(Ha,oe(R),z,{exportBackground:ha,viewBackgroundColor:va,name:Aa,fileHandle:Ba});case 7:return Va.abrupt("return",{fileHandle:Ba});case 8:case "end":return Va.stop()}var Ya},na)}));return function(R,z){return x.apply(this,arguments)}}(),Wc=(e(7225),function(x){var D=x.children,R=x.checked,z=x.onChange;return(0,Sa.jsxs)("div",{className:Dc("Checkbox",{"is-checked":R}),onClick:function(na){z(!R);na.currentTarget.querySelector(".Checkbox-box").focus()},
children:[(0,Sa.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":R,children:Jb}),(0,Sa.jsx)("div",{className:"Checkbox-label",children:D})]})});e(4623);var Gc=function(x){var D=x.children,R=x.gap,z=x.align,na=x.justifyContent,sa=x.className;x=x.style;return(0,Sa.jsx)("div",{className:Dc("Stack Stack_horizontal",sa),style:jb({"--gap":R,alignItems:z,justifyContent:na},x),children:D})},Rc=function(x){var D=x.children,R=x.gap,z=x.align,na=x.justifyContent;x=x.className;return(0,
Sa.jsx)("div",{className:Dc("Stack Stack_vertical",x),style:{"--gap":R,justifyItems:z,justifyContent:na},children:D})},Gd=(e(554),function(x){var D=x.fileName;x=x.onSave;return(0,Sa.jsxs)(Gc,{className:"ActiveFile",gap:1,align:"center",children:[(0,Sa.jsxs)("span",{className:"ActiveFile__fileName",children:[hm,(0,Sa.jsx)("span",{children:D})]}),(0,Sa.jsx)(Ga,{type:"icon",icon:Ac,title:Wb("buttons.save"),"aria-label":Wb("buttons.save"),onClick:x,"data-testid":"save-button"})]})});we({name:"changeProjectName",
perform:function(x,D,R){return Lh("change","title"),{appState:Xb(Xb({},D),{},{name:R}),commitToHistory:!1}},PanelComponent:function(x){var D=x.appState,R=x.updateData;x=x.appProps;return(0,Sa.jsx)(Kk,{label:Wb("labels.fileTitle"),value:D.name||"Unnamed",onChange:function(z){return R(z)},isNameEditable:void 0===x.name&&!D.viewModeEnabled})}});we({name:"changeExportScale",perform:function(x,D,R){return{appState:Xb(Xb({},D),{},{exportScale:R}),commitToHistory:!1}},PanelComponent:function(x){var D=x.appState,
R=x.updateData;x=oe(x.elements);var z=wh(x,D)?Sf(x,D):x;return(0,Sa.jsx)(Sa.Fragment,{children:yc.ZB.map(function(na){var sa=function(va,Aa,Ba){va=ia(zp(va,Aa).map(function(Ha){return Math.trunc(Ha*Ba)}),4);return[va[2],va[3]]}(z,yc.qy,na),ha=ia(sa,2);sa=ha[0];ha=ha[1];sa="".concat(Wb("buttons.scale")," ").concat(na,"x (").concat(sa,"x").concat(ha,")");return(0,Sa.jsx)(Ga,{size:"small",type:"radio",icon:"".concat(na,"x"),name:"export-canvas-scale",title:sa,"aria-label":sa,id:"export-canvas-scale",
checked:na===D.exportScale,onChange:function(){return R(na)}},na)})})}});we({name:"changeExportBackground",perform:function(x,D,R){return{appState:Xb(Xb({},D),{},{exportBackground:R}),commitToHistory:!1}},PanelComponent:function(x){var D=x.appState,R=x.updateData;return(0,Sa.jsx)(Wc,{checked:D.exportBackground,onChange:function(z){return R(z)},children:Wb("labels.withBackground")})}});we({name:"changeExportEmbedScene",perform:function(x,D,R){return{appState:Xb(Xb({},D),{},{exportEmbedScene:R}),commitToHistory:!1}},
PanelComponent:function(x){var D=x.appState,R=x.updateData;return(0,Sa.jsxs)(Wc,{checked:D.exportEmbedScene,onChange:function(z){return R(z)},children:[Wb("labels.exportEmbedScene"),(0,Sa.jsx)(uf,{label:Wb("labels.exportEmbedScene_details"),long:!0,children:(0,Sa.jsx)("div",{className:"excalidraw-tooltip-icon",children:bg})})]})}});we({name:"saveToActiveFile",perform:(Ld=(0,ff.Z)(Yd().mark(function na(D,R,z){var sa,ha,va;return Yd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:if(sa=!!R.fileHandle,
Aa.prev=1,!Yo(R.fileHandle)){Aa.next=8;break}return Aa.next=5,wf(D,R);case 5:Aa.t0=Aa.sent;Aa.next=11;break;case 8:return Aa.next=10,Em(D,R);case 10:Aa.t0=Aa.sent;case 11:return ha=Aa.t0,va=ha.fileHandle,Aa.abrupt("return",{commitToHistory:!1,appState:Xb(Xb({},R),{},{fileHandle:va,toastMessage:sa?null!=va&&va.name?Wb("toast.fileSavedToFilename").replace("{filename}",'"'.concat(va.name,'"')):Wb("toast.fileSaved"):null})});case 16:return Aa.prev=16,Aa.t1=Aa.catch(1),"AbortError"!==(null===Aa.t1||void 0===
Aa.t1?void 0:Aa.t1.name)&&console.error(Aa.t1),Aa.abrupt("return",{commitToHistory:!1});case 20:case "end":return Aa.stop()}},na,null,[[1,16]])})),function(D,R,z){return Ld.apply(this,arguments)}),keyTest:function(D){return"s"===D.key&&D[Af]&&!D.shiftKey},PanelComponent:function(D){var R,z=D.updateData;D=D.appState;return(0,Sa.jsx)(Gd,{onSave:function(){return z(null)},fileName:null===(R=D.fileHandle)||void 0===R?void 0:R.name})}});var Ld,Of,Oe,Rf=we({name:"saveFileToDisk",perform:(Of=(0,ff.Z)(Yd().mark(function sa(R,
z,na){var ha,va;return Yd().wrap(function(Aa){for(;;)switch(Aa.prev=Aa.next){case 0:return Aa.prev=0,Aa.next=3,Em(R,Xb(Xb({},z),{},{fileHandle:null}));case 3:return ha=Aa.sent,va=ha.fileHandle,Aa.abrupt("return",{commitToHistory:!1,appState:Xb(Xb({},z),{},{fileHandle:va})});case 8:return Aa.prev=8,Aa.t0=Aa.catch(0),"AbortError"!==(null===Aa.t0||void 0===Aa.t0?void 0:Aa.t0.name)&&console.error(Aa.t0),Aa.abrupt("return",{commitToHistory:!1});case 12:case "end":return Aa.stop()}},sa,null,[[0,8]])})),
function(R,z,na){return Of.apply(this,arguments)}),keyTest:function(R){return"s"===R.key&&R.shiftKey&&R[Af]},PanelComponent:function(R){var z=R.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:Cc,title:Wb("buttons.saveAs"),"aria-label":Wb("buttons.saveAs"),showAriaLabel:om(),hidden:!nm,onClick:function(){return z(null)},"data-testid":"save-as-button"})}});we({name:"loadScene",perform:(Oe=(0,ff.Z)(Yd().mark(function sa(z,na){var ha,va,Aa;return Yd().wrap(function(Ba){for(;;)switch(Ba.prev=Ba.next){case 0:return Ba.prev=
0,Ba.next=3,Cp(na,z);case 3:return ha=Ba.sent,va=ha.elements,Aa=ha.appState,Ba.abrupt("return",{elements:va,appState:Aa,commitToHistory:!0});case 9:if(Ba.prev=9,Ba.t0=Ba.catch(0),"AbortError"!==(null===Ba.t0||void 0===Ba.t0?void 0:Ba.t0.name)){Ba.next=13;break}return Ba.abrupt("return",!1);case 13:return Ba.abrupt("return",{elements:z,appState:Xb(Xb({},na),{},{errorMessage:Ba.t0.message}),commitToHistory:!1});case 14:case "end":return Ba.stop()}},sa,null,[[0,9]])})),function(z,na){return Oe.apply(this,
arguments)}),keyTest:function(z){return z[Af]&&"o"===z.key},PanelComponent:function(z){var na=z.updateData;z.appState;return(0,Sa.jsx)(Ga,{type:"button",icon:pc,title:Wb("buttons.load"),"aria-label":Wb("buttons.load"),showAriaLabel:om(),onClick:na,"data-testid":"load-button"})}});we({name:"exportWithDarkMode",perform:function(z,na,sa){return{appState:Xb(Xb({},na),{},{exportWithDarkMode:sa}),commitToHistory:!1}},PanelComponent:function(z){var na=z.appState,sa=z.updateData;return(0,Sa.jsx)("div",{style:{display:"flex",
justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,Sa.jsx)(zd,{value:na.exportWithDarkMode?"dark":"light",onChange:function(ha){sa("dark"===ha)},title:Wb("labels.toggleExportColorScheme")})})}});var pg="{}",Zf=we({name:"copyStyles",perform:function(z,na){z=z.find(function(sa){return na.selectedElementIds[sa.id]});return z&&(pg=JSON.stringify(z)),{appState:gd(gd({},na),{},{toastMessage:Wb("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(z){return z[Af]&&
z.altKey&&"KeyC"===z.code}}),jn=we({name:"pasteStyles",perform:function(z,na){var sa=JSON.parse(pg);return"text"!==(null==sa?void 0:sa.type)&&"diamond"!==(null==sa?void 0:sa.type)&&"rectangle"!==(null==sa?void 0:sa.type)&&"ellipse"!==(null==sa?void 0:sa.type)&&"arrow"!==(null==sa?void 0:sa.type)&&"freedraw"!==(null==sa?void 0:sa.type)&&"line"!==(null==sa?void 0:sa.type)?{elements:z,commitToHistory:!1}:{elements:z.map(function(ha){return na.selectedElementIds[ha.id]?(ha=cf(ha,{backgroundColor:null==
sa?void 0:sa.backgroundColor,strokeWidth:null==sa?void 0:sa.strokeWidth,strokeColor:null==sa?void 0:sa.strokeColor,strokeStyle:null==sa?void 0:sa.strokeStyle,fillStyle:null==sa?void 0:sa.fillStyle,opacity:null==sa?void 0:sa.opacity,roughness:null==sa?void 0:sa.roughness}),Yg(ha)&&(ke(ha,{fontSize:(null==sa?void 0:sa.fontSize)||yc.n5,fontFamily:(null==sa?void 0:sa.fontFamily)||yc.rk,textAlign:(null==sa?void 0:sa.textAlign)||yc.Hg}),Lj(ha)),ha):ha}),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",
keyTest:function(z){return z[Af]&&z.altKey&&"KeyV"===z.code}}),js=function(z){return(0,Sa.jsx)("button",{className:"help-icon",onClick:z.onClick,type:"button",title:"".concat(z.title," — ?"),"aria-label":z.title,children:bg})};we({name:"toggleCanvasMenu",perform:function(z,na){return{appState:ve(ve({},na),{},{openMenu:"canvas"===na.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(z){var na=z.appState;z=z.updateData;return(0,Sa.jsx)(Ga,{type:"button",icon:Ke,"aria-label":Wb("buttons.menu"),
onClick:z,selected:"canvas"===na.openMenu})}});we({name:"toggleEditMenu",perform:function(z,na){return{appState:ve(ve({},na),{},{openMenu:"shape"===na.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(z){var na=z.elements,sa=z.appState;z=z.updateData;return(0,Sa.jsx)(Ga,{visible:xh(sa,oe(na)),type:"button",icon:df,"aria-label":Wb("buttons.edit"),onClick:z,selected:"shape"===sa.openMenu})}});we({name:"toggleFullScreen",perform:function(){return Ul()||document.documentElement.requestFullscreen(),
Ul()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(z){return"KeyF"===z.code&&!z[Af]}});we({name:"toggleShortcuts",perform:function(z,na,sa,ha){z=ha.focusContainer;return na.showHelpDialog&&z(),{appState:ve(ve({},na),{},{showHelpDialog:!na.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(z){z=z.updateData;return(0,Sa.jsx)(js,{title:Wb("helpDialog.title"),onClick:z})},keyTest:function(z){return"?"===z.key}});var Ct=function(z,na){z=Sf(oe(z),na);return 2<=z.length&&!function(sa){if(2<=
sa.length){var ha,va=je(sa[0].groupIds);try{var Aa=function(){var Ha=ha.value;if(sa.reduce(function(Va,Ya){return Va&&Ya.groupIds.includes(Ha)},!0))return{v:!0}};for(va.s();!(ha=va.n()).done;){var Ba=Aa();if("object"===G(Ba))return Ba.v}}catch(Ha){va.e(Ha)}finally{va.f()}}return!1}(z)},Dt=we({name:"group",perform:function(z,na){var sa=Sf(oe(z),na);if(2>sa.length)return{appState:na,elements:z,commitToHistory:!1};var ha=vi(na);if(1===ha.length&&(ha=new Set(li(z,ha[0]).map(function(Ba){return Ba.id})),
sa=new Set(sa.map(function(Ba){return Ba.id})),(new Set([].concat(ja(Array.from(ha)),ja(Array.from(sa))))).size===ha.size))return{appState:na,elements:z,commitToHistory:!1};var va=dk();ha=z.map(function(Ba){if(na.selectedElementIds[Ba.id]){var Ha=na.editingGroupId;var Va=ja(Ba.groupIds);Ha=Ha?Va.indexOf(Ha):-1;Va=(Va.splice(-1<Ha?Ha:Va.length,0,va),Va);Ba=cf(Ba,{groupIds:Va})}return Ba});z=li(ha,va);var Aa=ha.lastIndexOf(z[z.length-1]);sa=ha.slice(Aa+1);ha=ha.slice(0,Aa).filter(function(Ba){return!Ba.groupIds.includes(va)});
z=[].concat(ja(ha),ja(z),ja(sa));return{appState:Qf(va,he(he({},na),{},{selectedGroupIds:{}}),oe(z)),elements:z,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(z,na){return Ct(z,na)},keyTest:function(z){return!z.shiftKey&&z[Af]&&"KeyG"===z.code},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Ct(na,sa),type:"button",icon:(0,Sa.jsx)(Yi,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.group"),
" — ").concat(Vd("CtrlOrCmd+G")),"aria-label":Wb("labels.group"),visible:wh(oe(na),sa)})}}),Bt=we({name:"ungroup",perform:function(z,na){if(0===vi(na).length)return{appState:na,elements:z,commitToHistory:!1};z=z.map(function(sa){var ha=function(va,Aa){return va.filter(function(Ba){return!Aa[Ba]})}(sa.groupIds,na.selectedGroupIds);return ha.length===sa.groupIds.length?sa:cf(sa,{groupIds:ha})});return{appState:Me(he(he({},na),{},{selectedGroupIds:{}}),oe(z)),elements:z,commitToHistory:!0}},keyTest:function(z){return z.shiftKey&&
z[Af]&&"KeyG"===z.code},contextItemLabel:"labels.ungroup",contextItemPredicate:function(z,na){return 0<vi(na).length},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{type:"button",hidden:0===vi(sa).length,icon:(0,Sa.jsx)(wj,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.ungroup")," — ").concat(Vd("CtrlOrCmd+Shift+G")),"aria-label":Wb("labels.ungroup"),visible:wh(oe(na),sa)})}}),Bv=(e(2789),function(z){var na=z.children,
sa=z.color,ha=z.border;z=z.onClick;return(0,Sa.jsx)("div",{className:"Avatar",style:{background:sa,border:"1px solid ".concat(ha)},onClick:z,children:na})});we({name:"goToCollaborator",perform:function(z,na,sa){return sa?{appState:Kg(Kg(Kg({},na),Be({scenePoint:sa,viewportDimensions:{width:na.width,height:na.height},zoom:na.zoom})),{},{openMenu:"canvas"===na.openMenu?null:na.openMenu}),commitToHistory:!1}:{appState:na,commitToHistory:!1}},PanelComponent:function(z){var na=z.appState,sa=z.updateData;
z=z.data;z=null==z?void 0:z.id;if(!z)return null;var ha=na.collaborators.get(z);if(!ha)return null;z=Dm(z,na);na=z.background;z=z.stroke;var va=function(Aa){if(!Aa)return"?";Aa=Aa.trim().split(" ");return 2>Aa.length?Aa[0].substring(0,2).toUpperCase():(Aa[0][0]+Aa[Aa.length-1][0]).toUpperCase()}(ha.username);return(0,Sa.jsx)(Bv,{color:na,border:z,onClick:function(){return sa(ha.pointer)},children:va})}});var Cv=we({name:"addToLibrary",perform:function(z,na,sa,ha){var va=Sf(oe(z),na);return ha.library.loadLibrary().then(function(Aa){ha.library.saveLibrary([].concat(ja(Aa),
[va.map(Wf)]))}),!1},contextItemLabel:"labels.addToLibrary"}),zv=function(z){var na=new Map;return z.forEach(function(sa){var ha=0===sa.groupIds.length?sa.id:sa.groupIds[sa.groupIds.length-1],va=na.get(ha)||[];na.set(ha,[].concat(ja(va),[sa]))}),Array.from(na.values())},Av=function(z,na,sa){var ha=sa.axis;sa=sa.position;z=At(z);var va=ia("x"===ha?["minX","maxX"]:["minY","maxY"],2),Aa=va[0];va=va[1];return Vh(Vh({},{x:0,y:0}),{},da({},ha,"start"===sa?na[Aa]-z[Aa]:"end"===sa?na[va]-z[va]:(na[Aa]+na[va])/
2-(z[Aa]+z[va])/2))},At=function(z){z=ia(Bg(z),4);return{minX:z[0],minY:z[1],maxX:z[2],maxY:z[3]}},Np=function(z,na){return 1<Sf(oe(z),na).length},Up=function(z,na,sa){na=function(va,Aa){var Ba=zv(va),Ha=At(va);return Ba.flatMap(function(Va){var Ya=Av(Va,Ha,Aa);return Va.map(function(ob){return cf(ob,{x:ob.x+Ya.x,y:ob.y+Ya.y})})})}(Sf(oe(z),na),sa);var ha=al(na);return z.map(function(va){return ha[va.id]||va})};we({name:"alignTop",perform:function(z,na){return{appState:na,elements:Up(z,na,{position:"start",
axis:"y"}),commitToHistory:!0}},keyTest:function(z){return z[Af]&&z.shiftKey&&"ArrowUp"===z.key},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(Lk,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.alignTop")," — ").concat(Vd("CtrlOrCmd+Shift+Up")),"aria-label":Wb("labels.alignTop"),visible:wh(oe(na),sa)})}});we({name:"alignBottom",perform:function(z,na){return{appState:na,
elements:Up(z,na,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(z){return z[Af]&&z.shiftKey&&"ArrowDown"===z.key},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(wl,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.alignBottom")," — ").concat(Vd("CtrlOrCmd+Shift+Down")),"aria-label":Wb("labels.alignBottom"),visible:wh(oe(na),sa)})}});we({name:"alignLeft",
perform:function(z,na){return{appState:na,elements:Up(z,na,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(z){return z[Af]&&z.shiftKey&&"ArrowLeft"===z.key},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(Wo,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.alignLeft")," — ").concat(Vd("CtrlOrCmd+Shift+Left")),"aria-label":Wb("labels.alignLeft"),visible:wh(oe(na),
sa)})}});we({name:"alignRight",perform:function(z,na){return{appState:na,elements:Up(z,na,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(z){return z[Af]&&z.shiftKey&&"ArrowRight"===z.key},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(Fm,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.alignRight")," — ").concat(Vd("CtrlOrCmd+Shift+Right")),"aria-label":Wb("labels.alignRight"),
visible:wh(oe(na),sa)})}});we({name:"alignVerticallyCentered",perform:function(z,na){return{appState:na,elements:Up(z,na,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(kj,{theme:sa.theme}),onClick:function(){return ha(null)},title:Wb("labels.centerVertically"),"aria-label":Wb("labels.centerVertically"),visible:wh(oe(na),sa)})}});we({name:"alignHorizontallyCentered",
perform:function(z,na){return{appState:na,elements:Up(z,na,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!Np(na,sa),type:"button",icon:(0,Sa.jsx)(xn,{theme:sa.theme}),onClick:function(){return ha(null)},title:Wb("labels.centerHorizontally"),"aria-label":Wb("labels.centerHorizontally"),visible:wh(oe(na),sa)})}});var Dv=function(z){var na=new Map;return z.forEach(function(sa){var ha=0===sa.groupIds.length?
sa.id:sa.groupIds[sa.groupIds.length-1],va=na.get(ha)||[];na.set(ha,[].concat(ja(va),[sa]))}),Array.from(na.values())},Ht=function(z){var na=ia(Bg(z),4);z=na[0];var sa=na[1],ha=na[2];na=na[3];return{minX:z,minY:sa,maxX:ha,maxY:na,width:ha-z,height:na-sa,midX:(z+ha)/2,midY:(sa+na)/2}},It=function(z,na){return 1<Sf(oe(z),na).length},Jt=function(z,na,sa){na=function(va,Aa){var Ba,Ha=ia("x"===Aa.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),Va=Ha[0],Ya=Ha[1],ob=Ha[2],Bb=Ha[3],
Rb=Ht(va);va=Dv(va).map(function(Xd){return[Xd,Ht(Xd)]}).sort(function(Xd,kd){return Xd[1][Ya]-kd[1][Ya]});Ha=0;var ic=Lg(va);try{for(ic.s();!(Ba=ic.n()).done;)Ha+=Ba.value[1][Bb]}catch(Xd){ic.e(Xd)}finally{ic.f()}var mc=(Rb[Bb]-Ha)/(va.length-1);if(0>mc){var Sc=va.findIndex(function(Xd){return Xd[1][Va]===Rb[Va]}),Xc=va.findIndex(function(Xd){return Xd[1][ob]===Rb[ob]}),Pc=(va[Xc][1][Ya]-va[Sc][1][Ya])/(va.length-1),Yc=va[Sc][1][Ya];return va.flatMap(function(Xd,kd){var qd=ia(Xd,2);Xd=qd[0];qd=qd[1];
var Hd={x:0,y:0};return kd!==Sc&&kd!==Xc&&(Yc+=Pc,Hd[Aa.axis]=Yc-qd[Ya]),Xd.map(function(He){return cf(He,{x:He.x+Hd.x,y:He.y+Hd.y})})})}var Bd=Rb[Va];return va.flatMap(function(Xd){var kd=ia(Xd,2);Xd=kd[0];kd=kd[1];var qd={x:0,y:0};return qd[Aa.axis]=Bd-kd[Va],Bd+=mc,Bd+=kd[Bb],Xd.map(function(Hd){return cf(Hd,{x:Hd.x+qd.x,y:Hd.y+qd.y})})})}(Sf(oe(z),na),sa);var ha=al(na);return z.map(function(va){return ha[va.id]||va})},Kt=(we({name:"distributeHorizontally",perform:function(z,na){return{appState:na,
elements:Jt(z,na,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(z){return z.altKey&&"KeyH"===z.code},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!It(na,sa),type:"button",icon:(0,Sa.jsx)(Cf,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.distributeHorizontally")," — ").concat(Vd("Alt+H")),"aria-label":Wb("labels.distributeHorizontally"),visible:wh(oe(na),sa)})}}),we({name:"distributeVertically",
perform:function(z,na){return{appState:na,elements:Jt(z,na,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(z){return z.altKey&&"KeyV"===z.code},PanelComponent:function(z){var na=z.elements,sa=z.appState,ha=z.updateData;return(0,Sa.jsx)(Ga,{hidden:!It(na,sa),type:"button",icon:(0,Sa.jsx)(Nn,{theme:sa.theme}),onClick:function(){return ha(null)},title:"".concat(Wb("labels.distributeVertically")," — ").concat(Vd("Alt+V")),"aria-label":Wb("labels.distributeVertically"),visible:wh(oe(na),
sa)})}}),we({name:"flipHorizontal",perform:function(z,na){return{elements:Mt(z,na,"horizontal"),appState:na,commitToHistory:!0}},keyTest:function(z){return z.shiftKey&&"KeyH"===z.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(z,na){z=Sf(oe(z),na);return 1===z.length&&"text"!==z[0].type}})),Lt=we({name:"flipVertical",perform:function(z,na){return{elements:Mt(z,na,"vertical"),appState:na,commitToHistory:!0}},keyTest:function(z){return z.shiftKey&&"KeyV"===z.code},contextItemLabel:"labels.flipVertical",
contextItemPredicate:function(z,na){return 1===Sf(oe(z),na).length}}),Mt=function(z,na,sa){var ha=Sf(oe(z),na);if(1<ha.length)return z;na=Ev(ha,na,sa);var va=al(na);return z.map(function(Aa){return va[Aa.id]||Aa})},Ev=function(z,na,sa){for(var ha=0;ha<z.length;ha++)if(Fv(z[ha],na),"vertical"===sa){var va=z[ha],Aa=va.x,Ba=va.y,Ha=fe(va.angle+Math.PI);0>Ha&&(Ha=fe(2*Math.PI+Ha));ke(va,{angle:Ha});ke(va,{x:Aa,y:Ba})}return z},Fv=function(z,na){var sa=z.x,ha=z.y,va=z.width,Aa=z.height,Ba=fe(z.angle),
Ha=0;(Dg(z)||ki(z))&&(Ha=2*z.points.reduce(function(Bb,Rb){return Math.max(Bb,Rb[0])},0)-z.width);ke(z,{angle:fe(0)});na=Tk(z,na.zoom);var Va=!0,Ya=0,ob=na.nw;if(ob||(Va=!1,ob=na.ne)){if(Dg(z)){for(va=1;va<z.points.length;va++)dd.movePoint(z,va,[-z.points[va][0],z.points[va][1]]);dd.normalizePoints(z)}else Ya=Va?z.x+2*va:z.x-2*va,Gi(z,!0,z,Va?"nw":"ne",!1,Ya,ob[1]),ke(z,{width:va,height:Aa});Ba=fe(2*Math.PI-Ba);0>Ba&&(Ba=fe(Ba+2*Math.PI));ke(z,{angle:Ba});ke(z,{x:sa+Ha,y:ha});Ei(z)}else ke(z,{angle:Ba})},
ts=we({name:"copy",perform:function(z,na){return fc(oe(z),na),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Gv=we({name:"cut",perform:function(z,na,sa,ha){return ts.perform(z,na,sa,ha),hn.perform(z,na,sa,ha)},contextItemLabel:"labels.cut",keyTest:function(z){return z[Af]&&"KeyX"===z.code}}),Nt=we({name:"copyAsSvg",perform:function(){var z=(0,ff.Z)(Yd().mark(function Ba(sa,ha,va,Aa){var Ha;return Yd().wrap(function(Va){for(;;)switch(Va.prev=Va.next){case 0:if(Aa.canvas){Va.next=
2;break}return Va.abrupt("return",{commitToHistory:!1});case 2:return Ha=Sf(oe(sa),ha),Va.prev=3,Va.next=6,vf("clipboard-svg",Ha.length?Ha:oe(sa),ha,ha);case 6:return Va.abrupt("return",{commitToHistory:!1});case 9:return Va.prev=9,Va.t0=Va.catch(3),console.error(Va.t0),Va.abrupt("return",{appState:Id(Id({},ha),{},{errorMessage:Va.t0.message}),commitToHistory:!1});case 13:case "end":return Va.stop()}},Ba,null,[[3,9]])}));return function(sa,ha,va,Aa){return z.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsSvg"}),
Ot=we({name:"copyAsPng",perform:function(){var z=(0,ff.Z)(Yd().mark(function Ba(sa,ha,va,Aa){var Ha;return Yd().wrap(function(Va){for(;;)switch(Va.prev=Va.next){case 0:if(Aa.canvas){Va.next=2;break}return Va.abrupt("return",{commitToHistory:!1});case 2:return Ha=Sf(oe(sa),ha),Va.prev=3,Va.next=6,vf("clipboard",Ha.length?Ha:oe(sa),ha,ha);case 6:return Va.abrupt("return",{appState:Id(Id({},ha),{},{toastMessage:Wb("toast.copyToClipboardAsPng",{exportSelection:Ha.length?Wb("toast.selection"):Wb("toast.canvas"),
exportColorScheme:ha.exportWithDarkMode?Wb("buttons.darkMode"):Wb("buttons.lightMode")})}),commitToHistory:!1});case 9:return Va.prev=9,Va.t0=Va.catch(3),console.error(Va.t0),Va.abrupt("return",{appState:Id(Id({},ha),{},{errorMessage:Va.t0.message}),commitToHistory:!1});case 13:case "end":return Va.stop()}},Ba,null,[[3,9]])}));return function(sa,ha,va,Aa){return z.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsPng",keyTest:function(z){return"KeyC"===z.code&&z.altKey&&z.shiftKey}}),Pt=we({name:"gridMode",
perform:function(z,na){return Lh("view","mode","grid"),{appState:oi(oi({},na),{},{gridSize:this.checked(na)?null:yc.k}),commitToHistory:!1}},checked:function(z){return null!==z.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(z){return z[Af]&&"Quote"===z.code}}),ss=we({name:"zenMode",perform:function(z,na){return Lh("view","mode","zen"),{appState:Ni(Ni({},na),{},{zenModeEnabled:!this.checked(na)}),commitToHistory:!1}},checked:function(z){return z.zenModeEnabled},contextItemLabel:"buttons.zenMode",
keyTest:function(z){return!z[Af]&&z.altKey&&"KeyZ"===z.code}}),rs=we({name:"stats",perform:function(z,na){return{appState:Dk(Dk({},na),{},{showStats:!this.checked(na)}),commitToHistory:!1}},checked:function(z){return z.showStats},contextItemLabel:"stats.title",keyTest:function(z){return!z[Af]&&z.altKey&&"Slash"===z.code}}),vt=function(z,na,sa){if(!(na.multiElement||na.resizingElement||na.editingElement||na.draggingElement)){sa=sa();if(null===sa)return{commitToHistory:!1};var ha=al(z),va=sa.elements,
Aa=al(va);z=z.filter(function(Ba){return!Aa.hasOwnProperty(Ba.id)});va=va.map(function(Ba){return cf(ha[Ba.id]||Ba,Ba)}).concat(z.map(function(Ba){return cf(Ba,{isDeleted:!0})}));return Ll(va,z),{elements:va,appState:yh(yh({},na),sa.appState),commitToHistory:!1,syncHistory:!0}}return{commitToHistory:!1}},uv=function(){function z(na,sa,ha,va){var Aa=this;q(this,z);this.actions={};this.renderAction=function(Ba,Ha){var Va=Aa.app.props.UIOptions.canvasActions;if(Aa.actions[Ba]&&"PanelComponent"in Aa.actions[Ba]&&
(!(Ba in Va)||Va[Ba])){var Ya=Aa.actions[Ba];Ba=Ya.PanelComponent;return(0,Sa.jsx)(Ba,{elements:Aa.getElementsIncludingDeleted(),appState:Aa.getAppState(),updateData:function(ob){Aa.updater(Ya.perform(Aa.getElementsIncludingDeleted(),Aa.getAppState(),ob,Aa.app))},appProps:Aa.app.props,data:Ha})}return null};this.updater=function(Ba){if(!(Ba&&"then"in Ba))return na(Ba);Ba.then(function(Ha){return na(Ha)})};this.getAppState=sa;this.getElementsIncludingDeleted=ha;this.app=va}return y(z,[{key:"registerAction",
value:function(na){this.actions[na.name]=na}},{key:"registerAll",value:function(na){var sa=this;na.forEach(function(ha){return sa.registerAction(ha)})}},{key:"handleKeyDown",value:function(na){var sa=this,ha=this.app.props.UIOptions.canvasActions,va=Object.values(this.actions).sort(function(Aa,Ba){return(Ba.keyPriority||0)-(Aa.keyPriority||0)}).filter(function(Aa){return(!(Aa.name in ha)||ha[Aa.name])&&Aa.keyTest&&Aa.keyTest(na,sa.getAppState(),sa.getElementsIncludingDeleted())});return 0!==va.length&&
!(this.getAppState().viewModeEnabled&&!Object.values(yc.EH).includes(va[0].name))&&(na.preventDefault(),this.updater(va[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}},{key:"executeAction",value:function(na){this.updater(na.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}]),z}(),yv=function(){function z(sa){var ha=this;q(this,z);this.libraryCache=null;this.resetLibrary=(0,ff.Z)(Yd().mark(function Aa(){var Ba,Ha;return Yd().wrap(function(Va){for(;;)switch(Va.prev=
Va.next){case 0:return Va.next=2,null===(Ba=(Ha=ha.app.props).onLibraryChange)||void 0===Ba?void 0:Ba.call(Ha,[]);case 2:ha.libraryCache=[];case 3:case "end":return Va.stop()}},Aa)}));this.restoreLibraryItem=function(Aa){Aa=oe(sl(Aa,null));return Aa.length?Aa:null};this.loadLibrary=function(){return new Promise(function(){var Aa=(0,ff.Z)(Yd().mark(function Va(Ha){var Ya,ob;return Yd().wrap(function(Bb){for(;;)switch(Bb.prev=Bb.next){case 0:if(!ha.libraryCache){Bb.next=2;break}return Bb.abrupt("return",
Ha(JSON.parse(JSON.stringify(ha.libraryCache))));case 2:if(Bb.prev=2,Ya=ha.app.libraryItemsFromStorage){Bb.next=6;break}return Bb.abrupt("return",Ha([]));case 6:ob=Ya.reduce(function(Rb,ic){return ha.restoreLibraryItem(ic)&&Rb.push(ic),Rb},[]);ha.libraryCache=JSON.parse(JSON.stringify(ob));Ha(ob);Bb.next=15;break;case 11:Bb.prev=11,Bb.t0=Bb.catch(2),console.error(Bb.t0),Ha([]);case 15:case "end":return Bb.stop()}},Va,null,[[2,11]])}));return function(Ha){return Aa.apply(this,arguments)}}())};this.saveLibrary=
function(){var Aa=(0,ff.Z)(Yd().mark(function Va(Ha){var Ya,ob,Bb,Rb;return Yd().wrap(function(ic){for(;;)switch(ic.prev=ic.next){case 0:return Ya=ha.libraryCache,ic.prev=1,Rb=JSON.stringify(Ha),ha.libraryCache=JSON.parse(Rb),ic.next=6,null===(ob=(Bb=ha.app.props).onLibraryChange)||void 0===ob?void 0:ob.call(Bb,Ha);case 6:ic.next=12;break;case 8:throw ic.prev=8,ic.t0=ic.catch(1),ha.libraryCache=Ya,ic.t0;case 12:case "end":return ic.stop()}},Va,null,[[1,8]])}));return function(Ha){return Aa.apply(this,
arguments)}}();this.app=sa}var na;return y(z,[{key:"importLibrary",value:(na=(0,ff.Z)(Yd().mark(function va(ha){var Aa,Ba,Ha,Va,Ya=this;return Yd().wrap(function(ob){for(;;)switch(ob.prev=ob.next){case 0:return ob.next=2,jo(ha);case 2:if((Aa=ob.sent)&&Aa.library){ob.next=5;break}return ob.abrupt("return");case 5:return Ba=function(Bb,Rb){return!Bb.find(function(ic){return ic.length===Rb.length&&ic.every(function(mc,Sc){return mc.id===Rb[Sc].id&&mc.versionNonce===Rb[Sc].versionNonce})})},ob.next=8,
this.loadLibrary();case 8:return Ha=ob.sent,Va=Aa.library.reduce(function(Bb,Rb){Rb=Ya.restoreLibraryItem(Rb);return Rb&&Ba(Ha,Rb)&&Bb.push(Rb),Bb},[]),ob.next=12,this.saveLibrary([].concat(ja(Ha),ja(Va)));case 12:case "end":return ob.stop()}},va,this)})),function(ha){return na.apply(this,arguments)})}]),z}(),yt=function(z){z=Array.from(z.values());return{x:Ft(z,function(na){return na.x})/z.length,y:Ft(z,function(na){return na.y})/z.length}},zt=function(z){var na=ia(z,2);z=na[0];na=na[1];return Math.hypot(z.x-
na.x,z.y-na.y)},Ft=function(z,na){return z.reduce(function(sa,ha){return sa+na(ha)},0)},vv=function(){function z(){var na=this;q(this,z);this.elementCache=new Map;this.recording=!0;this.stateHistory=[];this.redoStack=[];this.lastEntry=null;this.generateEntry=function(sa,ha){return na.dehydrateHistoryEntry({appState:{selectedElementIds:sa.selectedElementIds,selectedGroupIds:sa.selectedGroupIds,viewBackgroundColor:sa.viewBackgroundColor,editingLinearElement:sa.editingLinearElement,editingGroupId:sa.editingGroupId,
name:sa.name},elements:ha.reduce(function(va,Aa){if(Dg(Aa)&&sa.multiElement&&sa.multiElement.id===Aa.id){if(sa.multiElement&&sa.multiElement.id===Aa.id&&2>Aa.points.length)return va;va.push(Ol(Ol({},Aa),{},{points:Aa.lastCommittedPoint!==Aa.points[Aa.points.length-1]?Aa.points.slice(0,-1):Aa.points}))}else va.push(Aa);return va},[])})}}return y(z,[{key:"hydrateHistoryEntry",value:function(na){var sa=this,ha=na.elements;return{appState:JSON.parse(na.appState),elements:ha.map(function(va){var Aa,Ba=
null===(Aa=sa.elementCache.get(va.id))||void 0===Aa?void 0:Aa.get(va.versionNonce);if(!Ba)throw Error("Element not found: ".concat(va.id,":").concat(va.versionNonce));return Ba})}}},{key:"dehydrateHistoryEntry",value:function(na){var sa=this,ha=na.elements;return{appState:JSON.stringify(na.appState),elements:ha.map(function(va){sa.elementCache.has(va.id)||sa.elementCache.set(va.id,new Map);var Aa=sa.elementCache.get(va.id);return Aa.has(va.versionNonce)||Aa.set(va.versionNonce,Wf(va)),{id:va.id,versionNonce:va.versionNonce}})}}},
{key:"getSnapshotForTest",value:function(){var na=this;return{recording:this.recording,stateHistory:this.stateHistory.map(function(sa){return na.hydrateHistoryEntry(sa)}),redoStack:this.redoStack.map(function(sa){return na.hydrateHistoryEntry(sa)})}}},{key:"clear",value:function(){this.stateHistory.length=0;this.redoStack.length=0;this.lastEntry=null;this.elementCache.clear()}},{key:"shouldCreateEntry",value:function(na){var sa,ha=this.lastEntry;if(!ha||na.elements.length!==ha.elements.length)return!0;
for(var va=na.elements.length-1;-1<va;va--){var Aa=na.elements[va],Ba=ha.elements[va];if(!Aa||!Ba||Aa.id!==Ba.id||Aa.versionNonce!==Ba.versionNonce)return!0}for(sa in na.appState){var Ha,Va;if(("editingLinearElement"!==sa||(null===(Ha=na.appState[sa])||void 0===Ha?void 0:Ha.elementId)!==(null===(Va=ha.appState[sa])||void 0===Va?void 0:Va.elementId))&&"selectedElementIds"!==sa&&"selectedGroupIds"!==sa&&na.appState[sa]!==ha.appState[sa])return!0}return!1}},{key:"pushEntry",value:function(na,sa){na=
this.generateEntry(na,sa);(sa=this.hydrateHistoryEntry(na))&&this.shouldCreateEntry(sa)&&(this.stateHistory.push(na),this.lastEntry=sa,this.clearRedoStack())}},{key:"clearRedoStack",value:function(){this.redoStack.splice(0,this.redoStack.length)}},{key:"redoOnce",value:function(){if(0===this.redoStack.length)return null;var na=this.redoStack.pop();return void 0!==na?(this.stateHistory.push(na),this.hydrateHistoryEntry(na)):null}},{key:"undoOnce",value:function(){if(1===this.stateHistory.length)return null;
var na=this.stateHistory.pop(),sa=this.stateHistory[this.stateHistory.length-1];return void 0!==na?(this.redoStack.push(na),this.hydrateHistoryEntry(sa)):null}},{key:"setCurrentState",value:function(na,sa){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(na,sa))}},{key:"resumeRecording",value:function(){this.recording=!0}},{key:"record",value:function(na,sa){this.recording&&(this.pushEntry(na,sa),this.recording=!1)}}]),z}(),xt=[{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 320 512",className:"",
children:(0,Sa.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:"v"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 448 512",children:(0,Sa.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:"r"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,Sa.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:"d"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 512 512",children:(0,Sa.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:"e"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,Sa.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:"a"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 6 6",children:(0,Sa.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:["p","l"]},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 512 512",children:(0,Sa.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:"x"},{icon:(0,Sa.jsx)("svg",{viewBox:"0 0 448 512",children:(0,Sa.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:"t"}],wv=(e(1292),{cut:[Vd("CtrlOrCmd+X")],copy:[Vd("CtrlOrCmd+C")],
paste:[Vd("CtrlOrCmd+V")],copyStyles:[Vd("CtrlOrCmd+Alt+C")],pasteStyles:[Vd("CtrlOrCmd+Alt+V")],selectAll:[Vd("CtrlOrCmd+A")],deleteSelectedElements:[Vd("Del")],duplicateSelection:[Vd("CtrlOrCmd+D"),Vd("Alt+".concat(Wb("helpDialog.drag")))],sendBackward:[Vd("CtrlOrCmd+[")],bringForward:[Vd("CtrlOrCmd+]")],sendToBack:[Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Vd("Shift+Alt+C")],copyAsSvg:[],group:[Vd("CtrlOrCmd+G")],ungroup:[Vd("CtrlOrCmd+Shift+G")],
gridMode:[Vd("CtrlOrCmd+'")],zenMode:[Vd("Alt+Z")],stats:[Vd("Alt+/")],addToLibrary:[],flipHorizontal:[Vd("Shift+H")],flipVertical:[Vd("Shift+V")],viewMode:[Vd("Alt+R")]}),xv=function(z){var na=z.options,sa=z.onCloseRequest,ha=z.top,va=z.left,Aa=z.actionManager,Ba=z.appState;return(0,Sa.jsx)(Fa,{onCloseRequest:sa,top:ha,left:va,fitInViewport:!0,children:(0,Sa.jsx)("ul",{className:"context-menu",onContextMenu:function(Ha){return Ha.preventDefault()},children:na.map(function(Ha,Va){var Ya;if("separator"===
Ha)return(0,Sa.jsx)("hr",{className:"context-menu-option-separator"},Va);var ob,Bb=Ha.name,Rb=Ha.contextItemLabel?Wb(Ha.contextItemLabel):"";return(0,Sa.jsx)("li",{"data-testid":Bb,onClick:sa,children:(0,Sa.jsxs)("button",{className:Dc("context-menu-option",{dangerous:"deleteSelectedElements"===Bb,checkmark:null===(Ya=Ha.checked)||void 0===Ya?void 0:Ya.call(Ha,Ba)}),onClick:function(){return Aa.executeAction(Ha)},children:[(0,Sa.jsx)("div",{className:"context-menu-option__label",children:Rb}),(0,
Sa.jsx)("kbd",{className:"context-menu-option__shortcut",children:Bb?(ob=wv[Bb],ob&&0<ob.length?ob[0]:""):""})]})},Va)})})})},rr=new WeakMap,sr=function(z){var na,sa,ha=[];z.options.forEach(function(va){va&&ha.push(va)});ha.length&&(0,rh.render)((0,Sa.jsx)(xv,{top:z.top,left:z.left,options:ha,onCloseRequest:function(){return va=z.container,void((Aa=rr.get(va))&&((0,rh.unmountComponentAtNode)(Aa),Aa.remove(),rr.delete(va)));var va,Aa},actionManager:z.actionManager,appState:z.appState}),(na=z.container,
(sa=rr.get(na))||(sa=document.createElement("div"),na.querySelector(".excalidraw-contextMenuContainer").appendChild(sa),rr.set(na,sa),sa)))},Gt=function(z){var na=z.appState,sa=z.renderAction,ha=z.elementType;z=Kh(oe(z.elements),na);na=!!na.editingElement;var va=om(),Aa="rtl"===document.documentElement.getAttribute("dir"),Ba=Qk(ha)||z.some(function(Va){return Qk(Va.type)&&!Ri(Va.backgroundColor)}),Ha=Qk(ha)||z.some(function(Va){return Qk(Va.type)});return(0,Sa.jsxs)("div",{className:"panelColumn",
children:[sa("changeStrokeColor"),Ha&&sa("changeBackgroundColor"),Ba&&sa("changeFillStyle"),(Vk(ha)||z.some(function(Va){return Vk(Va.type)}))&&sa("changeStrokeWidth"),("freedraw"===ha||z.some(function(Va){return"freedraw"===Va.type}))&&sa("changeStrokeShape"),(r(ha)||z.some(function(Va){return r(Va.type)}))&&(0,Sa.jsxs)(Sa.Fragment,{children:[sa("changeStrokeStyle"),sa("changeSloppiness")]}),(I(ha)||z.some(function(Va){return I(Va.type)}))&&(0,Sa.jsx)(Sa.Fragment,{children:sa("changeSharpness")}),
("text"===ha||z.some(function(Va){return"text"===Va.type}))&&(0,Sa.jsxs)(Sa.Fragment,{children:[sa("changeFontSize"),sa("changeFontFamily"),sa("changeTextAlign")]}),("arrow"===ha||z.some(function(Va){return"arrow"===Va.type}))&&(0,Sa.jsx)(Sa.Fragment,{children:sa("changeArrowhead")}),sa("changeOpacity"),(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.layers")}),(0,Sa.jsxs)("div",{className:"buttonList",children:[sa("sendToBack"),sa("sendBackward"),sa("bringToFront"),sa("bringForward")]})]}),
1<z.length&&(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.align")}),(0,Sa.jsxs)("div",{className:"buttonList",children:[Aa?(0,Sa.jsxs)(Sa.Fragment,{children:[sa("alignRight"),sa("alignHorizontallyCentered"),sa("alignLeft")]}):(0,Sa.jsxs)(Sa.Fragment,{children:[sa("alignLeft"),sa("alignHorizontallyCentered"),sa("alignRight")]}),2<z.length&&sa("distributeHorizontally"),(0,Sa.jsxs)("div",{className:"iconRow",children:[sa("alignTop"),sa("alignVerticallyCentered"),sa("alignBottom"),
2<z.length&&sa("distributeVertically")]})]})]}),!va&&!na&&0<z.length&&(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.actions")}),(0,Sa.jsxs)("div",{className:"buttonList",children:[sa("duplicateSelection"),sa("deleteSelectedElements"),sa("group"),sa("ungroup")]})]})]})},wt=function(z){var na=z.canvas,sa=z.elementType,ha=z.setAppState;return(0,Sa.jsx)(Sa.Fragment,{children:xt.map(function(va,Aa){var Ba=va.value,Ha=va.icon,Va=va.key;va=Wb("toolBar.".concat(Ba));Va="".concat(Nh("string"==
typeof Va?Va:Va[0])," ").concat(Wb("helpDialog.or")," ").concat(Aa+1);return(0,Sa.jsx)(Ga,{className:"Shape",type:"radio",icon:Ha,checked:sa===Ba,name:"editor-current-shape",title:"".concat(Nh(va)," — ").concat(Va),keyBindingLabel:"".concat(Aa+1),"aria-label":Nh(va),"aria-keyshortcuts":Va,"data-testid":Ba,onChange:function(){ha({elementType:Ba,multiElement:null,selectedElementIds:{}});si(na,Ba);ha({})}},Ba)})})},tv=function(z){var na=z.renderAction;z.zoom;return(0,Sa.jsx)(Rc,{gap:1,children:(0,Sa.jsxs)(Gc,
{gap:1,align:"center",children:[na("zoomOut"),na("zoomIn"),na("resetZoom")]})})},ut=function(z){z.appState;z.setAppState;var na=z.actionManager;z=z.showThemeBtn;return(0,Sa.jsxs)("div",{style:{display:"flex"},children:[na.renderAction("changeViewBackgroundColor"),z&&na.renderAction("toggleTheme")]})},Et=(e(778),function(z){var na=z.isCollaborating,sa=z.collaboratorCount;z=z.onClick;return(0,Sa.jsx)(Sa.Fragment,{children:(0,Sa.jsx)(Ga,{className:Dc("CollabButton",{"is-collaborating":na}),onClick:z,
icon:ym,type:"button",title:Wb("labels.liveCollaboration"),"aria-label":Wb("labels.liveCollaboration"),showAriaLabel:om(),children:0<sa&&(0,Sa.jsx)("div",{className:"CollabButton-collaborators",children:sa})})})});e(196);e(1106);var qn=ce().forwardRef(function(z,na){var sa=z.children,ha=z.padding,va=z.className;z=z.style;return(0,Sa.jsx)("div",{className:Dc("Island",va),style:sg({"--padding":ha},z),ref:na,children:sa})}),sv=(e(8328),function(z){var na=z.theme;return(na=qv(void 0===na?"light":na))?
(0,rh.createPortal)((0,Sa.jsxs)("div",{className:Dc("Modal",z.className),role:"dialog","aria-modal":"true",onKeyDown:function(sa){"Escape"===sa.key&&(sa.nativeEvent.stopImmediatePropagation(),sa.stopPropagation(),z.onCloseRequest())},"aria-labelledby":z.labelledBy,children:[(0,Sa.jsx)("div",{className:"Modal__background",onClick:z.onCloseRequest}),(0,Sa.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(z.maxWidth,"px")},tabIndex:0,children:z.children})]}),na):null}),qv=function(z){var na=
ia((0,ue.useState)(null),2),sa=na[0],ha=na[1],va=om(),Aa=(0,ue.useRef)(va);Aa.current=va;var Ba=Ip().container;return(0,ue.useLayoutEffect)(function(){sa&&sa.classList.toggle("excalidraw--mobile",va)},[sa,va]),(0,ue.useLayoutEffect)(function(){var Ha=!(null==Ba||!Ba.classList.contains("theme--dark"))||"dark"===z,Va=document.createElement("div");return Va.classList.add("excalidraw","excalidraw-modal-container"),Va.classList.toggle("excalidraw--mobile",Aa.current),Ha&&(Va.classList.add("theme--dark"),
Va.classList.add("theme--dark-background-none")),document.body.appendChild(Va),ha(Va),function(){document.body.removeChild(Va)}},[Ba,z]),sa},Eq=function(z){var na=function(){var Ha=ia((0,ue.useState)(null),2),Va=Ha[1];return[Ha[0],(0,ue.useCallback)(function(Ya){return Va(Ya)},[])]}();na=ia(na,2);var sa=na[0];na=na[1];var ha=ia((0,ue.useState)(document.activeElement),1)[0],va=Ip().id;(0,ue.useEffect)(function(){if(sa){var Ha=Aa(sa);0<Ha.length&&!1!==z.autofocus&&(Ha[1]||Ha[0]).focus();var Va=function(Ya){if("Tab"===
Ya.key){var ob=Aa(sa),Bb=document.activeElement,Rb=ob.findIndex(function(ic){return ic===Bb});0===Rb&&Ya.shiftKey?(ob[ob.length-1].focus(),Ya.preventDefault()):Rb!==ob.length-1||Ya.shiftKey||(ob[0].focus(),Ya.preventDefault())}};return sa.addEventListener("keydown",Va),function(){return sa.removeEventListener("keydown",Va)}}},[sa,z.autofocus]);var Aa=function(Ha){return(Ha=Ha.querySelectorAll("button, a, input, select, textarea, div[tabindex]"))?Array.from(Ha):[]},Ba=function(){ha.focus();z.onCloseRequest()};
return(0,Sa.jsx)(sv,{className:Dc("Dialog",z.className),labelledBy:"dialog-title",maxWidth:z.small?550:800,onCloseRequest:Ba,theme:z.theme,children:(0,Sa.jsxs)(qn,{ref:na,children:[(0,Sa.jsxs)("h2",{id:"".concat(va,"-dialog-title"),className:"Dialog__title",children:[(0,Sa.jsx)("span",{className:"Dialog__titleContent",children:z.title}),(0,Sa.jsx)("button",{className:"Modal__close",onClick:Ba,"aria-label":Wb("buttons.close"),children:om()?yn:Om})]}),(0,Sa.jsx)("div",{className:"Dialog__content",children:z.children})]})})},
pv=function(z){var na=z.message,sa=z.onClose,ha=ia((0,ue.useState)(!!na),2);z=ha[0];var va=ha[1],Aa=Ip().container;ha=ce().useCallback(function(){va(!1);sa&&sa();null==Aa||Aa.focus()},[sa,Aa]);return(0,Sa.jsx)(Sa.Fragment,{children:z&&(0,Sa.jsx)(Eq,{small:!0,onCloseRequest:ha,title:Wb("errorDialog.title"),children:(0,Sa.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:na})})})},rv=(e(2205),"filter"in document.createElement("canvas").getContext("2d")),Yu=function(){return(0,Sa.jsxs)("div",{children:[(0,
Sa.jsx)("h3",{children:Wb("canvasError.cannotShowPreview")}),(0,Sa.jsx)("p",{children:(0,Sa.jsx)("span",{children:Wb("canvasError.canvasTooBig")})}),(0,Sa.jsxs)("em",{children:["(",Wb("canvasError.canvasTooBigTip"),")"]})]})},ps=function(z,na){(0,rh.unmountComponentAtNode)(na);na.innerHTML="";z instanceof HTMLCanvasElement?na.appendChild(z):(0,rh.render)((0,Sa.jsx)(Yu,{}),na)},qs=function(z){var na,sa=z.children,ha=z.title,va=z.onClick,Aa=z.color;z=z.shade;z=void 0===z?6:z;return(0,Sa.jsx)("button",
{className:"ExportDialog-imageExportButton",style:(na={},da(na,"--button-color",mf[Aa][z]),da(na,"--button-color-darker",mf[Aa][z+1]),da(na,"--button-color-darkest",mf[Aa][z+2]),na),title:ha,"aria-label":ha,onClick:va,children:sa})},Zu=function(z){var na=z.elements,sa=z.appState,ha=z.exportPadding,va=void 0===ha?yc.qy:ha;ha=z.actionManager;var Aa=z.onExportToPng,Ba=z.onExportToSvg,Ha=z.onExportToClipboard,Va=wh(na,sa);z=ia((0,ue.useState)(Va),2);var Ya=z[0],ob=z[1],Bb=(0,ue.useRef)(null),Rb=sa.exportBackground,
ic=sa.viewBackgroundColor,mc=Ya?Sf(na,sa):na;return(0,ue.useEffect)(function(){ob(Va)},[Va]),(0,ue.useEffect)(function(){var Sc=Bb.current;if(Sc)try{var Xc=Aq(mc,sa,{exportBackground:Rb,viewBackgroundColor:ic,exportPadding:va});Dp(Xc).then(function(){ps(Xc,Sc)}).catch(function(Pc){console.error(Pc);ps(new mn,Sc)})}catch(Pc){console.error(Pc),ps(new mn,Sc)}},[sa,mc,Rb,va,ic]),(0,Sa.jsxs)("div",{className:"ExportDialog",children:[(0,Sa.jsx)("div",{className:"ExportDialog__preview",ref:Bb}),rv&&ha.renderAction("exportWithDarkMode"),
(0,Sa.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,Sa.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[ha.renderAction("changeExportBackground"),Va&&(0,Sa.jsx)(Wc,{checked:Ya,onChange:function(Sc){return ob(Sc)},children:Wb("labels.onlySelected")}),ha.renderAction("changeExportEmbedScene")]})}),(0,Sa.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,Sa.jsx)(Gc,
{gap:2,children:ha.renderAction("changeExportScale")}),(0,Sa.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,Sa.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!nm&&ha.renderAction("changeProjectName")}),(0,Sa.jsxs)(Gc,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,Sa.jsx)(qs,{color:"indigo",title:Wb("buttons.exportToPng"),"aria-label":Wb("buttons.exportToPng"),onClick:function(){return Aa(mc)},
children:"PNG"}),(0,Sa.jsx)(qs,{color:"red",title:Wb("buttons.exportToSvg"),"aria-label":Wb("buttons.exportToSvg"),onClick:function(){return Ba(mc)},children:"SVG"}),Mb&&(0,Sa.jsx)(qs,{title:Wb("buttons.copyPngToClipboard"),onClick:function(){return Ha(mc)},color:"gray",shade:7,children:ld})]})]})},$u=function(z){var na=z.elements,sa=z.appState,ha=z.exportPadding;ha=void 0===ha?yc.qy:ha;var va=z.actionManager,Aa=z.onExportToPng,Ba=z.onExportToSvg;z=z.onExportToClipboard;var Ha=ia((0,ue.useState)(!1),
2),Va=Ha[0],Ya=Ha[1];Ha=ce().useCallback(function(){Ya(!1)},[]);return(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)(Ga,{onClick:function(){Ya(!0)},"data-testid":"image-export-button",icon:Le,type:"button","aria-label":Wb("buttons.exportImage"),showAriaLabel:om(),title:Wb("buttons.exportImage")}),Va&&(0,Sa.jsx)(Eq,{onCloseRequest:Ha,title:Wb("buttons.exportImage"),children:(0,Sa.jsx)(Zu,{elements:na,appState:sa,exportPadding:ha,actionManager:va,onExportToPng:Aa,onExportToSvg:Ba,onExportToClipboard:z,
onCloseRequest:Ha})})]})},ot=(e(1310),function(z){var na=z.children,sa=z.side;z=z.className;return(0,Sa.jsx)("div",{className:Dc("FixedSideContainer","FixedSideContainer_side_".concat(sa),z),children:na})}),pt=(e(7096),function(z){return(z=function(na){var sa=na.appState,ha=na.elements,va=sa.elementType;na=sa.isResizing;var Aa=sa.isRotating,Ba=sa.lastPointerDownWith,Ha=null!==sa.multiElement;if("arrow"===va||"line"===va)return Wb(Ha?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===
va)return Wb("hints.freeDraw");if("text"===va)return Wb("hints.text");ha=Sf(ha,sa);return na&&"mouse"===Ba&&1===ha.length?(sa=ha[0],Dg(sa)&&2===sa.points.length?Wb("hints.lockAngle"):Wb("hints.resize")):Aa&&"mouse"===Ba?Wb("hints.rotate"):1===ha.length&&Dg(ha[0])?sa.editingLinearElement?sa.editingLinearElement.activePointIndex?Wb("hints.lineEditor_pointSelected"):Wb("hints.lineEditor_nothingSelected"):Wb("hints.lineEditor_info"):1===ha.length&&Yg(ha[0])?Wb("hints.text_selected"):sa.editingElement&&
Yg(sa.editingElement)?Wb("hints.text_editing"):null}({appState:z.appState,elements:z.elements}))?(z=Vd(z),(0,Sa.jsx)("div",{className:"HintViewer",children:(0,Sa.jsx)("span",{children:z})})):null});e(3336);e(694);var av=(0,Sa.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,Sa.jsx)("path",{fill:"currentColor",d:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"})}),
bv=function(z){var na=z.elements,sa=z.pendingElements,ha=z.onRemoveFromLibrary;z=z.onClick;var va=(0,ue.useRef)(null);(0,ue.useEffect)(function(){var Ya=na||sa;if(Ya){var ob,Bb=va.current;return(0,ff.Z)(Yd().mark(function ic(){var mc,Sc,Xc;return Yd().wrap(function(Pc){for(;;)switch(Pc.prev=Pc.next){case 0:return Pc.next=2,Ap(Ya,{exportBackground:!1,viewBackgroundColor:mf.white});case 2:ob=Pc.sent,mc=yj(va.current.children),Pc.prev=4,mc.s();case 6:if((Sc=mc.n()).done){Pc.next=13;break}if("svg"===
(Xc=Sc.value).tagName){Pc.next=10;break}return Pc.abrupt("continue",11);case 10:Bb.removeChild(Xc);case 11:Pc.next=6;break;case 13:Pc.next=18;break;case 15:Pc.prev=15,Pc.t0=Pc.catch(4),mc.e(Pc.t0);case 18:return Pc.prev=18,mc.f(),Pc.finish(18);case 21:Bb.appendChild(ob);case 22:case "end":return Pc.stop()}},ic,null,[[4,15,18,21]])}))(),function(){ob&&Bb.removeChild(ob)}}},[na,sa]);var Aa=ia((0,ue.useState)(!1),2),Ba=Aa[0],Ha=Aa[1];Aa=om();var Va=(Ba||Aa)&&sa&&(0,Sa.jsx)("div",{className:"library-unit__adder",
children:av});return(0,Sa.jsxs)("div",{className:Dc("library-unit",{"library-unit__active":na||sa}),onMouseEnter:function(){return Ha(!0)},onMouseLeave:function(){return Ha(!1)},children:[(0,Sa.jsx)("div",{className:Dc("library-unit__dragger",{"library-unit__pulse":!!sa}),ref:va,draggable:!!na,onClick:na||sa?z:void 0,onDragStart:function(Ya){Ha(!1);Ya.dataTransfer.setData(yc.LO.excalidrawlib,JSON.stringify(na))}}),Va,na&&(Ba||Aa)&&(0,Sa.jsx)("button",{className:"library-unit__removeFromLibrary","aria-label":Wb("labels.removeFromLibrary"),
onClick:ha,children:Om})]})},cv=(0,Sa.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,Sa.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"})}),dv=(0,Sa.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,Sa.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"})}),qt=function(z){return(0,Sa.jsxs)("label",{className:Dc("ToolIcon ToolIcon__lock ToolIcon_type_floating zen-mode-visibility","ToolIcon_size_".concat("medium"),{"zen-mode-visibility--hidden":z.zenModeEnabled}),title:"".concat(z.title,
" — Q"),children:[(0,Sa.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:z.name,onChange:z.onChange,checked:z.checked,"aria-label":z.title}),(0,Sa.jsx)("div",{className:"ToolIcon__icon",children:z.checked?cv:dv})]})},ev=["heading","children"],oo=function(z){var na=z.heading,sa=z.children;z=Za(z,ev);var ha=Ip().id,va=(0,Sa.jsx)("h2",{className:"visually-hidden",id:"".concat(ha,"-").concat(na,"-title"),children:Wb("headings.".concat(na))});return(0,Sa.jsx)("section",Wj(Wj({},z),
{},{"aria-labelledby":"".concat(ha,"-").concat(na,"-title"),children:"function"==typeof sa?sa(va):(0,Sa.jsxs)(Sa.Fragment,{children:[va,sa]})}))},kt=(e(580),function(z){var na=z.children,sa=z.className;z=z.mobile;return(0,Sa.jsx)("div",{className:Dc("UserList",sa,{UserList_mobile:z}),children:na})}),Su=(0,Sa.jsx)("svg",{viewBox:"0 0 576 512",children:(0,Sa.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"})}),
lt=function(z){var na=z.appState,sa=z.setAppState;return(0,Sa.jsxs)("label",{className:Dc("ToolIcon ToolIcon_type_floating ToolIcon__library zen-mode-visibility","ToolIcon_size_medium",{"zen-mode-visibility--hidden":na.zenModeEnabled}),title:"".concat(Nh(Wb("toolBar.library"))," — 9"),style:{marginInlineStart:"var(--space-factor)"},children:[(0,Sa.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(ha){sa({isLibraryOpen:ha.target.checked})},checked:na.isLibraryOpen,
"aria-label":Nh(Wb("toolBar.library")),"aria-keyshortcuts":"9"}),(0,Sa.jsx)("div",{className:"ToolIcon__icon",children:Su})]})},Tu=function(z){var na=z.appState,sa=z.elements,ha=z.libraryMenu,va=z.actionManager,Aa=z.renderJSONExportDialog,Ba=z.renderImageExportDialog,Ha=z.setAppState,Va=z.onCollabButtonClick,Ya=z.onLockToggle,ob=z.canvas,Bb=z.isCollaborating,Rb=z.renderCustomFooter,ic=z.viewModeEnabled;z=z.showThemeBtn;return(0,Sa.jsxs)(Sa.Fragment,{children:[!ic&&(0,Sa.jsxs)(ot,{side:"top",className:"App-top-bar",
children:[(0,Sa.jsx)(oo,{heading:"shapes",children:function(mc){return(0,Sa.jsxs)(Rc,{gap:4,align:"center",children:[(0,Sa.jsxs)(Gc,{gap:1,children:[(0,Sa.jsxs)(qn,{padding:1,children:[mc,(0,Sa.jsx)(Gc,{gap:1,children:(0,Sa.jsx)(wt,{canvas:ob,elementType:na.elementType,setAppState:Ha})})]}),(0,Sa.jsx)(qt,{checked:na.elementLocked,onChange:Ya,title:Wb("toolBar.lock")}),(0,Sa.jsx)(lt,{appState:na,setAppState:Ha})]}),ha]})}}),(0,Sa.jsx)(pt,{appState:na,elements:sa})]}),(0,Sa.jsx)("div",{className:"App-bottom-bar",
style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,Sa.jsxs)(qn,{padding:0,children:["canvas"===na.openMenu?(0,Sa.jsx)(oo,{className:"App-mobile-menu",heading:"canvasActions",children:(0,Sa.jsx)("div",{className:"panelColumn",children:(0,Sa.jsxs)(Rc,{gap:4,children:[ic?(0,Sa.jsxs)(Sa.Fragment,{children:[Aa(),Ba()]}):(0,Sa.jsxs)(Sa.Fragment,{children:[va.renderAction("clearCanvas"),va.renderAction("loadScene"),Aa(),Ba(),Va&&(0,Sa.jsx)(Et,{isCollaborating:Bb,collaboratorCount:na.collaborators.size,
onClick:Va}),(0,Sa.jsx)(ut,{actionManager:va,appState:na,setAppState:Ha,showThemeBtn:z})]}),null==Rb?void 0:Rb(!0,na),0<na.collaborators.size&&(0,Sa.jsxs)("fieldset",{children:[(0,Sa.jsx)("legend",{children:Wb("labels.collaborators")}),(0,Sa.jsx)(kt,{mobile:!0,children:Array.from(na.collaborators).filter(function(mc){mc=ia(mc,2);mc=(mc[0],mc[1]);return 0!==Object.keys(mc).length}).map(function(mc){mc=ia(mc,2);var Sc=mc[0];mc[1];return(0,Sa.jsx)(ce().Fragment,{children:va.renderAction("goToCollaborator",
{id:Sc})},Sc)})})]})]})})}):"shape"===na.openMenu&&!ic&&xh(na,sa)?(0,Sa.jsx)(oo,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,Sa.jsx)(Gt,{appState:na,elements:sa,renderAction:va.renderAction,elementType:na.elementType})}):null,(0,Sa.jsxs)("footer",{className:"App-toolbar",children:[ic?(0,Sa.jsx)("div",{className:"App-toolbar-content",children:va.renderAction("toggleCanvasMenu")}):(0,Sa.jsxs)("div",{className:"App-toolbar-content",children:[va.renderAction("toggleCanvasMenu"),
va.renderAction("toggleEditMenu"),va.renderAction("undo"),va.renderAction("redo"),va.renderAction(na.multiElement?"finalize":"duplicateSelection"),va.renderAction("deleteSelectedElements")]}),na.scrolledOutside&&!na.openMenu&&(0,Sa.jsx)("button",{className:"scroll-back-to-content",onClick:function(){Ha(function(mc){for(var Sc=1;Sc<arguments.length;Sc++){var Xc=null!=arguments[Sc]?arguments[Sc]:{};Sc%2?Yk(Object(Xc),!0).forEach(function(Pc){da(mc,Pc,Xc[Pc])}):Object.getOwnPropertyDescriptors?Object.defineProperties(mc,
Object.getOwnPropertyDescriptors(Xc)):Yk(Object(Xc)).forEach(function(Pc){Object.defineProperty(mc,Pc,Object.getOwnPropertyDescriptor(Xc,Pc))})}return mc}({},Fg(sa,na)))},children:Wb("buttons.scrollBackToContent")})]})]})})]})},mt=(e(8051),function(z){var na=(0,ue.useRef)(null),sa=ia((0,ue.useState)(null),2),ha=sa[0],va=sa[1];return(0,ue.useLayoutEffect)(function(){if(z.spreadsheet){var Aa,Ba=S(z.chartType,z.spreadsheet,0,0);va(Ba);var Ha=na.current;return(0,ff.Z)(Yd().mark(function Ya(){return Yd().wrap(function(ob){for(;;)switch(ob.prev=
ob.next){case 0:return ob.next=2,Ap(Ba,{exportBackground:!1,viewBackgroundColor:mf.white});case 2:Aa=ob.sent,Ha.appendChild(Aa),z.selected&&Ha.parentNode.focus();case 5:case "end":return ob.stop()}},Ya)}))(),function(){Ha.removeChild(Aa)}}},[z.spreadsheet,z.chartType,z.selected]),(0,Sa.jsx)("button",{className:"ChartPreview",onClick:function(){ha&&z.onClick(z.chartType,ha)},children:(0,Sa.jsx)("div",{ref:na})})}),Uu=function(z){var na=z.setAppState,sa=z.appState,ha=z.onClose,va=z.onInsertChart;z=
ce().useCallback(function(){ha&&ha()},[ha]);var Aa=function(Ba,Ha){va(Ha);Lh("magic","chart",Ba);na({currentChartType:Ba,pasteDialog:{shown:!1,data:null}})};return(0,Sa.jsx)(Eq,{small:!0,onCloseRequest:z,title:Wb("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,Sa.jsxs)("div",{className:"container",children:[(0,Sa.jsx)(mt,{chartType:"bar",spreadsheet:sa.pasteDialog.data,selected:"bar"===sa.currentChartType,onClick:Aa}),(0,Sa.jsx)(mt,{chartType:"line",spreadsheet:sa.pasteDialog.data,
selected:"line"===sa.currentChartType,onClick:Aa})]})})};e(3922);var Vu=function(){return(0,Sa.jsxs)("div",{className:"HelpDialog--header",children:[(0,Sa.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:Wb("helpDialog.documentation")}),(0,Sa.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:Wb("helpDialog.blog")}),(0,Sa.jsx)("a",
{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:Wb("helpDialog.github")})]})},Wu=function(z){return(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("h3",{children:z.title}),z.children]})},Xu=function(z){return(0,Sa.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:z.children})},nt=function(z){return(0,Sa.jsx)("div",{style:{width:"49%"},children:z.children})},
os=function(z){return(0,Sa.jsxs)("div",{className:"HelpDialog--island",children:[(0,Sa.jsx)("h3",{className:"HelpDialog--island-title",children:z.caption}),z.children]})},nf=function(z){return(0,Sa.jsx)("div",{className:"HelpDialog--shortcut",children:(0,Sa.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,Sa.jsx)("div",{style:{lineHeight:1.4},children:z.label}),(0,Sa.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",
minWidth:"30%"},children:z.shortcuts.map(function(na,sa){return(0,Sa.jsxs)(ce().Fragment,{children:[(0,Sa.jsx)(fv,{children:na}),z.isOr&&sa!==z.shortcuts.length-1&&Wb("helpDialog.or")]},sa)})})]})})};nf.defaultProps={isOr:!0};var fv=function(z){return(0,Sa.jsx)("kbd",function(na){for(var sa=1;sa<arguments.length;sa++){var ha=null!=arguments[sa]?arguments[sa]:{};sa%2?Zi(Object(ha),!0).forEach(function(va){da(na,va,ha[va])}):Object.getOwnPropertyDescriptors?Object.defineProperties(na,Object.getOwnPropertyDescriptors(ha)):
Zi(Object(ha)).forEach(function(va){Object.defineProperty(na,va,Object.getOwnPropertyDescriptor(ha,va))})}return na}({className:"HelpDialog--key"},z))},gv=function(z){var na=z.onClose;z=ce().useCallback(function(){na&&na()},[na]);return(0,Sa.jsx)(Sa.Fragment,{children:(0,Sa.jsxs)(Eq,{onCloseRequest:z,title:Wb("helpDialog.title"),className:"HelpDialog",children:[(0,Sa.jsx)(Vu,{}),(0,Sa.jsx)(Wu,{title:Wb("helpDialog.shortcuts"),children:(0,Sa.jsxs)(Xu,{children:[(0,Sa.jsxs)(nt,{children:[(0,Sa.jsxs)(os,
{caption:Wb("helpDialog.shapes"),children:[(0,Sa.jsx)(nf,{label:Wb("toolBar.selection"),shortcuts:["V","1"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.rectangle"),shortcuts:["R","2"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.diamond"),shortcuts:["D","3"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.ellipse"),shortcuts:["E","4"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.arrow"),shortcuts:["A","5"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.line"),shortcuts:["P","6"]}),(0,Sa.jsx)(nf,{label:Wb("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),
(0,Sa.jsx)(nf,{label:Wb("toolBar.text"),shortcuts:["T","8"]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.editSelectedShape"),shortcuts:[Vd("Enter"),Wb("helpDialog.doubleClick")]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.textNewLine"),shortcuts:[Vd("Enter"),Vd("Shift+Enter")]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.textFinish"),shortcuts:[Vd("Esc"),Vd("CtrlOrCmd+Enter")]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.curvedArrow"),shortcuts:["A",Wb("helpDialog.click"),Wb("helpDialog.click"),Wb("helpDialog.click")],isOr:!1}),
(0,Sa.jsx)(nf,{label:Wb("helpDialog.curvedLine"),shortcuts:["L",Wb("helpDialog.click"),Wb("helpDialog.click"),Wb("helpDialog.click")],isOr:!1}),(0,Sa.jsx)(nf,{label:Wb("toolBar.lock"),shortcuts:["Q"]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.preventBinding"),shortcuts:[Vd("CtrlOrCmd")]})]}),(0,Sa.jsxs)(os,{caption:Wb("helpDialog.view"),children:[(0,Sa.jsx)(nf,{label:Wb("buttons.zoomIn"),shortcuts:[Vd("CtrlOrCmd++")]}),(0,Sa.jsx)(nf,{label:Wb("buttons.zoomOut"),shortcuts:[Vd("CtrlOrCmd+-")]}),(0,Sa.jsx)(nf,
{label:Wb("buttons.resetZoom"),shortcuts:[Vd("CtrlOrCmd+0")]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,Sa.jsx)(nf,{label:Wb("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,Sa.jsx)(nf,{label:Wb("buttons.fullScreen"),shortcuts:["F"]}),(0,Sa.jsx)(nf,{label:Wb("buttons.zenMode"),shortcuts:[Vd("Alt+Z")]}),(0,Sa.jsx)(nf,{label:Wb("labels.showGrid"),shortcuts:[Vd("CtrlOrCmd+'")]}),(0,Sa.jsx)(nf,{label:Wb("labels.viewMode"),shortcuts:[Vd("Alt+R")]}),(0,Sa.jsx)(nf,
{label:Wb("labels.toggleTheme"),shortcuts:[Vd("Alt+Shift+D")]}),(0,Sa.jsx)(nf,{label:Wb("stats.title"),shortcuts:[Vd("Alt+/")]})]})]}),(0,Sa.jsx)(nt,{children:(0,Sa.jsxs)(os,{caption:Wb("helpDialog.editor"),children:[(0,Sa.jsx)(nf,{label:Wb("labels.selectAll"),shortcuts:[Vd("CtrlOrCmd+A")]}),(0,Sa.jsx)(nf,{label:Wb("labels.multiSelect"),shortcuts:[Vd("Shift+".concat(Wb("helpDialog.click")))]}),(0,Sa.jsx)(nf,{label:Wb("labels.moveCanvas"),shortcuts:[Vd("Space+".concat(Wb("helpDialog.drag"))),Vd("Wheel+".concat(Wb("helpDialog.drag")))],
isOr:!0}),(0,Sa.jsx)(nf,{label:Wb("labels.cut"),shortcuts:[Vd("CtrlOrCmd+X")]}),(0,Sa.jsx)(nf,{label:Wb("labels.copy"),shortcuts:[Vd("CtrlOrCmd+C")]}),(0,Sa.jsx)(nf,{label:Wb("labels.paste"),shortcuts:[Vd("CtrlOrCmd+V")]}),(0,Sa.jsx)(nf,{label:Wb("labels.copyAsPng"),shortcuts:[Vd("Shift+Alt+C")]}),(0,Sa.jsx)(nf,{label:Wb("labels.copyStyles"),shortcuts:[Vd("CtrlOrCmd+Alt+C")]}),(0,Sa.jsx)(nf,{label:Wb("labels.pasteStyles"),shortcuts:[Vd("CtrlOrCmd+Alt+V")]}),(0,Sa.jsx)(nf,{label:Wb("labels.delete"),
shortcuts:[Vd("Del")]}),(0,Sa.jsx)(nf,{label:Wb("labels.sendToBack"),shortcuts:[Vd(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,Sa.jsx)(nf,{label:Wb("labels.bringToFront"),shortcuts:[Vd(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,Sa.jsx)(nf,{label:Wb("labels.sendBackward"),shortcuts:[Vd("CtrlOrCmd+[")]}),(0,Sa.jsx)(nf,{label:Wb("labels.bringForward"),shortcuts:[Vd("CtrlOrCmd+]")]}),(0,Sa.jsx)(nf,{label:Wb("labels.alignTop"),shortcuts:[Vd("CtrlOrCmd+Shift+Up")]}),(0,Sa.jsx)(nf,{label:Wb("labels.alignBottom"),
shortcuts:[Vd("CtrlOrCmd+Shift+Down")]}),(0,Sa.jsx)(nf,{label:Wb("labels.alignLeft"),shortcuts:[Vd("CtrlOrCmd+Shift+Left")]}),(0,Sa.jsx)(nf,{label:Wb("labels.alignRight"),shortcuts:[Vd("CtrlOrCmd+Shift+Right")]}),(0,Sa.jsx)(nf,{label:Wb("labels.duplicateSelection"),shortcuts:[Vd("CtrlOrCmd+D"),Vd("Alt+".concat(Wb("helpDialog.drag")))]}),(0,Sa.jsx)(nf,{label:Wb("buttons.undo"),shortcuts:[Vd("CtrlOrCmd+Z")]}),(0,Sa.jsx)(nf,{label:Wb("buttons.redo"),shortcuts:nj?[Vd("CtrlOrCmd+Y"),Vd("CtrlOrCmd+Shift+Z")]:
[Vd("CtrlOrCmd+Shift+Z")]}),(0,Sa.jsx)(nf,{label:Wb("labels.group"),shortcuts:[Vd("CtrlOrCmd+G")]}),(0,Sa.jsx)(nf,{label:Wb("labels.ungroup"),shortcuts:[Vd("CtrlOrCmd+Shift+G")]}),(0,Sa.jsx)(nf,{label:Wb("labels.flipHorizontal"),shortcuts:[Vd("Shift+H")]}),(0,Sa.jsx)(nf,{label:Wb("labels.flipVertical"),shortcuts:[Vd("Shift+V")]}),(0,Sa.jsx)(nf,{label:Wb("labels.showStroke"),shortcuts:[Vd("S")]}),(0,Sa.jsx)(nf,{label:Wb("labels.showBackground"),shortcuts:[Vd("G")]})]})})]})})]})})},rt=(e(5080),function(z){var na,
sa=z.children;z=z.color;return(0,Sa.jsx)("div",{className:"Card",style:(na={},da(na,"--card-color",mf[z][7]),da(na,"--card-color-darker",mf[z][8]),da(na,"--card-color-darkest",mf[z][9]),na),children:sa})}),hv=function(z){var na=z.elements,sa=z.appState,ha=z.actionManager,va=z.exportOpts,Aa=z.canvas,Ba=va.onExportToBackend;return(0,Sa.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,Sa.jsxs)("div",{className:"ExportDialog-cards",children:[va.saveFileToDisk&&(0,Sa.jsxs)(rt,{color:"lime",
children:[(0,Sa.jsx)("div",{className:"Card-icon",children:Hf}),(0,Sa.jsx)("h2",{children:Wb("exportDialog.disk_title")}),(0,Sa.jsxs)("div",{className:"Card-details",children:[Wb("exportDialog.disk_details"),!nm&&ha.renderAction("changeProjectName")]}),(0,Sa.jsx)(Ga,{className:"Card-button",type:"button",title:Wb("exportDialog.disk_button"),"aria-label":Wb("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){ha.executeAction(Rf)}})]}),Ba&&(0,Sa.jsxs)(rt,{color:"pink",children:[(0,Sa.jsx)("div",
{className:"Card-icon",children:Kb}),(0,Sa.jsx)("h2",{children:Wb("exportDialog.link_title")}),(0,Sa.jsx)("div",{className:"Card-details",children:Wb("exportDialog.link_details")}),(0,Sa.jsx)(Ga,{className:"Card-button",type:"button",title:Wb("exportDialog.link_button"),"aria-label":Wb("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return Ba(na,sa,Aa)}})]}),va.renderCustomUI&&va.renderCustomUI(na,sa,Aa)]})})},iv=function(z){var na=z.elements,sa=z.appState,ha=z.actionManager,va=z.exportOpts;
z=z.canvas;var Aa=ia((0,ue.useState)(!1),2),Ba=Aa[0],Ha=Aa[1];Aa=ce().useCallback(function(){Ha(!1)},[]);return(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)(Ga,{onClick:function(){Ha(!0)},"data-testid":"json-export-button",icon:Eh,type:"button","aria-label":Wb("buttons.export"),showAriaLabel:om(),title:Wb("buttons.export")}),Ba&&(0,Sa.jsx)(Eq,{onCloseRequest:Aa,title:Wb("buttons.export"),children:(0,Sa.jsx)(hv,{elements:na,appState:sa,actionManager:ha,onCloseRequest:Aa,exportOpts:va,canvas:z})})]})},
jv=["suggestedBindings","startBoundElement"],kv=function(z){var na=z.libraryItems,sa=z.onRemoveFromLibrary,ha=z.onAddToLibrary,va=z.onInsertShape,Aa=z.pendingElements,Ba=z.theme,Ha=z.setAppState,Va=z.setLibraryItems,Ya=z.libraryReturnUrl,ob=z.focusContainer,Bb=z.library,Rb=z.id;z=om()?4:6;var ic=Math.max(1,Math.ceil((na.length+(0<Aa.length?1:0))/z)),mc=[],Sc=!1;Ya=Ya||window.location.origin+window.location.pathname;mc.push((0,Sa.jsxs)("div",{className:"layer-ui__library-header",children:[(0,Sa.jsx)(Ga,
{type:"button",title:Wb("buttons.load"),"aria-label":Wb("buttons.load"),icon:pc,onClick:function(){Ep(Bb).then(function(){Ha({isLibraryOpen:!1});Ha({isLibraryOpen:!0})}).catch(kk).catch(function(Yc){Ha({errorMessage:Yc.message})})}},"import"),!!na.length&&(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)(Ga,{type:"button",title:Wb("buttons.export"),"aria-label":Wb("buttons.export"),icon:Eh,onClick:function(){Xo(Bb).catch(kk).catch(function(Yc){Ha({errorMessage:Yc.message})})}},"export"),(0,Sa.jsx)(Ga,
{type:"button",title:Wb("buttons.resetLibrary"),"aria-label":Wb("buttons.resetLibrary"),icon:be,onClick:function(){window.confirm(Wb("alerts.resetLibrary"))&&(Bb.resetLibrary(),Va([]),ob())}},"reset")]}),(0,Sa.jsx)("a",{href:"https://libraries.excalidraw.com?target\x3d".concat(window.name||"_blank","\x26referrer\x3d").concat(Ya,"\x26useHash\x3dtrue\x26token\x3d").concat(Rb,"\x26theme\x3d").concat(Ba),target:"_excalidraw_libraries",children:Wb("labels.libraries")})]},"library-header"));for(Ba=0;Ba<
ic;Ba++){Ya=z*Ba;Rb=[];for(var Xc=0;Xc<z;Xc++){var Pc=0<Aa.length&&!Sc&&Ya+Xc>=na.length;Sc=Sc||Pc;Rb.push((0,Sa.jsx)(Rc,{children:(0,Sa.jsx)(bv,{elements:na[Ya+Xc],pendingElements:Pc?Aa:void 0,onRemoveFromLibrary:sa.bind(null,Ya+Xc),onClick:Pc?ha.bind(null,Aa):va.bind(null,na[Ya+Xc])})},Xc))}mc.push((0,Sa.jsx)(Gc,{align:"center",gap:1,children:Rb},Ba))}return(0,Sa.jsx)(Rc,{align:"start",gap:1,className:"layer-ui__library-items",children:mc})},lv=function(z){var na=z.onClickOutside,sa=z.onInsertShape,
ha=z.pendingElements,va=z.onAddToLibrary,Aa=z.theme,Ba=z.setAppState,Ha=z.libraryReturnUrl,Va=z.focusContainer,Ya=z.library;z=z.id;var ob=(0,ue.useRef)(null);!function(Yc,Bd){(0,ue.useEffect)(function(){var Xd=function(kd){Yc.current&&(kd.target instanceof Element&&(Yc.current.contains(kd.target)||!document.body.contains(kd.target))||Bd(kd))};return document.addEventListener("pointerdown",Xd,!1),function(){document.removeEventListener("pointerdown",Xd)}},[Yc,Bd])}(ob,function(Yc){Yc.target.closest(".ToolIcon_type_button__library")||
na(Yc)});var Bb=ia((0,ue.useState)([]),2),Rb=Bb[0],ic=Bb[1],mc=ia((0,ue.useState)("preloading"),2);Bb=mc[0];var Sc=mc[1],Xc=(0,ue.useRef)(null);(0,ue.useEffect)(function(){return Promise.race([new Promise(function(Yc){Xc.current=setTimeout(function(){Yc("loading")},100)}),Ya.loadLibrary().then(function(Yc){ic(Yc);Sc("ready")})]).then(function(Yc){"loading"===Yc&&Sc("loading")}),function(){clearTimeout(Xc.current)}},[Ya]);mc=(0,ue.useCallback)(function(){var Yc=(0,ff.Z)(Yd().mark(function kd(Xd){var qd,
Hd;return Yd().wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return He.next=2,Ya.loadLibrary();case 2:qd=He.sent,Hd=qd.filter(function(Tg,ni){return ni!==Xd}),Ya.saveLibrary(Hd).catch(function(Tg){ic(qd);Ba({errorMessage:Wb("alerts.errorRemovingFromLibrary")})}),ic(Hd);case 6:case "end":return He.stop()}},kd)}));return function(Xd){return Yc.apply(this,arguments)}}(),[Ya,Ba]);var Pc=(0,ue.useCallback)(function(){var Yc=(0,ff.Z)(Yd().mark(function kd(Xd){var qd,Hd;return Yd().wrap(function(He){for(;;)switch(He.prev=
He.next){case 0:return He.next=2,Ya.loadLibrary();case 2:qd=He.sent,Hd=[].concat(ja(qd),[Xd]),va(),Ya.saveLibrary(Hd).catch(function(Tg){ic(qd);Ba({errorMessage:Wb("alerts.errorAddingToLibrary")})}),ic(Hd);case 7:case "end":return He.stop()}},kd)}));return function(Xd){return Yc.apply(this,arguments)}}(),[va,Ya,Ba]);return"preloading"===Bb?null:(0,Sa.jsx)(qn,{padding:1,ref:ob,className:"layer-ui__library",children:"loading"===Bb?(0,Sa.jsx)("div",{className:"layer-ui__library-message",children:Wb("labels.libraryLoadingMessage")}):
(0,Sa.jsx)(kv,{libraryItems:Rb,onRemoveFromLibrary:mc,onAddToLibrary:Pc,onInsertShape:sa,pendingElements:ha,setAppState:Ba,setLibraryItems:ic,libraryReturnUrl:Ha,focusContainer:Va,library:Ya,theme:Aa,id:z})})},mv=ce().memo(function(z){var na,sa=z.actionManager,ha=z.appState,va=z.setAppState,Aa=z.canvas,Ba=z.elements,Ha=z.onCollabButtonClick,Va=z.onLockToggle,Ya=z.onInsertElements,ob=z.zenModeEnabled,Bb=z.showExitZenModeBtn,Rb=z.showThemeBtn,ic=z.toggleZenMode,mc=z.isCollaborating,Sc=z.renderTopRightUI,
Xc=z.renderCustomFooter,Pc=z.viewModeEnabled,Yc=z.libraryReturnUrl,Bd=z.UIOptions,Xd=z.focusContainer,kd=z.library,qd=z.id;z=om();var Hd=function(){return Bd.canvasActions.export?(0,Sa.jsx)(iv,{elements:Ba,appState:ha,actionManager:sa,exportOpts:Bd.canvasActions.export,canvas:Aa}):null},He=function(){if(!Bd.canvasActions.saveAsImage)return null;var ye=function(Mg){return function(){var Wi=(0,ff.Z)(Yd().mark(function Fl(El){var Mf;return Yd().wrap(function(wg){for(;;)switch(wg.prev=wg.next){case 0:return wg.next=
2,vf(Mg,El,ha,{exportBackground:ha.exportBackground,name:ha.name,viewBackgroundColor:ha.viewBackgroundColor}).catch(kk).catch(function(Gl){console.error(Gl);va({errorMessage:Gl.message})});case 2:Mf=wg.sent,ha.exportEmbedScene&&Mf&&Yo(Mf)&&va({fileHandle:Mf});case 4:case "end":return wg.stop()}},Fl)}));return function(El){return Wi.apply(this,arguments)}}()};return(0,Sa.jsx)($u,{elements:Ba,appState:ha,actionManager:sa,onExportToPng:ye("png"),onExportToSvg:ye("svg"),onExportToClipboard:ye("clipboard")})},
Tg=function(){return(0,Sa.jsx)("div",{style:{width:".625em"}})},ni=(0,ue.useCallback)(function(ye){va({isLibraryOpen:!1})},[va]),Bi=(0,ue.useCallback)(function(){va({selectedElementIds:{},selectedGroupIds:{}})},[va]),pf=ha.isLibraryOpen?(0,Sa.jsx)(lv,{pendingElements:Sf(Ba,ha),onClickOutside:ni,onInsertShape:Ya,onAddToLibrary:Bi,setAppState:va,libraryReturnUrl:Yc,focusContainer:Xd,library:kd,theme:ha.theme,id:qd}):null;Ya=(0,Sa.jsxs)(Sa.Fragment,{children:[ha.isLoading&&(0,Sa.jsx)(Aj,{}),ha.errorMessage&&
(0,Sa.jsx)(pv,{message:ha.errorMessage,onClose:function(){return va({errorMessage:null})}}),ha.showHelpDialog&&(0,Sa.jsx)(gv,{onClose:function(){va({showHelpDialog:!1})}}),ha.pasteDialog.shown&&(0,Sa.jsx)(Uu,{setAppState:va,appState:ha,onInsertChart:Ya,onClose:function(){return va({pasteDialog:{shown:!1,data:null}})}})]});return z?(0,Sa.jsxs)(Sa.Fragment,{children:[Ya,(0,Sa.jsx)(Tu,{appState:ha,elements:Ba,actionManager:sa,libraryMenu:pf,renderJSONExportDialog:Hd,renderImageExportDialog:He,setAppState:va,
onCollabButtonClick:Ha,onLockToggle:Va,canvas:Aa,isCollaborating:mc,renderCustomFooter:Xc,viewModeEnabled:Pc,showThemeBtn:Rb})]}):(0,Sa.jsxs)("div",{className:Dc("layer-ui__wrapper",{"disable-pointerEvents":ha.draggingElement||ha.resizingElement||ha.editingElement&&!Yg(ha.editingElement)}),children:[Ya,(na=xh(ha,Ba),(0,Sa.jsx)(ot,{side:"top",children:(0,Sa.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,Sa.jsxs)(Rc,{gap:4,className:Dc({"disable-pointerEvents":ob}),children:[Pc?(0,Sa.jsx)(oo,
{heading:"canvasActions",className:Dc("zen-mode-transition",{"transition-left":ob}),children:(0,Sa.jsx)(qn,{padding:2,style:{zIndex:1},children:(0,Sa.jsx)(Rc,{gap:4,children:(0,Sa.jsxs)(Gc,{gap:1,justifyContent:"space-between",children:[Hd(),He()]})})})}):(0,Sa.jsx)(oo,{heading:"canvasActions",className:Dc("zen-mode-transition",{"transition-left":ob}),children:(0,Sa.jsx)(qn,{padding:2,style:{zIndex:1},children:(0,Sa.jsxs)(Rc,{gap:4,children:[(0,Sa.jsxs)(Gc,{gap:1,justifyContent:"space-between",children:[sa.renderAction("clearCanvas"),
(0,Sa.jsx)(Tg,{}),sa.renderAction("loadScene"),Hd(),He(),(0,Sa.jsx)(Tg,{}),Ha&&(0,Sa.jsx)(Et,{isCollaborating:mc,collaboratorCount:ha.collaborators.size,onClick:Ha})]}),(0,Sa.jsx)(ut,{actionManager:sa,appState:ha,setAppState:va,showThemeBtn:Rb}),ha.fileHandle&&(0,Sa.jsx)(Sa.Fragment,{children:sa.renderAction("saveToActiveFile")})]})})}),na&&(0,Sa.jsx)(oo,{heading:"selectedShapeActions",className:Dc("zen-mode-transition",{"transition-left":ob}),children:(0,Sa.jsx)(qn,{className:yc.$C.SHAPE_ACTIONS_MENU,
padding:2,style:{maxHeight:"".concat(ha.height-(ha.fileHandle?248:200),"px")},children:(0,Sa.jsx)(Gt,{appState:ha,elements:Ba,renderAction:sa.renderAction,elementType:ha.elementType})})})]}),!Pc&&(0,Sa.jsx)(oo,{heading:"shapes",children:function(ye){return(0,Sa.jsxs)(Rc,{gap:4,align:"start",children:[(0,Sa.jsxs)(Gc,{gap:1,children:[(0,Sa.jsx)(qt,{zenModeEnabled:ob,checked:ha.elementLocked,onChange:Va,title:Wb("toolBar.lock")}),(0,Sa.jsxs)(qn,{padding:1,className:Dc({"zen-mode":ob}),children:[(0,Sa.jsx)(pt,
{appState:ha,elements:Ba}),ye,(0,Sa.jsx)(Gc,{gap:1,children:(0,Sa.jsx)(wt,{canvas:Aa,elementType:ha.elementType,setAppState:va})})]}),(0,Sa.jsx)(lt,{appState:ha,setAppState:va})]}),pf]})}}),(0,Sa.jsxs)("div",{className:Dc("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":ob}),children:[(0,Sa.jsx)(kt,{children:0<ha.collaborators.size&&Array.from(ha.collaborators).filter(function(ye){ye=ia(ye,2);ye=(ye[0],ye[1]);return 0!==Object.keys(ye).length}).map(function(ye){var Mg=ia(ye,
2);ye=Mg[0];Mg=Mg[1];return(0,Sa.jsx)(uf,{label:Mg.username||"Unknown user",children:sa.renderAction("goToCollaborator",{id:ye})},ye)})}),null==Sc?void 0:Sc(z,ha)]})]})})),(0,Sa.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,Sa.jsx)("div",{className:Dc("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":ob}),children:(0,Sa.jsx)(Rc,{gap:2,children:(0,Sa.jsxs)(oo,{heading:"canvasActions",
children:[(0,Sa.jsx)(qn,{padding:1,children:(0,Sa.jsx)(tv,{renderAction:sa.renderAction,zoom:ha.zoom})}),!Pc&&(0,Sa.jsxs)("div",{className:Dc("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":ob}),children:[sa.renderAction("undo",{size:"small"}),sa.renderAction("redo",{size:"small"})]})]})})}),(0,Sa.jsx)("div",{className:Dc("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":ob}),children:null==Xc?void 0:
Xc(!1,ha)}),(0,Sa.jsx)("div",{className:Dc("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":ob}),children:sa.renderAction("toggleShortcuts")}),(0,Sa.jsx)("button",{className:Dc("disable-zen-mode",{"disable-zen-mode--visible":Bb}),onClick:ic,children:Wb("buttons.exitZenMode")})]}),ha.scrolledOutside&&(0,Sa.jsx)("button",{className:"scroll-back-to-content",onClick:function(){va(function(ye){for(var Mg=1;Mg<arguments.length;Mg++){var Wi=null!=arguments[Mg]?
arguments[Mg]:{};Mg%2?Fk(Object(Wi),!0).forEach(function(rk){da(ye,rk,Wi[rk])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ye,Object.getOwnPropertyDescriptors(Wi)):Fk(Object(Wi)).forEach(function(rk){Object.defineProperty(ye,rk,Object.getOwnPropertyDescriptor(Wi,rk))})}return ye}({},Fg(Ba,ha)))},children:Wb("buttons.scrollBackToContent")})]})},function(z,na){var sa=function(Aa){Aa.suggestedBindings;Aa.startBoundElement;return Za(Aa,jv)},ha=sa(z.appState),va=sa(na.appState);sa=Object.keys(ha);
return z.renderCustomFooter===na.renderCustomFooter&&z.langCode===na.langCode&&z.elements===na.elements&&sa.every(function(Aa){return ha[Aa]===va[Aa]})}),nv=(e(1528),function(z){var na,sa=om(),ha=Bg(z.elements),va=Kh(z.elements,z.appState),Aa=Bg(va);return sa&&z.appState.openMenu?null:(0,Sa.jsx)("div",{className:"Stats",children:(0,Sa.jsxs)(qn,{padding:2,children:[(0,Sa.jsx)("div",{className:"close",onClick:z.onClose,children:Om}),(0,Sa.jsx)("h3",{children:Wb("stats.title")}),(0,Sa.jsx)("table",{children:(0,
Sa.jsxs)("tbody",{children:[(0,Sa.jsx)("tr",{children:(0,Sa.jsx)("th",{colSpan:2,children:Wb("stats.scene")})}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.elements")}),(0,Sa.jsx)("td",{children:z.elements.length})]}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.width")}),(0,Sa.jsx)("td",{children:Math.round(ha[2])-Math.round(ha[0])})]}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.height")}),(0,Sa.jsx)("td",{children:Math.round(ha[3])-Math.round(ha[1])})]}),
1===va.length&&(0,Sa.jsx)("tr",{children:(0,Sa.jsx)("th",{colSpan:2,children:Wb("stats.element")})}),1<va.length&&(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsx)("tr",{children:(0,Sa.jsx)("th",{colSpan:2,children:Wb("stats.selected")})}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.elements")}),(0,Sa.jsx)("td",{children:va.length})]})]}),0<va.length&&(0,Sa.jsxs)(Sa.Fragment,{children:[(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:"x"}),(0,Sa.jsx)("td",{children:Math.round(Aa[0])})]}),
(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:"y"}),(0,Sa.jsx)("td",{children:Math.round(Aa[1])})]}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.width")}),(0,Sa.jsx)("td",{children:Math.round(Aa[2]-Aa[0])})]}),(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.height")}),(0,Sa.jsx)("td",{children:Math.round(Aa[3]-Aa[1])})]})]}),1===va.length&&(0,Sa.jsxs)("tr",{children:[(0,Sa.jsx)("td",{children:Wb("stats.angle")}),(0,Sa.jsx)("td",{children:"".concat(Math.round(180*
va[0].angle/Math.PI),"°")})]}),null===(na=z.renderCustomStats)||void 0===na?void 0:na.call(z,z.elements,z.appState)]})})]})})}),ov=(e(9757),function(z){var na=z.message,sa=z.clearToast,ha=(0,ue.useRef)(0),va=(0,ue.useCallback)(function(){return ha.current=window.setTimeout(function(){return sa()},yc.Lg)},[sa]);return(0,ue.useEffect)(function(){return va(),function(){return clearTimeout(ha.current)}},[va,na]),(0,Sa.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==ha?
void 0:ha.current)},onMouseLeave:va,children:(0,Sa.jsx)("p",{className:"Toast__message",children:na})})}),st=we({name:"viewMode",perform:function(z,na){return Lh("view","mode","view"),{appState:ql(ql({},na),{},{viewModeEnabled:!this.checked(na)}),commitToHistory:!1}},checked:function(z){return z.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(z){return!z[Af]&&z.altKey&&"KeyR"===z.code}}),tt=ce().createContext(!1),om=function(){return(0,ue.useContext)(tt)},jt=ce().createContext({container:null,
id:null}),Ip=function(){return(0,ue.useContext)(jt)},Bq=!1,ls=0,Jp=0,Kp=0,ap=!1,Cq=!1,ms=!1,ns={horizontal:null,vertical:null},no=0,Dq=!1,mo=null,zl=new Map,Gp=null,pr=null,Hp=null,ks=function(z){function na(Aa){q(this,na);var Ba=va.call(this,Aa);Ru.call(B(Ba));var Ha,Va,Ya,ob,Bb=Ij(),Rb=Aa.excalidrawRef,ic=Aa.viewModeEnabled;ic=void 0!==ic&&ic;var mc=Aa.zenModeEnabled;mc=void 0!==mc&&mc;var Sc=Aa.gridModeEnabled;Sc=void 0!==Sc&&Sc;var Xc=Aa.theme;Xc=void 0===Xc?Bb.theme:Xc;Aa=Aa.name;Aa=void 0===
Aa?Bb.name:Aa;if(Ba.state=Wd(Wd(Wd({},Bb),{},{theme:Xc,isLoading:!0},Ba.getCanvasOffsets()),{},{viewModeEnabled:ic,zenModeEnabled:mc,gridSize:Sc?yc.k:null,name:Aa,width:window.innerWidth,height:window.innerHeight}),Ba.id=dk(),Rb){var Pc;Bb="current"in Rb&&(null===(Pc=Rb.current)||void 0===Pc?void 0:Pc.readyPromise)||((Ya=new Promise(function(Yc,Bd){Ha=Yc;Va=Bd})).resolve=Ha,Ya.reject=Va,Ya);Ya={ready:!0,readyPromise:Bb,updateScene:Ba.updateScene,resetScene:Ba.resetScene,getSceneElementsIncludingDeleted:Ba.getSceneElementsIncludingDeleted,
history:{clear:Ba.resetHistory},scrollToContent:Ba.scrollToContent,getSceneElements:Ba.getSceneElements,getAppState:function(){return Ba.state},refresh:Ba.refresh,importLibrary:Ba.importLibraryFromUrl,setToastMessage:Ba.setToastMessage,id:Ba.id};"function"==typeof Rb?Rb(Ya):Rb.current=Ya;Bb.resolve(Ya)}return Ba.excalidrawContainerValue={container:Ba.excalidrawContainerRef.current,id:Ba.id},Ba.scene=new Ph,Ba.library=new yv(B(Ba)),Ba.history=new vv,Ba.actionManager=new uv(Ba.syncActionResult,function(){return Ba.state},
function(){return Ba.scene.getElementsIncludingDeleted()},B(Ba)),Ba.actionManager.registerAll(zm),Ba.actionManager.registerAction((ob=Ba.history,{name:"undo",perform:function(Yc,Bd){return vt(Yc,Bd,function(){return ob.undoOnce()})},keyTest:function(Yc){return Yc[Af]&&"z"===Yc.key.toLowerCase()&&!Yc.shiftKey},PanelComponent:function(Yc){var Bd=Yc.updateData;Yc=Yc.data;return(0,Sa.jsx)(Ga,{type:"button",icon:ig,"aria-label":Wb("buttons.undo"),onClick:Bd,size:(null==Yc?void 0:Yc.size)||"medium"})},
commitToHistory:function(){return!1}})),Ba.actionManager.registerAction(function(Yc){return{name:"redo",perform:function(Bd,Xd){return vt(Bd,Xd,function(){return Yc.redoOnce()})},keyTest:function(Bd){return Bd[Af]&&Bd.shiftKey&&"z"===Bd.key.toLowerCase()||nj&&Bd.ctrlKey&&!Bd.shiftKey&&"y"===Bd.key},PanelComponent:function(Bd){var Xd=Bd.updateData;Bd=Bd.data;return(0,Sa.jsx)(Ga,{type:"button",icon:Xf,"aria-label":Wb("buttons.redo"),onClick:Xd,size:(null==Bd?void 0:Bd.size)||"medium"})},commitToHistory:function(){return!1}}}(Ba.history)),
Ba}M(na,z);var sa,ha,va=Pe(na);return y(na,[{key:"renderCanvas",value:function(){var Aa=window.devicePixelRatio,Ba=this.state,Ha=Ba.width,Va=Ba.height,Ya=Ha*Aa;Aa*=Va;return Ba.viewModeEnabled?(0,Sa.jsx)("canvas",{className:"excalidraw__canvas",style:{width:Ha,height:Va,cursor:yc.oc.GRAB},width:Ya,height:Aa,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,
onPointerDown:this.handleCanvasPointerDown,children:Wb("labels.drawingCanvas")}):(0,Sa.jsx)("canvas",{className:"excalidraw__canvas",style:{width:Ha,height:Va},width:Ya,height:Aa,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:Wb("labels.drawingCanvas")})}},
{key:"render",value:function(){var Aa,Ba,Ha=this,Va=this.state,Ya=Va.zenModeEnabled;Va=Va.viewModeEnabled;var ob=this.props,Bb=ob.onCollabButtonClick,Rb=ob.renderTopRightUI,ic=ob.renderFooter;ob=ob.renderCustomStats;return(0,Sa.jsx)("div",{className:Dc("excalidraw excalidraw-container",{"excalidraw--view-mode":Va,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,
Sa.jsx)(jt.Provider,{value:this.excalidrawContainerValue,children:(0,Sa.jsxs)(tt.Provider,{value:this.isMobile,children:[(0,Sa.jsx)(mv,{canvas:this.canvas,appState:this.state,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:Bb,onLockToggle:this.toggleLock,onInsertElements:function(mc){return Ha.addElementsFromPasteOrLibrary({elements:mc,position:"center"})},zenModeEnabled:Ya,toggleZenMode:this.toggleZenMode,langCode:Cg.code,isCollaborating:this.props.isCollaborating||
!1,renderTopRightUI:Rb,renderCustomFooter:ic,viewModeEnabled:Va,showExitZenModeBtn:void 0===(null===(Aa=this.props)||void 0===Aa?void 0:Aa.zenModeEnabled)&&Ya,showThemeBtn:void 0===(null===(Ba=this.props)||void 0===Ba?void 0:Ba.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id}),(0,Sa.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,Sa.jsx)("div",
{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,Sa.jsx)(nv,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:ob}),null!==this.state.toastMessage&&(0,Sa.jsx)(ov,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,Sa.jsx)("main",{children:this.renderCanvas()})]})})})}},{key:"componentDidMount",value:(ha=(0,ff.Z)(Yd().mark(function Ba(){var Ha,Va,Ya,ob,Bb=this;return Yd().wrap(function(Rb){for(;;)switch(Rb.prev=
Rb.next){case 0:this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"!==yc.Vi.TEST&&"production"!==yc.Vi.DEVELOPMENT||(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return Bb.state}},setState:{configurable:!0,value:function(){return Bb.setState.apply(Bb,arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})),this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),
this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(Ha=this.excalidrawContainerRef)&&void 0!==Ha&&Ha.current?(this.resizeObserver=new ResizeObserver(function(){var ic=Bb.excalidrawContainerRef.current.getBoundingClientRect(),mc=ic.width;ic=ic.height;Bb.isMobile=mc<yc.kV||ic<yc.Yx&&mc<yc.sS;Bb.updateDOMRect()}),null===(Va=this.resizeObserver)||void 0===Va||Va.observe(this.excalidrawContainerRef.current)):window.matchMedia&&(Ya=window.matchMedia("(max-width: ".concat(yc.kV,
"px), (max-height: ").concat(yc.Yx,"px) and (max-width: ").concat(yc.sS,"px)")),ob=function(){return Bb.isMobile=Ya.matches},Ya.addListener(ob),this.detachIsMobileMqHandler=function(){return Ya.removeListener(ob)}),(new URLSearchParams(window.location.search.slice(1))).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene);case 8:case "end":return Rb.stop()}},Ba,this)})),function(){return ha.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var Ba;
null===(Ba=this.resizeObserver)||void 0===Ba||Ba.disconnect();this.unmounted=!0;this.removeEventListeners();this.scene.destroy();clearTimeout(no);no=0}},{key:"removeEventListeners",value:function(){var Ba,Ha;document.removeEventListener(yc.Ks.POINTER_UP,this.removePointer);document.removeEventListener(yc.Ks.COPY,this.onCopy);document.removeEventListener(yc.Ks.PASTE,this.pasteFromClipboard);document.removeEventListener(yc.Ks.CUT,this.onCut);null===(Ba=this.nearestScrollableContainer)||void 0===Ba||
Ba.removeEventListener(yc.Ks.SCROLL,this.onScroll);document.removeEventListener(yc.Ks.KEYDOWN,this.onKeyDown,!1);document.removeEventListener(yc.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1);document.removeEventListener(yc.Ks.KEYUP,this.onKeyUp);window.removeEventListener(yc.Ks.RESIZE,this.onResize,!1);window.removeEventListener(yc.Ks.UNLOAD,this.onUnload,!1);window.removeEventListener(yc.Ks.BLUR,this.onBlur,!1);window.removeEventListener(yc.Ks.DRAG_OVER,this.disableEvent,!1);window.removeEventListener(yc.Ks.DROP,
this.disableEvent,!1);document.removeEventListener(yc.Ks.GESTURE_START,this.onGestureStart,!1);document.removeEventListener(yc.Ks.GESTURE_CHANGE,this.onGestureChange,!1);document.removeEventListener(yc.Ks.GESTURE_END,this.onGestureEnd,!1);null===(Ha=this.detachIsMobileMqHandler)||void 0===Ha||Ha.call(this)}},{key:"addEventListeners",value:function(){var Ba,Ha;this.removeEventListeners();document.addEventListener(yc.Ks.POINTER_UP,this.removePointer);document.addEventListener(yc.Ks.COPY,this.onCopy);
this.props.handleKeyboardGlobally&&document.addEventListener(yc.Ks.KEYDOWN,this.onKeyDown,!1);document.addEventListener(yc.Ks.KEYUP,this.onKeyUp,{passive:!0});document.addEventListener(yc.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition);null===(Ba=document.fonts)||void 0===Ba||null===(Ha=Ba.addEventListener)||void 0===Ha||Ha.call(Ba,"loadingdone",this.onFontLoaded);document.addEventListener(yc.Ks.GESTURE_START,this.onGestureStart,!1);document.addEventListener(yc.Ks.GESTURE_CHANGE,this.onGestureChange,
!1);document.addEventListener(yc.Ks.GESTURE_END,this.onGestureEnd,!1);if(!this.state.viewModeEnabled){document.addEventListener(yc.Ks.PASTE,this.pasteFromClipboard);document.addEventListener(yc.Ks.CUT,this.onCut);if(this.props.detectScroll){a:{for(Ba=this.excalidrawContainerRef.current.parentElement;Ba;){if(Ba===document.body){Ba=document;break a}Ha=window.getComputedStyle(Ba).overflowY;if(Ba.scrollHeight>Ba.clientHeight&&("auto"===Ha||"scroll"===Ha))break a;Ba=Ba.parentElement}Ba=document}this.nearestScrollableContainer=
Ba;this.nearestScrollableContainer.addEventListener(yc.Ks.SCROLL,this.onScroll)}window.addEventListener(yc.Ks.RESIZE,this.onResize,!1);window.addEventListener(yc.Ks.UNLOAD,this.onUnload,!1);window.addEventListener(yc.Ks.BLUR,this.onBlur,!1);window.addEventListener(yc.Ks.DRAG_OVER,this.disableEvent,!1);window.addEventListener(yc.Ks.DROP,this.disableEvent,!1)}}},{key:"componentDidUpdate",value:function(Ba,Ha){var Va,Ya,ob=this;Ba.langCode!==this.props.langCode&&this.updateLanguage();Ba.viewModeEnabled!==
this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled});Ha.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements());Ba.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled});Ba.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme});Ba.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?yc.k:null});this.props.name&&
Ba.name!==this.props.name&&this.setState({name:this.props.name});null===(Va=this.excalidrawContainerRef.current)||void 0===Va||Va.classList.toggle("theme--dark","dark"===this.state.theme);this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(function(){ob.actionManager.executeAction($f)});Ba=Ha.multiElement;Ha.elementType!==this.state.elementType&&null!=Ba&&this.state.isBindingEnabled&&Xg(Ba)&&ng(Ba,this.state,this.scene,Hj(dd.getPointAtIndexGlobalCoordinates(Ba,
-1)));var Bb={},Rb={},ic={},mc={},Sc={};this.state.collaborators.forEach(function(Yc,Bd){if(Yc.selectedElementIds)for(var Xd=0,kd=Object.keys(Yc.selectedElementIds);Xd<kd.length;Xd++){var qd=kd[Xd];qd in ic||(ic[qd]=[]);ic[qd].push(Bd)}Yc.pointer&&(Yc.username&&(mc[Bd]=Yc.username),Yc.userState&&(Sc[Bd]=Yc.userState),Rb[Bd]=hk({sceneX:Yc.pointer.x,sceneY:Yc.pointer.y},ob.state),Bb[Bd]=Yc.button)});Ha=this.scene.getElements();Va=Si(Ha.filter(function(Yc){return!ob.state.editingElement||"text"!==ob.state.editingElement.type||
Yc.id!==ob.state.editingElement.id}),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:Rb,remotePointerButton:Bb,remoteSelectedElementIds:ic,remotePointerUsernames:mc,remotePointerUserStates:Sc,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom},{renderOptimizations:!0,renderScrollbars:!this.isMobile});Ba=Va.atLeastOneVisibleElement;
(Va=Va.scrollBars)&&(ns=Va);var Xc,Pc;Ha="text"!==(null===(Ya=this.state.editingElement)||void 0===Ya?void 0:Ya.type)&&!Ba&&0<Ha.length;(this.state.scrolledOutside!==Ha&&this.setState({scrolledOutside:Ha}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.state.isLoading)||null===(Xc=(Pc=this.props).onChange)||void 0===Xc||Xc.call(Pc,this.scene.getElementsIncludingDeleted(),this.state)}},{key:"addTextFromPaste",value:function(Ba){var Ha=hh({clientX:Jp,clientY:Kp},this.state);
Ba=Eg({x:Ha.x,y:Ha.y,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:Ba,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,
verticalAlign:yc.hs});this.scene.replaceAllElements([].concat(ja(this.scene.getElementsIncludingDeleted()),[Ba]));this.setState({selectedElementIds:da({},Ba.id,!0)});this.history.resumeRecording()}},{key:"selectShapeTool",value:function(Ba){var Ha;ap||si(this.canvas,Ba);(Ha=document.activeElement)instanceof HTMLElement&&Ha.className.includes("ToolIcon")&&this.focusContainer();oj(Ba)||this.setState({suggestedBindings:[]});"selection"!==Ba?this.setState({elementType:Ba,selectedElementIds:{},selectedGroupIds:{},
editingGroupId:null}):this.setState({elementType:Ba})}},{key:"handleTextWysiwyg",value:function(Ba,Ha){var Va=this;Ha=Ha.isExistingElement;var Ya=void 0!==Ha&&Ha,ob=function(Bb){var Rb=1<arguments.length&&void 0!==arguments[1]&&arguments[1];Va.scene.replaceAllElements(ja(Va.scene.getElementsIncludingDeleted().map(function(ic){if(ic.id===Ba.id&&Yg(ic)){var mc={text:Bb,isDeleted:null!=Rb?Rb:ic.isDeleted},Sc=Vl(Bb,jk(ic));var Xc=Sc.width;var Pc=Sc.height;Sc=Sc.baseline;var Yc=ic.textAlign;var Bd=ic.verticalAlign;
if("center"===Yc&&"middle"===Bd)Yc=Vl(ic.text,jk(ic)),Bd=kl(ic,{width:Xc-Yc.width,height:Pc-Yc.height}),Yc=ic.x-Bd.x,Bd=ic.y-Bd.y;else{var Xd=ia(Vf(ic),4);Bd=Xd[0];var kd=Xd[1],qd=Xd[2];Xd=Xd[3];var Hd=ia(Re(ic,Xc,Pc),4);Bd=ia(qi({s:!0,e:"center"===Yc||"left"===Yc,w:"center"===Yc||"right"===Yc},ic.x,ic.y,ic.angle,(Bd-Hd[0])/2,(kd-Hd[1])/2,(qd-Hd[2])/2,(Xd-Hd[3])/2),2);Yc=Bd[0];Bd=Bd[1]}Xc={width:Xc,height:Pc,x:Number.isFinite(Yc)?Yc:ic.x,y:Number.isFinite(Bd)?Bd:ic.y,baseline:Sc};ic=cf(ic,Tc(mc,Xc))}return ic})))};
!function(Bb){var Rb=Bb.id,ic=Bb.appState,mc=Bb.onChange,Sc=Bb.onSubmit,Xc=Bb.getViewportCoords,Pc=Bb.element,Yc=Bb.canvas,Bd=Bb.excalidrawContainer,Xd=function(){var Mf,wg=null===(Mf=Ph.getScene(Pc))||void 0===Mf?void 0:Mf.getElement(Rb);if(wg&&Yg(wg)){Mf=ia(Xc(wg.x,wg.y),2);var Gl=Mf[0],sk=Mf[1];Mf=wg.textAlign;var tk=wg.angle;kd.value=wg.text;var bm=wg.text.replace(/\r\n?/g,"\n").split("\n"),Lm=wg.height/bm.length;bm=(ic.offsetLeft+ic.width-Gl-8)/ic.zoom.value-Number(getComputedStyle(null==Bd?
void 0:Bd.parentNode).marginRight.slice(0,-2));var Yp=Object,Wv=Yp.assign,Vv=kd.style,Tv=jk(wg);Lm="".concat(Lm,"px");var Uv="".concat(wg.width,"px"),Rv="".concat(wg.height,"px");Gl="".concat(Gl,"px");sk="".concat(sk,"px");var wr=wg.width;var Pq=ic.zoom,Pv=180*tk/Math.PI;tk=(wr-2*ic.offsetLeft)*(Pq.value-1)/2;var Qv=(wg.height-2*ic.offsetTop)*(Pq.value-1)/2;wr=(wr>bm&&1!==Pq.value&&(tk=bm/2*(Pq.value-1)),"translate(".concat(tk,"px, ").concat(Qv,"px) scale(").concat(Pq.value,") rotate(").concat(Pv,
"deg)"));Wv.call(Yp,Vv,{font:Tv,lineHeight:Lm,width:Uv,height:Rv,left:Gl,top:sk,transform:wr,textAlign:Mf,color:wg.strokeColor,opacity:wg.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(bm,"px")})}},kd=document.createElement("textarea");kd.dir="auto";kd.tabIndex=0;kd.dataset.type="wysiwyg";kd.wrap="off";Object.assign(kd.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",
overflow:"hidden",whiteSpace:"pre",zIndex:"var(--zIndex-wysiwyg)"});Xd();mc&&(kd.oninput=function(){mc(Bk(kd.value))});kd.onkeydown=function(Mf){(Mf.stopPropagation(),"Escape"===Mf.key)?(Mf.preventDefault(),pf=!0,ye()):"Enter"===Mf.key&&Mf[Af]?(Mf.preventDefault(),Mf.isComposing||229===Mf.keyCode)||(pf=!0,ye()):("Tab"===Mf.key||Mf[Af]&&("BracketLeft"===Mf.code||"BracketRight"===Mf.code))&&(Mf.preventDefault(),Mf.shiftKey||"BracketLeft"===Mf.code?Tg():He(),kd.dispatchEvent(new Event("input")))};var qd=
" ".repeat(4),Hd=new RegExp("^ {1,".concat(4,"}")),He=function(){var Mf=kd.selectionStart,wg=kd.selectionEnd,Gl=ni(),sk=kd.value;Gl.forEach(function(tk){var bm=sk.slice(0,tk);tk=sk.slice(tk);sk="".concat(bm).concat(qd).concat(tk)});kd.value=sk;kd.selectionStart=Mf+4;kd.selectionEnd=wg+4*Gl.length},Tg=function(){var Mf=kd.selectionStart,wg=kd.selectionEnd,Gl=ni(),sk=[],tk=kd.value;Gl.forEach(function(bm){var Lm=tk.slice(bm,bm+4).match(Hd);if(Lm){var Yp=tk.slice(0,bm);Lm=tk.slice(bm+Lm[0].length);tk=
"".concat(Yp).concat(Lm);sk.push(bm)}});kd.value=tk;sk.length&&(Mf>sk[sk.length-1]?kd.selectionStart=Math.max(Mf-4,sk[sk.length-1]):kd.selectionStart=Mf,kd.selectionEnd=Math.max(kd.selectionStart,wg-4*sk.length))},ni=function(){var Mf=kd.selectionStart,wg=kd.selectionEnd,Gl=kd.value,sk=Gl.slice(0,Mf).match(/[^\n]*$/)[0].length;return Mf-=sk,Gl.slice(Mf,wg).split("\n").reduce(function(tk,bm,Lm,Yp){return tk.concat(Lm?tk[Lm-1]+Yp[Lm-1].length+1:Mf)},[]).reverse()},Bi=function(Mf){Mf.preventDefault();
Mf.stopPropagation()},pf=!1,ye=function(){El||(El=!0,kd.onblur=null,kd.oninput=null,kd.onkeydown=null,Fl&&Fl.disconnect(),window.removeEventListener("resize",Xd),window.removeEventListener("wheel",Bi,!0),window.removeEventListener("pointerdown",Wi),window.removeEventListener("pointerup",Mg),window.removeEventListener("blur",ye),rk(),kd.remove());Sc({text:Bk(kd.value),viaKeyboard:pf})},Mg=function wg(){window.removeEventListener("pointerup",wg);setTimeout(function(){kd.onblur=ye;kd.focus()})},Wi=function(wg){(wg.target instanceof
HTMLElement||wg.target instanceof SVGElement)&&wg.target.closest(".".concat(yc.$C.SHAPE_ACTIONS_MENU))&&!Dj(wg.target)&&(kd.onblur=null,window.addEventListener("pointerup",Mg),window.addEventListener("blur",ye))},rk=Ph.getScene(Pc).addCallback(function(){Xd();kd.focus()}),El=!1;kd.select();Mg();var Fl=null;Yc&&"ResizeObserver"in window?(Fl=new window.ResizeObserver(function(){Xd()})).observe(Yc):window.addEventListener("resize",Xd);window.addEventListener("pointerdown",Wi);window.addEventListener("wheel",
Bi,{passive:!1,capture:!0});null==Bd||Bd.querySelector(".excalidraw-textEditorContainer").appendChild(kd)}({id:Ba.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(Bb,Rb){Bb=hk({sceneX:Bb,sceneY:Rb},Va.state);return[Bb.x-Va.state.offsetLeft,Bb.y-Va.state.offsetTop]},onChange:ag(function(Bb){ob(Bb);!Ba.isDeleted&&Ei(Ba)}),onSubmit:ag(function(Bb){var Rb=Bb.text;Bb=Bb.viaKeyboard;var ic=!Rb.trim();ob(Rb,ic);!ic&&Bb&&Va.setState(function(mc){return{selectedElementIds:Wd(Wd({},mc.selectedElementIds),
{},da({},Ba.id,!0))}});ic&&Ll(Va.scene.getElements(),[Ba]);ic&&!Ya||Va.history.resumeRecording();Va.setState({draggingElement:null,editingElement:null});Va.state.elementLocked&&si(Va.canvas,Va.state.elementType);Va.focusContainer()}),element:Ba,excalidrawContainer:this.excalidrawContainerRef.current});this.deselectElements();ob(Ba.text)}},{key:"deselectElements",value:function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}},{key:"getTextElementAtPosition",value:function(Ba,
Ha){return(Ba=this.getElementAtPosition(Ba,Ha))&&Yg(Ba)&&!Ba.isDeleted?Ba:null}},{key:"getElementAtPosition",value:function(Ba,Ha,Va){var Ya=this.getElementsAtPosition(Ba,Ha);if(1<Ya.length){if(null!=Va&&Va.preferSelected)for(Va=Ya.length-1;-1<Va;Va--)if(this.state.selectedElementIds[Ya[Va].id])return Ya[Va];Va=Ya[Ya.length-1];return Xi(Va,this.state,Ba,Ha)?Ya[Ya.length-2]:Va}return 1===Ya.length?Ya[0]:null}},{key:"getElementsAtPosition",value:function(Ba,Ha){var Va,Ya,ob=this;return Va=this.scene.getElements(),
Ya=function(Bb){var Rb=ob.state,ic=10/Rb.zoom.value,mc=[Ba,Ha];return Rb.selectedElementIds[Bb.id]?eg(Bb,mc,ic):Ok(Bb,Rb,mc)},Va.filter(function(Bb){return!Bb.isDeleted&&Ya(Bb)})}},{key:"maybeCleanupAfterMissingPointerUp",value:function(Ba){null!==mo&&mo(Ba)}},{key:"updateGestureOnPointerDown",value:function(Ba){zl.set(Ba.pointerId,{x:Ba.clientX,y:Ba.clientY});2===zl.size&&(Gp=yt(zl),Hp=this.state.zoom.value,pr=zt(Array.from(zl.values())))}},{key:"initialPointerDownState",value:function(Ba){var Ha=
hh(Ba,this.state),Va=Sf(this.scene.getElements(),this.state),Ya=ia(Bg(Va),4),ob=Ya[0],Bb=Ya[1],Rb=Ya[2];Ya=Ya[3];return{origin:Ha,withCmdOrCtrl:Ba[Af],originInGrid:Hj(Dh(Ha.x,Ha.y,this.state.gridSize)),scrollbars:Zg(ns,Ba.clientX-this.state.offsetLeft,Ba.clientY-this.state.offsetTop),lastCoords:Wd({},Ha),originalElements:this.scene.getElements().reduce(function(ic,mc){return ic.set(mc.id,Wf(mc)),ic},new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(Rb+
ob)/2,y:(Ya+Bb)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(Ha,Va)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null}}}},{key:"handleDraggingScrollBar",value:function(Ba,Ha){var Va=this;if(!Ha.scrollbars.isOverEither||this.state.multiElement)return!1;ms=!0;Ha.lastCoords.x=Ba.clientX;Ha.lastCoords.y=Ba.clientY;var Ya=
ag(function(Bb){Bb.target instanceof HTMLElement&&Va.handlePointerMoveOverScrollbars(Bb,Ha)}),ob=ag(function(){ms=!1;si(Va.canvas,Va.state.elementType);mo=null;Va.setState({cursorButton:"up"});Va.savePointer(Ba.clientX,Ba.clientY,"up");window.removeEventListener(yc.Ks.POINTER_MOVE,Ya);window.removeEventListener(yc.Ks.POINTER_UP,ob)});return mo=ob,window.addEventListener(yc.Ks.POINTER_MOVE,Ya),window.addEventListener(yc.Ks.POINTER_UP,ob),!0}},{key:"isASelectedElement",value:function(Ba){return null!=
Ba&&this.state.selectedElementIds[Ba.id]}},{key:"isHittingCommonBoundingBoxOfSelectedElements",value:function(Ba,Ha){if(2>Ha.length)return!1;var Va=10/this.state.zoom.value;Ha=ia(Bg(Ha),4);var Ya=Ha[1],ob=Ha[2],Bb=Ha[3];return Ba.x>Ha[0]-Va&&Ba.x<ob+Va&&Ba.y>Ya-Va&&Ba.y<Bb+Va}},{key:"onKeyDownFromPointerDownHandler",value:function(Ba){var Ha=this;return ag(function(Va){Ha.maybeHandleResize(Ba,Va)||Ha.maybeDragNewGenericElement(Ba,Va)})}},{key:"onKeyUpFromPointerDownHandler",value:function(Ba){var Ha=
this;return ag(function(Va){"Alt"===Va.key&&Va.preventDefault();Ha.maybeHandleResize(Ba,Va)||Ha.maybeDragNewGenericElement(Ba,Va)})}},{key:"onPointerMoveFromPointerDownHandler",value:function(Ba){var Ha=this;return ag(function(Va){if(null===Ba.drag.offset&&(Ba.drag.offset=Hj(function(qd,Hd,He){qd=ia(Bg(qd),2);return[Hd-qd[0],He-qd[1]]}(Sf(Ha.scene.getElements(),Ha.state),Ba.origin.x,Ba.origin.y))),Va.target instanceof HTMLElement&&!Ha.handlePointerMoveOverScrollbars(Va,Ba)){var Ya=hh(Va,Ha.state),
ob=ia(Dh(Ya.x,Ya.y,Ha.state.gridSize),2),Bb=ob[0];ob=ob[1];if(Ba.drag.hasOccurred||"arrow"!==Ha.state.elementType&&"line"!==Ha.state.elementType||!(Math.hypot(Ba.origin.x-Ya.x,Ba.origin.y-Ya.y)<yc.f)){if(Ba.resize.isResizing&&(Ba.lastCoords.x=Ya.x,Ba.lastCoords.y=Ya.y,Ha.maybeHandleResize(Ba,Va)))return!0;if(Ha.state.editingLinearElement&&dd.handlePointDragging(Ha.state,function(qd){return Ha.setState(qd)},Ya.x,Ya.y,function(qd,Hd){Ha.maybeSuggestBindingForLinearElementAtCursor(qd,Hd,Ya)}))return Ba.lastCoords.x=
Ya.x,void(Ba.lastCoords.y=Ya.y);if(Ba.hit.allHitElements.some(function(qd){return Ha.isASelectedElement(qd)})||Ba.hit.hasHitCommonBoundingBoxOfSelectedElements){Ba.drag.hasOccurred=!0;var Rb=Sf(Ha.scene.getElements(),Ha.state);if(0<Rb.length&&!Ba.withCmdOrCtrl){ob=ia(Dh(Ya.x-Ba.drag.offset.x,Ya.y-Ba.drag.offset.y,Ha.state.gridSize),2);Bb=ob[0];ob=ob[1];var ic=[Math.abs(Ya.x-Ba.origin.x),Math.abs(Ya.y-Ba.origin.y)];if(function(qd,Hd,He,Tg,ni){var Bi=5<arguments.length&&void 0!==arguments[5]&&arguments[5],
pf=6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,ye=7<arguments.length&&void 0!==arguments[7]?arguments[7]:0,Mg=ia(Bg(Hd),2),Wi=He-Mg[0],rk=Tg-Mg[1];Hd.forEach(function(El){if(Bi){var Fl=Bi&&pf<ye;var Mf=Bi&&pf>ye;var wg=qd.originalElements.get(El.id);Fl=Fl&&wg?wg.x:El.x+Wi;Mf=Mf&&wg?wg.y:El.y+rk}else Fl=El.x+Wi,Mf=El.y+rk;ke(El,{x:Fl,y:Mf});Ei(El,{simultaneouslyUpdated:Hd})})}(Ba,Rb,Bb,ob,Ha.scene,Va.shiftKey,ic[0],ic[1]),Ha.maybeSuggestBindingForAll(Rb),Va.altKey&&!Ba.hit.hasBeenDuplicated){Ba.hit.hasBeenDuplicated=
!0;var mc;ic=[];Va=[];var Sc=new Map;Rb=new Map;var Xc=Ba.hit.element,Pc=lj(Ha.scene.getElementsIncludingDeleted());try{for(Pc.s();!(mc=Pc.n()).done;){var Yc=mc.value;if(Ha.state.selectedElementIds[Yc.id]||Yc.id===(null==Xc?void 0:Xc.id)&&Ba.hit.wasAddedToSelection){var Bd=Xj(Ha.state.editingGroupId,Sc,Yc),Xd=ia(Dh(Ba.origin.x-Ba.drag.offset.x,Ba.origin.y-Ba.drag.offset.y,Ha.state.gridSize),2);ke(Bd,{x:Bd.x+(Xd[0]-Bb),y:Bd.y+(Xd[1]-ob)});ic.push(Bd);Va.push(Yc);Rb.set(Yc.id,Bd.id)}else ic.push(Yc)}}catch(qd){Pc.e(qd)}finally{Pc.f()}mc=
[].concat(ic,Va);Tj(mc,Va,Rb,"duplicatesServeAsOld");Ha.scene.replaceAllElements(mc)}return}}if(mc=Ha.state.draggingElement)if("freedraw"===mc.type?(Yc=mc.points,Bd=Ya.x-mc.x,Xd=Ya.y-mc.y,Bb=mc.simulatePressure?mc.pressures:[].concat(ja(mc.pressures),[Va.pressure]),ke(mc,{points:[].concat(ja(Yc),[[Bd,Xd]]),pressures:Bb})):Dg(mc)?(Ba.drag.hasOccurred=!0,Yc=mc.points,Bd=Bb-mc.x,Xd=ob-mc.y,Va.shiftKey&&2===Yc.length&&(Xd=mk(Ha.state.elementType,Bd,Xd),Bd=Xd.width,Xd=Xd.height),1===Yc.length?ke(mc,{points:[].concat(ja(Yc),
[[Bd,Xd]])}):1<Yc.length&&ke(mc,{points:[].concat(ja(Yc.slice(0,-1)),[[Bd,Xd]])}),Xg(mc)&&Ha.maybeSuggestBindingForLinearElementAtCursor(mc,"end",Ya,Ha.state.startBoundElement)):(Ba.lastCoords.x=Ya.x,Ba.lastCoords.y=Ya.y,Ha.maybeDragNewGenericElement(Ba,Va)),"selection"===Ha.state.elementType){Yc=Ha.scene.getElements();!Va.shiftKey&&wh(Yc,Ha.state)&&(Ba.withCmdOrCtrl&&Ba.hit.element?Ha.setState(function(qd){return Me(Wd(Wd({},qd),{},{selectedElementIds:da({},Ba.hit.element.id,!0)}),Ha.scene.getElements())}):
Ha.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}));var kd=function(qd,Hd){Hd=ia(Vf(Hd),4);var He=Hd[0],Tg=Hd[1],ni=Hd[2],Bi=Hd[3];return qd.filter(function(pf){var ye=ia(gk(pf),4),Mg=ye[0],Wi=ye[1],rk=ye[2];ye=ye[3];return"selection"!==pf.type&&He<=Mg&&Tg<=Wi&&ni>=rk&&Bi>=ye})}(Yc,mc);Ha.setState(function(qd){return Me(Wd(Wd({},qd),{},{selectedElementIds:Wd(Wd(Wd({},qd.selectedElementIds),kd.reduce(function(Hd,He){return Hd[He.id]=!0,Hd},{})),Ba.hit.element?da({},Ba.hit.element.id,
!kd.length):null)}),Ha.scene.getElements())})}}}})}},{key:"handlePointerMoveOverScrollbars",value:function(Ba,Ha){return Ha.scrollbars.isOverHorizontal?(Ba=Ba.clientX,this.setState({scrollX:this.state.scrollX-(Ba-Ha.lastCoords.x)/this.state.zoom.value}),Ha.lastCoords.x=Ba,!0):Ha.scrollbars.isOverVertical?(Ba=Ba.clientY,this.setState({scrollY:this.state.scrollY-(Ba-Ha.lastCoords.y)/this.state.zoom.value}),Ha.lastCoords.y=Ba,!0):!1}},{key:"onPointerUpFromPointerDownHandler",value:function(Ba){var Ha=
this;return ag(function(Va){var Ya=Ha.state,ob=Ya.draggingElement,Bb=Ya.resizingElement,Rb=Ya.multiElement,ic=Ya.elementType,mc=Ya.elementLocked,Sc=Ya.isResizing;Ya=Ya.isRotating;if(Ha.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:Rb||Yg(Ha.state.editingElement)?Ha.state.editingElement:null}),Ha.savePointer(Va.clientX,Va.clientY,"up"),Ha.state.editingLinearElement){var Xc=dd.handlePointerUp(Va,Ha.state.editingLinearElement,Ha.state);
Xc!==Ha.state.editingLinearElement&&Ha.setState({editingLinearElement:Xc,suggestedBindings:[]})}if(mo=null,window.removeEventListener(yc.Ks.POINTER_MOVE,Ba.eventListeners.onMove),window.removeEventListener(yc.Ks.POINTER_UP,Ba.eventListeners.onUp),window.removeEventListener(yc.Ks.KEYDOWN,Ba.eventListeners.onKeyDown),window.removeEventListener(yc.Ks.KEYUP,Ba.eventListeners.onKeyUp),"freedraw"===(null==ob?void 0:ob.type))return ic=hh(Va,Ha.state),Rb=ob.points,mc=ic.x-ob.x,ic=ic.y-ob.y,mc===Rb[0][0]&&
ic===Rb[0][1]&&(ic+=1E-4,mc+=1E-4),Va=ob.simulatePressure?[]:[].concat(ja(ob.pressures),[Va.pressure]),ke(ob,{points:[].concat(ja(Rb),[[mc,ic]]),pressures:Va}),void Ha.actionManager.executeAction($f);if(Dg(ob))1<ob.points.length&&Ha.history.resumeRecording(),Va=hh(Va,Ha.state),Ba.drag.hasOccurred||!ob||Rb?Ba.drag.hasOccurred&&!Rb&&(Ha.state.isBindingEnabled&&Xg(ob)&&ng(ob,Ha.state,Ha.scene,Va),Ha.setState({suggestedBindings:[],startBoundElement:null}),mc?Ha.setState(function(Bd){return{draggingElement:null,
selectedElementIds:Wd(Wd({},Bd.selectedElementIds),{},da({},Ha.state.draggingElement.id,!0))}}):(Pi(Ha.canvas),Ha.setState(function(Bd){return{draggingElement:null,elementType:"selection",selectedElementIds:Wd(Wd({},Bd.selectedElementIds),{},da({},Ha.state.draggingElement.id,!0))}}))):(ke(ob,{points:[].concat(ja(ob.points),[[Va.x-ob.x,Va.y-ob.y]])}),Ha.setState({multiElement:ob,editingElement:Ha.state.draggingElement}));else{if("selection"!==ic&&ob&&Kj(ob))return Ha.scene.replaceAllElements(Ha.scene.getElementsIncludingDeleted().slice(0,
-1)),void Ha.setState({draggingElement:null});ob&&ke(ob,Rj(ob));Bb&&Ha.history.resumeRecording();Bb&&Kj(Bb)&&Ha.scene.replaceAllElements(Ha.scene.getElementsIncludingDeleted().filter(function(Bd){return Bd.id!==Bb.id}));var Pc=Ba.hit.element;if(Pc&&!Ba.drag.hasOccurred&&!Ba.hit.wasAddedToSelection)if(Va.shiftKey)if(Ha.state.selectedElementIds[Pc.id])if(null!=dh(Ha.state,Pc)){var Yc=Pc.groupIds.flatMap(function(Bd){return li(Ha.scene.getElements(),Bd)}).map(function(Bd){return da({},Bd.id,!1)}).reduce(function(Bd,
Xd){return Wd(Wd({},Bd),Xd)},{});Ha.setState(function(Bd){return{selectedGroupIds:Wd(Wd({},Bd.selectedElementIds),Pc.groupIds.map(function(Xd){return da({},Xd,!1)}).reduce(function(Xd,kd){return Wd(Wd({},Xd),kd)},{})),selectedElementIds:Wd(Wd({},Bd.selectedElementIds),Yc)}})}else Ha.setState(function(Bd){return Me(Wd(Wd({},Bd),{},{selectedElementIds:Wd(Wd({},Bd.selectedElementIds),{},da({},Pc.id,!1))}),Ha.scene.getElements())});else Ha.setState(function(Bd){return{selectedElementIds:Wd(Wd({},Bd.selectedElementIds),
{},da({},Pc.id,!0))}});else Ha.setState(function(Bd){return Wd({},Me(Wd(Wd({},Bd),{},{selectedElementIds:da({},Pc.id,!0)}),Ha.scene.getElements()))});Ha.state.editingLinearElement||Ba.drag.hasOccurred||Ha.state.isResizing||!(Pc&&Xi(Pc,Ha.state,Ba.origin.x,Ba.origin.y)||!Pc&&Ba.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!mc&&"freedraw"!==ic&&ob&&Ha.setState(function(Bd){return{selectedElementIds:Wd(Wd({},Bd.selectedElementIds),{},da({},ob.id,!0))}}),("selection"!==ic||wh(Ha.scene.getElements(),
Ha.state))&&Ha.history.resumeRecording(),(Ba.drag.hasOccurred||Sc||Ya)&&(Ha.state.isBindingEnabled?If:yd)(Sf(Ha.scene.getElements(),Ha.state)),mc||"freedraw"===ic?Ha.setState({draggingElement:null,suggestedBindings:[]}):(Pi(Ha.canvas),Ha.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):Ha.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}})}},{key:"maybeSuggestBindingForAll",value:function(Ba){var Ha;Ba=(Ha=new Set(Ba.map(function(Va){return Va.id})),
Ba.flatMap(function(Va){return Xg(Va)?zg(Va).filter(function(Ya){return!Ha.has(Ya.id)}):Ze(Va)?zf(Va).filter(function(Ya){return!Ha.has(Ya[0].id)}):[]}));this.setState({suggestedBindings:Ba})}},{key:"clearSelection",value:function(Ba){this.setState(function(Ha){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:Ha.editingGroupId&&null!=Ba&&Ba.groupIds.includes(Ha.editingGroupId)?Ha.editingGroupId:null}});this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}},
{key:"getTextWysiwygSnappedToCenterPosition",value:function(Ba,Ha,Va,Ya,ob){if(ob=function(Bb,Rb,ic){for(var mc=null,Sc=Bb.length-1;0<=Sc;--Sc)if(!Bb[Sc].isDeleted){var Xc=ia(Vf(Bb[Sc]),4),Pc=Xc[1],Yc=Xc[2],Bd=Xc[3];if(Xc[0]<Rb&&Rb<Yc&&Pc<ic&&ic<Bd){mc=Bb[Sc];break}}return mc}(this.scene.getElementsIncludingDeleted().filter(function(Bb){return!Yg(Bb)}),Ba,Ha))if(Ya=ob.x+ob.width/2,ob=ob.y+ob.height/2,Math.hypot(Ba-Ya,Ha-ob)<yc.wZ)return Ba=hk({sceneX:Ya,sceneY:ob},Va),{viewportX:Ba.x,viewportY:Ba.y,
elementCenterX:Ya,elementCenterY:ob}}},{key:"getCanvasOffsets",value:function(){var Ba;return null!==(Ba=this.excalidrawContainerRef)&&void 0!==Ba&&Ba.current?(Ba=this.excalidrawContainerRef.current.getBoundingClientRect(),{offsetLeft:Ba.left,offsetTop:Ba.top}):{offsetLeft:0,offsetTop:0}}},{key:"updateLanguage",value:(sa=(0,ff.Z)(Yd().mark(function Ha(){var Va,Ya=this;return Yd().wrap(function(ob){for(;;)switch(ob.prev=ob.next){case 0:return Va=bk.find(function(Bb){return Bb.code===Ya.props.langCode})||
Wg,ob.next=3,tg(Va);case 3:this.setAppState({});case 4:case "end":return ob.stop()}},Ha,this)})),function(){return sa.apply(this,arguments)})}],[{key:"resetTapTwice",value:function(){Bq=!1}}]),na}(ce().Component);ks.defaultProps={UIOptions:yc.cW};var Ru=function(){var z=this;this.rc=this.canvas=null;this.isMobile=this.unmounted=!1;this.excalidrawContainerRef=ce().createRef();this.focusContainer=function(){var na;z.props.autoFocus&&(null===(na=z.excalidrawContainerRef.current)||void 0===na||na.focus())};
this.getSceneElementsIncludingDeleted=function(){return z.scene.getElementsIncludingDeleted()};this.getSceneElements=function(){return z.scene.getElements()};this.syncActionResult=ag(function(na){if(!z.unmounted&&!1!==na){var sa=null;if(na.elements&&(na.elements.forEach(function(mc){var Sc;(null===(Sc=z.state.editingElement)||void 0===Sc?void 0:Sc.id)===mc.id&&z.state.editingElement!==mc&&!mc.isDeleted&&(sa=mc)}),z.scene.replaceAllElements(na.elements),na.commitToHistory&&z.history.resumeRecording()),
na.appState||sa){var ha,va,Aa,Ba,Ha,Va;na.commitToHistory&&z.history.resumeRecording();var Ya=(null==na||null===(ha=na.appState)||void 0===ha?void 0:ha.viewModeEnabled)||!1,ob=(null==na||null===(va=na.appState)||void 0===va?void 0:va.zenModeEnabled)||!1,Bb=(null==na||null===(Aa=na.appState)||void 0===Aa?void 0:Aa.gridSize)||null,Rb=(null==na||null===(Ba=na.appState)||void 0===Ba?void 0:Ba.theme)||"light",ic=null!==(Ha=null==na||null===(Va=na.appState)||void 0===Va?void 0:Va.name)&&void 0!==Ha?Ha:
z.state.name;void 0!==z.props.viewModeEnabled&&(Ya=z.props.viewModeEnabled);void 0!==z.props.zenModeEnabled&&(ob=z.props.zenModeEnabled);void 0!==z.props.gridModeEnabled&&(Bb=z.props.gridModeEnabled?yc.k:null);void 0!==z.props.theme&&(Rb=z.props.theme);void 0!==z.props.name&&(ic=z.props.name);z.setState(function(mc){var Sc;return Object.assign(na.appState||{},{editingElement:sa||(null===(Sc=na.appState)||void 0===Sc?void 0:Sc.editingElement)||null,viewModeEnabled:Ya,zenModeEnabled:ob,gridSize:Bb,
theme:Rb,name:ic})},function(){na.syncHistory&&z.history.setCurrentState(z.state,z.scene.getElementsIncludingDeleted())})}}});this.onBlur=ag(function(){ap=!1;z.setState({isBindingEnabled:!0})});this.onUnload=function(){z.onBlur()};this.disableEvent=function(na){na.preventDefault()};this.onFontLoaded=function(){z.scene.getElementsIncludingDeleted().forEach(function(na){Yg(na)&&kh.delete(na)});z.onSceneUpdated()};this.importLibraryFromUrl=function(){var na=(0,ff.Z)(Yd().mark(function Aa(ha,va){var Ba,
Ha,Va,Ya,ob;return Yd().wrap(function(Bb){for(;;)switch(Bb.prev=Bb.next){case 0:return window.location.hash.includes(yc.ah.addLibrary)?((Ba=new URLSearchParams(window.location.hash.slice(1))).delete(yc.ah.addLibrary),window.history.replaceState({},yc.iC,"#".concat(Ba.toString()))):window.location.search.includes(yc.UO.addLibrary)&&((Ha=new URLSearchParams(window.location.search)).delete(yc.UO.addLibrary),window.history.replaceState({},yc.iC,"?".concat(Ha.toString()))),Bb.prev=1,Bb.next=4,fetch(decodeURIComponent(ha));
case 4:return Va=Bb.sent,Bb.next=7,Va.blob();case 7:return Ya=Bb.sent,Bb.t0=JSON,Bb.next=11,Ya.text();case 11:Bb.t1=Bb.sent;var Rb=ob=Bb.t0.parse.call(Bb.t0,Bb.t1);if("object"===G(Rb)&&Rb&&Rb.type===yc.r8.excalidrawLibrary&&1===Rb.version){Bb.next=15;break}throw Error();case 15:if(va!==z.id&&!window.confirm(Wb("alerts.confirmAddLibrary",{numShapes:ob.library.length}))){Bb.next=20;break}return Bb.next=18,z.library.importLibrary(Ya);case 18:z.state.isLibraryOpen&&z.setState({isLibraryOpen:!1}),z.setState({isLibraryOpen:!0});
case 20:Bb.next=26;break;case 22:Bb.prev=22,Bb.t2=Bb.catch(1),window.alert(Wb("alerts.errorLoadingLibrary")),console.error(Bb.t2);case 26:return Bb.prev=26,z.focusContainer(),Bb.finish(26);case 29:case "end":return Bb.stop()}},Aa,null,[[1,22,26,29]])}));return function(ha,va){return na.apply(this,arguments)}}();this.resetHistory=function(){z.history.clear()};this.resetScene=ag(function(na){z.scene.replaceAllElements([]);z.setState(function(sa){return Wd(Wd({},Ij()),{},{isLoading:(null==na||!na.resetLoadingState)&&
sa.isLoading,theme:z.state.theme})});z.resetHistory()});this.initializeScene=(0,ff.Z)(Yd().mark(function sa(){var ha,va,Aa,Ba,Ha;return Yd().wrap(function(Va){for(;;)switch(Va.prev=Va.next){case 0:return"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var Ya=(0,ff.Z)(Yd().mark(function Rb(Bb){var ic,mc;return Yd().wrap(function(Sc){for(;;)switch(Sc.prev=Sc.next){case 0:if(Bb.files.length){Sc.next=2;break}return Sc.abrupt("return");case 2:return ic=Bb.files[0],
Sc.next=5,ic.getFile();case 5:(mc=Sc.sent).handle=ic,vl(mc,z.state,z.scene.getElementsIncludingDeleted()).then(function(Xc){return z.syncActionResult({elements:Xc.elements,appState:Wd(Wd({},Xc.appState||z.state),{},{isLoading:!1}),commitToHistory:!0})}).catch(function(Xc){z.setState({isLoading:!1,errorMessage:Xc.message})});case 8:case "end":return Sc.stop()}},Rb)}));return function(Bb){return Ya.apply(this,arguments)}}()),z.state.isLoading||z.setState({isLoading:!0}),va=null,Va.prev=3,Va.next=6,
z.props.initialData;case 6:if(Va.t0=Va.sent,Va.t0){Va.next=9;break}Va.t0=null;case 9:va=Va.t0;null!==(Aa=va)&&void 0!==Aa&&Aa.libraryItems&&(z.libraryItemsFromStorage=va.libraryItems);Va.next=17;break;case 13:Va.prev=13,Va.t1=Va.catch(3),console.error(Va.t1),va={appState:{errorMessage:Va.t1.message||"Encountered an error during importing or restoring scene data"}};case 17:if((Ba=Tm(va,null,null)).appState=Wd(Wd({},Ba.appState),{},{isLoading:!1}),null!==(ha=va)&&void 0!==ha&&ha.scrollToContent&&(Ba.appState=
Wd(Wd({},Ba.appState),Fg(Ba.elements,Wd(Wd({},Ba.appState),{},{width:z.state.width,height:z.state.height,offsetTop:z.state.offsetTop,offsetLeft:z.state.offsetLeft})))),z.resetHistory(),z.syncActionResult(Wd(Wd({},Ba),{},{commitToHistory:!0})),!(Ha=(new URLSearchParams(window.location.hash.slice(1))).get(yc.ah.addLibrary)||(new URLSearchParams(window.location.search)).get(yc.UO.addLibrary))){Va.next=26;break}return Va.next=26,z.importLibraryFromUrl(Ha);case 26:case "end":return Va.stop()}},sa,null,
[[3,13]])}));this.onResize=ag(function(){z.scene.getElementsIncludingDeleted().forEach(function(sa){return kh.delete(sa)});z.setState({})});this.onScroll=Sm(function(){var sa=z.getCanvasOffsets(),ha=sa.offsetTop,va=sa.offsetLeft;z.setState(function(Aa){return Aa.offsetLeft===va&&Aa.offsetTop===ha?null:{offsetTop:ha,offsetLeft:va}})},yc.HM);this.onCut=ag(function(sa){var ha;(null===(ha=z.excalidrawContainerRef.current)||void 0===ha?0:ha.contains(document.activeElement))&&!Dj(sa.target)&&(z.cutAll(),
sa.preventDefault())});this.onCopy=ag(function(sa){var ha;(null===(ha=z.excalidrawContainerRef.current)||void 0===ha?0:ha.contains(document.activeElement))&&!Dj(sa.target)&&(z.copyAll(),sa.preventDefault())});this.cutAll=function(){z.copyAll();z.actionManager.executeAction(hn)};this.copyAll=function(){fc(z.scene.getElements(),z.state)};this.onTapStart=function(sa){if(!Bq)return Bq=!0,clearTimeout(ls),void(ls=window.setTimeout(ks.resetTapTwice,yc.Gj));if(Bq&&1===sa.touches.length){var ha=ia(sa.touches,
1)[0];z.handleCanvasDoubleClick({clientX:ha.clientX,clientY:ha.clientY});Bq=!1;clearTimeout(ls)}sa.preventDefault();2===sa.touches.length&&z.setState({selectedElementIds:{}})};this.onTapEnd=function(sa){0<sa.touches.length&&z.setState({previousSelectedElementIds:{},selectedElementIds:z.state.previousSelectedElementIds})};this.pasteFromClipboard=ag(function(){var sa=(0,ff.Z)(Yd().mark(function Aa(va){var Ba,Ha,Va,Ya;return Yd().wrap(function(ob){for(;;)switch(ob.prev=ob.next){case 0:if(Ha=document.activeElement,
null===(Ba=z.excalidrawContainerRef.current)||void 0===Ba?void 0:Ba.contains(Ha)){ob.next=4;break}return ob.abrupt("return");case 4:if(Va=document.elementFromPoint(Jp,Kp),!va||Va instanceof HTMLCanvasElement&&!Dj(Ha)){ob.next=7;break}return ob.abrupt("return");case 7:return ob.next=9,Nf(va);case 9:if(Ya=ob.sent,!z.props.onPaste){ob.next=22;break}return ob.prev=11,ob.next=14,z.props.onPaste(Ya,va);case 14:if(ob.t0=ob.sent,!1!==ob.t0){ob.next=17;break}return ob.abrupt("return");case 17:ob.next=22;break;
case 19:ob.prev=19,ob.t1=ob.catch(11),console.error(ob.t1);case 22:Ya.errorMessage?z.setState({errorMessage:Ya.errorMessage}):Ya.spreadsheet?z.setState({pasteDialog:{data:Ya.spreadsheet,shown:!0}}):Ya.elements?z.addElementsFromPasteOrLibrary({elements:Ya.elements,position:"cursor"}):Ya.text&&z.addTextFromPaste(Ya.text),z.selectShapeTool("selection"),null==va||va.preventDefault();case 25:case "end":return ob.stop()}},Aa,null,[[11,19]])}));return function(va){return sa.apply(this,arguments)}}());this.addElementsFromPasteOrLibrary=
function(sa){var ha=sl(sa.elements,null),va=ia(Bg(ha),4),Aa=va[0],Ba=va[1],Ha=Math.abs(Aa-va[2])/2;va=Math.abs(Ba-va[3])/2;var Va="object"===G(sa.position)?sa.position.clientX:"cursor"===sa.position?Jp:z.state.width/2+z.state.offsetLeft;sa="object"===G(sa.position)?sa.position.clientY:"cursor"===sa.position?Kp:z.state.height/2+z.state.offsetTop;sa=hh({clientX:Va,clientY:sa},z.state);Ha=sa.x-Ha;va=sa.y-va;var Ya=new Map;Ha=ia(Dh(Ha,va,z.state.gridSize),2);var ob=Ha[0],Bb=Ha[1],Rb=new Map;Ha=ha.map(function(ic){var mc=
Xj(z.state.editingGroupId,Ya,ic,{x:ic.x+ob-Aa,y:ic.y+Bb-Ba});return Rb.set(ic.id,mc.id),mc});va=[].concat(ja(z.scene.getElementsIncludingDeleted()),ja(Ha));Tj(va,ha,Rb);z.scene.replaceAllElements(va);z.history.resumeRecording();z.setState(Me(Wd(Wd({},z.state),{},{isLibraryOpen:!1,selectedElementIds:Ha.reduce(function(ic,mc){return ic[mc.id]=!0,ic},{}),selectedGroupIds:{}}),z.scene.getElements()));z.selectShapeTool("selection")};this.setAppState=function(sa){z.setState(sa)};this.removePointer=function(sa){"touch"===
sa.pointerType&&no&&(clearTimeout(no),no=0,Dq=!1);zl.delete(sa.pointerId)};this.toggleLock=function(){z.setState(function(sa){return{elementLocked:!sa.elementLocked,elementType:sa.elementLocked?"selection":sa.elementType}})};this.toggleZenMode=function(){z.actionManager.executeAction(ss)};this.toggleStats=function(){z.state.showStats||Lh("dialog","stats");z.actionManager.executeAction(rs)};this.scrollToContent=function(){var sa=0<arguments.length&&void 0!==arguments[0]?arguments[0]:z.scene.getElements();
z.setState(Wd({},Fg(Array.isArray(sa)?sa:[sa],z.state,z.canvas)))};this.clearToast=function(){z.setState({toastMessage:null})};this.setToastMessage=function(sa){z.setState({toastMessage:sa})};this.restoreFileFromShare=(0,ff.Z)(Yd().mark(function ha(){var va,Aa,Ba;return Yd().wrap(function(Ha){for(;;)switch(Ha.prev=Ha.next){case 0:return Ha.prev=0,Ha.next=3,caches.open("web-share-target");case 3:return va=Ha.sent,Ha.next=6,va.match("shared-file");case 6:if(!(Aa=Ha.sent)){Ha.next=15;break}return Ha.next=
10,Aa.blob();case 10:return Ba=Ha.sent,z.loadFileToCanvas(Ba),Ha.next=14,va.delete("shared-file");case 14:window.history.replaceState(null,yc.iC,window.location.pathname);case 15:Ha.next=20;break;case 17:Ha.prev=17,Ha.t0=Ha.catch(0),z.setState({errorMessage:Ha.t0.message});case 20:case "end":return Ha.stop()}},ha,null,[[0,17]])}));this.updateScene=ag(function(ha){ha.commitToHistory&&z.history.resumeRecording();ha.appState&&z.setState(ha.appState);ha.elements&&z.scene.replaceAllElements(ha.elements);
ha.collaborators&&z.setState({collaborators:ha.collaborators})});this.onSceneUpdated=function(){z.setState({})};this.updateCurrentCursorPosition=ag(function(ha){Jp=ha.clientX;Kp=ha.clientY});this.onKeyDown=ag(function(ha){var va;if(!(("Proxy"in window&&(!ha.shiftKey&&/^[A-Z]$/.test(ha.key)||ha.shiftKey&&/^[a-z]$/.test(ha.key))&&(ha=new Proxy(ha,{get:function(Va,Ya){var ob=Va[Ya];return"function"==typeof ob?ob.bind(Va):"key"===Ya?ha.shiftKey?Va.key.toUpperCase():Va.key.toLowerCase():ob}})),Dj(ha.target)&&
"Escape"!==ha.key||oh(ha.key)&&(va=ha.target,va instanceof HTMLElement&&"wysiwyg"===va.dataset.type||va instanceof HTMLBRElement||va instanceof HTMLInputElement||va instanceof HTMLTextAreaElement||va instanceof HTMLSelectElement))||("?"===ha.key&&z.setState({showHelpDialog:!0}),z.actionManager.handleKeyDown(ha)||z.state.viewModeEnabled))){if(ha[Af]&&z.state.isBindingEnabled&&z.setState({isBindingEnabled:!1}),"Digit9"===ha.code&&z.setState({isLibraryOpen:!z.state.isLibraryOpen}),oh(ha.key)){va=z.state.gridSize&&
(ha.shiftKey?yc.$e:z.state.gridSize)||(ha.shiftKey?yc.Iw:yc.$e);var Aa=z.scene.getElements().filter(function(Va){return z.state.selectedElementIds[Va.id]}),Ba=0,Ha=0;"ArrowLeft"===ha.key?Ba=-va:"ArrowRight"===ha.key?Ba=va:"ArrowUp"===ha.key?Ha=-va:"ArrowDown"===ha.key&&(Ha=va);Aa.forEach(function(Va){ke(Va,{x:Va.x+Ba,y:Va.y+Ha});Ei(Va,{simultaneouslyUpdated:Aa})});z.maybeSuggestBindingForAll(Aa);ha.preventDefault()}else if("Enter"===ha.key)if(va=Sf(z.scene.getElements(),z.state),1===va.length&&Dg(va[0]))z.state.editingLinearElement&&
z.state.editingLinearElement.elementId===va[0].id||(z.history.resumeRecording(),z.setState({editingLinearElement:new dd(va[0],z.scene)}));else{if(1===va.length&&!Dg(va[0]))return va=va[0],z.startTextEditing({sceneX:va.x+va.width/2,sceneY:va.y+va.height/2}),void ha.preventDefault()}else ha.ctrlKey||ha.altKey||ha.metaKey||null!==z.state.draggingElement||((va=function(Va){var Ya=xt.find(function(ob,Bb){return Va===(Bb+1).toString()||("string"==typeof ob.key?ob.key===Va:ob.key.includes(Va))});return(null==
Ya?void 0:Ya.value)||null}(ha.key))?z.selectShapeTool(va):"q"===ha.key&&z.toggleLock());if(" "===ha.key&&0===zl.size&&(ap=!0,zi(z.canvas,yc.oc.GRABBING)),"g"===ha.key||"s"===ha.key)if(va=Sf(z.scene.getElements(),z.state),"selection"!==z.state.elementType||va.length)"g"===ha.key&&(Qk(z.state.elementType)||va.some(function(Va){return Qk(Va.type)}))&&z.setState({openPopup:"backgroundColorPicker"}),"s"===ha.key&&z.setState({openPopup:"strokeColorPicker"})}});this.onKeyUp=ag(function(ha){if(" "===ha.key&&
(z.state.viewModeEnabled?zi(z.canvas,yc.oc.GRAB):"selection"===z.state.elementType?Pi(z.canvas):(si(z.canvas,z.state.elementType),z.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),ap=!1),ha[Af]||z.state.isBindingEnabled||z.setState({isBindingEnabled:!0}),oh(ha.key))ha=Sf(z.scene.getElements(),z.state),z.state.isBindingEnabled?If(ha):yd(ha),z.setState({suggestedBindings:[]})});this.onGestureStart=ag(function(ha){ha.preventDefault();z.setState({selectedElementIds:{}});Hp=
z.state.zoom.value});this.onGestureChange=ag(function(ha){if(ha.preventDefault(),2!==zl.size){var va=Hp;va&&z.setState(function(Aa){var Ba=Aa.zoom,Ha=Aa.offsetLeft;Aa=Aa.offsetTop;return{zoom:ea(ra(va*ha.scale),Ba,{left:Ha,top:Aa},{x:Jp,y:Kp})}})}});this.onGestureEnd=ag(function(ha){ha.preventDefault();z.setState({previousSelectedElementIds:{},selectedElementIds:z.state.previousSelectedElementIds});Hp=null});this.startTextEditing=function(ha){var va=ha.sceneX,Aa=ha.sceneY;ha=ha.insertAtParentCenter;
var Ba=void 0===ha||ha;ha=z.getTextElementAtPosition(va,Aa);Ba=Ba&&z.getTextWysiwygSnappedToCenterPosition(va,Aa,z.state,z.canvas,window.devicePixelRatio);va=ha||Eg({x:Ba?Ba.elementCenterX:va,y:Ba?Ba.elementCenterY:Aa,strokeColor:z.state.currentItemStrokeColor,backgroundColor:z.state.currentItemBackgroundColor,fillStyle:z.state.currentItemFillStyle,strokeWidth:z.state.currentItemStrokeWidth,strokeStyle:z.state.currentItemStrokeStyle,roughness:z.state.currentItemRoughness,opacity:z.state.currentItemOpacity,
strokeSharpness:z.state.currentItemStrokeSharpness,text:"",fontSize:z.state.currentItemFontSize,fontFamily:z.state.currentItemFontFamily,textAlign:Ba?"center":z.state.currentItemTextAlign,verticalAlign:Ba?"middle":yc.hs});z.setState({editingElement:va});ha?Ba&&"center"===va.textAlign||ke(va,{verticalAlign:yc.hs}):(z.scene.replaceAllElements([].concat(ja(z.scene.getElementsIncludingDeleted()),[va])),Ba||ke(va,{y:va.y-va.baseline/2}));z.setState({editingElement:va});z.handleTextWysiwyg(va,{isExistingElement:!!ha})};
this.handleCanvasDoubleClick=function(ha){if(!z.state.multiElement&&"selection"===z.state.elementType){var va=Sf(z.scene.getElements(),z.state);if(1===va.length&&Dg(va[0]))z.state.editingLinearElement&&z.state.editingLinearElement.elementId===va[0].id||(z.history.resumeRecording(),z.setState({editingLinearElement:new dd(va[0],z.scene)}));else{Pi(z.canvas);var Aa=hh(ha,z.state);va=Aa.x;Aa=Aa.y;if(0<vi(z.state).length){var Ba=z.getElementAtPosition(va,Aa),Ha=Ba&&function(Va,Ya){return Va.groupIds.find(function(ob){return Ya[ob]})}(Ba,
z.state.selectedGroupIds);if(Ha)return void z.setState(function(Va){return Me(Wd(Wd({},Va),{},{editingGroupId:Ha,selectedElementIds:da({},Ba.id,!0),selectedGroupIds:{}}),z.scene.getElements())})}Pi(z.canvas);ha[Af]||z.state.viewModeEnabled||z.startTextEditing({sceneX:va,sceneY:Aa,insertAtParentCenter:!ha.altKey})}}};this.handleCanvasPointerMove=function(ha){z.savePointer(ha.clientX,ha.clientY,z.state.cursorButton);zl.has(ha.pointerId)&&zl.set(ha.pointerId,{x:ha.clientX,y:ha.clientY});var va=Hp;if(2===
zl.size&&Gp&&va&&pr){var Aa=yt(zl),Ba=Aa.x-Gp.x,Ha=Aa.y-Gp.y;Gp=Aa;var Va=zt(Array.from(zl.values()))/pr;z.setState(function(Xc){var Pc=Xc.zoom,Yc=Xc.offsetLeft,Bd=Xc.offsetTop;return{scrollX:Xc.scrollX+Ba/Pc.value,scrollY:Xc.scrollY+Ha/Pc.value,zoom:ea(ra(va*Va),Pc,{left:Yc,top:Bd},Aa),shouldCacheIgnoreZoom:!0}});z.resetShouldCacheIgnoreZoomDebounced()}else Gp=pr=Hp=null;if(!(ap||Cq||ms)){var Ya=Zg(ns,ha.clientX-z.state.offsetLeft,ha.clientY-z.state.offsetTop).isOverEither;z.state.draggingElement||
z.state.multiElement||(Ya?Pi(z.canvas):si(z.canvas,z.state.elementType));var ob=hh(ha,z.state),Bb=ob.x,Rb=ob.y;if(z.state.editingLinearElement&&!z.state.editingLinearElement.isDragging){var ic=dd.handlePointerMove(ha,Bb,Rb,z.state.editingLinearElement,z.state.gridSize);ic!==z.state.editingLinearElement&&z.setState({editingLinearElement:ic});null!=ic.lastUncommittedPoint?z.maybeSuggestBindingAtCursor(ob):z.setState({suggestedBindings:[]})}"arrow"===z.state.elementType&&(ic=z.state.draggingElement,
Xg(ic)?z.maybeSuggestBindingForLinearElementAtCursor(ic,"end",ob,z.state.startBoundElement):z.maybeSuggestBindingAtCursor(ob));if(z.state.multiElement){ha=z.state.multiElement;Ya=ha.x;ob=ha.y;ic=ha.points;var mc=ha.lastCommittedPoint,Sc=ic[ic.length-1];return si(z.canvas,z.state.elementType),void(Sc===mc?Math.hypot(Sc[0]-(Bb-Ya),Sc[1]-(Rb-ob))>=yc.qx?ke(ha,{points:[].concat(ja(ic),[[Bb-Ya,Rb-ob]])}):zi(z.canvas,yc.oc.POINTER):2<ic.length&&mc&&Math.hypot(mc[0]-(Bb-Ya),mc[1]-(Rb-ob))<yc.qx?(zi(z.canvas,
yc.oc.POINTER),ke(ha,{points:ic.slice(0,-1)})):(qj(ic,z.state.zoom.value)&&zi(z.canvas,yc.oc.POINTER),ke(ha,{points:[].concat(ja(ic.slice(0,-1)),[[Bb-Ya,Rb-ob]])})))}if(!(ha.buttons||"selection"!==z.state.elementType&&"text"!==z.state.elementType)){mc=z.scene.getElements();ic=Sf(mc,z.state);if(1!==ic.length||Ya||z.state.editingLinearElement){if(1<ic.length&&!Ya&&(Bb=jj(Bg(ic),Bb,Rb,z.state.zoom,ha.pointerType)))return void zi(z.canvas,le({transformHandleType:Bb}))}else if((Bb=fh(mc,z.state,Bb,Rb,
z.state.zoom,ha.pointerType))&&Bb.transformHandleType)return void zi(z.canvas,le(Bb));Bb=z.getElementAtPosition(ob.x,ob.y);"text"===z.state.elementType?zi(z.canvas,Yg(Bb)?yc.oc.TEXT:yc.oc.CROSSHAIR):z.state.viewModeEnabled?zi(z.canvas,yc.oc.GRAB):Ya||ha[Af]||!Bb&&!z.isHittingCommonBoundingBoxOfSelectedElements(ob,ic)?zi(z.canvas,yc.oc.AUTO):zi(z.canvas,yc.oc.MOVE)}}};this.handleTouchMove=function(ha){Dq=!0};this.handleCanvasPointerDown=function(ha){var va=document.getSelection();if(null!=va&&va.anchorNode&&
va.removeAllRanges(),z.maybeOpenContextMenuAfterPointerDownOnTouchDevices(ha),z.maybeCleanupAfterMissingPointerUp(ha),!(Cq||(z.setState({lastPointerDownWith:ha.pointerType,cursorButton:"down"}),z.savePointer(ha.clientX,ha.clientY,"down"),z.handleCanvasPanUsingWheelOrSpaceDrag(ha)||ha.button!==yc.Oh.MAIN&&ha.button!==yc.Oh.TOUCH||(z.updateGestureOnPointerDown(ha),1<zl.size))))if(va=z.initialPointerDownState(ha),!z.handleDraggingScrollBar(ha,va)&&(z.clearSelectionIfNotUsingSelection(),z.updateBindingEnabledOnPointerMove(ha),
!z.handleSelectionOnPointerDown(ha,va)))if("text"!==z.state.elementType){"arrow"===z.state.elementType||"line"===z.state.elementType?z.handleLinearElementOnPointerDown(ha,z.state.elementType,va):"freedraw"===z.state.elementType?z.handleFreeDrawElementOnPointerDown(ha,z.state.elementType,va):z.createGenericElementOnPointerDown(z.state.elementType,va);ha=z.onPointerMoveFromPointerDownHandler(va);var Aa=z.onPointerUpFromPointerDownHandler(va),Ba=z.onKeyDownFromPointerDownHandler(va),Ha=z.onKeyUpFromPointerDownHandler(va);
mo=Aa;z.state.viewModeEnabled||(window.addEventListener(yc.Ks.POINTER_MOVE,ha),window.addEventListener(yc.Ks.POINTER_UP,Aa),window.addEventListener(yc.Ks.KEYDOWN,Ba),window.addEventListener(yc.Ks.KEYUP,Ha),va.eventListeners.onMove=ha,va.eventListeners.onUp=Aa,va.eventListeners.onKeyUp=Ha,va.eventListeners.onKeyDown=Ba)}else z.handleTextOnPointerDown(ha,va)};this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(ha){"touch"===ha.pointerType&&(Dq=!1,no?Dq=!0:no=window.setTimeout(function(){no=
0;Dq||z.handleCanvasContextMenu(ha)},yc.nM))};this.handleCanvasPanUsingWheelOrSpaceDrag=function(ha){if(0!==zl.size||!(ha.button===yc.Oh.WHEEL||ha.button===yc.Oh.MAIN&&ap||z.state.viewModeEnabled))return!1;Cq=!0;var va=!1,Aa=/Linux/.test(window.navigator.platform);zi(z.canvas,yc.oc.GRABBING);var Ba=ha.clientX,Ha=ha.clientY,Va=ag(function(ob){var Bb=Ba-ob.clientX,Rb=Ha-ob.clientY;if(Ba=ob.clientX,Ha=ob.clientY,Aa&&!va&&(1<Math.abs(Bb)||1<Math.abs(Rb))){va=!0;var ic=function Xc(Sc){document.body.removeEventListener(yc.Ks.PASTE,
Xc);Sc.stopPropagation()};document.body.addEventListener(yc.Ks.PASTE,ic);window.addEventListener(yc.Ks.POINTER_UP,function Xc(){setTimeout(function(){document.body.removeEventListener(yc.Ks.PASTE,ic);window.removeEventListener(yc.Ks.POINTER_UP,Xc)},100)})}z.setState({scrollX:z.state.scrollX-Bb/z.state.zoom.value,scrollY:z.state.scrollY-Rb/z.state.zoom.value})}),Ya=ag(mo=function(){mo=null;Cq=!1;ap||(z.state.viewModeEnabled?zi(z.canvas,yc.oc.GRAB):si(z.canvas,z.state.elementType));z.setState({cursorButton:"up"});
z.savePointer(ha.clientX,ha.clientY,"up");window.removeEventListener(yc.Ks.POINTER_MOVE,Va);window.removeEventListener(yc.Ks.POINTER_UP,Ya);window.removeEventListener(yc.Ks.BLUR,Ya)});return window.addEventListener(yc.Ks.BLUR,Ya),window.addEventListener(yc.Ks.POINTER_MOVE,Va,{passive:!0}),window.addEventListener(yc.Ks.POINTER_UP,Ya),!0};this.clearSelectionIfNotUsingSelection=function(){"selection"!==z.state.elementType&&z.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})};
this.handleSelectionOnPointerDown=function(ha,va){if("selection"===z.state.elementType){var Aa=z.scene.getElements(),Ba=Sf(Aa,z.state);1!==Ba.length||z.state.editingLinearElement?1<Ba.length&&(va.resize.handleType=jj(Bg(Ba),va.origin.x,va.origin.y,z.state.zoom,ha.pointerType)):(Aa=fh(Aa,z.state,va.origin.x,va.origin.y,z.state.zoom,ha.pointerType),null!=Aa&&(z.setState({resizingElement:Aa.element}),va.resize.handleType=Aa.transformHandleType));if(va.resize.handleType)zi(z.canvas,le({transformHandleType:va.resize.handleType})),
va.resize.isResizing=!0,va.resize.offset=Hj(function(Sc,Xc,Pc,Yc){var Bd=ia(1===Xc.length?Vf(Xc[0]):Bg(Xc),4),Xd=Bd[0],kd=Bd[1],qd=Bd[2];Bd=Bd[3];Xc=1===Xc.length?Xc[0].angle:0;Yc=ia(Jf(Pc,Yc,(Xd+qd)/2,(kd+Bd)/2,-Xc),2);switch(Pc=Yc[0],Yc=Yc[1],Sc){case "n":return Jf(Pc-(Xd+qd)/2,Yc-kd,0,0,Xc);case "s":return Jf(Pc-(Xd+qd)/2,Yc-Bd,0,0,Xc);case "w":return Jf(Pc-Xd,Yc-(kd+Bd)/2,0,0,Xc);case "e":return Jf(Pc-qd,Yc-(kd+Bd)/2,0,0,Xc);case "nw":return Jf(Pc-Xd,Yc-kd,0,0,Xc);case "ne":return Jf(Pc-qd,Yc-
kd,0,0,Xc);case "sw":return Jf(Pc-Xd,Yc-Bd,0,0,Xc);case "se":return Jf(Pc-qd,Yc-Bd,0,0,Xc);default:return[0,0]}}(va.resize.handleType,Ba,va.origin.x,va.origin.y)),1===Ba.length&&Dg(Ba[0])&&2===Ba[0].points.length&&(va.resize.arrowDirection=(Ya=va.resize.handleType,ob=Ba[0],Bb=ia(ob.points,2),Rb=ia(Bb[1],2),ic=Rb[0],mc=Rb[1],"nw"===Ya&&(0>ic||0>mc)||"ne"===Ya&&0<=ic||"sw"===Ya&&0>=ic||"se"===Ya&&(0<ic||0<mc)?"end":"origin"));else{var Ha;if(z.state.editingLinearElement&&(Ba=dd.handlePointerDown(ha,
z.state,function(Sc){return z.setState(Sc)},z.history,va.origin),Ba.hitElement&&(va.hit.element=Ba.hitElement),Ba.didAddPoint))return!0;va.hit.element=null!==(Ha=va.hit.element)&&void 0!==Ha?Ha:z.getElementAtPosition(va.origin.x,va.origin.y);va.hit.allHitElements=z.getElementsAtPosition(va.origin.x,va.origin.y);var Va=va.hit.element;Ha=va.hit.allHitElements.some(function(Sc){return z.isASelectedElement(Sc)});if(null!==Va&&Ha||ha.shiftKey||va.hit.hasHitCommonBoundingBoxOfSelectedElements||z.clearSelection(Va),
null!=Va){if(ha[Af])return z.state.selectedElementIds[Va.id]||(va.hit.wasAddedToSelection=!0),z.setState(function(Sc){Sc=rc(rc({},Sc),{},{editingGroupId:Va.groupIds.length?Va.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:da({},Va.id,!0)});return Wd(Wd({},Sc),{},{previousSelectedElementIds:z.state.selectedElementIds})}),!1;z.state.selectedElementIds[Va.id]||(z.state.editingGroupId&&!Va.groupIds.includes(z.state.editingGroupId)&&z.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),
Ha||va.hit.hasHitCommonBoundingBoxOfSelectedElements||(z.setState(function(Sc){return Me(Wd(Wd({},Sc),{},{selectedElementIds:Wd(Wd({},Sc.selectedElementIds),{},da({},Va.id,!0))}),z.scene.getElements())}),va.hit.wasAddedToSelection=!0))}z.setState({previousSelectedElementIds:z.state.selectedElementIds})}}var Ya,ob,Bb,Rb,ic,mc;return!1};this.handleTextOnPointerDown=function(ha,va){var Aa;"text"!==(null===(Aa=z.state.editingElement)||void 0===Aa?void 0:Aa.type)&&(z.startTextEditing({sceneX:va.origin.x,
sceneY:va.origin.y,insertAtParentCenter:!ha.altKey}),Pi(z.canvas),z.state.elementLocked||z.setState({elementType:"selection"}))};this.handleFreeDrawElementOnPointerDown=function(ha,va,Aa){var Ba,Ha=ia(Dh(Aa.origin.x,Aa.origin.y,null),2),Va=(Ba={type:va,x:Ha[0],y:Ha[1],strokeColor:z.state.currentItemStrokeColor,backgroundColor:z.state.currentItemBackgroundColor,fillStyle:z.state.currentItemFillStyle,strokeWidth:z.state.currentItemStrokeWidth,strokeStyle:z.state.currentItemStrokeStyle,roughness:z.state.currentItemRoughness,
opacity:z.state.currentItemOpacity,strokeSharpness:z.state.currentItemLinearStrokeSharpness,simulatePressure:.5===ha.pressure},Tc(Tc({},xm(Ba.type,Ba)),{},{points:Ba.points||[],pressures:[],simulatePressure:Ba.simulatePressure,lastCommittedPoint:null}));z.setState(function(Ya){return{selectedElementIds:Wd(Wd({},Ya.selectedElementIds),{},da({},Va.id,!1))}});ha=Va.simulatePressure?Va.pressures:[].concat(ja(Va.pressures),[ha.pressure]);ke(Va,{points:[[0,0]],pressures:ha});Aa=hg(Aa.origin,z.scene);z.scene.replaceAllElements([].concat(ja(z.scene.getElementsIncludingDeleted()),
[Va]));z.setState({draggingElement:Va,editingElement:Va,startBoundElement:Aa,suggestedBindings:[]})};this.handleLinearElementOnPointerDown=function(ha,va,Aa){if(z.state.multiElement){var Ba=z.state.multiElement;if("line"===Ba.type&&qj(Ba.points,z.state.zoom.value))return ke(Ba,{lastCommittedPoint:Ba.points[Ba.points.length-1]}),void z.actionManager.executeAction($f);va=Ba.x;ha=Ba.y;var Ha=Ba.lastCommittedPoint;if(1<Ba.points.length&&Ha&&Math.hypot(Ha[0]-(Aa.origin.x-va),Ha[1]-(Aa.origin.y-ha))<yc.qx)return void z.actionManager.executeAction($f);
z.setState(function(Bb){return{selectedElementIds:Wd(Wd({},Bb.selectedElementIds),{},da({},Ba.id,!0))}});ke(Ba,{lastCommittedPoint:Ba.points[Ba.points.length-1]});zi(z.canvas,yc.oc.POINTER)}else{Ha=ia(Dh(Aa.origin.x,Aa.origin.y,z.state.gridSize),2);ha=Ha[0];Ha=Ha[1];var Va=z.state,Ya=Va.currentItemStartArrowhead;Va=Va.currentItemEndArrowhead;Ya=ia("arrow"===va?[Ya,Va]:[null,null],2);var ob=Qg({type:va,x:ha,y:Ha,strokeColor:z.state.currentItemStrokeColor,backgroundColor:z.state.currentItemBackgroundColor,
fillStyle:z.state.currentItemFillStyle,strokeWidth:z.state.currentItemStrokeWidth,strokeStyle:z.state.currentItemStrokeStyle,roughness:z.state.currentItemRoughness,opacity:z.state.currentItemOpacity,strokeSharpness:z.state.currentItemLinearStrokeSharpness,startArrowhead:Ya[0],endArrowhead:Ya[1]});z.setState(function(Bb){return{selectedElementIds:Wd(Wd({},Bb.selectedElementIds),{},da({},ob.id,!1))}});ke(ob,{points:[].concat(ja(ob.points),[[0,0]])});Aa=hg(Aa.origin,z.scene);z.scene.replaceAllElements([].concat(ja(z.scene.getElementsIncludingDeleted()),
[ob]));z.setState({draggingElement:ob,editingElement:ob,startBoundElement:Aa,suggestedBindings:[]})}};this.createGenericElementOnPointerDown=function(ha,va){va=ia(Dh(va.origin.x,va.origin.y,z.state.gridSize),2);ha=xf({type:ha,x:va[0],y:va[1],strokeColor:z.state.currentItemStrokeColor,backgroundColor:z.state.currentItemBackgroundColor,fillStyle:z.state.currentItemFillStyle,strokeWidth:z.state.currentItemStrokeWidth,strokeStyle:z.state.currentItemStrokeStyle,roughness:z.state.currentItemRoughness,opacity:z.state.currentItemOpacity,
strokeSharpness:z.state.currentItemStrokeSharpness});"selection"===ha.type?z.setState({selectionElement:ha,draggingElement:ha}):(z.scene.replaceAllElements([].concat(ja(z.scene.getElementsIncludingDeleted()),[ha])),z.setState({multiElement:null,draggingElement:ha,editingElement:ha}))};this.updateBindingEnabledOnPointerMove=function(ha){ha=!ha[Af];z.state.isBindingEnabled!==ha&&z.setState({isBindingEnabled:ha})};this.maybeSuggestBindingAtCursor=function(ha){ha=hg(ha,z.scene);z.setState({suggestedBindings:null!=
ha?[ha]:[]})};this.maybeSuggestBindingForLinearElementAtCursor=function(ha,va,Aa,Ba){va=hg(Aa,z.scene);z.setState({suggestedBindings:null==va||(null==Ba?void 0:Ba.id)===va.id&&3>ha.points.length?[]:[va]})};this.handleCanvasRef=function(ha){var va,Aa,Ba;null!==ha?(z.canvas=ha,z.rc=Bj.canvas(z.canvas),z.canvas.addEventListener(yc.Ks.WHEEL,z.handleWheel,{passive:!1}),z.canvas.addEventListener(yc.Ks.TOUCH_START,z.onTapStart),z.canvas.addEventListener(yc.Ks.TOUCH_END,z.onTapEnd)):(null===(va=z.canvas)||
void 0===va||va.removeEventListener(yc.Ks.WHEEL,z.handleWheel),null===(Aa=z.canvas)||void 0===Aa||Aa.removeEventListener(yc.Ks.TOUCH_START,z.onTapStart),null===(Ba=z.canvas)||void 0===Ba||Ba.removeEventListener(yc.Ks.TOUCH_END,z.onTapEnd))};this.handleAppOnDrop=function(){var ha=(0,ff.Z)(Yd().mark(function Ba(Aa){var Ha,Va,Ya,ob,Bb,Rb,ic,mc,Sc,Xc;return Yd().wrap(function(Pc){for(;;)switch(Pc.prev=Pc.next){case 0:if(Pc.prev=0,"image/png"!==(null==(Ya=Aa.dataTransfer.files[0])?void 0:Ya.type)&&"image/svg+xml"!==
(null==Ya?void 0:Ya.type)){Pc.next=21;break}if(!nm){Pc.next=14;break}return Pc.prev=4,ob=Aa.dataTransfer.items[0],Pc.next=8,ob.getAsFileSystemHandle();case 8:Ya.handle=Pc.sent;Pc.next=14;break;case 11:Pc.prev=11,Pc.t0=Pc.catch(4),console.warn(Pc.t0.name,Pc.t0.message);case 14:return Pc.next=16,vl(Ya,z.state,z.scene.getElementsIncludingDeleted());case 16:return Bb=Pc.sent,Rb=Bb.elements,ic=Bb.appState,z.syncActionResult({elements:Rb,appState:Wd(Wd({},ic||z.state),{},{isLoading:!1}),commitToHistory:!0}),
Pc.abrupt("return");case 21:Pc.next=26;break;case 23:return Pc.prev=23,Pc.t1=Pc.catch(0),Pc.abrupt("return",z.setState({isLoading:!1,errorMessage:Pc.t1.message}));case 26:if(""===(mc=Aa.dataTransfer.getData(yc.LO.excalidrawlib))){Pc.next=30;break}return z.addElementsFromPasteOrLibrary({elements:JSON.parse(mc),position:Aa}),Pc.abrupt("return");case 30:if(!((null==(Sc=null===(Ha=Aa.dataTransfer)||void 0===Ha?void 0:Ha.files[0])?void 0:Sc.type)===yc.LO.excalidrawlib||null!=Sc&&null!==(Va=Sc.name)&&void 0!==
Va&&Va.endsWith(".excalidrawlib"))){Pc.next=35;break}z.library.importLibrary(Sc).then(function(){z.setState({isLibraryOpen:!1});z.setState({isLibraryOpen:!0})}).catch(function(Yc){return z.setState({isLoading:!1,errorMessage:Yc.message})});Pc.next=49;break;case 35:if(z.setState({isLoading:!0}),!nm){Pc.next=47;break}return Pc.prev=37,Xc=Aa.dataTransfer.items[0],Pc.next=41,Xc.getAsFileSystemHandle();case 41:Sc.handle=Pc.sent;Pc.next=47;break;case 44:Pc.prev=44,Pc.t2=Pc.catch(37),console.warn(Pc.t2.name,
Pc.t2.message);case 47:return Pc.next=49,z.loadFileToCanvas(Sc);case 49:case "end":return Pc.stop()}},Ba,null,[[0,23],[4,11],[37,44]])}));return function(Aa){return ha.apply(this,arguments)}}();this.loadFileToCanvas=function(ha){vl(ha,z.state,z.scene.getElementsIncludingDeleted()).then(function(va){return z.syncActionResult({elements:va.elements,appState:Wd(Wd({},va.appState||z.state),{},{isLoading:!1}),commitToHistory:!0})}).catch(function(va){z.setState({isLoading:!1,errorMessage:va.message})})};
this.handleCanvasContextMenu=function(ha){ha.preventDefault();var va=hh(ha,z.state),Aa=(va=z.getElementAtPosition(va.x,va.y,{preferSelected:!0}))?"element":"canvas",Ba=z.excalidrawContainerRef.current.getBoundingClientRect(),Ha=ha.clientX-Ba.left,Va=ha.clientY-Ba.top;va&&!z.state.selectedElementIds[va.id]?z.setState({selectedElementIds:da({},va.id,!0)},function(){z._openContextMenu({top:Va,left:Ha},Aa)}):z._openContextMenu({top:Va,left:Ha},Aa)};this.maybeDragNewGenericElement=function(ha,va){var Aa=
z.state.draggingElement,Ba=ha.lastCoords;if(Aa)if("selection"===Aa.type)Pk(Aa,z.state.elementType,ha.origin.x,ha.origin.y,Ba.x,Ba.y,Math.abs(ha.origin.x-Ba.x),Math.abs(ha.origin.y-Ba.y),va.shiftKey,va.altKey);else{var Ha=ia(Dh(Ba.x,Ba.y,z.state.gridSize),2);Ba=Ha[0];Ha=Ha[1];Pk(Aa,z.state.elementType,ha.originInGrid.x,ha.originInGrid.y,Ba,Ha,Math.abs(ha.originInGrid.x-Ba),Math.abs(ha.originInGrid.y-Ha),va.shiftKey,va.altKey);z.maybeSuggestBindingForAll([Aa])}};this.maybeHandleResize=function(ha,va){var Aa=
Sf(z.scene.getElements(),z.state),Ba=ha.resize.handleType;z.setState({isResizing:Ba&&"rotation"!==Ba,isRotating:"rotation"===Ba});var Ha=ha.lastCoords;Ha=ia(Dh(Ha.x-ha.resize.offset.x,Ha.y-ha.resize.offset.y,z.state.gridSize),2);a:{var Va=ha.resize.arrowDirection,Ya=va.shiftKey,ob=va.altKey,Bb=va.shiftKey;va=Ha[0];var Rb=Ha[1];Ha=ha.resize.center.x;var ic=ha.resize.center.y;if(1===Aa.length){Ha=ia(Aa,1)[0];if("rotation"===Ba)Ba=ia(Vf(Ha),4),Ba=5*Math.PI/2+Math.atan2(Rb-(Ba[1]+Ba[3])/2,va-(Ba[0]+Ba[2])/
2),Ya&&(Ba+=yc.ay/2,Ba-=Ba%yc.ay),Ba=fe(Ba),ke(Ha,{angle:Ba}),Ei(Ha);else if(!Dg(Ha)||2!==Ha.points.length||"nw"!==Ba&&"ne"!==Ba&&"sw"!==Ba&&"se"!==Ba)if(!Yg(Ha)||"nw"!==Ba&&"ne"!==Ba&&"sw"!==Ba&&"se"!==Ba)Ba&&Gi(ha.originalElements.get(Ha.id),Bb,Ha,Ba,ob,va,Rb);else{Ya=ia(Vf(Ha),4);Bb=Ya[0];ha=Ya[1];Va=Ya[2];Ya=Ya[3];Rb=ia(Jf(va,Rb,(Bb+Va)/2,(ha+Ya)/2,-Ha.angle),2);va=Rb[0];Rb=Rb[1];switch(Ba){case "se":var mc=Math.max((va-Bb)/(Va-Bb),(Rb-ha)/(Ya-ha));break;case "nw":mc=Math.max((Va-va)/(Va-Bb),
(Ya-Rb)/(Ya-ha));break;case "ne":mc=Math.max((va-Bb)/(Va-Bb),(Ya-Rb)/(Ya-ha));break;case "sw":mc=Math.max((Va-va)/(Va-Bb),(Rb-ha)/(Ya-ha))}0<mc&&(va=Ha.width*mc,mc*=Ha.height,Rb=fg(Ha,va,mc),null!==Rb&&(ic=ia(Re(Ha,va,mc),4),Bb=(Bb-ic[0])/2,ha=(ha-ic[1])/2,Va=(Va-ic[2])/2,Ya=(Ya-ic[3])/2,Ba={n:/^(n|ne|nw)$/.test(Ba)||ob&&/^(s|se|sw)$/.test(Ba),s:/^(s|se|sw)$/.test(Ba)||ob&&/^(n|ne|nw)$/.test(Ba),w:/^(w|nw|sw)$/.test(Ba)||ob&&/^(e|ne|se)$/.test(Ba),e:/^(e|ne|se)$/.test(Ba)||ob&&/^(w|nw|sw)$/.test(Ba)},
Ba=ia(qi(Ba,Ha.x,Ha.y,Ha.angle,Bb,ha,Va,Ya),2),ke(Ha,{fontSize:Rb.size,width:va,height:mc,baseline:Rb.baseline,x:Ba[0],y:Ba[1]})));Ei(Ha)}else Ba=ia(Vf(Ha),4),ob=ia(Jf(va,Rb,(Ba[0]+Ba[2])/2,(Ba[1]+Ba[3])/2,-Ha.angle),2),Ba=ob[0],ob=ob[1],ob=ia("end"===Va?[Ba-Ha.x,ob-Ha.y]:[Ha.x+Ha.points[1][0]-Ba,Ha.y+Ha.points[1][1]-ob],2),Ba=ob[0],ob=ob[1],Ya&&(mc=Ha.angle,Ba=mk.apply(void 0,[Ha.type].concat(ja(Jf(Ba,ob,0,0,mc)))),Ba=Jf(Ba.width,Ba.height,0,0,-mc),ob=ia(Ba,2),Ba=ob[0],ob=ob[1]),Va=ia(qi("end"===
Va?{s:!0,e:!0}:{n:!0,w:!0},Ha.x,Ha.y,Ha.angle,0,0,(Ha.points[1][0]-Ba)/2,(Ha.points[1][1]-ob)/2),2),ke(Ha,{x:Va[0],y:Va[1],points:[[0,0],[Ba,ob]]});Ha=!0}else{if(1<Aa.length){if("rotation"===Ba){Ha=(Ck(ha,Aa,va,Rb,Ya,Ha,ic),!0);break a}if("nw"===Ba||"ne"===Ba||"sw"===Ba||"se"===Ba){Ha=(Hm(Aa,Ba,va,Rb),!0);break a}}Ha=!1}}return!!Ha&&(z.maybeSuggestBindingForAll(Aa),!0)};this._openContextMenu=function(ha,va){var Aa=ha.left;ha=ha.top;var Ba=Dt.contextItemPredicate(z.actionManager.getElementsIncludingDeleted(),
z.actionManager.getAppState()),Ha=Bt.contextItemPredicate(z.actionManager.getElementsIncludingDeleted(),z.actionManager.getAppState()),Va=Kt.contextItemPredicate(z.actionManager.getElementsIncludingDeleted(),z.actionManager.getAppState()),Ya=Lt.contextItemPredicate(z.actionManager.getElementsIncludingDeleted(),z.actionManager.getAppState()),ob=z.scene.getElements(),Bb=[];(Mb&&0<ob.length&&Bb.push(Ot),ub&&0<ob.length&&Bb.push(Nt),"canvas"===va)?(va=[].concat(Bb,[void 0===z.props.gridModeEnabled&&Pt,
void 0===z.props.zenModeEnabled&&ss,void 0===z.props.viewModeEnabled&&st,rs]),z.state.viewModeEnabled?sr({options:va,top:ha,left:Aa,actionManager:z.actionManager,appState:z.state,container:z.excalidrawContainerRef.current}):sr({options:[z.isMobile&&navigator.clipboard&&{name:"paste",perform:function(Rb,ic){return z.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},z.isMobile&&navigator.clipboard&&"separator",Mb&&0<ob.length&&Ot,ub&&0<ob.length&&Nt,(Mb&&0<ob.length||ub&&
0<ob.length)&&"separator",Ql,"separator",void 0===z.props.gridModeEnabled&&Pt,void 0===z.props.zenModeEnabled&&ss,void 0===z.props.viewModeEnabled&&st,rs],top:ha,left:Aa,actionManager:z.actionManager,appState:z.state,container:z.excalidrawContainerRef.current})):"element"===va&&(z.state.viewModeEnabled?sr({options:[navigator.clipboard&&ts].concat(Bb),top:ha,left:Aa,actionManager:z.actionManager,appState:z.state,container:z.excalidrawContainerRef.current}):sr({options:[z.isMobile&&Gv,z.isMobile&&navigator.clipboard&&
ts,z.isMobile&&navigator.clipboard&&{name:"paste",perform:function(Rb,ic){return z.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},z.isMobile&&"separator"].concat(Bb,["separator",Zf,jn,"separator",Ba&&Dt,Ha&&Bt,(Ba||Ha)&&"separator",Cv,"separator",Gn,Fn,ji,rl,"separator",Va&&Kt,Ya&&Lt,(Va||Ya)&&"separator",Zk,hn]),top:ha,left:Aa,actionManager:z.actionManager,appState:z.state,container:z.excalidrawContainerRef.current}))};this.handleWheel=ag(function(ha){if(ha.preventDefault(),
!Cq){var va=ha.deltaX,Aa=ha.deltaY,Ba=z.state,Ha=Ba.selectedElementIds,Va=Ba.previousSelectedElementIds;if(ha.metaKey||ha.ctrlKey){ha=Math.sign(Aa);Ba=Math.abs(Aa);10<Ba&&(Ba=10);Ba*=ha;0!==Object.keys(Va).length&&setTimeout(function(){z.setState({selectedElementIds:Va,previousSelectedElementIds:{}})},1E3);var Ya=z.state.zoom.value-Ba/100;return Ya+=Math.log10(Math.max(1,z.state.zoom.value))*-ha,Ya=Math.round(Ya*yc.V4*100)/(100*yc.V4),z.setState(function(ob){var Bb=ob.zoom,Rb=ob.offsetLeft;ob=ob.offsetTop;
return{zoom:ea(ra(Ya),Bb,{left:Rb,top:ob},{x:Jp,y:Kp}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(Ha).length?Ha:Va,shouldCacheIgnoreZoom:!0}}),void z.resetShouldCacheIgnoreZoomDebounced()}ha.shiftKey?z.setState(function(ob){return{scrollX:ob.scrollX-(Aa||va)/ob.zoom.value}}):z.setState(function(ob){var Bb=ob.zoom;return{scrollX:ob.scrollX-va/Bb.value,scrollY:ob.scrollY-Aa/Bb.value}})}});this.savePointer=function(ha,va,Aa){var Ba,Ha;ha&&va&&(ha=hh({clientX:ha,clientY:va},z.state),
isNaN(ha.x)||isNaN(ha.y),null===(Ba=(Ha=z.props).onPointerUpdate)||void 0===Ba||Ba.call(Ha,{pointer:ha,button:Aa,pointersMap:zl}))};this.resetShouldCacheIgnoreZoomDebounced=Sm(function(){z.unmounted||z.setState({shouldCacheIgnoreZoom:!1})},300);this.updateDOMRect=function(ha){var va;if(null!==(va=z.excalidrawContainerRef)&&void 0!==va&&va.current){var Aa=z.excalidrawContainerRef.current.getBoundingClientRect();va=Aa.width;var Ba=Aa.height,Ha=Aa.left;Aa=Aa.top;var Va=z.state,Ya=Va.height,ob=Va.offsetTop,
Bb=Va.offsetLeft;if(va===Va.width&&Ba===Ya&&Ha===Bb&&Aa===ob)return void(ha&&ha());z.setState({width:va,height:Ba,offsetLeft:Ha,offsetTop:Aa},function(){ha&&ha()})}};this.refresh=function(){z.setState(Wd({},z.getCanvasOffsets()))}};"production"!==yc.Vi.TEST&&"production"!==yc.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(z){return this.app.scene.replaceAllElements(z)}}}));
e(4285);e(3313);var it=function(z){var na=z.getDimensions,sa=void 0===na?function(Aa,Ba){return{width:Aa,height:Ba,scale:1}}:na;z=Tm({elements:z.elements,appState:z.appState},null,null);na=z.appState;var ha=na.exportBackground,va=na.viewBackgroundColor;return Aq(oe(z.elements),qh(qh({},na),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),{exportBackground:ha,viewBackgroundColor:va},function(Aa,Ba){var Ha=document.createElement("canvas");Aa=sa(Aa,Ba);return Ha.width=Aa.width,Ha.height=Aa.height,{canvas:Ha,
scale:Aa.scale}})},Qu=function(z){var na=it(z),sa=z.mimeType,ha=void 0===sa?"image/png":sa,va=z.quality;return"image/png"===ha&&"number"==typeof va&&console.warn('"quality" will be ignored for "image/png" mimeType'),"image/jpg"===ha&&(ha="image/jpeg"),va=va||(/image\/jpe?g/.test(ha)?.92:.8),new Promise(function(Aa){na.toBlob(function(Ba){Aa(Ba)},ha,va)})},Yv=function(){var z=(0,ff.Z)(Yd().mark(function ha(sa){var va,Aa,Ba,Ha,Va,Ya,ob;return Yd().wrap(function(Bb){for(;;)switch(Bb.prev=Bb.next){case 0:return va=
sa.elements,Aa=sa.appState,Ba=void 0===Aa?Ij():Aa,Ha=sa.exportPadding,Va=Tm({elements:va,appState:Ba},null,null),Ya=Va.elements,ob=Va.appState,Bb.abrupt("return",Ap(oe(Ya),qh(qh({},ob),{},{exportPadding:Ha})));case 3:case "end":return Bb.stop()}},ha)}));return function(sa){return z.apply(this,arguments)}}(),Hv=["initialData","UIOptions"],Iv=["initialData","UIOptions"],Kv=function(z){var na,sa,ha=z.onChange,va=z.initialData,Aa=z.excalidrawRef,Ba=z.onCollabButtonClick,Ha=z.isCollaborating,Va=z.onPointerUpdate,
Ya=z.renderTopRightUI,ob=z.renderFooter,Bb=z.langCode;Bb=void 0===Bb?Wg.code:Bb;var Rb=z.viewModeEnabled,ic=z.zenModeEnabled,mc=z.gridModeEnabled,Sc=z.libraryReturnUrl,Xc=z.theme,Pc=z.name,Yc=z.renderCustomStats,Bd=z.onPaste,Xd=z.detectScroll;Xd=void 0===Xd||Xd;var kd=z.handleKeyboardGlobally;kd=void 0!==kd&&kd;var qd=z.onLibraryChange,Hd=z.autoFocus;Hd=void 0!==Hd&&Hd;z=null===(na=z.UIOptions)||void 0===na?void 0:na.canvasActions;na={canvasActions:km(km({},yc.cW.canvasActions),z)};null!=z&&z.export&&
(na.canvasActions.export.saveFileToDisk=(null===(sa=z.export)||void 0===sa?void 0:sa.saveFileToDisk)||yc.cW.canvasActions.export.saveFileToDisk);return(0,ue.useEffect)(function(){var He=function(Tg){"number"==typeof Tg.scale&&1!==Tg.scale&&Tg.preventDefault()};return document.addEventListener("touchmove",He,{passive:!1}),function(){document.removeEventListener("touchmove",He)}},[]),(0,Sa.jsx)(Rl,{langCode:Bb,children:(0,Sa.jsx)(ks,{onChange:ha,initialData:va,excalidrawRef:Aa,onCollabButtonClick:Ba,
isCollaborating:Ha,onPointerUpdate:Va,renderTopRightUI:Ya,renderFooter:ob,langCode:Bb,viewModeEnabled:Rb,zenModeEnabled:ic,gridModeEnabled:mc,libraryReturnUrl:Sc,theme:Xc,name:Pc,renderCustomStats:Yc,UIOptions:na,onPaste:Bd,detectScroll:Xd,handleKeyboardGlobally:kd,onLibraryChange:qd,autoFocus:Hd})})},Lv=(0,ue.forwardRef)(function(z,na){return(0,Sa.jsx)(Kv,km(km({},z),{},{excalidrawRef:na}))}),Mv=ce().memo(Lv,function(z,na){z.initialData;var sa=z.UIOptions,ha=void 0===sa?{}:sa,va=Xh()(z,Hv);sa=(na.initialData,
na.UIOptions);var Aa=void 0===sa?{}:sa,Ba=Xh()(na,Iv);sa=Object.keys(ha);var Ha=Object.keys(Aa);if(sa.length!==Ha.length)return!1;sa=sa.every(function(Va){"canvasActions"===Va&&Object.keys(ha.canvasActions).every(function(Ya){var ob,Bb,Rb,ic;return"export"===Ya&&null!=ha&&null!==(ob=ha.canvasActions)&&void 0!==ob&&ob.export&&null!=Aa&&null!==(Bb=Aa.canvasActions)&&void 0!==Bb&&Bb.export?ha.canvasActions.export.saveFileToDisk===Aa.canvasActions.export.saveFileToDisk:(null==ha||null===(Rb=ha.canvasActions)||
void 0===Rb?void 0:Rb[Ya])===(null==Aa||null===(ic=Aa.canvasActions)||void 0===ic?void 0:ic[Ya])});return!0});z=Object.keys(z);na=Object.keys(na);return sa&&z.length===na.length&&z.every(function(Va){return va[Va]===Ba[Va]})}),Nv=(e(8336),Mv)},4698:function(u){u.exports=A},6207:function(u){u.exports=n},8950:function(u,m,e){function q(y,E,M,G,B,F,v){try{var T=y[F](v),ca=T.value}catch(W){return void M(W)}T.done?E(ca):Promise.resolve(ca).then(G,B)}function w(y){return function(){var E=this,M=arguments;
return new Promise(function(G,B){function F(ca){q(T,G,B,F,v,"next",ca)}function v(ca){q(T,G,B,F,v,"throw",ca)}var T=y.apply(E,M);F(void 0)})}}e.d(m,{Z:function(){return w}})},1463:function(u){u.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","strokeShape":"Stroke shape","strokeShape_gel":"Gel pen","strokeShape_fountain":"Fountain pen","strokeShape_brush":"Brush pen","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","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"},"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"},"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":"Importing images isn\'t supported at the moment.\\n\\nDid you want to import a scene? This image does not seem to contain any scene data. Have you enabled this 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?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"toolBar":{"selection":"Selection","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":{"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","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, CtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to move or remove, or hold Alt and click to add new points"},"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"},"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":{"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:function(u){u.exports=JSON.parse('{"ar-SA":100,"bg-BG":68,"ca-ES":84,"cs-CZ":29,"da-DK":20,"de-DE":100,"el-GR":74,"en":100,"es-ES":100,"fa-IR":77,"fi-FI":100,"fr-FR":100,"he-IL":99,"hi-IN":67,"hu-HU":60,"id-ID":100,"it-IT":100,"ja-JP":100,"kab-KAB":93,"kk-KZ":26,"ko-KR":68,"lv-LV":14,"my-MM":56,"nb-NO":100,"nl-NL":100,"nn-NO":74,"oc-FR":100,"pa-IN":99,"pl-PL":70,"pt-BR":100,"pt-PT":99,"ro-RO":100,"ru-RU":99,"sk-SK":100,"sv-SE":100,"tr-TR":78,"uk-UA":80,"zh-CN":100,"zh-TW":100}')}},a={};return k.m=
p,k.n=function(u){var m=u&&u.__esModule?function(){return u.default}:function(){return u};return k.d(m,{a:m}),m},f=Object.getPrototypeOf?function(u){return Object.getPrototypeOf(u)}:function(u){return u.__proto__},k.t=function(u,m){if((1&m&&(u=this(u)),8&m)||"object"==typeof u&&u&&(4&m&&u.__esModule||16&m&&"function"==typeof u.then))return u;var e=Object.create(null);k.r(e);var q={};b=b||[null,f({}),f([]),f(f)];for(m=2&m&&u;"object"==typeof m&&!~b.indexOf(m);m=f(m))Object.getOwnPropertyNames(m).forEach(function(w){q[w]=
function(){return u[w]}});return q.default=function(){return u},k.d(e,q),e},k.d=function(u,m){for(var e in m)k.o(m,e)&&!k.o(u,e)&&Object.defineProperty(u,e,{enumerable:!0,get:m[e]})},k.f={},k.e=function(u){return Promise.all(Object.keys(k.f).reduce(function(m,e){return k.f[e](u,m),m},[]))},k.u=function(u){return"excalidraw-assets/"+{9:"image",43:"i18n-de-DE-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",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-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"}[u]+"-"+{9:"02a1f3ecd6baf42daaa6",43:"2984c3ea70efb6a7673c",60:"530261d88e915f413822",62:"93a8203eb30054101fcc",137:"10da607a92dd9ee4b6b1",149:"fb8bc9b15f2d232ce452",164:"72dfe5e520fb843a911e",196:"220f20ddbd7092a3a948",213:"60da00067a54eacae6ea",242:"9c8f0251105b94363a8f",246:"102950eb1c0d17b2be82",262:"c22c852f5d1007b76cfd",280:"b7ad703689a54409b91a",
304:"9b20d01d442a9938174a",317:"770832e8199e76bcea31",351:"6f613ec62c184eed761c",364:"7e2c395dc072fbeb4dc8",381:"5eb00d985874b4016992",384:"63af3f6053ca50d0c1a3",387:"c485bdbc1ad44e51f1f1",401:"4fc55e97187d84b3e35f",465:"55de4a420bc2799d63ac",472:"1856fe5f0aa5f6733c71",491:"36ef4139fdc39bd473e9",526:"ef1babaff2ea7b0ca48c",558:"a98b3a07a69a56aa6ddc",565:"3fb584025bb45201012f",583:"3398bd8076ace43903a4",617:"fdc74fe43abb7f09253d",649:"72a00814a5ea1bc1bd4d",661:"2173dae4a84d3f943a3d",698:"5fd1ff062cab18b6c3ec",
710:"5d17bed42e8aa3e26778",736:"881ef50682618d9bd3d3",752:"dc651de2037f6a904212",852:"589514e9da02be71829e",869:"1620932d8cf3b49dbac7",899:"efdf3550b88b63639a73",920:"5b64fbe09ec2fdc5c686",933:"3577c3ff017e2af147ee"}[u]+".js"},k.o=function(u,m){return Object.prototype.hasOwnProperty.call(u,m)},h={},k.l=function(u,m,e,q){if(h[u])h[u].push(m);else{var w;if(void 0!==e){q=document.getElementsByTagName("script");for(var y=0;y<q.length;y++){var E=q[y];if(E.getAttribute("src")==u||E.getAttribute("data-webpack")==
"Excalidraw:"+e){var M=E;break}}}M||(w=!0,(M=document.createElement("script")).charset="utf-8",M.timeout=120,k.nc&&M.setAttribute("nonce",k.nc),M.setAttribute("data-webpack","Excalidraw:"+e),M.src=u);h[u]=[m];m=function(B,F){M.onerror=M.onload=null;clearTimeout(G);var v=h[u];if(delete h[u],M.parentNode&&M.parentNode.removeChild(M),v&&v.forEach(function(T){return T(F)}),B)return B(F)};var G=setTimeout(m.bind(null,void 0,{type:"timeout",target:M}),12E4);M.onerror=m.bind(null,M.onerror);M.onload=m.bind(null,
M.onload);w&&document.head.appendChild(M)}},k.r=function(u){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"});Object.defineProperty(u,"__esModule",{value:!0})},k.p="",function(){var u={388:0};k.f.j=function(q,w){var y=k.o(u,q)?u[q]:void 0;if(0!==y)if(y)w.push(y[2]);else{var E=new Promise(function(G,B){y=u[q]=[G,B]});w.push(y[2]=E);w=k.p+k.u(q);var M=Error();k.l(w,function(G){if(k.o(u,q)&&(0!==(y=u[q])&&(u[q]=void 0),y)){var B=G&&("load"===
G.type?"missing":G.type);G=G&&G.target&&G.target.src;M.message="Loading chunk "+q+" failed.\n("+B+": "+G+")";M.name="ChunkLoadError";M.type=B;M.request=G;y[1](M)}},"chunk-"+q,q)}};var m=function(q,w){var y,E=w[0],M=w[1],G=w[2],B=0;for(y in M)k.o(M,y)&&(k.m[y]=M[y]);G&&G(k);for(q&&q(w);B<E.length;B++)q=E[B],k.o(u,q)&&u[q]&&u[q][0](),u[E[B]]=0},e=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];e.forEach(m.bind(null,0));e.push=m.bind(null,e.push.bind(e))}(),k(21)}()})};
'use strict';
var $frontend$handler$draw$load_excalidraw_file$$ = function($file$jscomp$50$$, $ok_handler$jscomp$20$$) {
var $temp__5720__auto__$jscomp$407$$ = $APP.$frontend$state$get_current_repo$$();
$APP.$cljs$core$truth_$$($temp__5720__auto__$jscomp$407$$) && $APP.$frontend$util$p_handle$cljs$0core$0IFn$0_invoke$0arity$03$$($APP.$frontend$handler$file$load_file$$($temp__5720__auto__$jscomp$407$$, $file$jscomp$50$$), function($content$jscomp$129$$) {
return $ok_handler$jscomp$20$$.$cljs$core$IFn$_invoke$arity$1$ ? $ok_handler$jscomp$20$$.$cljs$core$IFn$_invoke$arity$1$($content$jscomp$129$$) : $ok_handler$jscomp$20$$.call(null, $content$jscomp$129$$);
}, function($error$jscomp$61$$) {
return $APP.$cljs$core$println$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$(["Error loading ", $file$jscomp$50$$, ": ", $error$jscomp$61$$]));
});
}, $frontend$extensions$excalidraw$update_draw_content_width$$ = function($state$jscomp$274$$) {
for (var $el_94332__$1_width_94333$$ = $APP.$rum$core$dom_node$$($state$jscomp$274$$).querySelector(".draw-wrap");;) {
if (null != $el_94332__$1_width_94333$$ && void 0 !== $el_94332__$1_width_94333$$ && void 0 !== $el_94332__$1_width_94333$$.classList) {
if ($APP.$cljs$core$truth_$$($el_94332__$1_width_94333$$.classList.contains("block-content"))) {
$el_94332__$1_width_94333$$ = $el_94332__$1_width_94333$$.clientWidth, $APP.$cljs$core$reset_BANG_$$($cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_draw_DASH_width$$.$cljs$core$IFn$_invoke$arity$1$($state$jscomp$274$$), $el_94332__$1_width_94333$$);
} else {
$el_94332__$1_width_94333$$ = $el_94332__$1_width_94333$$.parentNode;
continue;
}
}
break;
}
return $state$jscomp$274$$;
}, $cljs$cst$keyword$view_DASH_mode_DASH_enabled$$ = new $APP.$cljs$core$Keyword$$(null, "view-mode-enabled", "view-mode-enabled", -588220561), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_grid_DASH_mode_QMARK_$$ = new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "grid-mode?", "frontend.extensions.excalidraw/grid-mode?", -1189627787), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_view_DASH_mode_QMARK_$$ = new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw",
"view-mode?", "frontend.extensions.excalidraw/view-mode?", 525380621), $cljs$cst$keyword$grid_DASH_mode_DASH_enabled$$ = new $APP.$cljs$core$Keyword$$(null, "grid-mode-enabled", "grid-mode-enabled", 584978327), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_elements$$ = new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "elements", "frontend.extensions.excalidraw/elements", 1745667967), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_loading_QMARK_$$ =
new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "loading?", "frontend.extensions.excalidraw/loading?", -1335058663), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_data$$ = new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "data", "frontend.extensions.excalidraw/data", -1371036113), $cljs$cst$keyword$zen_DASH_mode_DASH_enabled$$ = new $APP.$cljs$core$Keyword$$(null, "zen-mode-enabled", "zen-mode-enabled", -955634269), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_zen_DASH_mode_QMARK_$$ =
new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "zen-mode?", "frontend.extensions.excalidraw/zen-mode?", 1559773511), $cljs$cst$keyword$initial_DASH_data$$ = new $APP.$cljs$core$Keyword$$(null, "initial-data", "initial-data", -1315709804), $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_draw_DASH_width$$ = new $APP.$cljs$core$Keyword$$("frontend.extensions.excalidraw", "draw-width", "frontend.extensions.excalidraw/draw-width", -681100043);
$APP.$JSCompiler_StaticMethods_beforeLoadModuleCode$$("excalidraw");
var $module$node_modules$$excalidraw$excalidraw$dist$excalidraw_production_min$$ = $APP.$shadow$js$require$$(606);
var $frontend$extensions$excalidraw$excalidraw$$, $frontend$extensions$excalidraw$serialize_as_json$$, $frontend$extensions$excalidraw$draw_inner$$, $frontend$extensions$excalidraw$draw_container$$;
$APP.$frontend$extensions$excalidraw$$ = {};
$frontend$extensions$excalidraw$excalidraw$$ = $APP.$frontend$rum$adapt_class$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$goog$object$get$$($module$node_modules$$excalidraw$excalidraw$dist$excalidraw_production_min$$, "default"));
$frontend$extensions$excalidraw$serialize_as_json$$ = $APP.$goog$object$get$$($module$node_modules$$excalidraw$excalidraw$dist$excalidraw_production_min$$, "serializeAsJSON");
$frontend$extensions$excalidraw$draw_inner$$ = $APP.$rum$core$lazy_build$$($APP.$rum$core$build_defcs$$, function($map__94313__$1_state$jscomp$275$$, $data$jscomp$194$$, $option$jscomp$21$$) {
var $_STAR_draw_width$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_draw_DASH_width$$), $_STAR_zen_mode_QMARK_$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_zen_DASH_mode_QMARK_$$), $_STAR_view_mode_QMARK_$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$,
$cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_view_DASH_mode_QMARK_$$), $_STAR_grid_mode_QMARK_$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_grid_DASH_mode_QMARK_$$), $wide_mode_QMARK_$$ = $APP.$frontend$state$sub$$($APP.$cljs$cst$keyword$ui_SLASH_wide_DASH_mode_QMARK_$$), $_STAR_elements$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$,
$cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_elements$$);
$map__94313__$1_state$jscomp$275$$ = $APP.$cljs$core$__destructure_map$$($option$jscomp$21$$);
var $file$jscomp$94$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$, $APP.$cljs$cst$keyword$file$$), $block_uuid$jscomp$27$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__94313__$1_state$jscomp$275$$, $APP.$cljs$cst$keyword$block_DASH_uuid$$);
return $APP.$cljs$core$truth_$$($data$jscomp$194$$) ? $APP.$daiquiri$core$create_element$$("div", {onMouseDown:function($e$jscomp$656$$) {
return $APP.$frontend$util$stop$$($e$jscomp$656$$);
}, className:"overflow-hidden"}, [$APP.$daiquiri$core$create_element$$("div", {style:{fontSize:10}, className:"my-1"}, [$APP.$daiquiri$core$create_element$$("a", {onClick:$APP.$frontend$handler$ui$toggle_wide_mode_BANG_$$, className:"mr-2"}, [$APP.$daiquiri$interpreter$interpret$$($APP.$frontend$util$format$cljs$0core$0IFn$0_invoke$0arity$0variadic$$("Wide Mode (%s)", $APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$core$truth_$$($wide_mode_QMARK_$$) ? "ON" : "OFF"])))]),
$APP.$daiquiri$core$create_element$$("a", {onClick:function() {
return $APP.$cljs$core$swap_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($_STAR_zen_mode_QMARK_$$, $APP.$cljs$core$not$$);
}, className:"mr-2"}, [$APP.$daiquiri$interpreter$interpret$$($APP.$frontend$util$format$cljs$0core$0IFn$0_invoke$0arity$0variadic$$("Zen Mode (%s)", $APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$core$truth_$$($APP.$cljs$core$_deref$$($_STAR_zen_mode_QMARK_$$)) ? "ON" : "OFF"])))]), $APP.$daiquiri$core$create_element$$("a", {onClick:function() {
return $APP.$cljs$core$swap_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($_STAR_view_mode_QMARK_$$, $APP.$cljs$core$not$$);
}, className:"mr-2"}, [$APP.$daiquiri$interpreter$interpret$$($APP.$frontend$util$format$cljs$0core$0IFn$0_invoke$0arity$0variadic$$("View Mode (%s)", $APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$core$truth_$$($APP.$cljs$core$_deref$$($_STAR_view_mode_QMARK_$$)) ? "ON" : "OFF"])))]), $APP.$daiquiri$core$create_element$$("a", {onClick:function() {
return $APP.$cljs$core$swap_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($_STAR_grid_mode_QMARK_$$, $APP.$cljs$core$not$$);
}, className:"mr-2"}, [$APP.$daiquiri$interpreter$interpret$$($APP.$frontend$util$format$cljs$0core$0IFn$0_invoke$0arity$0variadic$$("Grid Mode (%s)", $APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$core$truth_$$($APP.$cljs$core$_deref$$($_STAR_view_mode_QMARK_$$)) ? "ON" : "OFF"])))]), $APP.$daiquiri$core$create_element$$("a", {onClick:function() {
var $G__94325$jscomp$inline_7652_temp__5720__auto__$jscomp$910$$ = new $APP.$cljs$core$PersistentVector$$(null, 2, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, [$APP.$cljs$cst$keyword$block_SLASH_uuid$$, $block_uuid$jscomp$27$$], null);
$G__94325$jscomp$inline_7652_temp__5720__auto__$jscomp$910$$ = $APP.$frontend$db$utils$pull$cljs$0core$0IFn$0_invoke$0arity$01$$ ? $APP.$frontend$db$utils$pull$cljs$0core$0IFn$0_invoke$0arity$01$$($G__94325$jscomp$inline_7652_temp__5720__auto__$jscomp$910$$) : $APP.$frontend$db$utils$pull$$.call(null, $G__94325$jscomp$inline_7652_temp__5720__auto__$jscomp$910$$);
return $APP.$cljs$core$truth_$$($G__94325$jscomp$inline_7652_temp__5720__auto__$jscomp$910$$) ? $APP.$frontend$handler$editor$edit_block_BANG_$cljs$0core$0IFn$0_invoke$0arity$04$$(0, null) : null;
}, className:"mr-2"}, ["Edit Block"])]), $APP.$daiquiri$core$create_element$$("div", {onMouseDown:function($e$jscomp$657$$) {
$APP.$frontend$util$stop$$($e$jscomp$657$$);
return $APP.$frontend$state$set_state_BANG_$$($APP.$cljs$cst$keyword$block_SLASH_component_DASH_editing_DASH_mode_QMARK_$$, !0);
}, onBlur:function() {
return $APP.$frontend$state$set_state_BANG_$$($APP.$cljs$cst$keyword$block_SLASH_component_DASH_editing_DASH_mode_QMARK_$$, !1);
}, style:{width:$APP.$cljs$core$_deref$$($_STAR_draw_width$$), height:$APP.$cljs$core$truth_$$($wide_mode_QMARK_$$) ? 650 : 500}, className:"draw-wrap"}, [$APP.$daiquiri$interpreter$interpret$$(function() {
var $G__94327$$ = $APP.$cljs$core$merge$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([new $APP.$cljs$core$PersistentArrayMap$$(null, 5, [$APP.$cljs$cst$keyword$on_DASH_change$$, function($elements$jscomp$16$$, $app_state$jscomp$1$$) {
if ($APP.$cljs$core$truth_$$(function() {
var $or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$ = $APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$("down", $APP.$goog$object$get$$($app_state$jscomp$1$$, "cursorButton"));
if ($or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$) {
return $or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$;
}
$or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$ = $APP.$goog$object$get$$($app_state$jscomp$1$$, "draggingElement");
if ($APP.$cljs$core$truth_$$($or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$)) {
return $or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$;
}
$or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$ = $APP.$goog$object$get$$($app_state$jscomp$1$$, "editingElement");
if ($APP.$cljs$core$truth_$$($or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$)) {
return $or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$;
}
$or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$ = $APP.$goog$object$get$$($app_state$jscomp$1$$, "editingGroupId");
return $APP.$cljs$core$truth_$$($or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$) ? $or__4212__auto__$jscomp$839_or__4212__auto____$1$jscomp$103_or__4212__auto____$2$jscomp$32_or__4212__auto____$3$jscomp$15$$ : $APP.$goog$object$get$$($app_state$jscomp$1$$, "editingLinearElement");
}())) {
return null;
}
var $elements__GT_clj$$ = $APP.$cljs_bean$core$__GT_clj$$($elements$jscomp$16$$);
return $APP.$cljs$core$seq$$($elements__GT_clj$$) && $APP.$cljs$core$not_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($elements__GT_clj$$, $APP.$cljs$core$_deref$$($_STAR_elements$$)) ? ($APP.$cljs$core$reset_BANG_$$($_STAR_elements$$, $elements__GT_clj$$), $APP.$frontend$handler$draw$save_excalidraw_BANG_$$($file$jscomp$94$$, $frontend$extensions$excalidraw$serialize_as_json$$.$cljs$core$IFn$_invoke$arity$2$ ? $frontend$extensions$excalidraw$serialize_as_json$$.$cljs$core$IFn$_invoke$arity$2$($elements$jscomp$16$$,
$app_state$jscomp$1$$) : $frontend$extensions$excalidraw$serialize_as_json$$.call(null, $elements$jscomp$16$$, $app_state$jscomp$1$$))) : null;
}, $cljs$cst$keyword$zen_DASH_mode_DASH_enabled$$, $APP.$cljs$core$_deref$$($_STAR_zen_mode_QMARK_$$), $cljs$cst$keyword$view_DASH_mode_DASH_enabled$$, $APP.$cljs$core$_deref$$($_STAR_view_mode_QMARK_$$), $cljs$cst$keyword$grid_DASH_mode_DASH_enabled$$, $APP.$cljs$core$_deref$$($_STAR_grid_mode_QMARK_$$), $cljs$cst$keyword$initial_DASH_data$$, $data$jscomp$194$$], null)]));
return $frontend$extensions$excalidraw$excalidraw$$.$cljs$core$IFn$_invoke$arity$1$ ? $frontend$extensions$excalidraw$excalidraw$$.$cljs$core$IFn$_invoke$arity$1$($G__94327$$) : $frontend$extensions$excalidraw$excalidraw$$.call(null, $G__94327$$);
}())])]) : null;
}, new $APP.$cljs$core$PersistentVector$$(null, 7, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, [$APP.$rum$core$reactive$$, $APP.$rum$core$local$cljs$0core$0IFn$0_invoke$0arity$02$$(800, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_draw_DASH_width$$), $APP.$rum$core$local$cljs$0core$0IFn$0_invoke$0arity$02$$(!0, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_zen_DASH_mode_QMARK_$$), $APP.$rum$core$local$cljs$0core$0IFn$0_invoke$0arity$02$$(!1, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_view_DASH_mode_QMARK_$$),
$APP.$rum$core$local$cljs$0core$0IFn$0_invoke$0arity$02$$(!1, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_grid_DASH_mode_QMARK_$$), $APP.$rum$core$local$cljs$0core$0IFn$0_invoke$0arity$02$$(null, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_elements$$), new $APP.$cljs$core$PersistentArrayMap$$(null, 2, [$APP.$cljs$cst$keyword$did_DASH_mount$$, $frontend$extensions$excalidraw$update_draw_content_width$$, $APP.$cljs$cst$keyword$did_DASH_update$$, $frontend$extensions$excalidraw$update_draw_content_width$$],
null)], null), "frontend.extensions.excalidraw/draw-inner");
$frontend$extensions$excalidraw$draw_container$$ = $APP.$rum$core$lazy_build$$($APP.$rum$core$build_defcs$$, function($_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$, $attrs94328_option$jscomp$22$$) {
var $_STAR_data_data$jscomp$195$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_data$$);
$_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$ = $APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_loading_QMARK_$$);
$_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$ = $APP.$rum$core$react$$($_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$);
$_STAR_data_data$jscomp$195$$ = $APP.$rum$core$react$$($_STAR_data_data$jscomp$195$$);
var $db_restoring_QMARK_$jscomp$4$$ = $APP.$frontend$state$sub$$($APP.$cljs$cst$keyword$db_SLASH_restoring_QMARK_$$);
return $APP.$cljs$core$truth_$$($APP.$cljs$cst$keyword$file$$.$cljs$core$IFn$_invoke$arity$1$($attrs94328_option$jscomp$22$$)) ? $APP.$cljs$core$truth_$$($db_restoring_QMARK_$jscomp$4$$) ? ($attrs94328_option$jscomp$22$$ = $APP.$frontend$ui$loading$$("Loading"), $APP.$daiquiri$core$create_element$$("div", $APP.$cljs$core$map_QMARK_$$($attrs94328_option$jscomp$22$$) ? $APP.$daiquiri$interpreter$attributes$$($APP.$daiquiri$normalize$merge_with_class$cljs$0core$0IFn$0_invoke$0arity$0variadic$$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([new $APP.$cljs$core$PersistentArrayMap$$(null,
1, [$APP.$cljs$cst$keyword$class$$, new $APP.$cljs$core$PersistentVector$$(null, 1, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, ["ls-center"], null)], null), $attrs94328_option$jscomp$22$$]))) : {className:"ls-center"}, $APP.$cljs$core$map_QMARK_$$($attrs94328_option$jscomp$22$$) ? null : [$APP.$daiquiri$interpreter$interpret$$($attrs94328_option$jscomp$22$$)])) : !1 === $_STAR_loading_QMARK_$jscomp$1_loading_QMARK_$jscomp$5_state$jscomp$276$$ ? $frontend$extensions$excalidraw$draw_inner$$($_STAR_data_data$jscomp$195$$,
$attrs94328_option$jscomp$22$$) : null : null;
}, new $APP.$cljs$core$PersistentVector$$(null, 2, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, [$APP.$rum$core$reactive$$, new $APP.$cljs$core$PersistentArrayMap$$(null, 1, [$APP.$cljs$cst$keyword$init$$, function($state$jscomp$277$$) {
var $file$jscomp$95_option$jscomp$23_vec__94329$$ = $APP.$cljs$cst$keyword$rum_SLASH_args$$.$cljs$core$IFn$_invoke$arity$1$($state$jscomp$277$$);
$file$jscomp$95_option$jscomp$23_vec__94329$$ = $APP.$cljs$core$nth$$.$cljs$core$IFn$_invoke$arity$3$($file$jscomp$95_option$jscomp$23_vec__94329$$, 0, null);
$file$jscomp$95_option$jscomp$23_vec__94329$$ = $APP.$cljs$cst$keyword$file$$.$cljs$core$IFn$_invoke$arity$1$($file$jscomp$95_option$jscomp$23_vec__94329$$);
var $_STAR_data$jscomp$1$$ = $APP.$cljs$core$atom$$.$cljs$core$IFn$_invoke$arity$1$(null), $_STAR_loading_QMARK_$jscomp$2$$ = $APP.$cljs$core$atom$$.$cljs$core$IFn$_invoke$arity$1$(!0);
$APP.$cljs$core$truth_$$($file$jscomp$95_option$jscomp$23_vec__94329$$) && $frontend$handler$draw$load_excalidraw_file$$($file$jscomp$95_option$jscomp$23_vec__94329$$, function($data$jscomp$196_e$jscomp$inline_7655$$) {
if ($APP.$clojure$string$blank_QMARK_$$($data$jscomp$196_e$jscomp$inline_7655$$)) {
var $data__$1$jscomp$9$$ = null;
} else {
try {
$data__$1$jscomp$9$$ = JSON.parse($data$jscomp$196_e$jscomp$inline_7655$$);
} catch ($e94305$jscomp$inline_7656$$) {
if ($e94305$jscomp$inline_7656$$ instanceof Error) {
$data$jscomp$196_e$jscomp$inline_7655$$ = $e94305$jscomp$inline_7656$$, $APP.$cljs$core$println$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$(["from json error:"])), console.dir($data$jscomp$196_e$jscomp$inline_7655$$), $data__$1$jscomp$9$$ = $APP.$frontend$handler$notification$show_BANG_$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$frontend$util$format$$("Could not load this invalid excalidraw file"), $APP.$cljs$cst$keyword$error$$);
} else {
throw $e94305$jscomp$inline_7656$$;
}
}
}
$APP.$cljs$core$reset_BANG_$$($_STAR_data$jscomp$1$$, $data__$1$jscomp$9$$);
return $APP.$cljs$core$reset_BANG_$$($_STAR_loading_QMARK_$jscomp$2$$, !1);
});
return $APP.$cljs$core$assoc$$.$cljs$core$IFn$_invoke$arity$variadic$($state$jscomp$277$$, $cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_data$$, $_STAR_data$jscomp$1$$, $APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$cljs$cst$keyword$frontend_DOT_extensions_DOT_excalidraw_SLASH_loading_QMARK_$$, $_STAR_loading_QMARK_$jscomp$2$$]));
}], null)], null), "frontend.extensions.excalidraw/draw-container");
$APP.$frontend$extensions$excalidraw$draw$$ = $APP.$rum$core$lazy_build$$($APP.$rum$core$build_defc$$, function($option$jscomp$24$$) {
var $repo$jscomp$378$$ = $APP.$frontend$state$get_current_repo$$(), $granted_QMARK_$jscomp$2$$ = $APP.$frontend$state$sub$$(new $APP.$cljs$core$PersistentVector$$(null, 2, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, [$APP.$cljs$cst$keyword$nfs_SLASH_user_DASH_granted_QMARK_$$, $repo$jscomp$378$$], null));
return $APP.$frontend$config$local_db_QMARK_$$($repo$jscomp$378$$) && $APP.$cljs$core$not$$($granted_QMARK_$jscomp$2$$) && $APP.$cljs$core$not$$($APP.$frontend$util$electron_QMARK_$$()) && $APP.$cljs$core$not$$($APP.$frontend$mobile$util$is_native_platform_QMARK_$$()) ? null : $frontend$extensions$excalidraw$draw_container$$($option$jscomp$24$$);
}, new $APP.$cljs$core$PersistentVector$$(null, 1, 5, $APP.$cljs$core$PersistentVector$EMPTY_NODE$$, [$APP.$rum$core$reactive$$], null), "frontend.extensions.excalidraw/draw");
$APP.$shadow$loader$mm$$.$setLoaded$();
}).call(this);
//# sourceMappingURL=excalidraw.js.map