(function(){ shadow$provide[595]=function(ya,ba,Ta,I){var v=ba(200).Buffer;!function(Y,y){"object"==typeof I&&"object"==typeof Ta?Ta.exports=y(ba(22),ba(31)):"function"==typeof define&&define.amd?define(["react","react-dom"],y):"object"==typeof I?I.ExcalidrawLib=y(ba(22),ba(31)):Y.ExcalidrawLib=y(Y.React,Y.ReactDOM)}(self,function(Y,y){return function(){function n(g){var h=z[g];if(void 0!==h)return h.exports;h=z[g]={id:g,exports:{}};return u[g](h,h.exports,n),h.exports}var b,u={5779:function(g,h){h.N=void 0;var c= /^([^\w]*)(javascript|data|vbscript)/im,p=/&#(\w+)(^\w|;)?/g,m=/&(newline|tab);/gi,q=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,E=/^.+(:|:)/gim,w=[".","/"];h.N=function(t){var r;t=(r=t||"",r.replace(p,function(f,F){return String.fromCharCode(F)})).replace(m,"").replace(q,"").trim();return t?-1>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>> 8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])];for(;t>>8^m[255&(w^E[t++])];return-1^w}c.version="0.3.0";var m=function(){for(var E=0,w=Array(256),t=0;256!=t;++t)E=1&(E=1&(E=1&(E=1&(E=1&(E=1&(E=1&(E=1&(E=t)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1)?-306674912^E>>>1:E>>>1,w[t]=E;return"undefined"!=typeof Int32Array?new Int32Array(w):w}(),q="undefined"!= typeof v;c.table=m;c.bstr=function(E){if(32768>>8,w=m[255&(w^E.charCodeAt(r++))]^w>>>8;return r===t&&(w=w>>>8^m[255&(w^E.charCodeAt(r))]),-1^w};c.buf=function(E){if(1E4>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])])>>>8^m[255&(w^E[t++])];for(;t>>8^m[255&(w^E[t++])];return-1^w};c.str=function(E){for(var w, t,r=-1,f=0,F=E.length;f(w=E.charCodeAt(f++))?r=r>>>8^m[255&(r^w)]:2048>w?r=(r=r>>>8^m[255&(r^(192|w>>6&31))])>>>8^m[255&(r^(128|63&w))]:55296<=w&&57344>w?(w=64+(1023&w),t=1023&E.charCodeAt(f++),r=(r=(r=(r=r>>>8^m[255&(r^(240|w>>8&7))])>>>8^m[255&(r^(128|w>>2&63))])>>>8^m[255&(r^(128|t>>6&15|3&w))])>>>8^m[255&(r^(128|63&t))]):r=(r=(r=r>>>8^m[255&(r^(224|w>>12&15))])>>>8^m[255&(r^(128|w>>6&63))])>>>8^m[255&(r^(128|63&w))];return-1^r}};"undefined"==typeof DO_NOT_EXPORT_CRC?g(h):g({})},4739:function(g, h,c){function p(Ba,Ka){const Oa="atom"+ ++Fa,Va={toString:()=>Oa};return"function"==typeof Ba?Va.read=Ba:(Va.init=Ba,Va.read=Ya=>Ya(Va),Va.write=(Ya,Ua,La)=>Ua(Va,"function"==typeof La?La(Ya(Va)):La)),Ka&&(Va.write=Ka),Va}function m(Ba,Ka){Ka=Q(Ka);const {s:Oa}=(0,w.useContext)(Ka),Va=(0,w.useCallback)(ja=>{ja=Oa.r(Ba,ja);if("e"in ja)throw ja.e;if("p"in ja)throw ja.p;if("v"in ja)return ja.v;throw Error("no atom value");},[Oa,Ba]),[[Ya,Ua,La],ma]=(0,w.useReducer)((0,w.useCallback)((ja,oa)=>{const ia= Va(oa);return Object.is(ja[1],ia)&&ja[2]===Ba?ja:[oa,ia,Ba]},[Va,Ba]),void 0,()=>[void 0,Va(void 0),Ba]);return La!==Ba&&ma(void 0),(0,w.useEffect)(()=>{const ja=Oa.s(Ba,ma);return ma(void 0),ja},[Oa,Ba]),(0,w.useEffect)(()=>{Oa.c(Ba,Ya)}),(0,w.useDebugValue)(Ua),Ua}function q(Ba,Ka){Ka=Q(Ka);const {s:Oa,w:Va}=(0,w.useContext)(Ka);return(0,w.useCallback)(Ya=>{if(!("write"in Ba))throw Error("not writable atom");const Ua=La=>Oa.w(Ba,Ya,La);return Va?Va(Ua):Oa.w(Ba,Ya,void 0)},[Oa,Va,Ba])}function E(Ba, Ka){return"scope"in Ba&&(console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."),Ka=Ba.scope),[m(Ba,Ka),q(Ba,Ka)]}c.d(h,{Dv:function(){return m},KO:function(){return E},Vv:function(){return K},b9:function(){return q},cn:function(){return p},zt:function(){return va}});var w=c(9787);const t=Symbol(),r=Ba=>{var Ka,Oa;null==(Oa=(Ka=Ba[t]).c)||Oa.call(Ka)},f=(Ba,Ka)=>{const Oa=Ba[t].o,Va=Ka[t].o;return Oa===Va||Ba===Va||!!Oa[t]&&f(Oa,Ka)},F=Ba=>{const Ka={o:Ba,c:null},Oa=new Promise(Va=> {Ka.c=()=>{Ka.c=null;Va()};Ba.then(Ka.c,Ka.c)});return Oa[t]=Ka,Oa};var C=Object.defineProperty,M=Object.defineProperties,aa=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,V=(Ba,Ka,Oa)=>Ka in Ba?C(Ba,Ka,{enumerable:!0,configurable:!0,writable:!0,value:Oa}):Ba[Ka]=Oa;const T=Ba=>{const Ka=new WeakMap,Oa=new WeakMap,Va=new Map;let Ya,Ua;if(Ya=new Set,Ua=new Set,Ba)for(const [ub,Yb]of Ba)Ba={v:Yb,r:0,d:new Map}, Object.freeze(Ba),"init"in ub||console.warn("Found initial value for derived atom which can cause unexpected behavior",ub),Ka.set(ub,Ba);const La=new WeakMap,ma=new WeakMap,ja=ub=>{let Yb=ma.get(ub);return Yb||(Yb=new Map,ma.set(ub,Yb)),Yb},oa=(ub,Yb)=>{if(ub){const dc=ja(ub);let uc=dc.get(Yb);return uc||(uc=oa(ub.p,Yb),uc&&("p"in uc&&uc.p.then(()=>dc.delete(Yb)),dc.set(Yb,uc))),uc}return Ka.get(Yb)},ia=(ub,Yb,dc)=>{(Object.freeze(dc),ub)?ja(ub).set(Yb,dc):(ub=Ka.get(Yb),Ka.set(Yb,dc),Va.has(Yb)|| Va.set(Yb,ub))},sa=(ub,Yb=new Map,dc)=>{if(!dc)return Yb;const uc=new Map;let xc=!1;return dc.forEach(Gb=>{var lc;const Ab=(null==(lc=oa(ub,Gb))?void 0:lc.r)||0;uc.set(Gb,Ab);Yb.get(Gb)!==Ab&&(xc=!0)}),Yb.size!==uc.size||xc?uc:Yb},Ea=(ub,Yb,dc,uc,xc)=>{const Gb=oa(ub,Yb);if(Gb){if(xc&&!("p"in Gb&&f(Gb.p,xc)))return Gb;"p"in Gb&&r(Gb.p)}uc={v:dc,r:(null==Gb?void 0:Gb.r)||0,d:sa(ub,null==Gb?void 0:Gb.d,uc)};return Gb&&"v"in Gb&&Object.is(Gb.v,dc)?uc.d===Gb.d||uc.d.size===Gb.d.size&&Array.from(uc.d.keys()).every(lc=> Gb.d.has(lc))||Promise.resolve().then(()=>{Qb(ub)}):(++uc.r,uc.d.has(Yb)&&(uc.d=(new Map(uc.d)).set(Yb,uc.r))),ia(ub,Yb,uc),uc},Qa=(ub,Yb,dc,uc,xc)=>{const Gb=oa(ub,Yb);if(Gb){if(xc&&!("p"in Gb&&f(Gb.p,xc)))return Gb;"p"in Gb&&r(Gb.p)}dc={e:dc,r:(null==Gb?void 0:Gb.r)||0,d:sa(ub,null==Gb?void 0:Gb.d,uc)};return ia(ub,Yb,dc),dc},Xa=(ub,Yb,dc,uc)=>{const xc=oa(ub,Yb);if(xc&&"p"in xc){if(f(xc.p,dc))return xc;r(xc.p)}((Gb,lc,Ab)=>{let vc=La.get(lc);vc||(vc=new Map,La.set(lc,vc));Ab.then(()=>{vc.get(Gb)=== Ab&&(vc.delete(Gb),vc.size||La.delete(lc))});vc.set(Gb,Ab)})(ub,Yb,dc);dc={p:dc,r:(null==xc?void 0:xc.r)||0,d:sa(ub,null==xc?void 0:xc.d,uc)};return ia(ub,Yb,dc),dc},Pa=(ub,Yb,dc,uc)=>{if(dc instanceof Promise){const xc=F(dc.then(Gb=>{Ea(ub,Yb,Gb,uc,xc);Qb(ub)}).catch(Gb=>{if(Gb instanceof Promise)return Gb[t]?Gb.then(()=>{cb(ub,Yb,!0)}):Gb;Qa(ub,Yb,Gb,uc,xc);Qb(ub)}));return Xa(ub,Yb,xc,uc)}return Ea(ub,Yb,dc,uc)},cb=(ub,Yb,dc)=>{if(!dc&&(dc=oa(ub,Yb))&&(dc.r!==dc.i&&"p"in dc&&dc.p[t].c||(dc.d.forEach((Gb, lc)=>{lc!==Yb&&(Oa.has(lc)?(Gb=oa(ub,lc))&&Gb.r===Gb.i&&cb(ub,lc):cb(ub,lc))}),Array.from(dc.d).every(([Gb,lc])=>(Gb=oa(ub,Gb))&&"v"in Gb&&Gb.r===lc))))return dc;const uc=new Set;try{var xc=Yb.read(Gb=>{uc.add(Gb);const lc=Gb===Yb?oa(ub,Gb):cb(ub,Gb);if(lc){if("e"in lc)throw lc.e;if("p"in lc)throw lc.p;return lc.v}if("init"in Gb)return Gb.init;throw Error("no atom init");});return Pa(ub,Yb,xc,uc)}catch(Gb){return Gb instanceof Promise?(xc=F(Gb),Xa(ub,Yb,xc,uc)):Qa(ub,Yb,Gb,uc)}},tb=(ub,Yb)=>!Yb.l.size&& (!Yb.t.size||1===Yb.t.size&&Yb.t.has(ub)),Mb=(ub,Yb)=>{const dc=Oa.get(Yb);null==dc||dc.t.forEach(uc=>{if(uc!==Yb){const Fc=oa(ub,uc);if(Fc){"p"in Fc&&r(Fc.p);var xc={},Gb=Fc,lc;for(lc in Gb||={})U.call(Gb,lc)&&V(xc,lc,Gb[lc]);if(O)for(lc of O(Gb))P.call(Gb,lc)&&V(xc,lc,Gb[lc]);xc=(Ab=xc,vc={i:Fc.r},M(Ab,aa(vc)));ia(ub,uc,xc)}else console.warn("[Bug] could not invalidate non existing atom",uc);var Ab,vc;Mb(ub,uc)}})},yb=(ub,Yb,dc)=>{let uc=!0;const xc=(Gb,lc)=>{const Ab=cb(ub,Gb);if("e"in Ab)throw Ab.e; if("p"in Ab){if(null==lc?0:lc.unstable_promise)return Ab.p.then(()=>xc(Gb,lc));throw console.info("Reading pending atom state in write operation. We throw a promise for now.",Gb),Ab.p;}if("v"in Ab)return Ab.v;throw console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.",Gb),Error("no value found");};dc=Yb.write(xc,(Gb,lc)=>{let Ab;if(Gb===Yb){if(!("init"in Gb))throw Error("atom not writable");(vc=>{const Fc=new Set,tc=La.get(vc);return tc&&(La.delete(vc), tc.forEach((Oc,dd)=>{r(Oc);Fc.add(dd)})),Fc})(Gb).forEach(vc=>{vc!==ub&&Pa(vc,Gb,lc)});Pa(ub,Gb,lc);Mb(ub,Gb)}else Ab=yb(ub,Gb,lc);return uc||Qb(ub),Ab},dc);return uc=!1,ub=void 0,dc},ob=(ub,Yb,dc)=>{ub=yb(dc,ub,Yb);return Qb(dc),ub},Ja=(ub,Yb)=>{Yb={t:new Set(Yb&&[Yb]),l:new Set};Oa.set(ub,Yb);Ua.add(ub);if(cb(void 0,ub).d.forEach((dc,uc)=>{(dc=Oa.get(uc))?dc.t.add(ub):uc!==ub&&Ja(uc,ub)}),ub.write&&ub.onMount){const dc=ub.onMount(uc=>ob(ub,uc));dc&&(Yb.u=dc)}return Yb},bb=ub=>{var Yb;const dc=null== (Yb=Oa.get(ub))?void 0:Yb.u;dc&&dc();Oa.delete(ub);Ua.delete(ub);(Yb=oa(void 0,ub))?Yb.d.forEach((uc,xc)=>{xc!==ub&&(uc=Oa.get(xc))&&(uc.t.delete(ub),tb(xc,uc)&&bb(xc))}):console.warn("[Bug] could not find atom state to unmount",ub)},hb=(ub,Yb,dc)=>{const uc=new Set(Yb.d.keys());null==dc||dc.forEach((xc,Gb)=>{if(uc.has(Gb))return void uc.delete(Gb);(xc=Oa.get(Gb))&&(xc.t.delete(ub),tb(Gb,xc)&&bb(Gb))});uc.forEach(xc=>{const Gb=Oa.get(xc);Gb?Gb.t.add(ub):Oa.has(ub)&&Ja(xc,ub)})},Qb=ub=>{if(ub)ja(ub).forEach((Yb, dc)=>{Yb!==Ka.get(dc)&&(Yb=Oa.get(dc),null==Yb||Yb.l.forEach(uc=>uc(ub)))});else{for(;Va.size;){const Yb=Array.from(Va);Va.clear();Yb.forEach(([dc,uc])=>{const xc=oa(void 0,dc);xc&&xc.d!==(null==uc?void 0:uc.d)&&hb(dc,xc,null==uc?void 0:uc.d);dc=Oa.get(dc);null==dc||dc.l.forEach(Gb=>Gb())})}Ya.forEach(Yb=>Yb())}};return{r:(ub,Yb)=>cb(Yb,ub),w:ob,c:(ub,Yb)=>{Yb&&(dc=>{ja(dc).forEach((uc,xc)=>{const Gb=Ka.get(xc);(uc.r>((null==Gb?void 0:Gb.r)||0)||"v"in uc&&uc.r===(null==Gb?void 0:Gb.r)&&uc.d!==(null== Gb?void 0:Gb.d))&&(Ka.set(xc,uc),uc.d!==(null==Gb?void 0:Gb.d)&&hb(xc,uc,null==Gb?void 0:Gb.d))})})(Yb);Qb(void 0)},s:(ub,Yb)=>{const dc=(uc=>{let xc=Oa.get(uc);return xc||=Ja(uc),xc})(ub).l;return dc.add(Yb),()=>{dc.delete(Yb);const uc=Oa.get(ub);uc&&tb(ub,uc)&&bb(ub)}},h:(ub,Yb)=>{for(const [dc,uc]of ub)"init"in dc&&(Pa(Yb,dc,uc),Mb(Yb,dc));Qb(Yb)},n:ub=>(Ya.add(ub),()=>{Ya.delete(ub)}),l:()=>Ua.values(),a:ub=>Ka.get(ub),m:ub=>Oa.get(ub)}},K=Ba=>{const Ka=T(Ba),Oa=Va=>new Promise((Ya,Ua)=>{const La= Ka.r(Va);"e"in La?Ua(La.e):Ya("p"in La?La.p.then(()=>Oa(Va)):La.v)});return{get:Va=>{Va=Ka.r(Va);if("e"in Va)throw Va.e;if(!("p"in Va))return Va.v},asyncGet:Oa,set:(Va,Ya)=>Ka.w(Va,Ya),sub:(Va,Ya)=>Ka.s(Va,Ya),SECRET_INTERNAL_store:Ka}},D=(Ba,Ka)=>({s:Ka?Ka(Ba).SECRET_INTERNAL_store:T(Ba)}),L=new Map,Q=Ba=>(L.has(Ba)||L.set(Ba,(0,w.createContext)(D())),L.get(Ba));var N=Object.defineProperty,la=Object.defineProperties,R=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty, S=Object.prototype.propertyIsEnumerable,ha=(Ba,Ka,Oa)=>Ka in Ba?N(Ba,Ka,{enumerable:!0,configurable:!0,writable:!0,value:Oa}):Ba[Ka]=Oa,W=(Ba,Ka)=>{for(var Oa in Ka||={})X.call(Ka,Oa)&&ha(Ba,Oa,Ka[Oa]);if(Z)for(Oa of Z(Ka))S.call(Ka,Oa)&&ha(Ba,Oa,Ka[Oa]);return Ba};const ra=Ba=>Ba.debugLabel||Ba.toString(),wa=([Ba,Ka])=>Object.fromEntries(Ka.flatMap(Oa=>{var Va,Ya,Ua=null==(Va=Ba.m)?void 0:Va.call(Ba,Oa);if(!Ua)return[];Va=Ua.t;Ua=(null==(Ya=Ba.a)?void 0:Ya.call(Ba,Oa))||{};return[[Oa.debugLabel|| Oa.toString(),(La=W(W(W({},"e"in Ua&&{error:Ua.e}),"p"in Ua&&{promise:Ua.p}),"v"in Ua&&{value:Ua.v}),ma={dependents:Array.from(Va).map(ra)},la(La,R(ma)))]];var La,ma})),va=({children:Ba,initialValues:Ka,scope:Oa,unstable_createStore:Va,unstable_enableVersionedWrite:Ya})=>{const [Ua,La]=(0,w.useState)();(0,w.useEffect)(()=>{Ua&&(ma.current.s.c(null,Ua),delete Ua.p)},[Ua]);const ma=(0,w.useRef)();ma.current||(ma.current=D(Ka,Va),Ya&&(ma.current.w=ja=>{La(oa=>{oa=oa?{p:oa}:{};return ja(oa),oa})}));Ya|| (ja=>{const {s:oa}=ja,[ia,sa]=(0,w.useState)([]);(0,w.useEffect)(()=>{var Ea;const Qa=()=>{var Pa;sa(Array.from((null==(Pa=oa.l)?void 0:Pa.call(oa))||[]))},Xa=null==(Ea=oa.n)?void 0:Ea.call(oa,Qa);return Qa(),Xa},[oa]);(0,w.useDebugValue)([oa,ia],wa)})(ma.current);Ka=Q(Oa);return(0,w.createElement)(Ka.Provider,{value:ma.current},Ba)};let Fa=0},200:function(g,h,c){function p(O,U,P){function V(wa){var va=Q,Fa=N;return Q=N=void 0,S=wa,R=O.apply(Fa,va)}function T(wa){var va=wa-X;return void 0===X||va>= U||0>va||W&&wa-S>=la}function K(){var wa=F.Date.now();if(T(wa))return D(wa);var va=setTimeout,Fa=U-(wa-X);wa=W?aa(Fa,la-(wa-S)):Fa;Z=va(K,wa)}function D(wa){return Z=void 0,ra&&Q?V(wa):(Q=N=void 0,R)}function L(){var wa=F.Date.now(),va=T(wa);if(Q=arguments,N=this,X=wa,va){if(void 0===Z)return wa=X,S=wa,Z=setTimeout(K,U),ha?V(wa):R;if(W)return Z=setTimeout(K,U),V(X)}return void 0===Z&&(Z=setTimeout(K,U)),R}var Q,N,la,R,Z,X,S=0,ha=!1,W=!1,ra=!0;if("function"!=typeof O)throw new TypeError("Expected a function"); return U=q(U)||0,m(P)&&(ha=!!P.leading,la=(W="maxWait"in P)?M(q(P.maxWait)||0,U):la,ra="trailing"in P?!!P.trailing:ra),L.cancel=function(){void 0!==Z&&clearTimeout(Z);S=0;Q=X=N=Z=void 0},L.flush=function(){return void 0===Z?R:D(F.Date.now())},L}function m(O){var U=typeof O;return!!O&&("object"==U||"function"==U)}function q(O){if("number"==typeof O)return O;if("symbol"==typeof O||O&&"object"==typeof O&&"[object Symbol]"==C.call(O))return NaN;m(O)&&(O="function"==typeof O.valueOf?O.valueOf():O,O=m(O)? O+"":O);if("string"!=typeof O)return 0===O?O:+O;O=O.replace(E,"");var U=t.test(O);return U||r.test(O)?f(O.slice(2),U?2:8):w.test(O)?NaN:+O}var E=/^\s+|\s+$/g,w=/^[-+]0x[0-9a-f]+$/i,t=/^0b[01]+$/i,r=/^0o[0-7]+$/i,f=parseInt;h="object"==typeof self&&self&&self.Object===Object&&self;var F="object"==typeof c.g&&c.g&&c.g.Object===Object&&c.g||h||Function("return this")(),C=Object.prototype.toString,M=Math.max,aa=Math.min;g.exports=function(O,U,P){var V=!0,T=!0;if("function"!=typeof O)throw new TypeError("Expected a function"); return m(P)&&(V="leading"in P?!!P.leading:V,T="trailing"in P?!!P.trailing:T),p(O,U,{leading:V,maxWait:U,trailing:T})}},2744:function(g,h,c){h={};(0,c(9187).assign)(h,c(4395),c(578),c(2684));g.exports=h},4395:function(g,h,c){function p(F){if(!(this instanceof p))return new p(F);F=this.options=E.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},F||{});F.raw&&0F.windowBits&&(F.windowBits+=16);this.err= 0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new r;this.strm.avail_out=0;var C=q.deflateInit2(this.strm,F.level,F.method,F.windowBits,F.memLevel,F.strategy);if(0!==C)throw Error(t[C]);if(F.header&&q.deflateSetHeader(this.strm,F.header),F.dictionary){var M;if(M="string"==typeof F.dictionary?w.string2buf(F.dictionary):"[object ArrayBuffer]"===f.call(F.dictionary)?new Uint8Array(F.dictionary):F.dictionary,0!==(C=q.deflateSetDictionary(this.strm,M)))throw Error(t[C]);this._dict_set=!0}}function m(F, C){C=new p(C);if(C.push(F,!0),C.err)throw C.msg||t[C.err];return C.result}var q=c(7651),E=c(9187),w=c(8592),t=c(5604),r=c(249),f=Object.prototype.toString;p.prototype.push=function(F,C){var M,aa=this.strm,O=this.options.chunkSize;if(this.ended)return!1;C=C===~~C?C:!0===C?4:0;"string"==typeof F?aa.input=w.string2buf(F):"[object ArrayBuffer]"===f.call(F)?aa.input=new Uint8Array(F):aa.input=F;aa.next_in=0;aa.avail_in=aa.input.length;do{if(0===aa.avail_out&&(aa.output=new E.Buf8(O),aa.next_out=0,aa.avail_out= O),1!==(M=q.deflate(aa,C))&&0!==M)return this.onEnd(M),this.ended=!0,!1;0!==aa.avail_out&&(0!==aa.avail_in||4!==C&&2!==C)||("string"===this.options.to?this.onData(w.buf2binstring(E.shrinkBuf(aa.output,aa.next_out))):this.onData(E.shrinkBuf(aa.output,aa.next_out)))}while((0aa.windowBits&&(aa.windowBits=-aa.windowBits, 0===aa.windowBits&&(aa.windowBits=-15));!(0<=aa.windowBits&&16>aa.windowBits)||M&&M.windowBits||(aa.windowBits+=32);15aa.windowBits&&0==(15&aa.windowBits)&&(aa.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new f;this.strm.avail_out=0;M=q.inflateInit2(this.strm,aa.windowBits);if(M!==t.Z_OK)throw Error(r[M]);if(this.header=new F,q.inflateGetHeader(this.strm,this.header),aa.dictionary&&("string"==typeof aa.dictionary?aa.dictionary=w.string2buf(aa.dictionary): "[object ArrayBuffer]"===C.call(aa.dictionary)&&(aa.dictionary=new Uint8Array(aa.dictionary)),aa.raw&&(M=q.inflateSetDictionary(this.strm,aa.dictionary))!==t.Z_OK))throw Error(r[M]);}function m(M,aa){aa=new p(aa);if(aa.push(M,!0),aa.err)throw aa.msg||r[aa.err];return aa.result}var q=c(7823),E=c(9187),w=c(8592),t=c(2684),r=c(5604),f=c(249),F=c(9968),C=Object.prototype.toString;p.prototype.push=function(M,aa){var O,U,P,V,T=this.strm,K=this.options.chunkSize,D=this.options.dictionary,L=!1;if(this.ended)return!1; aa=aa===~~aa?aa:!0===aa?t.Z_FINISH:t.Z_NO_FLUSH;"string"==typeof M?T.input=w.binstring2buf(M):"[object ArrayBuffer]"===C.call(M)?T.input=new Uint8Array(M):T.input=M;T.next_in=0;T.avail_in=T.input.length;do{if(0===T.avail_out&&(T.output=new E.Buf8(K),T.next_out=0,T.avail_out=K),(O=q.inflate(T,t.Z_NO_FLUSH))===t.Z_NEED_DICT&&D&&(O=q.inflateSetDictionary(this.strm,D)),O===t.Z_BUF_ERROR&&!0===L&&(O=t.Z_OK,L=!1),O!==t.Z_STREAM_END&&O!==t.Z_OK)return this.onEnd(O),this.ended=!0,!1;T.next_out&&(0!==T.avail_out&& O!==t.Z_STREAM_END&&(0!==T.avail_in||aa!==t.Z_FINISH&&aa!==t.Z_SYNC_FLUSH)||("string"===this.options.to?(U=w.utf8border(T.output,T.next_out),P=T.next_out-U,V=w.buf2string(T.output,U),T.next_out=P,T.avail_out=K-P,P&&E.arraySet(T.output,T.output,U,P,0),this.onData(V)):this.onData(E.shrinkBuf(T.output,T.next_out))));0===T.avail_in&&0===T.avail_out&&(L=!0)}while((0r&&(t.subarray&&E||!t.subarray&&q))return String.fromCharCode.apply(null,m.shrinkBuf(t,r));for(var f="",F=0;Fg;g++)w[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;w[254]=w[254]=1;h.string2buf=function(t){var r,f,F,C,M=t.length,aa=0;for(F=0;Fr?1:2048>r?2:65536>r?3:4;var O=new m.Buf8(aa);for(F=C=0;Cr?O[C++]=r:2048>r?(O[C++]=192|r>>>6,O[C++]=128|63&r):65536>r?(O[C++]=224|r>>>12,O[C++]=128|r>>>6&63,O[C++]=128|63&r):(O[C++]=240|r>>>18,O[C++]=128|r>>>12&63,O[C++]=128|r>>>6&63,O[C++]=128|63&r);return O}; h.buf2binstring=function(t){return p(t,t.length)};h.binstring2buf=function(t){for(var r=new m.Buf8(t.length),f=0,F=r.length;f(F=t[r++]))aa[f++]=F;else if(4<(C=w[F]))aa[f++]=65533,r+=C-1;else{for(F&=2===C?31:3===C?15:7;1F?aa[f++]=F:(F-=65536,aa[f++]=55296|F>>10&1023,aa[f++]=56320|1023&F)}return p(aa,f)};h.utf8border=function(t, r){var f;(r=r||t.length)>t.length&&(r=t.length);for(f=r-1;0<=f&&128==(192&t[f]);)f--;return 0>f||0===f?r:f+w[t[f]]>r?f:r}},3693:function(g){g.exports=function(h,c,p,m){var q=65535&h|0;h=h>>>16&65535|0;for(var E;0!==p;){p-=E=2E3m;m++){c=m;for(var q=0;8>q;q++)c=1&c?3988292384^c>>>1:c>>>1;p[m]=c}return p}();g.exports=function(c,p,m,q){m=q+m;for(c^=-1;q>>8^h[255&(c^p[q])];return-1^c}},7651:function(g,h,c){function p(N,la){return N.msg=L[la],la}function m(N){for(var la= N.length;0<=--la;)N[la]=0}function q(N){var la=N.state,R=la.pending;R>N.avail_out&&(R=N.avail_out);0!==R&&(V.arraySet(N.output,la.pending_buf,la.pending_out,R,N.next_out),N.next_out+=R,la.pending_out+=R,N.total_out+=R,N.avail_out-=R,la.pending-=R,0===la.pending&&(la.pending_out=0))}function E(N,la){T._tr_flush_block(N,0<=N.block_start?N.block_start:-1,N.strstart-N.block_start,la);N.block_start=N.strstart;q(N.strm)}function w(N,la){N.pending_buf[N.pending++]=la}function t(N,la){N.pending_buf[N.pending++]= la>>>8&255;N.pending_buf[N.pending++]=255&la}function r(N,la){var R,Z,X=N.max_chain_length,S=N.strstart,ha=N.prev_length,W=N.nice_match,ra=N.strstart>N.w_size-262?N.strstart-(N.w_size-262):0,wa=N.window,va=N.w_mask,Fa=N.prev,Ba=N.strstart+258,Ka=wa[S+ha-1],Oa=wa[S+ha];N.prev_length>=N.good_match&&(X>>=2);W>N.lookahead&&(W=N.lookahead);do if(wa[(R=la)+ha]===Oa&&wa[R+ha-1]===Ka&&wa[R]===wa[S]&&wa[++R]===wa[S+1]){S+=2;for(R++;wa[++S]===wa[++R]&&wa[++S]===wa[++R]&&wa[++S]===wa[++R]&&wa[++S]===wa[++R]&& wa[++S]===wa[++R]&&wa[++S]===wa[++R]&&wa[++S]===wa[++R]&&wa[++S]===wa[++R]&&Sha){if(N.match_start=la,ha=Z,Z>=W)break;Ka=wa[S+ha-1];Oa=wa[S+ha]}}while((la=Fa[la&va])>ra&&0!=--X);return ha<=N.lookahead?ha:N.lookahead}function f(N){var la,R,Z,X,S,ha,W,ra=N.w_size;do{if(R=N.window_size-N.lookahead-N.strstart,N.strstart>=ra+(ra-262)){V.arraySet(N.window,N.window,ra,ra,0);N.match_start-=ra;N.strstart-=ra;N.block_start-=ra;var wa=la=N.hash_size;do{var va=N.head[--wa];N.head[wa]= va>=ra?va-ra:0}while(--la);wa=la=ra;do va=N.prev[--wa],N.prev[wa]=va>=ra?va-ra:0;while(--la);R+=ra}if(0===N.strm.avail_in)break;if(Z=N.strm,X=N.window,S=N.strstart+N.lookahead,ha=R,W=void 0,(W=Z.avail_in)>ha&&(W=ha),la=0===W?0:(Z.avail_in-=W,V.arraySet(X,Z.input,Z.next_in,W,S),1===Z.state.wrap?Z.adler=K(Z.adler,X,W,S):2===Z.state.wrap&&(Z.adler=D(Z.adler,X,W,S)),Z.next_in+=W,Z.total_in+=W,W),N.lookahead+=la,3<=N.lookahead+N.insert)for(wa=N.strstart-N.insert,N.ins_h=N.window[wa],N.ins_h=(N.ins_h<< N.hash_shift^N.window[wa+1])&N.hash_mask;N.insert&&(N.ins_h=(N.ins_h<N.lookahead+N.insert)););}while(262>N.lookahead&&0!==N.strm.avail_in)}function F(N,la){for(var R,Z;;){if(262>N.lookahead){if(f(N),262>N.lookahead&&0===la)return 1;if(0===N.lookahead)break}if(R=0,3<=N.lookahead&&(N.ins_h=(N.ins_h<N.strstart?N.strstart:2,4===la?(E(N,!0),0===N.strm.avail_out?3:4):N.last_lit&&(E(N,!1),0===N.strm.avail_out)?1:2}function C(N,la){for(var R,Z,X;;){if(262>N.lookahead){if(f(N),262>N.lookahead&&0===la)return 1;if(0===N.lookahead)break}if(R=0,3<=N.lookahead&&(N.ins_h=(N.ins_h<< N.hash_shift^N.window[N.strstart+3-1])&N.hash_mask,R=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=2,0!==R&&N.prev_length=N.match_length&&(1===N.strategy||3===N.match_length&&4096N.strstart?N.strstart:2,4===la?(E(N,!0),0===N.strm.avail_out?3:4):N.last_lit&&(E(N,!1),0===N.strm.avail_out)?1:2}function M(N,la,R,Z,X){this.good_length=N;this.max_lazy=la;this.nice_length=R;this.max_chain=Z;this.func=X}function aa(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex= 0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new V.Buf16(1146);this.dyn_dtree=new V.Buf16(122); this.bl_tree=new V.Buf16(78);m(this.dyn_ltree);m(this.dyn_dtree);m(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new V.Buf16(16);this.heap=new V.Buf16(573);m(this.heap);this.heap_max=this.heap_len=0;this.depth=new V.Buf16(573);m(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function O(N){var la;return N&&N.state?(N.total_in=N.total_out=0,N.data_type=2,(la=N.state).pending=0, la.pending_out=0,0>la.wrap&&(la.wrap=-la.wrap),la.status=la.wrap?42:113,N.adler=2===la.wrap?0:1,la.last_flush=0,T._tr_init(la),0):p(N,-2)}function U(N){var la,R=O(N);return 0===R&&((la=N.state).window_size=2*la.w_size,m(la.head),la.max_lazy_match=Q[la.level].max_lazy,la.good_match=Q[la.level].good_length,la.nice_match=Q[la.level].nice_length,la.max_chain_length=Q[la.level].max_chain,la.strstart=0,la.block_start=0,la.lookahead=0,la.insert=0,la.match_length=la.prev_length=2,la.match_available=0,la.ins_h= 0),R}function P(N,la,R,Z,X,S){if(!N)return-2;var ha=1;if(-1===la&&(la=6),0>Z?(ha=0,Z=-Z):15X||9Z||15la||9S||4N.pending_buf_size-5&&(R=N.pending_buf_size-5);;){if(1>=N.lookahead){if(f(N),0===N.lookahead&&0===la)return 1;if(0===N.lookahead)break}N.strstart+=N.lookahead;N.lookahead=0;var Z=N.block_start+R;if((0===N.strstart||N.strstart>= Z)&&(N.lookahead=N.strstart-Z,N.strstart=Z,E(N,!1),0===N.strm.avail_out)||N.strstart-N.block_start>=N.w_size-262&&(E(N,!1),0===N.strm.avail_out))return 1}return N.insert=0,4===la?(E(N,!0),0===N.strm.avail_out?3:4):(N.strstart>N.block_start&&(E(N,!1),N.strm.avail_out),1)}),new M(4,4,8,4,F),new M(4,5,16,8,F),new M(4,6,32,32,F),new M(4,4,16,16,C),new M(8,16,32,32,C),new M(8,16,128,128,C),new M(8,32,128,256,C),new M(32,128,258,1024,C),new M(32,258,258,4096,C)];h.deflateInit=function(N,la){return P(N, la,8,15,8,0)};h.deflateInit2=P;h.deflateReset=U;h.deflateResetKeep=O;h.deflateSetHeader=function(N,la){return N&&N.state?2!==N.state.wrap?-2:(N.state.gzhead=la,0):-2};h.deflate=function(N,la){var R,Z;if(!N||!N.state||5la)return N?p(N,-2):-2;if(Z=N.state,!N.output||!N.input&&0!==N.avail_in||666===Z.status&&4!==la)return p(N,0===N.avail_out?-5:-2);if(Z.strm=N,R=Z.last_flush,Z.last_flush=la,42===Z.status)if(2===Z.wrap)N.adler=0,w(Z,31),w(Z,139),w(Z,8),Z.gzhead?(w(Z,(Z.gzhead.text?1:0)+(Z.gzhead.hcrc? 2:0)+(Z.gzhead.extra?4:0)+(Z.gzhead.name?8:0)+(Z.gzhead.comment?16:0)),w(Z,255&Z.gzhead.time),w(Z,Z.gzhead.time>>8&255),w(Z,Z.gzhead.time>>16&255),w(Z,Z.gzhead.time>>24&255),w(Z,9===Z.level?2:2<=Z.strategy||2>Z.level?4:0),w(Z,255&Z.gzhead.os),Z.gzhead.extra&&Z.gzhead.extra.length&&(w(Z,255&Z.gzhead.extra.length),w(Z,Z.gzhead.extra.length>>8&255)),Z.gzhead.hcrc&&(N.adler=D(N.adler,Z.pending_buf,Z.pending,0)),Z.gzindex=0,Z.status=69):(w(Z,0),w(Z,0),w(Z,0),w(Z,0),w(Z,0),w(Z,9===Z.level?2:2<=Z.strategy|| 2>Z.level?4:0),w(Z,3),Z.status=113);else{var X=8+(Z.w_bits-8<<4)<<8;X|=(2<=Z.strategy||2>Z.level?0:6>Z.level?1:6===Z.level?2:3)<<6;0!==Z.strstart&&(X|=32);Z.status=113;t(Z,X+(31-X%31));0!==Z.strstart&&(t(Z,N.adler>>>16),t(Z,65535&N.adler));N.adler=1}if(69===Z.status)if(Z.gzhead.extra){for(X=Z.pending;Z.gzindex<(65535&Z.gzhead.extra.length)&&(Z.pending!==Z.pending_buf_size||(Z.gzhead.hcrc&&Z.pending>X&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X)),q(N),X=Z.pending,Z.pending!==Z.pending_buf_size));)w(Z, 255&Z.gzhead.extra[Z.gzindex]),Z.gzindex++;Z.gzhead.hcrc&&Z.pending>X&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X));Z.gzindex===Z.gzhead.extra.length&&(Z.gzindex=0,Z.status=73)}else Z.status=73;if(73===Z.status)if(Z.gzhead.name){X=Z.pending;do{if(Z.pending===Z.pending_buf_size&&(Z.gzhead.hcrc&&Z.pending>X&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X)),q(N),X=Z.pending,Z.pending===Z.pending_buf_size)){var S=1;break}S=Z.gzindexX&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X));0===S&&(Z.gzindex=0,Z.status=91)}else Z.status=91;if(91===Z.status)if(Z.gzhead.comment){X=Z.pending;do{if(Z.pending===Z.pending_buf_size&&(Z.gzhead.hcrc&&Z.pending>X&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X)),q(N),X=Z.pending,Z.pending===Z.pending_buf_size)){S=1;break}S=Z.gzindex X&&(N.adler=D(N.adler,Z.pending_buf,Z.pending-X,X));0===S&&(Z.status=103)}else Z.status=103;if(103===Z.status&&(Z.gzhead.hcrc?(Z.pending+2>Z.pending_buf_size&&q(N),Z.pending+2<=Z.pending_buf_size&&(w(Z,255&N.adler),w(Z,N.adler>>8&255),N.adler=0,Z.status=113)):Z.status=113),0!==Z.pending){if(q(N),0===N.avail_out)return Z.last_flush=-1,0}else if(0===N.avail_in&&(la<<1)-(4=ha.lookahead){if(f(ha),258>= ha.lookahead&&0===W)return 1;if(0===ha.lookahead)break}if(ha.match_length=0,3<=ha.lookahead&&0ha.lookahead&&(ha.match_length=ha.lookahead)}if(3<=ha.match_length?(ra=T._tr_tally(ha,1,ha.match_length-3),ha.lookahead-=ha.match_length, ha.strstart+=ha.match_length,ha.match_length=0):(ra=T._tr_tally(ha,0,ha.window[ha.strstart]),ha.lookahead--,ha.strstart++),ra&&(E(ha,!1),0===ha.strm.avail_out))return 1}return ha.insert=0,4===W?(E(ha,!0),0===ha.strm.avail_out?3:4):ha.last_lit&&(E(ha,!1),0===ha.strm.avail_out)?1:2}(Z,la):Q[Z.level].func(Z,la);if(3!==R&&4!==R||(Z.status=666),1===R||3===R)return 0===N.avail_out&&(Z.last_flush=-1),0;if(2===R&&(1===la?T._tr_align(Z):5!==la&&(T._tr_stored_block(Z,0,0,!1),3===la&&(m(Z.head),0===Z.lookahead&& (Z.strstart=0,Z.block_start=0,Z.insert=0))),q(N),0===N.avail_out))return Z.last_flush=-1,0}return 4!==la?0:0>=Z.wrap?1:(2===Z.wrap?(w(Z,255&N.adler),w(Z,N.adler>>8&255),w(Z,N.adler>>16&255),w(Z,N.adler>>24&255),w(Z,255&N.total_in),w(Z,N.total_in>>8&255),w(Z,N.total_in>>16&255),w(Z,N.total_in>>24&255)):(t(Z,N.adler>>>16),t(Z,65535&N.adler)),q(N),0=R.w_size&&(0===Z&&(m(R.head),R.strstart=0,R.block_start=0,R.insert=0),X=new V.Buf8(R.w_size),V.arraySet(X,la,S-R.w_size,R.w_size,0),la=X,S=R.w_size);X=N.avail_in;var ha=N.next_in;var W=N.input;N.avail_in=S;N.next_in=0;N.input=la;for(f(R);3<= R.lookahead;){la=R.strstart;S=R.lookahead-2;do R.ins_h=(R.ins_h<T&&(V+=t[w++]<< T,T+=8,V+=t[w++]<>>=p=N>>>24,T-=p,0===(p=N>>>16&255))F[f++]=65535&N;else{if(!(16&p)){if(0==(64&p)){N=K[(65535&N)+(V&(1<>>=p,T-=p);15>T&&(V+=t[w++]<>>=p=N>>>24,T-=p,!(16&(p=N>>>16&255))){if(0==(64&p)){N=D[(65535&N)+(V&(1<M){h.msg="invalid distance too far back";E.mode=30;break a}if(V>>>=p,T-=p,m>(p=f-c)){if((p=m-p)>O&&E.sane){h.msg="invalid distance too far back";E.mode=30;break a}if(N=0,q=P,0===U){if(N+=aa-p,p>3;V&=(1<<(T-=la<<3))-1;h.next_in=w;h.next_out=f;h.avail_in=w>>24&255)+(V>>>8&65280)+((65280& V)<<8)+((255&V)<<24)}function m(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new f.Buf16(320);this.work=new f.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0} function q(V){var T;return V&&V.state?(T=V.state,V.total_in=V.total_out=T.total=0,V.msg="",T.wrap&&(V.adler=1&T.wrap),T.mode=1,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new f.Buf32(852),T.distcode=T.distdyn=new f.Buf32(592),T.sane=1,T.back=-1,0):-2}function E(V){var T;return V&&V.state?((T=V.state).wsize=0,T.whave=0,T.wnext=0,q(V)):-2}function w(V,T){var K,D;return V&&V.state?(D=V.state,0>T?(K=0,T=-T):(K=1+(T>>4),48>T&&(T&=15)),T&&(8>T||15=V.wsize?(f.arraySet(V.window,T,K-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):((L=V.wsize-V.wnext)>D&&(L=D),f.arraySet(V.window,T,K-D,L,V.wnext),(D-=L)?(f.arraySet(V.window,T,K-D,D,0),V.wnext=D,V.whave=V.wsize): (V.wnext+=L,V.wnext===V.wsize&&(V.wnext=0),V.whaveOa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>8&255;K.check=C(K.check,S,2,0);Oa=Ka=0;K.mode=2;break}if(K.flags=0,K.head&&(K.head.done=!1),!(1&K.wrap)||(((255&Ka)<<8)+(Ka>>8))%31){V.msg="incorrect header check";K.mode=30;break}if(8!=(15&Ka)){V.msg= "unknown compression method";K.mode=30;break}if(Oa-=4,R=8+(15&(Ka>>>=4)),0===K.wbits)K.wbits=R;else if(R>K.wbits){V.msg="invalid window size";K.mode=30;break}K.dmax=1<Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>8&1);512&K.flags&&(S[0]=255&Ka,S[1]=Ka>>> 8&255,K.check=C(K.check,S,2,0));Oa=Ka=0;K.mode=3;case 3:for(;32>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>8&255,S[2]=Ka>>>16&255,S[3]=Ka>>>24&255,K.check=C(K.check,S,4,0));Oa=Ka=0;K.mode=4;case 4:for(;16>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>8);512&K.flags&&(S[0]=255&Ka,S[1]=Ka>>>8&255,K.check=C(K.check,S,2,0));Oa=Ka=0;K.mode=5;case 5:if(1024&K.flags){for(;16>Oa;){if(0=== Ba)break a;Ba--;Ka+=Fa[va++]<>>8&255,K.check=C(K.check,S,2,0));Oa=Ka=0}else K.head&&(K.head.extra=null);K.mode=6;case 6:if(1024&K.flags&&((D=K.length)>Ba&&(D=Ba),D&&(K.head&&(R=K.head.extra_len-K.length,K.head.extra||(K.head.extra=Array(K.head.extra_len)),f.arraySet(K.head.extra,Fa,va,D,R)),512&K.flags&&(K.check=C(K.check,Fa,D,va)),Ba-=D,va+=D,K.length-=D),K.length))break a;K.length=0;K.mode=7;case 7:if(2048&K.flags){if(0=== Ba)break a;D=0;do R=Fa[va+D++],K.head&&R&&65536>K.length&&(K.head.name+=String.fromCharCode(R));while(R&&DK.length&&(K.head.comment+=String.fromCharCode(R));while(R&&D Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>9&1,K.head.done=!0);V.adler=K.check=0;K.mode=12;break;case 10:for(;32>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>= 7&Oa;Oa-=7&Oa;K.mode=27;break}for(;3>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>=1)){case 0:K.mode=14;break;case 1:var La=K;if(P){O=new f.Buf32(512);U=new f.Buf32(32);for(Q=0;144>Q;)La.lens[Q++]=8;for(;256>Q;)La.lens[Q++]=9;for(;280>Q;)La.lens[Q++]=7;for(;288>Q;)La.lens[Q++]=8;aa(1,La.lens,0,288,O,0,La.work,{bits:9});for(Q=0;32>Q;)La.lens[Q++]=5;aa(2,La.lens,0,32,U,0,La.work,{bits:5});P=!1}La.lencode=O;La.lenbits=9;La.distcode=U;La.distbits=5;if(K.mode=20,6=== T){Ka>>>=2;Oa-=2;break a}break;case 2:K.mode=17;break;case 3:V.msg="invalid block type",K.mode=30}Ka>>>=2;Oa-=2;break;case 14:Ka>>>=7&Oa;for(Oa-=7&Oa;32>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>16^65535)){V.msg="invalid stored block lengths";K.mode=30;break}if(K.length=65535&Ka,Ka=0,Oa=0,K.mode=15,6===T)break a;case 15:K.mode=16;case 16:if(D=K.length){if(D>Ba&&(D=Ba),D>wa&&(D=wa),0===D)break a;f.arraySet(ra,Fa,va,D,W);Ba-=D;va+=D;wa-=D;W+=D;K.length-=D;break}K.mode= 12;break;case 17:for(;14>Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>=5,Oa-=5,K.ndist=1+(31&Ka),Ka>>>=5,Oa-=5,K.ncode=4+(15&Ka),Ka>>>=4,Oa-=4,286Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>=3;Oa-=3}for(;19>K.have;)K.lens[ha[K.have++]]=0;if(K.lencode=K.lendyn,K.lenbits=7,Z={bits:K.lenbits},Ua= aa(0,K.lens,0,19,K.lencode,0,K.work,Z),K.lenbits=Z.bits,Ua){V.msg="invalid code lengths set";K.mode=30;break}K.have=0;K.mode=19;case 19:for(;K.have>>24)<=Oa);){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<N)Ka>>>=Q,Oa-=Q,K.lens[K.have++]=N;else{if(16===N){for(La=Q+2;Oa>>=Q,Oa-=Q,0===K.have){V.msg="invalid bit length repeat";K.mode=30;break}R=K.lens[K.have-1];D= 3+(3&Ka);Ka>>>=2;Oa-=2}else if(17===N){for(La=Q+3;Oa>>=Q));Ka>>>=3;Oa-=3}else{for(La=Q+7;Oa>>=Q));Ka>>>=7;Oa-=7}if(K.have+D>K.nlen+K.ndist){V.msg="invalid bit length repeat";K.mode=30;break}for(;D--;)K.lens[K.have++]=R}}if(30===K.mode)break;if(0===K.lens[256]){V.msg="invalid code -- missing end-of-block";K.mode=30;break}if(K.lenbits=9,Z={bits:K.lenbits}, Ua=aa(1,K.lens,0,K.nlen,K.lencode,0,K.work,Z),K.lenbits=Z.bits,Ua){V.msg="invalid literal/lengths set";K.mode=30;break}if(K.distbits=6,K.distcode=K.distdyn,Z={bits:K.distbits},Ua=aa(2,K.lens,K.nlen,K.ndist,K.distcode,0,K.work,Z),K.distbits=Z.bits,Ua){V.msg="invalid distances set";K.mode=30;break}if(K.mode=20,6===T)break a;case 20:K.mode=21;case 21:if(6<=Ba&&258<=wa){V.next_out=W;V.avail_out=wa;V.next_in=va;V.avail_in=Ba;K.hold=Ka;K.bits=Oa;M(V,Ya);W=V.next_out;ra=V.output;wa=V.avail_out;va=V.next_in; Fa=V.input;Ba=V.avail_in;Ka=K.hold;Oa=K.bits;12===K.mode&&(K.back=-1);break}for(K.back=0;La=(X=K.lencode[Ka&(1<>>16&255,N=65535&X,!((Q=X>>>24)<=Oa);){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>ma)])>>>16&255,N=65535&X,!(ma+(Q=X>>>24)<=Oa);){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>=ma;Oa-=ma;K.back+=ma}if(Ka>>>=Q,Oa-=Q,K.back+=Q,K.length=N,0===La){K.mode=26;break}if(32&La){K.back=-1; K.mode=12;break}if(64&La){V.msg="invalid literal/length code";K.mode=30;break}K.extra=15&La;K.mode=22;case 22:if(K.extra){for(La=K.extra;Oa>>=K.extra;Oa-=K.extra;K.back+=K.extra}K.was=K.length;K.mode=23;case 23:for(;La=(X=K.distcode[Ka&(1<>>16&255,N=65535&X,!((Q=X>>>24)<=Oa);){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>ma)])>>> 16&255,N=65535&X,!(ma+(Q=X>>>24)<=Oa);){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<>>=ma;Oa-=ma;K.back+=ma}if(Ka>>>=Q,Oa-=Q,K.back+=Q,64&La){V.msg="invalid distance code";K.mode=30;break}K.offset=N;K.extra=15&La;K.mode=24;case 24:if(K.extra){for(La=K.extra;Oa>>=K.extra;Oa-=K.extra;K.back+=K.extra}if(K.offset>K.dmax){V.msg="invalid distance too far back";K.mode=30;break}K.mode=25;case 25:if(0===wa)break a;if(D= Ya-wa,K.offset>D){if((D=K.offset-D)>K.whave&&K.sane){V.msg="invalid distance too far back";K.mode=30;break}D>K.wnext?(D-=K.wnext,L=K.wsize-D):L=K.wnext-D;D>K.length&&(D=K.length);Q=K.window}else Q=ra,L=W-K.offset,D=K.length;D>wa&&(D=wa);wa-=D;K.length-=D;do ra[W++]=Q[L++];while(--D);0===K.length&&(K.mode=21);break;case 26:if(0===wa)break a;ra[W++]=K.length;wa--;K.mode=21;break;case 27:if(K.wrap){for(;32>Oa;){if(0===Ba)break a;Ba--;Ka|=Fa[va++]<Oa;){if(0===Ba)break a;Ba--;Ka+=Fa[va++]<K.mode&&(27>K.mode||4!==T))&&r(V,V.output,V.next_out,Ya-V.avail_out)?(K.mode=31,-4):(Va-=V.avail_in,Ya-=V.avail_out,V.total_in+=Va,V.total_out+=Ya,K.total+=Ya,K.wrap&&Ya&&(V.adler=K.check=K.flags?C(K.check,ra,Ya,V.next_out-Ya):F(K.check,ra,Ya,V.next_out-Ya)),V.data_type=K.bits+(K.last?64:0)+(12===K.mode?128:0)+(20===K.mode||15===K.mode?256:0),(0===Va&&0===Ya||4===T)&&0===Ua&&(Ua=-5),Ua)};h.inflateEnd=function(V){if(!V||!V.state)return-2;var T=V.state;return T.window&& (T.window=null),V.state=null,0};h.inflateGetHeader=function(V,T){var K;return V&&V.state?0==(2&(K=V.state).wrap)?-2:(K.head=T,T.done=!1,0):-2};h.inflateSetDictionary=function(V,T){var K,D=T.length;return V&&V.state?0!==(K=V.state).wrap&&11!==K.mode?-2:11===K.mode&&F(1,T,D,0)!==K.check?-3:r(V,T,D,D)?(K.mode=31,-4):(K.havedict=1,0):-2};h.inflateInfo="pako inflate (from Nodeca project)"},6446:function(g,h,c){var p=c(9187),m=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195, 227,258,0,0],q=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],E=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],w=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];g.exports=function(t,r,f,F,C,M,aa,O){var U,P,V,T,K,D,L=O.bits,Q,N,la,R,Z,X=0,S,ha=null,W=0,ra=new p.Buf16(16);var wa=new p.Buf16(16);var va=null,Fa=0;for(Q=0;15>=Q;Q++)ra[Q]= 0;for(N=0;Nla&&(Ba=la),0===la)return C[M++]=20971520,C[M++]=20971520,O.bits=1,0;for(L=1;L=Q;Q++)if(U<<=1,0>(U-=ra[Q]))return-1;if(0Q;Q++)wa[Q+1]=wa[Q]+ra[Q];for(N=0;NT?(K=va[Fa+aa[N]],D=ha[W+aa[N]]):(K=96,D=0);U=1<>Z)+(P-=U)]=Ka<<24|K<<16|D|0;while(0!==P);for(U=1<>=1;if(0!==U?(S&=U-1,S+=U):S=0,N++,0==--ra[Q]){if(Q===la)break;Q=r[f+aa[N]]}if(Q>Ba&&(S&F)!==V){0===Z&&(Z=Ba);wa+=L;for(U=1<<(R=Q-Z);R+Z=(U-=ra[R+Z]));)R++,U<<=1;if(X+=1< Ba?X[Ba]:X[256+(Ba>>>7)]}function w(Ba,Ka){Ba.pending_buf[Ba.pending++]=255&Ka;Ba.pending_buf[Ba.pending++]=Ka>>>8&255}function t(Ba,Ka,Oa){Ba.bi_valid>16-Oa?(Ba.bi_buf|=Ka<>16-Ba.bi_valid,Ba.bi_valid+=Oa-16):(Ba.bi_buf|=Ka<>>=1,Oa<<=1;while(0<--Ka);return Oa>>>1}function F(Ba,Ka,Oa){var Va,Ya=Array(16),Ua=0;for(Va=1;15>=Va;Va++)Ya[Va]= Ua=Ua+Oa[Va-1]<<1;for(Oa=0;Oa<=Ka;Oa++)Va=Ba[2*Oa+1],0!==Va&&(Ba[2*Oa]=f(Ya[Va]++,Va))}function C(Ba){var Ka;for(Ka=0;286>Ka;Ka++)Ba.dyn_ltree[2*Ka]=0;for(Ka=0;30>Ka;Ka++)Ba.dyn_dtree[2*Ka]=0;for(Ka=0;19>Ka;Ka++)Ba.bl_tree[2*Ka]=0;Ba.dyn_ltree[512]=1;Ba.opt_len=Ba.static_len=0;Ba.last_lit=Ba.matches=0}function M(Ba){8Ba.heap_len;)Ya[2*(Va=Ba.heap[++Ba.heap_len]=2>ja?++ja:0)]=1,Ba.depth[Va]=0,Ba.opt_len--,La&&(Ba.static_len-=Ua[2*Va+1]);Ka.max_code=ja;for(Oa=Ba.heap_len>> 1;1<=Oa;Oa--)O(Ba,Ya,Oa);Va=ma;do Oa=Ba.heap[1],Ba.heap[1]=Ba.heap[Ba.heap_len--],O(Ba,Ya,1),Ua=Ba.heap[1],Ba.heap[--Ba.heap_max]=Oa,Ba.heap[--Ba.heap_max]=Ua,Ya[2*Va]=Ya[2*Oa]+Ya[2*Ua],Ba.depth[Va]=(Ba.depth[Oa]>=Ba.depth[Ua]?Ba.depth[Oa]:Ba.depth[Ua])+1,Ya[2*Oa+1]=Ya[2*Ua+1]=Va,Ba.heap[1]=Va++,O(Ba,Ya,1);while(2<=Ba.heap_len);Ba.heap[--Ba.heap_max]=Ba.heap[1];var oa,ia,sa,Ea,Qa;Oa=Ka.dyn_tree;Va=Ka.max_code;Ua=Ka.stat_desc.static_tree;La=Ka.stat_desc.has_stree;ma=Ka.stat_desc.extra_bits;var Xa= Ka.stat_desc.extra_base,Pa=Ka.stat_desc.max_length,cb=0;for(sa=0;15>=sa;sa++)Ba.bl_count[sa]=0;Oa[2*Ba.heap[Ba.heap_max]+1]=0;for(Ka=Ba.heap_max+1;573>Ka;Ka++)(sa=Oa[2*Oa[2*(oa=Ba.heap[Ka])+1]+1]+1)>Pa&&(sa=Pa,cb++),Oa[2*oa+1]=sa,oa>Va||(Ba.bl_count[sa]++,Ea=0,oa>=Xa&&(Ea=ma[oa-Xa]),Qa=Oa[2*oa],Ba.opt_len+=Qa*(sa+Ea),La&&(Ba.static_len+=Qa*(Ua[2*oa+1]+Ea)));if(0!==cb){do{for(sa=Pa-1;0===Ba.bl_count[sa];)sa--;Ba.bl_count[sa]--;Ba.bl_count[sa+1]+=2;Ba.bl_count[Pa]--;cb-=2}while(0Va||(Oa[2*ia+1]!==sa&&(Ba.opt_len+=(sa-Oa[2*ia+1])*Oa[2*ia],Oa[2*ia+1]=sa),oa--)}F(Ya,ja,Ba.bl_count)}function V(Ba,Ka,Oa){var Va,Ya=-1,Ua=Ka[1],La=0,ma=7,ja=4;0===Ua&&(ma=138,ja=3);Ka[2*(Oa+1)+1]=65535;for(Va=0;Va<=Oa;Va++){var oa=Ua;Ua=Ka[2*(Va+1)+1];++La=La?Ba.bl_tree[34]++:Ba.bl_tree[36]++,La=0,Ya=oa,0===Ua?(ma=138,ja=3):oa===Ua?(ma=6,ja= 3):(ma=7,ja=4))}}function T(Ba,Ka,Oa){var Va,Ya,Ua=-1,La=Ka[1],ma=0,ja=7,oa=4;0===La&&(ja=138,oa=3);for(Va=0;Va<=Oa;Va++)if(Ya=La,La=Ka[2*(Va+1)+1],!(++ma=ma?(r(Ba,17,Ba.bl_tree),t(Ba,ma-3,3)):(r(Ba,18,Ba.bl_tree),t(Ba,ma-11,7));ma=0;Ua=Ya;0===La?(ja=138,oa=3):Ya===La?(ja=6,oa=3):(ja=7,oa=4)}}function K(Ba,Ka,Oa,Va){t(Ba,Va?1:0,3);M(Ba);w(Ba,Oa);w(Ba, ~Oa);D.arraySet(Ba.pending_buf,Ba.window,Ka,Oa,Ba.pending);Ba.pending+=Oa}var D=c(9187),L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Q=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],la=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=Array(576);p(R);var Z=Array(60);p(Z);var X=Array(512);p(X);var S=Array(256);p(S);var ha=Array(29);p(ha);var W,ra,wa,va=Array(30);p(va);var Fa=!1;h._tr_init=function(Ba){if(!Fa){var Ka, Oa,Va,Ya=Array(16);for(Va=Oa=0;28>Va;Va++)for(ha[Va]=Oa,Ka=0;Ka<1<Va;Va++)for(va[Va]=Oa,Ka=0;Ka<1<>=7;30>Va;Va++)for(va[Va]=Oa<<7,Ka=0;Ka<1<=Ka;Ka++)Ya[Ka]=0;for(Ka=0;143>=Ka;)R[2*Ka+1]=8,Ka++,Ya[8]++;for(;255>=Ka;)R[2*Ka+1]=9,Ka++,Ya[9]++;for(;279>=Ka;)R[2*Ka+1]=7,Ka++,Ya[7]++;for(;287>=Ka;)R[2*Ka+1]=8,Ka++,Ya[8]++;F(R,287,Ya);for(Ka=0;30>Ka;Ka++)Z[2*Ka+1]=5,Z[2*Ka]=f(Ka,5);W=new m(R, L,257,286,15);ra=new m(Z,Q,0,30,15);wa=new m([],N,0,19,7);!0;Fa=!0}Ba.l_desc=new q(Ba.dyn_ltree,W);Ba.d_desc=new q(Ba.dyn_dtree,ra);Ba.bl_desc=new q(Ba.bl_tree,wa);Ba.bi_buf=0;Ba.bi_valid=0;C(Ba)};h._tr_stored_block=K;h._tr_flush_block=function(Ba,Ka,Oa,Va){var Ya,Ua,La=0;0=ja;ja++,oa>>>=1)if(1&oa&&0!==ma.dyn_ltree[2*ja])return 0;if(0!==ma.dyn_ltree[18]||0!==ma.dyn_ltree[20]||0!==ma.dyn_ltree[26])return 1; for(ja=32;256>ja;ja++)if(0!==ma.dyn_ltree[2*ja])return 1;return 0}(Ba)),P(Ba,Ba.l_desc),P(Ba,Ba.d_desc),La=function(ma){var ja;V(ma,ma.dyn_ltree,ma.l_desc.max_code);V(ma,ma.dyn_dtree,ma.d_desc.max_code);P(ma,ma.bl_desc);for(ja=18;3<=ja&&0===ma.bl_tree[2*la[ja]+1];ja--);return ma.opt_len+=3*(ja+1)+14,ja}(Ba),Ya=Ba.opt_len+3+7>>>3,(Ua=Ba.static_len+3+7>>>3)<=Ya&&(Ya=Ua)):Ya=Ua=Oa+5;Oa+4<=Ya&&-1!==Ka?K(Ba,Ka,Oa,Va):4===Ba.strategy||Ua===Ya?(t(Ba,2+(Va?1:0),3),U(Ba,R,Z)):(t(Ba,4+(Va?1:0),3),function(ma, ja,oa,ia){var sa;t(ma,ja-257,5);t(ma,oa-1,5);t(ma,ia-4,4);for(sa=0;sa>>8&255,Ba.pending_buf[Ba.d_buf+2*Ba.last_lit+1]=255&Ka,Ba.pending_buf[Ba.l_buf+Ba.last_lit]=255&Oa,Ba.last_lit++,0===Ka?Ba.dyn_ltree[2*Oa]++:(Ba.matches++,Ka--,Ba.dyn_ltree[2* (S[Oa]+256+1)]++,Ba.dyn_dtree[2*E(Ka)]++),Ba.last_lit===Ba.lit_bufsize-1};h._tr_align=function(Ba){t(Ba,2,3);r(Ba,256,R);16===Ba.bi_valid?(w(Ba,Ba.bi_buf),Ba.bi_buf=0,Ba.bi_valid=0):8<=Ba.bi_valid&&(Ba.pending_buf[Ba.pending++]=255&Ba.bi_buf,Ba.bi_buf>>=8,Ba.bi_valid-=8)}},249:function(g){g.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},9066:function(g){g.exports= function(h){h.data&&h.name&&(h=h.data);for(var c=!0,p="",m="",q=0;qU&&(U= V,P=L)}return Math.sqrt(U)>C?(w(r,f,P+1,C,M),w(r,P,F,C,M)):(M.length||M.push(aa),M.push(O)),M}function t(r,f=.15,F){const C=[],M=(r.length-1)/3;for(let aa=0;aa{const [Pa,cb]=Xa;Xa[0]=(Pa-ia)*Ea-(cb-sa)*Qa+ia;Xa[1]=(Pa-ia)*Qa+(cb-sa)*Ea+sa})}}function m(ma){const ja=ma[0];ma=ma[1];return Math.sqrt(Math.pow(ja[0]-ma[0],2)+Math.pow(ja[1]-ma[1],2))}function q(ma, ja){const oa=ja.hachureAngle+90;var ia=ja.hachureGap;0>ia&&(ia=4*ja.strokeWidth);ia=Math.max(ia,.1);ja=[0,0];if(oa)for(const sa of ma)p(sa,ja,oa);ia=function(sa,Ea){var Qa=[];for(var Xa of sa)sa=[...Xa],sa[0].join(",")!==sa[sa.length-1].join(",")&&sa.push([sa[0][0],sa[0][1]]),2Mb.yminyb.ymin?1:Mb.xyb.x?1:Mb.ymax===yb.ymax?0:(Mb.ymax-yb.ymax)/Math.abs(Mb.ymax-yb.ymax)),!sa.length)return Xa;let cb=[],tb=sa[0].ymin;for(;cb.length||sa.length;){if(sa.length){Pa=-1;for(Qa=0;Qatb);Qa++)Pa=Qa;sa.splice(0,Pa+1).forEach(Mb=>{cb.push({s:tb,edge:Mb})})}if(cb=cb.filter(Mb=>!(Mb.edge.ymax<=tb)),cb.sort((Mb,yb)=>Mb.edge.x===yb.edge.x?0:(Mb.edge.x- yb.edge.x)/Math.abs(Mb.edge.x-yb.edge.x)),1=cb.length)break;Xa.push([[Math.round(cb[Pa].edge.x),tb],[Math.round(cb[Qa].edge.x),tb]])}tb+=Ea;cb.forEach(Mb=>{Mb.edge.x+=Ea*Mb.edge.islope})}return Xa}(ma,ia);if(oa){for(const sa of ma)p(sa,ja,-oa);!function(sa,Ea,Qa){const Xa=[];sa.forEach(Pa=>Xa.push(...Pa));p(Xa,Ea,Qa)}(ia,ja,-oa)}return ia}function E(ma){const ja=[];a:{var oa=ma;for(var ia=[];""!==oa;){if(!oa.match(/^([ \t\r\n,]+)/))if(oa.match(/^([aAcChHlLmMqQsStTvVzZ])/))ia[ia.length]= {type:0,text:RegExp.$1};else{if(!oa.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)){oa=[];break a}ia[ia.length]={type:1,text:`${parseFloat(RegExp.$1)}`}}oa=oa.substr(RegExp.$1.length)}oa=(ia[ia.length]={type:2,text:""},ia)}ia="BOD";let sa=0;for(var Ea=oa[sa];2!==Ea.type;){let Qa=0;const Xa=[];if("BOD"===ia){if("M"!==Ea.text&&"m"!==Ea.text)return E("M0,0"+ma);sa++;Qa=Ba[Ea.text];ia=Ea.text}else 1===Ea.type?Qa=Ba[ia]:(sa++,Qa=Ba[Ea.text],ia=Ea.text);if(!(sa+Qacb%2?Pa+oa:Pa+ja);Ea.push({key:"C",data:ma});ja=ma[4];oa=ma[5];break;case "Q":Ea.push({key:"Q",data:[...Xa]});ja=Xa[2];oa=Xa[3];break;case "q":ma=Xa.map((Pa,cb)=>cb%2?Pa+oa:Pa+ja);Ea.push({key:"Q",data:ma});ja=ma[2];oa=ma[3];break;case "A":Ea.push({key:"A",data:[...Xa]}); ja=Xa[5];oa=Xa[6];break;case "a":ja+=Xa[5];oa+=Xa[6];Ea.push({key:"A",data:[Xa[0],Xa[1],Xa[2],Xa[3],Xa[4],ja,oa]});break;case "H":Ea.push({key:"H",data:[...Xa]});ja=Xa[0];break;case "h":ja+=Xa[0];Ea.push({key:"H",data:[ja]});break;case "V":Ea.push({key:"V",data:[...Xa]});oa=Xa[0];break;case "v":oa+=Xa[0];Ea.push({key:"V",data:[oa]});break;case "S":Ea.push({key:"S",data:[...Xa]});ja=Xa[2];oa=Xa[3];break;case "s":ma=Xa.map((Pa,cb)=>cb%2?Pa+oa:Pa+ja);Ea.push({key:"S",data:ma});ja=ma[2];oa=ma[3];break; case "T":Ea.push({key:"T",data:[...Xa]});ja=Xa[0];oa=Xa[1];break;case "t":ja+=Xa[0];oa+=Xa[1];Ea.push({key:"T",data:[ja,oa]});break;case "Z":case "z":Ea.push({key:"Z",data:[]}),ja=ia,oa=sa}return Ea}function t(ma){const ja=[];var oa="";let ia=0,sa=0,Ea=0,Qa=0,Xa=0,Pa=0;for(const {key:tb,data:Mb}of ma){switch(tb){case "M":ja.push({key:"M",data:[...Mb]});[ia,sa]=Mb;[Ea,Qa]=Mb;break;case "C":ja.push({key:"C",data:[...Mb]});ia=Mb[4];sa=Mb[5];Xa=Mb[2];Pa=Mb[3];break;case "L":ja.push({key:"L",data:[...Mb]}); [ia,sa]=Mb;break;case "H":ia=Mb[0];ja.push({key:"L",data:[ia,sa]});break;case "V":sa=Mb[0];ja.push({key:"L",data:[ia,sa]});break;case "S":var cb=ma=0;"C"===oa||"S"===oa?(ma=ia+(ia-Xa),cb=sa+(sa-Pa)):(ma=ia,cb=sa);ja.push({key:"C",data:[ma,cb,...Mb]});Xa=Mb[0];Pa=Mb[1];ia=Mb[2];sa=Mb[3];break;case "T":const [yb,ob]=Mb;cb=ma=0;"Q"===oa||"T"===oa?(ma=ia+(ia-Xa),cb=sa+(sa-Pa)):(ma=ia,cb=sa);ja.push({key:"C",data:[ia+2*(ma-ia)/3,sa+2*(cb-sa)/3,yb+2*(ma-yb)/3,ob+2*(cb-ob)/3,yb,ob]});Xa=ma;Pa=cb;ia=yb;sa= ob;break;case "Q":const [Ja,bb,hb,Qb]=Mb;ja.push({key:"C",data:[ia+2*(Ja-ia)/3,sa+2*(bb-sa)/3,hb+2*(Ja-hb)/3,Qb+2*(bb-Qb)/3,hb,Qb]});Xa=Ja;Pa=bb;ia=hb;sa=Qb;break;case "A":oa=Math.abs(Mb[0]);ma=Math.abs(Mb[1]);cb=Mb[2];const ub=Mb[3],Yb=Mb[4],dc=Mb[5],uc=Mb[6];if(0===oa||0===ma)ja.push({key:"C",data:[ia,sa,dc,uc,dc,uc]}),ia=dc,sa=uc;else if(ia!==dc||sa!==uc)f(ia,sa,dc,uc,oa,ma,cb,ub,Yb).forEach(function(xc){ja.push({key:"C",data:xc})}),ia=dc,sa=uc;break;case "Z":ja.push({key:"Z",data:[]}),ia=Ea,sa= Qa}oa=tb}return ja}function r(ma,ja,oa){return[ma*Math.cos(oa)-ja*Math.sin(oa),ma*Math.sin(oa)+ja*Math.cos(oa)]}function f(ma,ja,oa,ia,sa,Ea,Qa,Xa,Pa,cb){const tb=(Mb=Qa,Math.PI*Mb/180);var Mb;Mb=[];if(cb)[Xa,yb,ob,Ja]=cb;else{[ma,ja]=r(ma,ja,-tb);[oa,ia]=r(oa,ia,-tb);var yb=(ma-oa)/2;var ob=(ja-ia)/2;var Ja=yb*yb/(sa*sa)+ob*ob/(Ea*Ea);1Xa&&(Xa=2*Math.PI+Xa);0>yb&&(yb=2*Math.PI+yb);Pa&&Xa>yb&&(Xa-=2*Math.PI);!Pa&&yb>Xa&&(yb-=2*Math.PI)}if(Math.abs(yb-Xa)>120*Math.PI/180){bb=yb;const hb=oa,Qb=ia;yb=Pa&&yb>Xa?Xa+120*Math.PI/180:Xa+120*Math.PI/180*-1;Mb=f(oa=ob+sa*Math.cos(yb),ia=Ja+Ea*Math.sin(yb),hb,Qb,sa,Ea,Qa,0,Pa,[yb,bb,ob,Ja])}Qa=Math.tan((yb-Xa)/4); sa=4/3*sa*Qa;Qa*=4/3*Ea;Ea=[ma,ja];ma=[ma+sa*Math.sin(Xa),ja-Qa*Math.cos(Xa)];ja=[oa+sa*Math.sin(yb),ia-Qa*Math.cos(yb)];oa=[oa,ia];if(ma[0]=2*Ea[0]-ma[0],ma[1]=2*Ea[1]-ma[1],cb)return[ma,ja,oa].concat(Mb);Mb=[ma,ja,oa].concat(Mb);cb=[];for(oa=0;oasa;)sa+=2*Math.PI,Ea+=2*Math.PI;Ea-sa>2*Math.PI&&(sa=0,Ea=2*Math.PI);var cb=Math.min(2*Math.PI/Pa.curveStepCount/2,(Ea-sa)/2);const tb=R(cb,ma,ja,oa,ia,sa,Ea,1,Pa);Pa.disableMultiStroke||(cb=R(cb,ma,ja,oa,ia,sa,Ea,1.5,Pa),tb.push(...cb));return Qa&&(Xa?tb.push(...D(ma, ja,ma+oa*Math.cos(sa),ja+ia*Math.sin(sa),Pa),...D(ma,ja,ma+oa*Math.cos(Ea),ja+ia*Math.sin(Ea),Pa)):tb.push({op:"lineTo",data:[ma,ja]},{op:"lineTo",data:[ma+oa*Math.cos(sa),ja+ia*Math.sin(sa)]})),{type:"path",ops:tb}}function U(ma,ja){const oa=[];for(const ia of ma)if(ia.length){ma=ja.maxRandomnessOffset||0;const sa=ia.length;if(2Pa?1:500Xa&&(tb=Pa/10);Xa= tb/2;Pa=.2+.2*V(sa);let Mb=sa.bowing*sa.maxRandomnessOffset*(ia-ja)/200,yb=sa.bowing*sa.maxRandomnessOffset*(ma-oa)/200;Mb=K(Mb,sa,cb);yb=K(yb,sa,cb);const ob=[],Ja=sa.preserveVertices;return Ea&&(Qa?ob.push({op:"move",data:[ma+(Ja?0:K(Xa,sa,cb)),ja+(Ja?0:K(Xa,sa,cb))]}):ob.push({op:"move",data:[ma+(Ja?0:K(tb,sa,cb)),ja+(Ja?0:K(tb,sa,cb))]})),Qa?ob.push({op:"bcurveTo",data:[Mb+ma+(oa-ma)*Pa+K(Xa,sa,cb),yb+ja+(ia-ja)*Pa+K(Xa,sa,cb),Mb+ma+2*(oa-ma)*Pa+K(Xa,sa,cb),yb+ja+2*(ia-ja)*Pa+K(Xa,sa,cb),oa+(Ja? 0:K(Xa,sa,cb)),ia+(Ja?0:K(Xa,sa,cb))]}):ob.push({op:"bcurveTo",data:[Mb+ma+(oa-ma)*Pa+K(tb,sa,cb),yb+ja+(ia-ja)*Pa+K(tb,sa,cb),Mb+ma+2*(oa-ma)*Pa+K(tb,sa,cb),yb+ja+2*(ia-ja)*Pa+K(tb,sa,cb),oa+(Ja?0:K(tb,sa,cb)),ia+(Ja?0:K(tb,sa,cb))]}),ob}function Q(ma,ja,oa){const ia=[];ia.push([ma[0][0]+K(ja,oa),ma[0][1]+K(ja,oa)]);ia.push([ma[0][0]+K(ja,oa),ma[0][1]+K(ja,oa)]);for(let sa=1;saoa&&(oa=4*ja.strokeWidth);oa=Math.max(oa,.1);ma=q(ma, Object.assign({},ja,{hachureGap:oa}));const ia=Math.PI/180*ja.hachureAngle,sa=[],Ea=.5*oa*Math.cos(ia);oa=.5*oa*Math.sin(ia);for(const [Qa,Xa]of ma)m([Qa,Xa])&&sa.push([[Qa[0]-Ea,Qa[1]+oa],[...Xa]],[[Qa[0]+Ea,Qa[1]-oa],[...Xa]]);return{type:"fillSketch",ops:this.renderLines(sa,ja)}}}class ha extends X{fillPolygons(ma,ja){const oa=this._fillPolygons(ma,ja);ja=Object.assign({},ja,{hachureAngle:ja.hachureAngle+90});ma=this._fillPolygons(ma,ja);return oa.ops=oa.ops.concat(ma.ops),oa}}class W{constructor(ma){this.helper= ma}fillPolygons(ma,ja){ma=q(ma,ja=Object.assign({},ja,{hachureAngle:0}));return this.dotsOnLines(ma,ja)}dotsOnLines(ma,ja){const oa=[];let ia=ja.hachureGap;0>ia&&(ia=4*ja.strokeWidth);ia=Math.max(ia,.1);let sa=ja.fillWeight;0>sa&&(sa=ja.strokeWidth/2);const Ea=ia/4;for(const Xa of ma){var Qa=m(Xa);ma=Math.ceil(Qa/ia)-1;Qa-=ma*ia;const Pa=(Xa[0][0]+Xa[1][0])/2-ia/4,cb=Math.min(Xa[0][1],Xa[1][1]);for(let tb=0;tbja.dashOffset?0>ja.hachureGap?4*ja.strokeWidth:ja.hachureGap:ja.dashOffset,ia=0>ja.dashGap?0>ja.hachureGap?4*ja.strokeWidth:ja.hachureGap:ja.dashGap,sa=[];return ma.forEach(Ea=>{var Qa=m(Ea);const Xa=Math.floor(Qa/(oa+ia));Qa=(Qa+ia-Xa*(oa+ia))/2;let Pa=Ea[0];var cb=Ea[1];Pa[0]>cb[0]&& (Pa=Ea[1],cb=Ea[0]);Ea=Math.atan((cb[1]-Pa[1])/(cb[0]-Pa[0]));for(cb=0;cbja.hachureGap?4*ja.strokeWidth:ja.hachureGap,ia=0>ja.zigzagOffset?oa:ja.zigzagOffset; ma=q(ma,ja=Object.assign({},ja,{hachureGap:oa+ia}));return{type:"fillSketch",ops:this.zigzagLines(ma,ia,ja)}}zigzagLines(ma,ja,oa){const ia=[];return ma.forEach(sa=>{var Ea=m(sa);Ea=Math.round(Ea/(2*ja));let Qa=sa[0];var Xa=sa[1];Qa[0]>Xa[0]&&(Qa=sa[1],Xa=sa[0]);sa=Math.atan((Xa[1]-Qa[1])/(Xa[0]-Qa[0]));for(Xa=0;Xasa;)sa+=2*Math.PI,Ea+=2*Math.PI;Ea-sa>2*Math.PI&&(sa=0,Ea=2*Math.PI);const tb=(Ea-sa)/Xa.curveStepCount,Mb=[];for(;sa<=Ea;sa+=tb)Mb.push([ma+oa*Math.cos(sa),ja+ia*Math.sin(sa)]);ma=(Mb.push([ma+oa*Math.cos(Ea), ja+ia*Math.sin(Ea)]),Mb.push([ma,ja]),P([Mb],Xa));Qa.call(Pa,ma)}return"none"!==Xa.stroke&&Pa.push(cb),this._d("arc",Pa,Xa)}curve(ma,ja){ja=this._o(ja);const oa=[],ia=C(ma,ja);ja.fill&&"none"!==ja.fill&&3<=ma.length&&(ma=function(sa,Ea=0){var Qa=sa.length;if(3>Qa)throw Error("A curve must have at least three points.");const Xa=[];if(3===Qa)Xa.push([...sa[0]],[...sa[1]],[...sa[2]],[...sa[2]]);else{Qa=[];Qa.push(sa[0],sa[0]);for(var Pa=1;Paoa.simplification),Qa=function(Xa,Pa,cb){var tb= t(w(E(Xa)));Xa=[];let Mb=[];var yb=[0,0];let ob=[];const Ja=()=>{4<=ob.length&&Mb.push(...(0,Oa.s)(ob,Pa));ob=[]};for(const {key:bb,data:hb}of tb)switch(bb){case "M":Ja();Mb.length&&(Xa.push(Mb),Mb=[]);yb=[hb[0],hb[1]];Mb.push(yb);break;case "L":Ja();Mb.push([hb[0],hb[1]]);break;case "C":ob.length||(tb=Mb.length?Mb[Mb.length-1]:yb,ob.push([tb[0],tb[1]]));ob.push([hb[0],hb[1]]);ob.push([hb[2],hb[3]]);ob.push([hb[4],hb[5]]);break;case "Z":Ja(),Mb.push([yb[0],yb[1]])}Ja();Mb.length&&(Xa.push(Mb),Mb= []);if(!cb)return Xa;yb=[];for(const bb of Xa)Xa=(0,Oa.o)(bb,cb),Xa.length&&yb.push(Xa);return yb}(ma,1,Ea?4-4*oa.simplification:(1+oa.roughness)/2);return ja&&("solid"===oa.fillStyle?ia.push(U(Qa,oa)):ia.push(P(Qa,oa))),sa&&(Ea?Qa.forEach(Xa=>{ia.push(F(Xa,!1,oa))}):ia.push(function(Xa,Pa){Xa=t(w(E(Xa)));const cb=[];let tb=[0,0],Mb=[0,0];for(const {key:yb,data:ob}of Xa)switch(yb){case "M":const Ja=1*(Pa.maxRandomnessOffset||0),bb=Pa.preserveVertices;cb.push({op:"move",data:ob.map(xc=>xc+(bb?0:K(Ja, Pa)))});Mb=[ob[0],ob[1]];tb=[ob[0],ob[1]];break;case "L":cb.push(...D(Mb[0],Mb[1],ob[0],ob[1],Pa));Mb=[ob[0],ob[1]];break;case "C":const [hb,Qb,ub,Yb,dc,uc]=ob;cb.push(...Z(hb,Qb,ub,Yb,dc,uc,Mb,Pa));Mb=[dc,uc];break;case "Z":cb.push(...D(Mb[0],Mb[1],tb[0],tb[1],Pa)),Mb=[tb[0],tb[1]]}return{type:"path",ops:cb}}(ma,oa))),this._d("path",ia,oa)}opsToPath(ma,ja){let oa="";for(const ia of ma.ops)switch(ma="number"==typeof ja&&0<=ja?ia.data.map(sa=>+sa.toFixed(ja)):ia.data,ia.op){case "move":oa+=`M${ma[0]} ${ma[1]} `; break;case "bcurveTo":oa+=`C${ma[0]} ${ma[1]}, ${ma[2]} ${ma[3]}, ${ma[4]} ${ma[5]} `;break;case "lineTo":oa+=`L${ma[0]} ${ma[1]} `}return oa.trim()}toPaths(ma){var ja=ma.sets||[];ma=ma.options||this.defaultOptions;const oa=[];for(const ia of ja){ja=null;switch(ia.type){case "path":ja={d:this.opsToPath(ia),stroke:ma.stroke,strokeWidth:ma.strokeWidth,fill:"none"};break;case "fillPath":ja={d:this.opsToPath(ia),stroke:"none",strokeWidth:0,fill:ma.fill||"none"};break;case "fillSketch":ja=this.fillSketch(ia, ma)}ja&&oa.push(ja)}return oa}fillSketch(ma,ja){let oa=ja.fillWeight;return 0>oa&&(oa=ja.strokeWidth/2),{d:this.opsToPath(ma),stroke:ja.fill||"none",strokeWidth:oa,fill:"none"}}}class Ya{constructor(ma,ja){this.canvas=ma;this.ctx=this.canvas.getContext("2d");this.gen=new Va(ja)}draw(ma){const ja=ma.sets||[],oa=ma.options||this.getDefaultOptions(),ia=this.ctx,sa=ma.options.fixedDecimalPlaceDigits;for(const Ea of ja)switch(Ea.type){case "path":ia.save();ia.strokeStyle="none"===oa.stroke?"transparent": oa.stroke;ia.lineWidth=oa.strokeWidth;oa.strokeLineDash&&ia.setLineDash(oa.strokeLineDash);oa.strokeLineDashOffset&&(ia.lineDashOffset=oa.strokeLineDashOffset);this._drawToContext(ia,Ea,sa);ia.restore();break;case "fillPath":ia.save();ia.fillStyle=oa.fill||"";this._drawToContext(ia,Ea,sa,"curve"===ma.shape||"polygon"===ma.shape||"path"===ma.shape?"evenodd":"nonzero");ia.restore();break;case "fillSketch":this.fillSketch(ia,Ea,oa)}}fillSketch(ma,ja,oa){let ia=oa.fillWeight;0>ia&&(ia=oa.strokeWidth/ 2);ma.save();oa.fillLineDash&&ma.setLineDash(oa.fillLineDash);oa.fillLineDashOffset&&(ma.lineDashOffset=oa.fillLineDashOffset);ma.strokeStyle=oa.fill||"";ma.lineWidth=ia;this._drawToContext(ma,ja,oa.fixedDecimalPlaceDigits);ma.restore()}_drawToContext(ma,ja,oa,ia="nonzero"){ma.beginPath();for(const sa of ja.ops){const Ea="number"==typeof oa&&0<=oa?sa.data.map(Qa=>+Qa.toFixed(oa)):sa.data;switch(sa.op){case "move":ma.moveTo(Ea[0],Ea[1]);break;case "bcurveTo":ma.bezierCurveTo(Ea[0],Ea[1],Ea[2],Ea[3], Ea[4],Ea[5]);break;case "lineTo":ma.lineTo(Ea[0],Ea[1])}}"fillPath"===ja.type?ma.fill(ia):ma.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(ma,ja,oa,ia,sa){ma=this.gen.line(ma,ja,oa,ia,sa);return this.draw(ma),ma}rectangle(ma,ja,oa,ia,sa){ma=this.gen.rectangle(ma,ja,oa,ia,sa);return this.draw(ma),ma}ellipse(ma,ja,oa,ia,sa){ma=this.gen.ellipse(ma,ja,oa,ia,sa);return this.draw(ma),ma}circle(ma,ja,oa,ia){ma=this.gen.circle(ma,ja,oa,ia);return this.draw(ma), ma}linearPath(ma,ja){ma=this.gen.linearPath(ma,ja);return this.draw(ma),ma}polygon(ma,ja){ma=this.gen.polygon(ma,ja);return this.draw(ma),ma}arc(ma,ja,oa,ia,sa,Ea,Qa=!1,Xa){ma=this.gen.arc(ma,ja,oa,ia,sa,Ea,Qa,Xa);return this.draw(ma),ma}curve(ma,ja){ma=this.gen.curve(ma,ja);return this.draw(ma),ma}path(ma,ja){ma=this.gen.path(ma,ja);return this.draw(ma),ma}}class Ua{constructor(ma,ja){this.svg=ma;this.gen=new Va(ja)}draw(ma){var ja=ma.sets||[];const oa=ma.options||this.getDefaultOptions(),ia=this.svg.ownerDocument|| window.document,sa=ia.createElementNS("http://www.w3.org/2000/svg","g"),Ea=ma.options.fixedDecimalPlaceDigits;for(const Qa of ja){ja=null;switch(Qa.type){case "path":ja=ia.createElementNS("http://www.w3.org/2000/svg","path");ja.setAttribute("d",this.opsToPath(Qa,Ea));ja.setAttribute("stroke",oa.stroke);ja.setAttribute("stroke-width",oa.strokeWidth+"");ja.setAttribute("fill","none");oa.strokeLineDash&&ja.setAttribute("stroke-dasharray",oa.strokeLineDash.join(" ").trim());oa.strokeLineDashOffset&&ja.setAttribute("stroke-dashoffset", `${oa.strokeLineDashOffset}`);break;case "fillPath":ja=ia.createElementNS("http://www.w3.org/2000/svg","path");ja.setAttribute("d",this.opsToPath(Qa,Ea));ja.setAttribute("stroke","none");ja.setAttribute("stroke-width","0");ja.setAttribute("fill",oa.fill||"");"curve"!==ma.shape&&"polygon"!==ma.shape||ja.setAttribute("fill-rule","evenodd");break;case "fillSketch":ja=this.fillSketch(ia,Qa,oa)}ja&&sa.appendChild(ja)}return sa}fillSketch(ma,ja,oa){let ia=oa.fillWeight;0>ia&&(ia=oa.strokeWidth/2);ma=ma.createElementNS("http://www.w3.org/2000/svg", "path");return ma.setAttribute("d",this.opsToPath(ja,oa.fixedDecimalPlaceDigits)),ma.setAttribute("stroke",oa.fill||""),ma.setAttribute("stroke-width",ia+""),ma.setAttribute("fill","none"),oa.fillLineDash&&ma.setAttribute("stroke-dasharray",oa.fillLineDash.join(" ").trim()),oa.fillLineDashOffset&&ma.setAttribute("stroke-dashoffset",`${oa.fillLineDashOffset}`),ma}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(ma,ja){return this.gen.opsToPath(ma,ja)}line(ma, ja,oa,ia,sa){ma=this.gen.line(ma,ja,oa,ia,sa);return this.draw(ma)}rectangle(ma,ja,oa,ia,sa){ma=this.gen.rectangle(ma,ja,oa,ia,sa);return this.draw(ma)}ellipse(ma,ja,oa,ia,sa){ma=this.gen.ellipse(ma,ja,oa,ia,sa);return this.draw(ma)}circle(ma,ja,oa,ia){ma=this.gen.circle(ma,ja,oa,ia);return this.draw(ma)}linearPath(ma,ja){ma=this.gen.linearPath(ma,ja);return this.draw(ma)}polygon(ma,ja){ma=this.gen.polygon(ma,ja);return this.draw(ma)}arc(ma,ja,oa,ia,sa,Ea,Qa=!1,Xa){ma=this.gen.arc(ma,ja,oa,ia,sa, Ea,Qa,Xa);return this.draw(ma)}curve(ma,ja){ma=this.gen.curve(ma,ja);return this.draw(ma)}path(ma,ja){ma=this.gen.path(ma,ja);return this.draw(ma)}}var La={canvas:(ma,ja)=>new Ya(ma,ja),svg:(ma,ja)=>new Ua(ma,ja),generator:ma=>new Va(ma),newSeed:()=>Va.newSeed()}},5714:function(g){g.exports=function(h,c,p){var m=[],q=h.length;if(0===q)return m;c=0>c?Math.max(0,c+q):c||0;for(void 0!==p&&(q=0>p?p+q:p);q-- >c;)m[q-c]=h[q];return m}},5422:function(g,h,c){g=c(487);g=c.n(g);h=c(631);h=c.n(h);var p=c(2052); p=c.n(p);var m=c(4010);m=c.n(m);var q=c(1469);q=c.n(q);var E=c(9329);E=c.n(E);c=c(2044);var w={};w.styleTagTransform=E();w.setAttributes=m();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=q();g()(c.Z,w);c.Z&&c.Z.locals&&c.Z.locals},487:function(g){function h(q){for(var E=-1,w=0;w=D.length?{done:!0}:{done:!1,value:D[N++]}},e:function(X){throw X;},f:L}}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 la,R=!0,Z=!1;return{s:function(){Q=Q.call(D)},n:function(){var X=Q.next(); return R=X.done,X},e:function(X){Z=!0;la=X},f:function(){try{R||null==Q.return||Q.return()}finally{if(Z)throw la;}}}}function m(D,L){(null==L||L>D.length)&&(L=D.length);for(var Q=0,N=Array(L);QZ.points.length)return D=D.map(function(X){return X.id===Z.id?(0,F.BE)(X,{isDeleted:!0}):X}),{elements:D,appState:m(m({}, T(L,D)),{},{editingLinearElement:null}),commitToHistory:!1};Q={startBindingElement:null!=N&&N.includes(0)?null:la,endBindingElement:null!=N&&N.includes(Z.points.length-1)?null:R};return M._.deletePoints(Z,N),{elements:D,appState:m(m({},L),{},{editingLinearElement:m(m(m({},L.editingLinearElement),Q),{},{selectedPointsIndices:0<(null==N?void 0:N[0])?[N[0]-1]:[0]})}),commitToHistory:!0}}Q=function(X,S){return{elements:X.map(function(ha){return S.selectedElementIds[ha.id]||(0,O.Xh)(ha)&&S.selectedElementIds[ha.containerId]? (0,F.BE)(ha,{isDeleted:!0}):ha}),appState:m(m({},S),{},{selectedElementIds:{}})}}(D,L);N=Q.elements;Q=Q.appState;return(0,aa.$q)(N,D.filter(function(X){return L.selectedElementIds[X.id]})),{elements:N,appState:m(m({},Q=T(Q,N)),{},{activeTool:(0,U.Om)(L,{type:"selection"}),multiElement:null}),commitToHistory:(0,E.N)((0,f.Lm)(D),L)}},contextItemLabel:"labels.delete",keyTest:function(D,L,Q){return(D.key===w.tW.BACKSPACE||D.key===w.tW.DELETE)&&!D[w.tW.CTRL_OR_CMD]},PanelComponent:function(D){var L=D.elements, Q=D.appState,N=D.updateData;return(0,V.jsx)(t.V,{type:"button",icon:P.XH,title:(0,r.t)("labels.delete"),"aria-label":(0,r.t)("labels.delete"),onClick:function(){return N(null)},visible:(0,E.N)((0,f.Lm)(L),Q)})}})},8671:function(g,h,c){function p(ja,oa){var ia=Object.keys(ja);if(Object.getOwnPropertySymbols){var sa=Object.getOwnPropertySymbols(ja);oa&&(sa=sa.filter(function(Ea){return Object.getOwnPropertyDescriptor(ja,Ea).enumerable}));ia.push.apply(ia,sa)}return ia}function m(ja){for(var oa=1;oa< arguments.length;oa++){var ia=null!=arguments[oa]?arguments[oa]:{};oa%2?p(Object(ia),!0).forEach(function(sa){(0,r.Z)(ja,sa,ia[sa])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ja,Object.getOwnPropertyDescriptors(ia)):p(Object(ia)).forEach(function(sa){Object.defineProperty(ja,sa,Object.getOwnPropertyDescriptor(ia,sa))})}return ja}function q(ja,oa){var ia=Object.keys(ja);if(Object.getOwnPropertySymbols){var sa=Object.getOwnPropertySymbols(ja);oa&&(sa=sa.filter(function(Ea){return Object.getOwnPropertyDescriptor(ja, Ea).enumerable}));ia.push.apply(ia,sa)}return ia}function E(ja){for(var oa=1;oa=ea.length?{done:!0}:{done:!1,value:ea[ab++]}},e:function(Pc){throw Pc;},f:ua}}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 Db,ic=!0,Gc=!1;return{s:function(){Na=Na.call(ea)},n:function(){var Pc=Na.next();return ic=Pc.done,Pc},e:function(Pc){Gc=!0;Db=Pc},f:function(){try{ic||null== Na.return||Na.return()}finally{if(Gc)throw Db;}}}}function E(ea,ua){(null==ua||ua>ea.length)&&(ua=ea.length);for(var Na=0,ab=Array(ua);Na=ea.length?{done:!0}:{done:!1,value:ea[ab++]}},e:function(Pc){throw Pc;},f:ua}}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 Db,ic=!0,Gc=!1;return{s:function(){Na=Na.call(ea)},n:function(){var Pc= Na.next();return ic=Pc.done,Pc},e:function(Pc){Gc=!0;Db=Pc},f:function(){try{ic||null==Na.return||Na.return()}finally{if(Gc)throw Db;}}}}function t(ea,ua){(null==ua||ua>ea.length)&&(ua=ea.length);for(var Na=0,ab=Array(ua);Na=ea.length?{done:!0}:{done:!1,value:ea[ab++]}},e:function(Pc){throw Pc;},f:ua}}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 Db,ic=!0,Gc=!1;return{s:function(){Na=Na.call(ea)},n:function(){var Pc=Na.next();return ic=Pc.done,Pc},e:function(Pc){Gc=!0;Db=Pc},f:function(){try{ic||null==Na.return||Na.return()}finally{if(Gc)throw Db;}}}}function K(ea,ua){(null==ua||ua>ea.length)&&(ua=ea.length);for(var Na=0,ab=Array(ua);Na=ea.length?{done:!0}:{done:!1,value:ea[ab++]}},e:function(Pc){throw Pc;},f:ua}}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 Db,ic=!0,Gc=!1;return{s:function(){Na=Na.call(ea)},n:function(){var Pc=Na.next();return ic=Pc.done,Pc},e:function(Pc){Gc=!0;Db=Pc},f:function(){try{ic|| null==Na.return||Na.return()}finally{if(Gc)throw Db;}}}}function X(ea,ua){(null==ua||ua>ea.length)&&(ua=ea.length);for(var Na=0,ab=Array(ua);Nazd.points.length||(0,Qb.QD)(zd)?ea.filter(function(Me){return Me.id!==zd.id}):void 0,appState:C(C({},ua),{},{cursorButton:"up",editingLinearElement:null}),commitToHistory:!0}}(Gc=ua.pendingImageElementId&&ab.getElement(ua.pendingImageElementId))&& (0,Va.DR)(Gc,{isDeleted:!0},!1);window.document.activeElement instanceof HTMLElement&&ic();var Ie;if(ic=ua.multiElement?ua.multiElement:"freedraw"===(null===(Db=ua.editingElement)||void 0===Db?void 0:Db.type)?ua.editingElement:null){"freedraw"!==ic.type&&"touch"!==ua.lastPointerDownWith&&(Db=ic.points,(Gc=ic.lastCommittedPoint)&&Db[Db.length-1]===Gc||(0,Va.DR)(ic,{points:ic.points.slice(0,-1)}));(0,Qb.QD)(ic)&&(ea=ea.slice(0,-1));Db=(0,dd.g6)(ic.points,ua.zoom.value);if(("line"===ic.type||"freedraw"=== ic.type)&&Db){var Oe=ic.points,Ye=Oe[0];(0,Va.DR)(ic,{points:Oe.map(function(Me,Ff){return Ff===Oe.length-1?[Ye[0],Ye[1]]:Me})})}(0,ub.Mn)(ic)&&!Db&&1Na.length)return{appState:ua,elements:ea,commitToHistory:!1};var ab=(0,Ya.iJ)(ua);if(1===ab.length){ab=new Set((0,Ya.Fb)(ea,ab[0]).map(function(Pc){return Pc.id}));var Db=new Set(Na.map(function(Pc){return Pc.id}));if((new Set([].concat((0,Oa.Z)(Array.from(ab)),(0,Oa.Z)(Array.from(Db))))).size===ab.size)return{appState:ua,elements:ea,commitToHistory:!1}}var ic=(0,ac.kb)(),Gc= (0,ma.xn)(Na);ab=ea.map(function(Pc){return Gc.get(Pc.id)?(0,Va.BE)(Pc,{groupIds:(0,Ya.S_)(Pc.groupIds,ic,ua.editingGroupId)}):Pc});ea=(0,Ya.Fb)(ab,ic);Db=ab.lastIndexOf(ea[ea.length-1]);Na=ab.slice(Db+1);ab=ab.slice(0,Db).filter(function(Pc){return!(0,Ya.Nd)(Pc,ic)});ea=[].concat((0,Oa.Z)(ab),(0,Oa.Z)(ea),(0,Oa.Z)(Na));return{appState:(0,Ya.F$)(ic,V(V({},ua),{},{selectedGroupIds:{}}),(0,Qb.Lm)(ea)),elements:ea,commitToHistory:!0}},contextItemLabel:"labels.group",predicate:function(ea,ua){return Ac(ea, ua)},keyTest:function(ea){return!ea.shiftKey&&ea[Qa.tW.CTRL_OR_CMD]&&ea.key===Qa.tW.G},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!Ac(ua,Na),type:"button",icon:(0,Mb.jsx)(cb.BF,{theme:Na.theme}),onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.group")," — ").concat((0,ma.uY)("CtrlOrCmd+G")),"aria-label":(0,Xa.t)("labels.group"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}}),kd=(0,Pa.z)({name:"ungroup",trackEvent:{category:"element"}, perform:function(ea,ua){if(0===(0,Ya.iJ)(ua).length)return{appState:ua,elements:ea,commitToHistory:!1};var Na=[];ea=ea.map(function(Db){(0,ub.Xh)(Db)&&Na.push(Db.id);var ic=(0,Ya.h6)(Db.groupIds,ua.selectedGroupIds);return ic.length===Db.groupIds.length?Db:(0,Va.BE)(Db,{groupIds:ic})});var ab=(0,Ya.bO)(V(V({},ua),{},{selectedGroupIds:{}}),(0,Qb.Lm)(ea));return Na.forEach(function(Db){return ab.selectedElementIds[Db]=!1}),{appState:ab,elements:ea,commitToHistory:!0}},keyTest:function(ea){return ea.shiftKey&& ea[Qa.tW.CTRL_OR_CMD]&&ea.key===Qa.tW.G.toUpperCase()},contextItemLabel:"labels.ungroup",predicate:function(ea,ua){return 0<(0,Ya.iJ)(ua).length},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{type:"button",hidden:0===(0,Ya.iJ)(Na).length,icon:(0,Mb.jsx)(cb.RJ,{theme:Na.theme}),onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.ungroup")," — ").concat((0,ma.uY)("CtrlOrCmd+Shift+G")),"aria-label":(0,Xa.t)("labels.ungroup"),visible:(0,Ua.N)((0,Qb.Lm)(ua), Na)})}}),wd=c(8982),Wd=c(487),Qd=c.n(Wd),Ge=c(631),de=c.n(Ge),$c=c(2052),Kc=c.n($c),Ce=c(4010),mh=c.n(Ce),fg=c(1469),Yf=c.n(fg),re=c(9329),xf=c.n(re),Dh=c(3729),Tg={};Tg.styleTagTransform=xf();Tg.setAttributes=mh();Tg.insert=Kc().bind(null,"head");Tg.domAPI=de();Tg.insertStyleElement=Yf();Qd()(Dh.Z,Tg);Dh.Z&&Dh.Z.locals&&Dh.Z.locals;var yc=c(9787),Nf=function(ea){var ua=ea.color,Na=ea.onClick,ab=ea.src;ea=(0,wd.f)(ea.name);var Db=(0,yc.useState)(!1);Db=(0,Oc.Z)(Db,2);var ic=Db[1];Db=!Db[0]&&ab;return(0,Mb.jsx)("div", {className:"Avatar",style:Db?void 0:{background:ua},onClick:Na,children:Db?(0,Mb.jsx)("img",{className:"Avatar-img",src:ab,alt:ea,referrerPolicy:"no-referrer",onError:function(){return ic(!0)}}):ea})},ed=c(2264);(0,Pa.z)({name:"goToCollaborator",viewMode:!0,trackEvent:{category:"collab"},perform:function(ea,ua,Na){return Na?{appState:L(L(L({},ua),(0,ed.s)({scenePoint:Na,viewportDimensions:{width:ua.width,height:ua.height},zoom:ua.zoom})),{},{openMenu:"canvas"===ua.openMenu?null:ua.openMenu}),commitToHistory:!1}: {appState:ua,commitToHistory:!1}},PanelComponent:function(ea){var ua=ea.appState,Na=ea.updateData;ea=(0,Oc.Z)(ea.data,2);var ab=ea[1];ua=(0,wd.X)(ea[0],ua);return(0,Mb.jsx)(Nf,{color:ua.background,border:ua.stroke,onClick:function(){return Na(ab.pointer)},name:ab.username||"",src:ab.avatarUrl})}});var Hb=c(2791),Sb=(0,Pa.z)({name:"addToLibrary",trackEvent:{category:"element"},perform:function(ea,ua,Na,ab){var Db=(0,Ua.eD)((0,Qb.Lm)(ea),ua,!0);return Db.some(function(ic){return"image"===ic.type})? {commitToHistory:!1,appState:N(N({},ua),{},{errorMessage:"Support for adding images to the library coming soon!"})}:ab.library.getLatestLibrary().then(function(ic){return ab.library.setLibrary([{id:(0,ac.kb)(),status:"unpublished",elements:Db.map(Hb.OL),created:Date.now()}].concat((0,Oa.Z)(ic)))}).then(function(){return{commitToHistory:!1,appState:N(N({},ua),{},{toast:{message:(0,Xa.t)("toast.addedToLibrary")}})}}).catch(function(ic){return{commitToHistory:!1,appState:N(N({},ua),{},{errorMessage:ic.message})}})}, contextItemLabel:"labels.addToLibrary"}),Ib=c(8925),Ad=function(ea,ua,Na){var ab=Na.axis;Na=Na.position;ea=(0,Ib.v2)(ea);var Db=(0,Oc.Z)("x"===ab?["minX","maxX"]:["minY","maxY"],2),ic=Db[0];Db=Db[1];return R(R({},{x:0,y:0}),{},"start"===Na?(0,hb.Z)({},ab,ua[ic]-ea[ic]):"end"===Na?(0,hb.Z)({},ab,ua[Db]-ea[Db]):(0,hb.Z)({},ab,(ua[ic]+ua[Db])/2-(ea[ic]+ea[Db])/2))},be=function(ea,ua){return 1<(0,Ua.eD)((0,Qb.Lm)(ea),ua).length},Od=function(ea,ua,Na){ua=function(Db,ic){var Gc=(0,Ya.AI)(Db),Pc=(0,Ib.v2)(Db); return Gc.flatMap(function(Rd){var zd=Ad(Rd,Pc,ic);return Rd.map(function(Ie){return(0,Va.BE)(Ie,{x:Ie.x+zd.x,y:Ie.y+zd.y})})})}((0,Ua.eD)((0,Qb.Lm)(ea),ua),Na);var ab=(0,ma.xn)(ua);return ea.map(function(Db){return ab.get(Db.id)||Db})};(0,Pa.z)({name:"alignTop",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:Od(ea,ua,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(ea){return ea[Qa.tW.CTRL_OR_CMD]&&ea.shiftKey&&ea.key===Qa.tW.ARROW_UP},PanelComponent:function(ea){var ua= ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.Ct,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.alignTop")," — ").concat((0,ma.uY)("CtrlOrCmd+Shift+Up")),"aria-label":(0,Xa.t)("labels.alignTop"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}});(0,Pa.z)({name:"alignBottom",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:Od(ea,ua,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(ea){return ea[Qa.tW.CTRL_OR_CMD]&& ea.shiftKey&&ea.key===Qa.tW.ARROW_DOWN},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.HL,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.alignBottom")," — ").concat((0,ma.uY)("CtrlOrCmd+Shift+Down")),"aria-label":(0,Xa.t)("labels.alignBottom"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}});(0,Pa.z)({name:"alignLeft",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua, elements:Od(ea,ua,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(ea){return ea[Qa.tW.CTRL_OR_CMD]&&ea.shiftKey&&ea.key===Qa.tW.ARROW_LEFT},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.xs,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.alignLeft")," — ").concat((0,ma.uY)("CtrlOrCmd+Shift+Left")),"aria-label":(0,Xa.t)("labels.alignLeft"),visible:(0,Ua.N)((0,Qb.Lm)(ua), Na)})}});(0,Pa.z)({name:"alignRight",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:Od(ea,ua,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(ea){return ea[Qa.tW.CTRL_OR_CMD]&&ea.shiftKey&&ea.key===Qa.tW.ARROW_RIGHT},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.mh,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.alignRight")," — ").concat((0,ma.uY)("CtrlOrCmd+Shift+Right")), "aria-label":(0,Xa.t)("labels.alignRight"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}});(0,Pa.z)({name:"alignVerticallyCentered",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:Od(ea,ua,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.ST,onClick:function(){return ab(null)},title:(0,Xa.t)("labels.centerVertically"),"aria-label":(0,Xa.t)("labels.centerVertically"), visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}});(0,Pa.z)({name:"alignHorizontallyCentered",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:Od(ea,ua,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!be(ua,Na),type:"button",icon:cb.gK,onClick:function(){return ab(null)},title:(0,Xa.t)("labels.centerHorizontally"),"aria-label":(0,Xa.t)("labels.centerHorizontally"), visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}});var Hf=function(ea,ua){return 1<(0,Ua.eD)((0,Qb.Lm)(ea),ua).length},kb=function(ea,ua,Na){ua=function(Db,ic){var Gc,Pc=(0,Oc.Z)("x"===ic.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),Rd=Pc[0],zd=Pc[1],Ie=Pc[2],Oe=Pc[3],Ye=(0,Ib.v2)(Db);Db=(0,Ya.AI)(Db).map(function(Og){return[Og,(0,Ib.v2)(Og)]}).sort(function(Og,pi){return Og[1][zd]-pi[1][zd]});Pc=0;var Me=Z(Db);try{for(Me.s();!(Gc=Me.n()).done;)Pc+=Gc.value[1][Oe]}catch(Og){Me.e(Og)}finally{Me.f()}var Ff= (Ye[Oe]-Pc)/(Db.length-1);if(0>Ff){var If=Db.findIndex(function(Og){return Og[1][Rd]===Ye[Rd]}),jg=Db.findIndex(function(Og){return Og[1][Ie]===Ye[Ie]}),Jf=(Db[jg][1][zd]-Db[If][1][zd])/(Db.length-1),tg=Db[If][1][zd];return Db.flatMap(function(Og,pi){var ji=(0,Oc.Z)(Og,2);Og=ji[0];ji=ji[1];var xj={x:0,y:0};return pi!==If&&pi!==jg&&(tg+=Jf,xj[ic.axis]=tg-ji[zd]),Og.map(function(Oj){return(0,Va.BE)(Oj,{x:Oj.x+xj.x,y:Oj.y+xj.y})})})}var Zh=Ye[Rd];return Db.flatMap(function(Og){var pi=(0,Oc.Z)(Og,2); Og=pi[0];pi=pi[1];var ji={x:0,y:0};return ji[ic.axis]=Zh-pi[Rd],Zh+=Ff,Zh+=pi[Oe],Og.map(function(xj){return(0,Va.BE)(xj,{x:xj.x+ji.x,y:xj.y+ji.y})})})}((0,Ua.eD)((0,Qb.Lm)(ea),ua),Na);var ab=(0,ma.xn)(ua);return ea.map(function(Db){return ab.get(Db.id)||Db})},rb=((0,Pa.z)({name:"distributeHorizontally",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:kb(ea,ua,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(ea){return!ea[Qa.tW.CTRL_OR_CMD]&&ea.altKey&& ea.code===Qa.aU.H},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!Hf(ua,Na),type:"button",icon:cb.uD,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.distributeHorizontally")," — ").concat((0,ma.uY)("Alt+H")),"aria-label":(0,Xa.t)("labels.distributeHorizontally"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}}),(0,Pa.z)({name:"distributeVertically",trackEvent:{category:"element"},perform:function(ea,ua){return{appState:ua,elements:kb(ea, ua,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(ea){return!ea[Qa.tW.CTRL_OR_CMD]&&ea.altKey&&ea.code===Qa.aU.V},PanelComponent:function(ea){var ua=ea.elements,Na=ea.appState,ab=ea.updateData;return(0,Mb.jsx)(uc.V,{hidden:!Hf(ua,Na),type:"button",icon:cb.W5,onClick:function(){return ab(null)},title:"".concat((0,Xa.t)("labels.distributeVertically")," — ").concat((0,ma.uY)("Alt+V")),"aria-label":(0,Xa.t)("labels.distributeVertically"),visible:(0,Ua.N)((0,Qb.Lm)(ua),Na)})}}),c(8634)), nb=c(267),Ub=(0,Pa.z)({name:"flipHorizontal",trackEvent:{category:"element"},perform:function(ea,ua){return{elements:Yc(ea,ua,"horizontal"),appState:ua,commitToHistory:!0}},keyTest:function(ea){return ea.shiftKey&&"KeyH"===ea.code},contextItemLabel:"labels.flipHorizontal",predicate:function(ea,ua){ea=(0,Ua.eD)((0,Qb.Lm)(ea),ua);return 1===ea.length&&"text"!==ea[0].type}}),Kb=(0,Pa.z)({name:"flipVertical",trackEvent:{category:"element"},perform:function(ea,ua){return{elements:Yc(ea,ua,"vertical"), appState:ua,commitToHistory:!0}},keyTest:function(ea){return ea.shiftKey&&"KeyV"===ea.code&&!ea[Qa.tW.CTRL_OR_CMD]},contextItemLabel:"labels.flipVertical",predicate:function(ea,ua){return 1===(0,Ua.eD)((0,Qb.Lm)(ea),ua).length}}),Yc=function(ea,ua,Na){var ab=(0,Ua.eD)((0,Qb.Lm)(ea),ua);if(1Gc&&(Gc=(0,rb.LW)(2*Math.PI+Gc));(0,Va.DR)(ab,{angle:Gc});(0,Va.DR)(ab,{x:Db,y:ic})}}),ea},ud=function(ea,ua){var Na=ea.x,ab=ea.y,Db=ea.width,ic=ea.height,Gc=(0,rb.LW)(ea.angle);(0,Va.DR)(ea,{angle:(0,rb.LW)(0)});var Pc=(0,nb.PC)(ea,ua.zoom);ua=!0;var Rd=Pc.nw;if(Rd||(ua=!1,Rd=Pc.ne)){var zd;Pc=0;(0,ub.bt)(ea)&&3>ea.points.length&&(Pc=2*ea.points.reduce(function(Oe,Ye){return Math.max(Oe,Ye[0])},0)-ea.width);(0,ub.bt)(ea)&&(zd=(0,Ib.Ut)(ea,ea.points));var Ie= (0,Ib.qf)(ea);if((0,ub.bt)(ea)&&3>ea.points.length){for(ua=1;uaGc&&(Gc=(0,rb.LW)(Gc+2*Math.PI)),(0,Va.DR)(ea,{angle:Gc}),(0,Va.DR)(ea,{x:Na+Pc,y:ab,width:Db,height:ic}),(0,xc.Ww)(ea),zd&&(0,ub.bt)(ea))Na= (0,Ib.Ut)(ea,ea.points),(0,Va.DR)(ea,{x:ea.x+.5*(zd[0]-Na[0]+(zd[2]-Na[2])),y:ea.y,width:Db,height:ic})}else(0,Va.DR)(ea,{angle:Gc})},fe=c(4688),ke=(0,Pa.z)({name:"gridMode",viewMode:!0,trackEvent:{category:"canvas",predicate:function(ea){return!ea.gridSize}},perform:function(ea,ua){return{appState:ha(ha({},ua),{},{gridSize:this.checked(ua)?null:tb.k}),commitToHistory:!1}},checked:function(ea){return null!==ea.gridSize},predicate:function(ea,ua,Na){return void 0===Na.gridModeEnabled},contextItemLabel:"labels.showGrid", keyTest:function(ea){return ea[Qa.tW.CTRL_OR_CMD]&&ea.code===Qa.aU.QUOTE}}),bf=(0,Pa.z)({name:"zenMode",viewMode:!0,trackEvent:{category:"canvas",predicate:function(ea){return!ea.zenModeEnabled}},perform:function(ea,ua){return{appState:ra(ra({},ua),{},{zenModeEnabled:!this.checked(ua)}),commitToHistory:!1}},checked:function(ea){return ea.zenModeEnabled},predicate:function(ea,ua,Na){return void 0===Na.zenModeEnabled},contextItemLabel:"buttons.zenMode",keyTest:function(ea){return!ea[Qa.tW.CTRL_OR_CMD]&& ea.altKey&&ea.code===Qa.aU.Z}}),ie=c(4958),tf=c(202),pg=c(4929),Eg=(0,Pa.z)({name:"toggleLock",trackEvent:{category:"element"},perform:function(ea,ua){var Na=(0,Ua.eD)(ea,ua,!0);if(!Na.length)return!1;var ab=qb(Na),Db=(0,ma.xn)(Na),ic="lock"===ab;return{elements:ea.map(function(Gc){return Db.has(Gc.id)?(0,Va.BE)(Gc,{locked:ic}):Gc}),appState:va(va({},ua),{},{selectedLinearElement:ic?null:ua.selectedLinearElement}),commitToHistory:!0}},contextItemLabel:function(ea,ua){ea=(0,Ua.eD)(ea,ua,!1);return 1=== ea.length?ea[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":"lock"===qb(ea)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},keyTest:function(ea,ua,Na){return ea.key.toLocaleLowerCase()===Qa.tW.L&&ea[Qa.tW.CTRL_OR_CMD]&&ea.shiftKey&&0<(0,Ua.eD)(Na,ua,!1).length}}),qb=function(ea){return ea.some(function(ua){return!ua.locked})?"lock":"unlock"},za=(0,Pa.z)({name:"toggleLinearEditor",trackEvent:{category:"element"},predicate:function(ea,ua){ea=(0,Ua.eD)(ea,ua);return!(1!== ea.length||!(0,ub.bt)(ea[0]))},perform:function(ea,ua,Na,ab){var Db;ea=(0,Ua.eD)((0,Qb.Lm)(ea),ua,!0)[0];Na=(null===(Db=ua.editingLinearElement)||void 0===Db?void 0:Db.elementId)===ea.id?null:new Yb._(ea,ab.scene);return{appState:Ba(Ba({},ua),{},{editingLinearElement:Na}),commitToHistory:!1}},contextItemLabel:function(ea,ua){var Na;ea=(0,Ua.eD)((0,Qb.Lm)(ea),ua,!0)[0];return(null===(Na=ua.editingLinearElement)||void 0===Na?void 0:Na.elementId)===ea.id?"labels.lineEditor.exit":"labels.lineEditor.edit"}})}, 7901:function(g,h,c){c.d(h,{N:function(){return p},z:function(){return m}});var p=[],m=function(q){return p=p.concat(q),q}},785:function(g,h,c){c.d(h,{C:function(){return m}});g=c(2335);h=c(8211);c=c(6340);var p={toggleTheme:[(0,c.uY)("Shift+Alt+D")],saveScene:[(0,c.uY)("CtrlOrCmd+S")],loadScene:[(0,c.uY)("CtrlOrCmd+O")],clearCanvas:[(0,c.uY)("CtrlOrCmd+Delete")],imageExport:[(0,c.uY)("CtrlOrCmd+Shift+E")],cut:[(0,c.uY)("CtrlOrCmd+X")],copy:[(0,c.uY)("CtrlOrCmd+C")],paste:[(0,c.uY)("CtrlOrCmd+V")], copyStyles:[(0,c.uY)("CtrlOrCmd+Alt+C")],pasteStyles:[(0,c.uY)("CtrlOrCmd+Alt+V")],selectAll:[(0,c.uY)("CtrlOrCmd+A")],deleteSelectedElements:[(0,c.uY)("Delete")],duplicateSelection:[(0,c.uY)("CtrlOrCmd+D"),(0,c.uY)("Alt+".concat((0,h.t)("helpDialog.drag")))],sendBackward:[(0,c.uY)("CtrlOrCmd+[")],bringForward:[(0,c.uY)("CtrlOrCmd+]")],sendToBack:[g.Um?(0,c.uY)("CtrlOrCmd+Alt+["):(0,c.uY)("CtrlOrCmd+Shift+[")],bringToFront:[g.Um?(0,c.uY)("CtrlOrCmd+Alt+]"):(0,c.uY)("CtrlOrCmd+Shift+]")],copyAsPng:[(0,c.uY)("Shift+Alt+C")], copyAsSvg:[],group:[(0,c.uY)("CtrlOrCmd+G")],ungroup:[(0,c.uY)("CtrlOrCmd+Shift+G")],gridMode:[(0,c.uY)("CtrlOrCmd+'")],zenMode:[(0,c.uY)("Alt+Z")],stats:[(0,c.uY)("Alt+/")],addToLibrary:[],flipHorizontal:[(0,c.uY)("Shift+H")],flipVertical:[(0,c.uY)("Shift+V")],viewMode:[(0,c.uY)("Alt+R")],hyperlink:[(0,c.uY)("CtrlOrCmd+K")],toggleLock:[(0,c.uY)("CtrlOrCmd+Shift+L")]},m=function(q){return(q=p[q])&&0=N.length?{done:!0}:{done:!1,value:N[Z++]}},e:function(W){throw W; },f:la}}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 X,S=!0,ha=!1;return{s:function(){R=R.call(N)},n:function(){var W=R.next();return S=W.done,W},e:function(W){ha=!0;X=W},f:function(){try{S||null==R.return||R.return()}finally{if(ha)throw X;}}}}function m(N,la){(null==la||la>N.length)&&(la=N.length);for(var R=0,Z=Array(la);RR.length?{type:"NOT_SPREADSHEET",reason:"Less than two rows"}:{type:aa,spreadsheet:{title:la?N[0][0]:null,labels:null,values:R}}}la=U(N,0);R=U(N,1);if(!la&&!R)return{type:"NOT_SPREADSHEET",reason:"Value is not numeric"};la=(0,r.Z)(R?[0,1]:[1,0],2);var Z=la[0],X=la[1];R=(la=null===O(N[0][X]))?N.slice(1):N;return 2>R.length?{type:"NOT_SPREADSHEET", reason:"Less than 2 rows"}:{type:aa,spreadsheet:{title:la?N[0][X]:null,labels:R.map(function(S){return S[Z]}),values:R.map(function(S){return O(S[X])})}}},V=function(N){var la=N.trim().split("\n").map(function(Z){return Z.trim().split("\t")});if(la.length&&2!==la[0].length&&(la=N.trim().split("\n").map(function(Z){return Z.trim().split(",")})),0===la.length)return{type:"NOT_SPREADSHEET",reason:"No values"};var R=la[0].length;if(!la.every(function(Z){return Z.length===R}))return{type:"NOT_SPREADSHEET", reason:"All rows don't have same number of columns"};N=P(la);return N.type!==aa&&(la=P(function(Z){for(var X=[],S=0;S=Rb.length?{done:!0}:{done:!1, value:Rb[qc++]}},e:function(Lb){throw Lb;},f:Ra}}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 Tb,nc=!0,jc=!1;return{s:function(){rc=rc.call(Rb)},n:function(){var Lb=rc.next();return nc=Lb.done,Lb},e:function(Lb){jc=!0;Tb=Lb},f:function(){try{nc||null==rc.return||rc.return()}finally{if(jc)throw Tb;}}}}function f(Rb,Ra){(null==Ra||Ra>Rb.length)&&(Ra=Rb.length);for(var rc=0,qc=Array(Ra);rc< Ra;rc++)qc[rc]=Rb[rc];return qc}function F(Rb,Ra){var rc=Object.keys(Rb);if(Object.getOwnPropertySymbols){var qc=Object.getOwnPropertySymbols(Rb);Ra&&(qc=qc.filter(function(Tb){return Object.getOwnPropertyDescriptor(Rb,Tb).enumerable}));rc.push.apply(rc,qc)}return rc}function C(Rb){for(var Ra=1;Ra=Rb.length?{done:!0}:{done:!1,value:Rb[qc++]}},e:function(Lb){throw Lb;},f:Ra}}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 Tb,nc=!0,jc=!1;return{s:function(){rc=rc.call(Rb)},n:function(){var Lb=rc.next();return nc=Lb.done,Lb},e:function(Lb){jc=!0;Tb=Lb},f:function(){try{nc||null==rc.return||rc.return()}finally{if(jc)throw Tb; }}}}function U(Rb,Ra){(null==Ra||Ra>Rb.length)&&(Ra=Rb.length);for(var rc=0,qc=Array(Ra);rc=Rb.length?{done:!0}:{done:!1,value:Rb[qc++]}},e:function(Lb){throw Lb;},f:Ra}}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 Tb,nc=!0,jc=!1;return{s:function(){rc=rc.call(Rb)},n:function(){var Lb=rc.next();return nc=Lb.done,Lb},e:function(Lb){jc=!0;Tb=Lb},f:function(){try{nc||null==rc.return||rc.return()}finally{if(jc)throw Tb;}}}}function la(Rb,Ra){(null==Ra||Ra>Rb.length)&&(Ra=Rb.length);for(var rc=0,qc=Array(Ra);rcnc.points.length)return Tb;Tb.push(E(E({},nc),{},{points:nc.lastCommittedPoint!==nc.points[nc.points.length-1]?nc.points.slice(0,-1):nc.points}))}else Tb.push(nc);return Tb},[])})}}return(0,va.Z)(Rb,[{key:"hydrateHistoryEntry",value:function(Ra){var rc=this,qc= Ra.elements;return{appState:JSON.parse(Ra.appState),elements:qc.map(function(Tb){var nc,jc=null===(nc=rc.elementCache.get(Tb.id))||void 0===nc?void 0:nc.get(Tb.versionNonce);if(!jc)throw Error("Element not found: ".concat(Tb.id,":").concat(Tb.versionNonce));return jc})}}},{key:"dehydrateHistoryEntry",value:function(Ra){var rc=this,qc=Ra.elements;return{appState:JSON.stringify(Ra.appState),elements:qc.map(function(Tb){rc.elementCache.has(Tb.id)||rc.elementCache.set(Tb.id,new Map);var nc=rc.elementCache.get(Tb.id); return nc.has(Tb.versionNonce)||nc.set(Tb.versionNonce,(0,Fc.OL)(Tb)),{id:Tb.id,versionNonce:Tb.versionNonce}})}}},{key:"getSnapshotForTest",value:function(){var Ra=this;return{recording:this.recording,stateHistory:this.stateHistory.map(function(rc){return Ra.hydrateHistoryEntry(rc)}),redoStack:this.redoStack.map(function(rc){return Ra.hydrateHistoryEntry(rc)})}}},{key:"clear",value:function(){this.stateHistory.length=0;this.redoStack.length=0;this.lastEntry=null;this.elementCache.clear()}},{key:"shouldCreateEntry", value:function(Ra){var rc,qc=this.lastEntry;if(!qc||Ra.elements.length!==qc.elements.length)return!0;for(var Tb=Ra.elements.length-1;-1=Pf&&Oh<=Qf||Gg.has(Sf.id))&&Vg.push(Sf.id),Vg},[]);Lb(le)}else Lb([].concat((0,W.Z)(jc),[jf]));Sc(jf)}else Sc(null),Lb(jc.filter(function(Vg){return Vg!== jf}))},Ld=function(jf){return(jc.includes(jf)?rc.filter(function(le){return jc.includes(le.id)}):rc.filter(function(le){return le.id===jf})).map(function(le){return T(T({},le),{},{elements:(0,Fc._N)(le.elements)})})},pe=function(jf){var le,qg,Qg,Pf,Qf;return(0,Ja.jsx)(ed.Z.Col,{children:(0,Ja.jsx)(Pg,{elements:null===(le=jf.item)||void 0===le?void 0:le.elements,isPending:!(null!==(qg=jf.item)&&void 0!==qg&&qg.id||null===(Qg=jf.item)||void 0===Qg||!Qg.elements),onClick:jf.onClick||function(){},id:(null=== (Pf=jf.item)||void 0===Pf?void 0:Pf.id)||null,selected:!(null===(Qf=jf.item)||void 0===Qf||!Qf.id)&&jc.includes(jf.item.id),onToggle:hd,onDrag:function(Gg,Vg){Vg.dataTransfer.setData(ob.LO.excalidrawlib,(0,oh.NI)(Ld(Gg)))}})},jf.key)};Hc=function(jf){jf=jf.map(function(le){return le.id?pe({item:le,onClick:function(){return Tb(Ld(le.id))},key:le.id}):pe({key:"__pending__item__",item:le,onClick:function(){return qc(nc)}})});jf=(0,yb.yo)(jf,4);return jf.length||(jf=[[]]),jf.map(function(le,qg,Qg){return qg=== Qg.length-1&&(le=le.concat(Array(4-le.length).fill(null).map(function(Pf,Qf){return pe({key:"empty_".concat(Qf),item:null})}))),(0,Ja.jsx)(ed.Z.Row,{align:"center",className:"library-menu-items-container__row",children:le},qg)})};var Zd=rc.filter(function(jf){return"published"!==jf.status}),je=rc.filter(function(jf){return"published"===jf.status}),af=!(rc.length||Zd.length||je.length||nc.length);return(0,Ja.jsx)("div",{className:"library-menu-items-container",style:nc.length||Zd.length||je.length? {justifyContent:"flex-start"}:{},children:(0,Ja.jsxs)(ed.Z.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:0Jb.length)return!1; var fc=10/this.state.zoom.value;Jb=(0,Ab.KP)(Jb);Jb=(0,ha.Z)(Jb,4);var Hc=Jb[1],Nc=Jb[2],Sc=Jb[3];return Lb.x>Jb[0]-fc&&Lb.xHc-fc&&Lb.y (null!=Ra.props.UIOptions.dockedSidebarBreakpoint?Ra.props.UIOptions.dockedSidebarBreakpoint:ob.sk)})};this.onResize=(0,yb.tH)(function(){Ra.scene.getElementsIncludingDeleted().forEach(function(qc){return(0,jb.bI)(qc)});Ra.setState({})});this.renderScene=function(){var qc={},Tb={},nc={},jc={},Lb={};Ra.state.collaborators.forEach(function(Hc,Nc){if(Hc.selectedElementIds)for(var Sc=0,hd=Object.keys(Hc.selectedElementIds);Scob.f||!nc&&0!==jc)&&(nc=(0,yb.dE)(Ra.lastPointerDown,Ra.state),nc=(0,xl.wq)(Ra.hitLinkElement,Ra.state,[nc.x,nc.y],Ra.device.isMobile),jc=(0,yb.dE)(Ra.lastPointerUp,Ra.state),jc=(0,xl.wq)(Ra.hitLinkElement,Ra.state,[jc.x,jc.y],Ra.device.isMobile),nc&&jc)){var Lb,Jb;(nc=Ra.hitLinkElement.link)&&(nc=(0,Ek.$)(nc),Ra.props.onLinkOpen&&(Jb=(0,yb.ag)(ob.Ks.EXCALIDRAW_LINK,Tb.nativeEvent),Ra.props.onLinkOpen(X(X({}, Ra.hitLinkElement),{},{link:nc}),Jb)),null===(Lb=Jb)||void 0===Lb||!Lb.defaultPrevented)&&(Tb=(0,Ek.q)(nc)?"_self":"_blank",(Tb=window.open(void 0,Tb))&&(Tb.opener=null,Tb.location=nc))}};this.handleCanvasPointerMove=function(Tb){Ra.savePointer(Tb.clientX,Tb.clientY,Ra.state.cursorButton);Ui.has(Tb.pointerId)&&Ui.set(Tb.pointerId,{x:Tb.clientX,y:Tb.clientY});var nc=Dk;if(2===Ui.size&&dm&&nc&&vm){var jc=Oc(Ui),Lb=jc.x-dm.x,Jb=jc.y-dm.y;dm=jc;var fc=dd(Array.from(Ui.values())),Hc=(fc="freedraw"===Ra.state.activeTool.type&& Ra.state.penMode?1:fc/vm)?(0,sb.j)(nc*fc):Ra.state.zoom.value;Ra.setState(function(le){le=(0,Ac.E)({viewportX:jc.x,viewportY:jc.y,nextZoom:Hc},le);Ra.translateCanvas({zoom:le.zoom,scrollX:le.scrollX+Lb/Hc,scrollY:le.scrollY+Jb/Hc,shouldCacheIgnoreZoom:!0})});Ra.resetShouldCacheIgnoreZoomDebounced()}else dm=vm=Dk=null;if(!(Mk||Ei||Fk||(0,dc.l$)(Ra.state))){nc=(0,sb._4)(ij,Tb.clientX-Ra.state.offsetLeft,Tb.clientY-Ra.state.offsetTop).isOverEither;Ra.state.draggingElement||Ra.state.multiElement||(nc? (0,yb.z8)(Ra.canvas):(0,yb.Uk)(Ra.canvas,Ra.state));fc=(0,yb.dE)(Tb,Ra.state);var Nc=fc.x,Sc=fc.y;if(Ra.state.editingLinearElement&&!Ra.state.editingLinearElement.isDragging){var hd=vc._.handlePointerMove(Tb,Nc,Sc,Ra.state);hd&&hd!==Ra.state.editingLinearElement&&(0,ja.flushSync)(function(){Ra.setState({editingLinearElement:hd})});null!=(null==hd?void 0:hd.lastUncommittedPoint)?Ra.maybeSuggestBindingAtCursor(fc):(0,ja.flushSync)(function(){Ra.setState({suggestedBindings:[]})})}if((0,tc.Lx)(Ra.state.activeTool.type)){var Ld= Ra.state.draggingElement;(0,tc.Mn)(Ld,!1)?Ra.maybeSuggestBindingsForLinearElementAtCoords(Ld,[fc],Ra.state.startBoundElement):Ra.maybeSuggestBindingAtCursor(fc)}if(Ra.state.multiElement){nc=Ra.state.multiElement;Ld=nc.x;var pe=nc.y;fc=nc.points;var Zd=nc.lastCommittedPoint,je=fc[fc.length-1];if((0,yb.Uk)(Ra.canvas,Ra.state),je===Zd)(0,$b.LW)(Nc-Ld,Sc-pe,je[0],je[1])>=ob.qx?(0,tb.DR)(nc,{points:[].concat((0,W.Z)(fc),[[Nc-Ld,Sc-pe]])}):(0,yb.KJ)(Ra.canvas,ob.oc.POINTER);else if(2Lb.points.length?{elements:Ra.scene.getElementsIncludingDeleted().filter(function(Hc){return Hc.id!==Lb.id})}:{}),{},{appState:{draggingElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:Object.keys(Ra.state.selectedElementIds).filter(function(Hc){return Hc!==Lb.id}).reduce(function(Hc,Nc){return Hc[Nc]= Ra.state.selectedElementIds[Nc],Hc},{})}}))}else{var Jb=document.getSelection();if(null!=Jb&&Jb.anchorNode&&Jb.removeAllRanges(),Ra.maybeOpenContextMenuAfterPointerDownOnTouchDevices(Tb),Ra.maybeCleanupAfterMissingPointerUp(Tb),Ra.state.penDetected||"pen"!==Tb.pointerType||Ra.setState(function(Hc){return{penMode:!0,penDetected:!0}}),!Ra.device.isTouchScreen&&["pen","touch"].includes(Tb.pointerType)&&(Ra.device=(0,yb.v4)(Ra.device,{isTouchScreen:!0})),!(Ei||(Ra.lastPointerDown=Tb,Ra.setState({lastPointerDownWith:Tb.pointerType, cursorButton:"down"}),Ra.savePointer(Tb.clientX,Tb.clientY,"down"),Ra.handleCanvasPanUsingWheelOrSpaceDrag(Tb)||Tb.button!==ob.Oh.MAIN&&Tb.button!==ob.Oh.TOUCH||1=Ui.size&&(Tb.button===ob.Oh.WHEEL||Tb.button===ob.Oh.MAIN&&Mk||(0,dc.l$)(Ra.state)||Ra.state.viewModeEnabled))||(0,Ab.iB)(Ra.state.editingElement))return!1;Ei=!0;Tb.preventDefault();var nc=!1,jc=/Linux/.test(window.navigator.platform);(0,yb.KJ)(Ra.canvas,ob.oc.GRABBING);var Lb=Tb.clientX,Jb=Tb.clientY,fc=(0,yb.$9)(function(Nc){var Sc=Lb-Nc.clientX,hd=Jb-Nc.clientY; if(Lb=Nc.clientX,Jb=Nc.clientY,jc&&!nc&&(1ob.$n)){Pf.next=42;break}throw Error((0,Pa.t)("errors.fileTooBig",{maxSize:"".concat(Math.trunc(ob.$n/1024/1024),"MB")}));case 42:if(Ld&&(jf=null===(af=Ra.files[Zd])|| void 0===af?void 0:af.dataURL,le=jf&&(0,Wc.KG)(jf),Ra.setImagePreviewCursor(le||Nc)),Pf.t7=null===(Hc=Ra.files[Zd])||void 0===Hc?void 0:Hc.dataURL,Pf.t7){Pf.next=48;break}return Pf.next=47,(0,Wc.Sf)(Nc);case 47:Pf.t7=Pf.sent;case 48:return qg=Pf.t7,Qg=(0,tb.DR)(Sc,{fileId:Zd},!1),Pf.abrupt("return",new Promise(function(){var Qf=(0,ra.Z)(Ua().mark(function Oh(Vg,Sf){var Jj,$f;return Ua().wrap(function(xi){for(;;)switch(xi.prev=xi.next){case 0:if(xi.prev=0,Ra.files=X(X({},Ra.files),{},(0,Va.Z)({},Zd, {mimeType:pe,id:Zd,dataURL:qg,created:Date.now(),lastRetrieved:Date.now()})),$f=Ra.imageCache.get(Zd)){xi.next=7;break}return Ra.addNewImagesToImageCache(),xi.next=7,Ra.updateImageCache([Qg]);case 7:if(!((null==$f?void 0:$f.image)instanceof Promise)){xi.next=10;break}return xi.next=10,$f.image;case 10:Ra.state.pendingImageElementId!==Qg.id&&(null===(Jj=Ra.state.draggingElement)||void 0===Jj?void 0:Jj.id)!==Qg.id&&Ra.initializeImageDimensions(Qg,!0);Vg(Qg);xi.next=18;break;case 14:xi.prev=14,xi.t0= xi.catch(0),console.error(xi.t0),Sf(Error((0,Pa.t)("errors.imageInsertError")));case 18:return xi.prev=18,Ld||(0,yb.z8)(Ra.canvas),xi.finish(18);case 21:case "end":return xi.stop()}},Oh,null,[[0,14,18,21]])}));return function(Vg,Sf){return Qf.apply(this,arguments)}}()));case 51:case "end":return Pf.stop()}},Lb,null,[[6,19],[31,37]])}));return function(jc){return Tb.apply(this,arguments)}}();this.insertImageElement=function(){var Tb=(0,ra.Z)(Ua().mark(function fc(jc,Lb,Jb){return Ua().wrap(function(Hc){for(;;)switch(Hc.prev= Hc.next){case 0:return Ra.scene.replaceAllElements([].concat((0,W.Z)(Ra.scene.getElementsIncludingDeleted()),[jc])),Hc.prev=1,Hc.next=4,Ra.initializeImage({imageFile:Lb,imageElement:jc,showCursorImagePreview:Jb});case 4:Hc.next=11;break;case 6:Hc.prev=6,Hc.t0=Hc.catch(1),(0,tb.DR)(jc,{isDeleted:!0}),Ra.actionManager.executeAction(Ea.pL),Ra.setState({errorMessage:Hc.t0.message||(0,Pa.t)("errors.imageInsertError")});case 11:case "end":return Hc.stop()}},fc,null,[[1,6]])}));return function(jc,Lb,Jb){return Tb.apply(this, arguments)}}();this.setImagePreviewCursor=function(){var Tb=(0,ra.Z)(Ua().mark(function Lb(jc){var Jb,fc,Hc,Nc,Sc,hd,Ld;return Ua().wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return Jb=96,pe.next=3,(0,Wc.Tu)(jc,{maxWidthOrHeight:Jb});case 3:return fc=pe.sent,pe.next=6,(0,Wc.Sf)(fc);case 6:if(Hc=pe.sent,jc.type!==ob.LO.svg){pe.next=20;break}return pe.next=10,(0,Lk.PK)(Hc);case 10:Nc=pe.sent,Sc=Math.min(Nc.height,Jb),(hd=Nc.width/Nc.height*Sc)>Jb&&(Sc=(hd=Jb)*(Nc.height/Nc.width)),(Ld= document.createElement("canvas")).height=Sc,Ld.width=hd,Ld.getContext("2d").drawImage(Nc,0,0,hd,Sc),Hc=Ld.toDataURL(ob.LO.svg);case 20:Ra.state.pendingImageElementId&&(0,yb.KJ)(Ra.canvas,"url(".concat(Hc,") 4 4, auto"));case 21:case "end":return pe.stop()}},Lb)}));return function(jc){return Tb.apply(this,arguments)}}();this.onImageAction=(0,ra.Z)(Ua().mark(function nc(){var jc,Lb,Jb,fc,Hc,Nc,Sc,hd,Ld,pe=arguments;return Ua().wrap(function(Zd){for(;;)switch(Zd.prev=Zd.next){case 0:return jc=0fc&&(Nc=fc*jc);var Sc=Ra.state.zoom.value-Nc/100;return Sc+=Math.log10(Math.max(1,Ra.state.zoom.value))*-jc*Math.min(1,Hc/20),Ra.translateCanvas(function(hd){return X(X({},(0,Ac.E)({viewportX:lg,viewportY:fl,nextZoom:(0,sb.j)(Sc)},hd)),{},{shouldCacheIgnoreZoom:!0})}),void Ra.resetShouldCacheIgnoreZoomDebounced()}jc.shiftKey? Ra.translateCanvas(function(hd){return{scrollX:hd.scrollX-(Jb||Lb)/hd.zoom.value}}):Ra.translateCanvas(function(hd){var Ld=hd.zoom;return{scrollX:hd.scrollX-Lb/Ld.value,scrollY:hd.scrollY-Jb/Ld.value}})}});this.savePointer=function(jc,Lb,Jb){var fc,Hc;jc&&Lb&&(jc=(0,yb.dE)({clientX:jc,clientY:Lb},Ra.state),isNaN(jc.x)||isNaN(jc.y),null===(fc=(Hc=Ra.props).onPointerUpdate)||void 0===fc||fc.call(Hc,{pointer:jc,button:Jb,pointersMap:Ui}))};this.resetShouldCacheIgnoreZoomDebounced=(0,yb.Ds)(function(){Ra.unmounted|| Ra.setState({shouldCacheIgnoreZoom:!1})},300);this.updateDOMRect=function(jc){var Lb;if(null!==(Lb=Ra.excalidrawContainerRef)&&void 0!==Lb&&Lb.current){var Jb=Ra.excalidrawContainerRef.current.getBoundingClientRect();Lb=Jb.width;var fc=Jb.height,Hc=Jb.left;Jb=Jb.top;var Nc=Ra.state,Sc=Nc.height,hd=Nc.offsetTop,Ld=Nc.offsetLeft;if(Lb===Nc.width&&fc===Sc&&Hc===Ld&&Jb===hd)return void(jc&&jc());Ra.setState({width:Lb,height:fc,offsetLeft:Hc,offsetTop:Jb},function(){jc&&jc()})}};this.refresh=function(){Ra.setState(X({}, Ra.getCanvasOffsets()))}};"production"!==ob.Vi.TEST&&"production"!==ob.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){var Ra;return null===(Ra=this.app)||void 0===Ra?void 0:Ra.scene.getElementsIncludingDeleted()},set:function(Ra){var rc;return null===(rc=this.app)||void 0===rc?void 0:rc.scene.replaceAllElements(Ra)}}}));var cm=Tm},3807:function(g,h,c){c.d(h,{o:function(){return C}});var p=c(45),m=c(3646);g=c(487);g=c.n(g);h=c(631); h=c.n(h);var q=c(2052);q=c.n(q);var E=c(4010);E=c.n(E);var w=c(1469);w=c.n(w);var t=c(9329);t=c.n(t);var r=c(6029),f={};f.styleTagTransform=t();f.setAttributes=E();f.insert=q().bind(null,"head");f.domAPI=h();f.insertStyleElement=w();g()(r.Z,f);r.Z&&r.Z.locals&&r.Z.locals;var F=c(4512),C=function(M){var aa=M.children,O=M.checked,U=M.onChange;return(0,F.jsxs)("div",{className:(0,p.Z)("Checkbox",M.className,{"is-checked":O}),onClick:function(P){U(!O,P);P.currentTarget.querySelector(".Checkbox-box").focus()}, children:[(0,F.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":O,children:m.eQ}),(0,F.jsx)("div",{className:"Checkbox-label",children:aa})]})}},4499:function(g,h,c){c.d(h,{z:function(){return D}});var p=c(2577);g=c(9787);var m=c.n(g),q=c(2891),E=c(6340);g=c(487);g=c.n(g);h=c(631);h=c.n(h);var w=c(2052);w=c.n(w);var t=c(4010);t=c.n(t);var r=c(1469);r=c.n(r);var f=c(9329);f=c.n(f);var F=c(2345),C={};C.styleTagTransform=f();C.setAttributes=t();C.insert=w().bind(null,"head");C.domAPI= h();C.insertStyleElement=r();g()(F.Z,C);F.Z&&F.Z.locals&&F.Z.locals;var M=c(6066),aa=c(8211),O=c(56),U=c(4512),P=function(L){var Q=(new Option).style;return Q.color=L,!!Q.color},V=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),T=function(L){var Q=L.colors,N=L.color,la=L.onChange,R=L.onClose,Z=L.label,X=L.showInput,S=void 0===X||X,ha=L.type,W=L.elements,ra=m().useRef(),wa=m().useRef(),va=m().useRef(),Fa=m().useRef();L=m().useState(function(){return"canvasBackground"=== ha?[]:function(Ba,Ka){var Oa=[];Ba=Ba.filter(function(La){return!La.isDeleted}).sort(function(La,ma){return ma.updated-La.updated});for(var Va=0,Ya={elementBackground:"backgroundColor",elementStroke:"strokeColor"}[Ka];VaOa.length;){var Ua=Ba[Va];5>Oa.length&&!O.Z[Ka].includes(Ua[Ya])&&!Oa.includes(Ua[Ya])&&Oa.push(Ua[Ya]);Va++}return Oa}(W,ha)});L=(0,p.Z)(L,1)[0];m().useEffect(function(){wa.current?wa.current.focus():Fa.current?Fa.current.focus():va.current&&va.current.focus()},[]); X=function(Ba){var Ka=1=La.length?{done:!0}:{done:!1,value:La[oa++]}},e:function(Qa){throw Qa;},f:ma}}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 ia,sa=!0,Ea=!1;return{s:function(){ja=ja.call(La)},n:function(){var Qa=ja.next();return sa=Qa.done,Qa},e:function(Qa){Ea=!0;ia=Qa},f:function(){try{sa||null==ja.return||ja.return()}finally{if(Ea)throw ia;}}}}function E(La,ma){(null==ma||ma>La.length)&&(ma=La.length);for(var ja=0,oa=Array(ma);ja=N?(ha.style.width="".concat(N,"px"),ha.style.left="0px",ha.style.overflowX="scroll"):ha.style.left="".concat(P+ra-L>N?N-ra-10:P,"px"),W>=la?(ha.style.height="".concat(la-20,"px"),ha.style.top="10px",ha.style.overflowY="scroll"):ha.style.top="".concat(V+W-Q>la?la-W:V,"px")}},[V,P,D,N,la,L,Q]),(0,p.useEffect)(function(){if(T){var X=function(S){var ha;null!==(ha=R.current)&&void 0!==ha&&ha.contains(S.target)||(0,f.unstable_batchedUpdates)(function(){return T(S)})};return document.addEventListener("pointerdown", X,!1),function(){return document.removeEventListener("pointerdown",X,!1)}}},[T]),(0,M.jsx)("div",{className:"popover",ref:R,tabIndex:-1,children:U})}},9430:function(g,h,c){function p(S,ha){var W=Object.keys(S);if(Object.getOwnPropertySymbols){var ra=Object.getOwnPropertySymbols(S);ha&&(ra=ra.filter(function(wa){return Object.getOwnPropertyDescriptor(S,wa).enumerable}));W.push.apply(W,ra)}return W}c.d(h,{Y:function(){return X},b:function(){return Z}});var m=c(2577),q=c(9787);g=c.n(q);var E=c(1881), w=c(4739),t=c(9487),r=g().createContext({}),f=c(45),F=c(8211),C=c(2134),M=c(3646),aa=c(7169),O=c(4512),U=c(1894),P=function(S){return(0,O.jsx)("div",{className:"layer-ui__sidebar-dock-button","data-testid":"sidebar-dock",children:(0,O.jsxs)(U.u,{label:(0,F.t)("labels.sidebarLock"),children:[(0,O.jsxs)("label",{className:(0,f.Z)("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_medium"),children:[(0,O.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:S.onChange, checked:S.checked,"aria-label":(0,F.t)("labels.sidebarLock")})," ",(0,O.jsx)("div",{className:(0,f.Z)("Sidebar__pin-btn",{"Sidebar__pin-btn--pinned":S.checked}),tabIndex:0,children:M.qQ})," "]})," "]})})};g=function(S){var ha=(0,q.createContext)([!1,function(){}]),W=function(wa){wa=wa.children;var va=(0,q.useState)(!1);va=(0,m.Z)(va,2);var Fa=va[0],Ba=va[1];va=(0,q.useMemo)(function(){return[Fa,Ba]},[Fa]);return(0,O.jsx)(ha.Provider,{value:va,children:wa})},ra=function(wa){var va=(0,q.useContext)(ha); va=(0,m.Z)(va,2);var Fa=va[0],Ba=va[1];return(0,q.useLayoutEffect)(function(){if(!wa.__isFallback)return Ba(!0),function(){return Ba(!1)}},[wa.__isFallback,Ba]),wa.__isFallback&&Fa?null:(0,O.jsx)(S,function(Ka){for(var Oa=1;OaD?D=5:D+V.width>=T&&(D=T-V.width-5);"bottom"===P?(U=O.top+O.height+5)+V.height>=K&&(U=O.top-V.height-5):0>(U=O.top-V.height-5)&&(U=O.top+O.height+5);Object.assign(aa.style,{top:"".concat(U,"px"),left:"".concat(D,"px")})},M=function(aa){var O= aa.children,U=aa.label,P=aa.long,V=void 0!==P&&P;aa=aa.style;return(0,r.useEffect)(function(){return function(){return F().classList.remove("excalidraw-tooltip--visible")}},[]),(0,f.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(T){var K=T.currentTarget;T=F();T.classList.add("excalidraw-tooltip--visible");T.style.minWidth=V?"50ch":"10ch";T.style.maxWidth=V?"50ch":"15ch";T.textContent=U;K=K.getBoundingClientRect();C(T,K)},onPointerLeave:function(){return F().classList.remove("excalidraw-tooltip--visible")}, style:aa,children:O})}},6773:function(g,h,c){c.d(h,{Z:function(){return O}});var p=c(2577);g=c(487);g=c.n(g);h=c(631);h=c.n(h);var m=c(2052);m=c.n(m);var q=c(4010);q=c.n(q);var E=c(1469);E=c.n(E);var w=c(9329);w=c.n(w);var t=c(6359),r={};r.styleTagTransform=w();r.setAttributes=q();r.insert=m().bind(null,"head");r.domAPI=h();r.insertStyleElement=E();g()(t.Z,r);t.Z&&t.Z.locals&&t.Z.locals;g=c(9787);var f=c.n(g),F=c(45),C=c(1894),M=c(2134),aa=c(4512),O=function(U){var P=U.className,V=U.mobile;U=U.collaborators; var T=(0,M.eh)(),K=new Map;U.forEach(function(D,L){K.set(D.id||L,D)});U=0({current:[],version:0,set:aa}));return{In:({children:aa})=>{const O=M(P=>P.set),U=M(P=>P.version);return(0,m.useLayoutEffect)(()=>{O(P=>({version:P.version+1}))},[]),(0,m.useLayoutEffect)(()=>(O(({current:P})=>({current:[...P,aa]})),()=>O(({current:P})=>({current:P.filter(V=>V!==aa)}))),[aa,U]),null},Out:()=>{const aa=M(O=>O.current);return q().createElement(q().Fragment,null,aa)}}}c.d(h,{A3:function(){return f},ZC:function(){return C},R6:function(){return F}});var m=c(9787),q=c.n(m);const E= M=>{let aa;const O=new Set,U=(T,K)=>{T="function"==typeof T?T(aa):T;if(!Object.is(T,aa)){const D=aa;aa=(null!=K?K:"object"!=typeof T)?T:Object.assign({},aa,T);O.forEach(L=>L(aa,D))}},P=()=>aa,V={setState:U,getState:P,subscribe:T=>(O.add(T),()=>O.delete(T)),destroy:()=>{console.warn("[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected.");O.clear()}};return aa= M(U,P,V),V};g=c(5668);const {useSyncExternalStoreWithSelector:w}=g,t=M=>{"function"!=typeof M&&console.warn('[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.');const aa="function"==typeof M?M?E(M):E:M;M=(O,U)=>function(P,V=P.getState,T){P=w(P.subscribe,P.getState,P.getServerState||P.getState,V,T);return(0,m.useDebugValue)(P),P}(aa,O,U);return Object.assign(M,aa),M},r=M=>M?t(M):t;var f= q().createContext(null),F=function(){return q().useContext(f)},C=function(){return q().useMemo(function(){return{mainMenuTunnel:p(),welcomeScreenMenuHintTunnel:p(),welcomeScreenToolbarHintTunnel:p(),welcomeScreenHelpHintTunnel:p(),welcomeScreenCenterTunnel:p(),footerCenterTunnel:p(),jotaiScope:Symbol()}},[])}},9127:function(g,h,c){function p(S,ha){var W=Object.keys(S);if(Object.getOwnPropertySymbols){var ra=Object.getOwnPropertySymbols(S);ha&&(ra=ra.filter(function(wa){return Object.getOwnPropertyDescriptor(S, wa).enumerable}));W.push.apply(W,ra)}return W}function m(S){for(var ha=1;ha=K.length?{done:!0}:{done:!1,value:K[Q++]}},e:function(Z){throw Z;},f:D}}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 N,la=!0,R=!1;return{s:function(){L=L.call(K)}, n:function(){var Z=L.next();return la=Z.done,Z},e:function(Z){R=!0;N=Z},f:function(){try{la||null==L.return||L.return()}finally{if(R)throw N;}}}}function m(K,D){(null==D||D>K.length)&&(D=K.length);for(var L=0,Q=Array(D);L=X.length?{done:!0}:{done:!1,value:X[W++]}},e:function(Fa){throw Fa;},f:S}}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 ra,wa=!0,va=!1;return{s:function(){ha= ha.call(X)},n:function(){var Fa=ha.next();return wa=Fa.done,Fa},e:function(Fa){va=!0;ra=Fa},f:function(){try{wa||null==ha.return||ha.return()}finally{if(va)throw ra;}}}}function E(X,S){(null==S||S>X.length)&&(S=X.length);for(var ha=0,W=Array(S);ha= W.length?{done:!0}:{done:!1,value:W[va++]}},e:function(Oa){throw Oa;},f:ra}}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 Fa,Ba=!0,Ka=!1;return{s:function(){wa=wa.call(W)},n:function(){var Oa=wa.next();return Ba=Oa.done,Oa},e:function(Oa){Ka=!0;Fa=Oa},f:function(){try{Ba||null==wa.return||wa.return()}finally{if(Ka)throw Fa;}}}}function m(W,ra){(null==ra||ra>W.length)&&(ra=W.length); for(var wa=0,va=Array(ra);waLa.points.length?[[0,0],[La.width,La.height]]:La.points;if(0!==ia[0][0]||0!==ia[0][1])sa=aa._.getNormalizedPoints(La),ia=sa.points,ma=sa.x,sa=sa.y;return D(La,{type:"draw"===La.type?"line":La.type,startBinding:La.startBinding,endBinding:La.endBinding,lastCommittedPoint:null,startArrowhead:ja,endArrowhead:oa,points:ia,x:ma,y:sa});case "ellipse":case "rectangle":case "diamond":return D(La, {})}}(Ya,null==wa?void 0:wa.refreshDimensions);Ua&&((Ya=null==Fa?void 0:Fa.get(Ya.id))&&Ya.version>Ua.version&&(Ua=(0,O.ZP)(Ua,Ya.version)),va.has(Ua.id)&&(Ua=E(E({},Ua),{},{id:(0,F.kb)()})),va.add(Ua.id),Va.push(Ua))}return Va},[]);if(null==wa||!wa.repairBindings)return W;var Ba;ra=(0,U.xn)(W);var Ka=p(W);try{for(Ka.s();!(Ba=Ka.n()).done;){var Oa=Ba.value;(0,f.iB)(Oa)&&Oa.containerId?Q(Oa,ra):Oa.boundElements&&L(Oa,ra)}}catch(Va){Ka.e(Va)}finally{Ka.f()}return W},la=function(W,ra,wa){ra=ra[W];return void 0!== ra?ra:wa[W]},R={isLibraryOpen:function(W,ra){return["openSidebar","isLibraryOpen"in W?W.isLibraryOpen?"library":null:la("openSidebar",W,ra)]},isLibraryMenuDocked:function(W,ra){var wa;return["isSidebarDocked",null!==(wa=W.isLibraryMenuDocked)&&void 0!==wa?wa:la("isSidebarDocked",W,ra)]}},Z=function(W,ra){var wa,va,Fa,Ba;W=W||{};for(var Ka=(0,M.im)(),Oa={},Va=0,Ya=Object.keys(R);Vaoa-Xa&&saia-Xa&&Qa=cb[0]&&Xa<=Mb&&Pa>=tb-85&&Pa<=tb)return!1;ia=Ba(oa,ia);oa=ia.x;ia=ia.y;return!(sa>=oa-Qa&&sa<=oa+320+10+Qa&&Ea>=ia-Qa&&Ea<=ia+Qa+10+42)}},8290:function(g,h,c){function p(ma,ja){var oa=Object.keys(ma);if(Object.getOwnPropertySymbols){var ia=Object.getOwnPropertySymbols(ma);ja&&(ia=ia.filter(function(sa){return Object.getOwnPropertyDescriptor(ma,sa).enumerable}));oa.push.apply(oa,ia)}return oa}c.d(h,{$q:function(){return Ya},DK:function(){return la},H:function(){return R},HG:function(){return V}, N1:function(){return U},R:function(){return L},Ww:function(){return S},Y9:function(){return Z},ZB:function(){return wa},cz:function(){return O},ek:function(){return Oa},el:function(){return K}});var m=c(7169),q=c(2577),E=c(75),w=c(1974),t=c(2325),r=c(1935),f=c(1564),F=c(6938),C=c(6340),M=c(6066),aa=c(5710),O=function(ma){return!ma[M.tW.CTRL_OR_CMD]},U=function(ma){return ma.isBindingEnabled},P=function(ma,ja){var oa=[];return ja.forEach(function(ia){ia=ma.getNonDeletedElement(ia);null!=ia&&oa.push(ia)}), oa},V=function(ma,ja,oa){var ia=new Set,sa=new Set;T(ma,ja,oa,"start",ia,sa);T(ma,oa,ja,"end",ia,sa);ja=Array.from(sa).filter(function(Ea){return!ia.has(Ea)});P(f.Z.getScene(ma),ja).forEach(function(Ea){var Qa;(0,r.DR)(Ea,{boundElements:null===(Qa=Ea.boundElements)||void 0===Qa?void 0:Qa.filter(function(Xa){return"arrow"!==Xa.type||Xa.id!==ma.id})})})},T=function(ma,ja,oa,ia,sa,Ea){"keep"!==ja&&(null!=ja?null!=oa&&("keep"===oa?N(ma,ja,ia):"start"!==ia&&oa.id===ja.id)||(Q(ma,ja,ia),sa.add(ja.id)): (ja="start"===ia?"startBinding":"endBinding",oa=ma[ja],ma=null==oa?null:((0,r.DR)(ma,(0,m.Z)({},ja,null)),oa.elementId),null!=ma&&Ea.add(ma)))},K=function(ma){ma.forEach(function(ja){(0,w.Mn)(ja)?V(ja,Fa(ja,"start"),Fa(ja,"end")):(0,w.f0)(ja)&&D(ja)})},D=function(ma){Ba(ma).forEach(function(ja){ja=(0,q.Z)(ja,2);var oa=ja[1];return V(ja[0],"end"===oa?"keep":ma,"start"===oa?"keep":ma)})},L=function(ma,ja,oa,ia){null!=ja.startBoundElement&&Q(ma,ja.startBoundElement,"start");ja=Z(ia,oa);null==ja||N(ma, ja,"end")||Q(ma,ja,"end")},Q=function(ma,ja,oa){(0,r.DR)(ma,(0,m.Z)({},"start"===oa?"startBinding":"endBinding",function(ia){for(var sa=1;sama.points.length},R=function(ma){ma.forEach(function(ja){(0,w.Mn)(ja)&&V(ja,null,null)})},Z=function(ma,ja){return(0,E.QG)(ja.getNonDeletedElements(),function(oa){return(0,w.f0)(oa,!1)&&(0,t.uu)(oa,ma)})}, X=function(ma,ja,oa){var ia="start"===oa?-1:1;oa=-1===ia?0:ma.points.length-1;ia=oa-ia;oa=F._.getPointAtIndexGlobalCoordinates(ma,oa);ma=F._.getPointAtIndexGlobalCoordinates(ma,ia);return{focus:(0,t.T_)(ja,ma,oa),gap:Math.max(1,(0,t.oT)(ja,oa))}},S=function(ma,ja){var oa,ia=(null!==(oa=ma.boundElements)&&void 0!==oa?oa:[]).filter(function(Qa){return"arrow"===Qa.type});if(0!==ia.length){ja=null!=ja?ja:{};var sa=ja.newSize,Ea=ha(ja.simultaneouslyUpdated);P(f.Z.getScene(ma),ia.map(function(Qa){return Qa.id})).forEach(function(Qa){if((0,w.bt)(Qa)){var Xa, Pa;if((null===(Xa=Qa.startBinding)||void 0===Xa?void 0:Xa.elementId)===ma.id||(null===(Pa=Qa.endBinding)||void 0===Pa?void 0:Pa.elementId)===ma.id)Xa=ra(ma,Qa.startBinding,sa),Pa=ra(ma,Qa.endBinding,sa),Ea.has(Qa.id)?(0,r.DR)(Qa,{startBinding:Xa,endBinding:Pa}):(W(Qa,"start",Xa,ma),W(Qa,"end",Pa,ma),(0,aa.WJ)(Qa)&&(0,aa.RB)(Qa,!1))}})}},ha=function(ma){return new Set((ma||[]).map(function(ja){return ja.id}))},W=function(ma,ja,oa,ia){if(!(null==oa||oa.elementId!==ia.id&&2=S.length?{done:!0}:{done:!1,value:S[ra++]}},e:function(Ba){throw Ba;},f:ha}}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 wa,va=!0,Fa=!1;return{s:function(){W=W.call(S)},n:function(){var Ba= W.next();return va=Ba.done,Ba},e:function(Ba){Fa=!0;wa=Ba},f:function(){try{va||null==W.return||W.return()}finally{if(Fa)throw wa;}}}}function m(S,ha){(null==ha||ha>S.length)&&(ha=S.length);for(var W=0,ra=Array(ha);W=Va&&(Ka=P(Va,S,ha,W,ra)),0<=Ya&&1>=Ya&&(Oa=P(Ya,S,ha,W,ra)),[Ka,Oa]},T=function(S,ha){var W=[0,0];S=S.reduce(function(ra,wa){var va=wa.op;wa=wa.data;if("move"===va)W=wa;else if("bcurveTo"===va){va=[wa[0],wa[1]];var Fa=[wa[2],wa[3]];wa=[wa[4],wa[5]];va=ha?ha.apply(void 0, va):va;Fa=ha?ha.apply(void 0,Fa):Fa;var Ba=ha?ha.apply(void 0,wa):wa,Ka=ha?ha.apply(void 0,(0,E.Z)(W)):W;W=wa;wa=function(Oa,Va,Ya,Ua){var La=V(Oa[0],Va[0],Ya[0],Ua[0]),ma=V(Oa[1],Va[1],Ya[1],Ua[1]);Va=Math.min(Oa[0],Ua[0]);Ya=Math.max(Oa[0],Ua[0]);La&&(La=La.filter(function(ja){return null!==ja}),Va=Math.min.apply(Math,[Va].concat((0,E.Z)(La))),Ya=Math.max.apply(Math,[Ya].concat((0,E.Z)(La))));La=Math.min(Oa[1],Ua[1]);Oa=Math.max(Oa[1],Ua[1]);ma&&(Ua=ma.filter(function(ja){return null!==ja}),La= Math.min.apply(Math,[La].concat((0,E.Z)(Ua))),Oa=Math.max.apply(Math,[Oa].concat((0,E.Z)(Ua))));return[Va,La,Ya,Oa]}(Ka,va,Fa,Ba);wa=(0,q.Z)(wa,4);va=wa[1];Fa=wa[2];Ba=wa[3];ra.minX=Math.min(ra.minX,wa[0]);ra.minY=Math.min(ra.minY,va);ra.maxX=Math.max(ra.maxX,Fa);ra.maxY=Math.max(ra.maxY,Ba)}return ra},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[S.minX,S.minY,S.maxX,S.maxY]},K=function(S){var ha,W=1/0,ra=1/0,wa=-1/0,va=-1/0;S=p(S);try{for(S.s();!(ha=S.n()).done;){var Fa=(0,q.Z)(ha.value,2),Ba= Fa[0],Ka=Fa[1];W=Math.min(W,Ba);ra=Math.min(ra,Ka);wa=Math.max(wa,Ba);va=Math.max(va,Ka)}}catch(Oa){S.e(Oa)}finally{S.f()}return[W,ra,wa,va]},D=function(S,ha,W,ra){ha=U(ha[0]);if(1>ha.length)return null;var wa="start"===W?1:ha.length-1,va=ha[wa].data,Fa=[va[4],va[5]],Ba=[va[2],va[3]],Ka=[va[0],va[1]];ha=ha[wa-1];var Oa=[0,0];"move"===ha.op?Oa=ha.data:"bcurveTo"===ha.op&&(Oa=[ha.data[4],ha.data[5]]);wa=function(oa,ia){return Math.pow(1-oa,3)*Fa[ia]+3*oa*Math.pow(1-oa,2)*Ba[ia]+3*Math.pow(oa,2)*(1- oa)*Ka[ia]+Oa[ia]*Math.pow(oa,3)};ha=(0,q.Z)("start"===W?Oa:Fa,2);W=ha[0];ha=ha[1];va=[wa(.3,0),wa(.3,1)];wa=va[0];va=va[1];var Va=Math.hypot(W-wa,ha-va);wa=(W-wa)/Va;va=(ha-va)/Va;Va={arrow:30,bar:15,dot:15,triangle:15}[ra];var Ya=0;if("arrow"===ra){var Ua=(0,q.Z)(S.points[S.points.length-1],2);Ya=Ua[0];Ua=Ua[1];var La=(0,q.Z)(1S.points.length){var ra=(0,q.Z)(S.points[0],2);ra=(0,w.U1)(S.x+ra[0],S.y+ra[1],ha,W,S.angle);var wa= (0,q.Z)(ra,2);ra=wa[0];wa=wa[1];var va=[ra,wa,ra,wa],Fa=(0,C.WJ)(S);Fa&&(ra=M._.getMinMaxXYWithBoundText(S,[ra,wa,ra,wa],Fa),va=[ra[0],ra[1],ra[2],ra[3]]);return va}wa=null===(ra=(0,r.R2)(S))||void 0===ra?void 0:ra[0];ra=null!=wa?wa:function(Ba){var Ka=t.Z.generator(),Oa=(0,r.i)(Ba);return Ka[Ba.roundness?"curve":Oa.fill?"polygon":"linearPath"](Ba.points,Oa)}(S);ra=U(ra);ra=T(ra,function(Ba,Ka){return(0,w.U1)(S.x+Ba,S.y+Ka,ha,W,S.angle)});ra=[ra[0],ra[1],ra[2],ra[3]];if(wa=(0,C.WJ)(S))ra=M._.getMinMaxXYWithBoundText(S, ra,wa),ra=[ra[0],ra[1],ra[2],ra[3]];return ra},Q=function(S){var ha=aa(S);var W=(0,q.Z)(ha,6),ra=W[0],wa=W[1];ha=W[2];var va=W[3],Fa=W[4],Ba=W[5];if((0,f.F9)(S))return ha=K(S.points.map(function(Ya){Ya=(0,q.Z)(Ya,2);return(0,w.U1)(Ya[0],Ya[1],Fa-S.x,Ba-S.y,S.angle)})),ha=(0,q.Z)(ha,4),[ha[0]+S.x,ha[1]+S.y,ha[2]+S.x,ha[3]+S.y];if((0,f.bt)(S))ha=L(S,Fa,Ba);else if("diamond"===S.type){W=(0,w.U1)(Fa,wa,Fa,Ba,S.angle);wa=(0,q.Z)(W,2);W=wa[0];wa=wa[1];va=(0,w.U1)(Fa,va,Fa,Ba,S.angle);var Ka=(0,q.Z)(va, 2);va=Ka[0];Ka=Ka[1];ra=(0,w.U1)(ra,Ba,Fa,Ba,S.angle);var Oa=(0,q.Z)(ra,2);ra=Oa[0];Oa=Oa[1];ha=(0,w.U1)(ha,Ba,Fa,Ba,S.angle);var Va=(0,q.Z)(ha,2);ha=Va[0];Va=Va[1];ha=[Math.min(W,va,ra,ha),Math.min(wa,Ka,Oa,Va),Math.max(W,va,ra,ha),Math.max(wa,Ka,Oa,Va)]}else"ellipse"===S.type?(ha=(ha-ra)/2,wa=(va-wa)/2,va=Math.cos(S.angle),Ka=Math.sin(S.angle),W=Math.hypot(ha*va,wa*Ka),ha=Math.hypot(wa*va,ha*Ka),ha=[Fa-W,Ba-ha,Fa+W,Ba+ha]):(W=(0,w.U1)(ra,wa,Fa,Ba,S.angle),Ka=(0,q.Z)(W,2),W=Ka[0],Ka=Ka[1],ra=(0,w.U1)(ra, va,Fa,Ba,S.angle),Oa=(0,q.Z)(ra,2),ra=Oa[0],Oa=Oa[1],va=(0,w.U1)(ha,va,Fa,Ba,S.angle),Va=(0,q.Z)(va,2),va=Va[0],Va=Va[1],ha=(0,w.U1)(ha,wa,Fa,Ba,S.angle),wa=(0,q.Z)(ha,2),ha=wa[0],wa=wa[1],ha=[Math.min(W,ra,va,ha),Math.min(Ka,Oa,Va,wa),Math.max(W,ra,va,ha),Math.max(Ka,Oa,Va,wa)]);return ha},N=function(S){if(!S.length)return[0,0,0,0];var ha=1/0,W=-1/0,ra=1/0,wa=-1/0;return S.forEach(function(va){va=Q(va);va=(0,q.Z)(va,4);var Fa=va[1],Ba=va[2],Ka=va[3];ha=Math.min(ha,va[0]);ra=Math.min(ra,Fa);W=Math.max(W, Ba);wa=Math.max(wa,Ka)}),[ha,ra,W,wa]},la=function(S,ha,W,ra){if(!(0,f.bt)(S)&&!(0,f.F9)(S))return[S.x,S.y,S.x+ha,S.y+W];ha=(0,F.z)(0,ha,(0,F.z)(1,W,S.points,ra),ra);(0,f.F9)(S)?ha=K(ha):(W=t.Z.generator(),ha=S.roundness?W.curve(ha,(0,r.i)(S)):W.linearPath(ha,(0,r.i)(S)),ha=U(ha),ha=T(ha));ha=(0,q.Z)(ha,4);return[ha[0]+S.x,ha[1]+S.y,ha[2]+S.x,ha[3]+S.y]},R=function(S,ha){var W=t.Z.generator();ha=null==S.roundness?W.linearPath(ha,(0,r.i)(S)):W.curve(ha,(0,r.i)(S));ha=U(ha);ha=T(ha);ha=(0,q.Z)(ha,4); return[ha[0]+S.x,ha[1]+S.y,ha[2]+S.x,ha[3]+S.y]},Z=function(S,ha){if(!S.length)return[0,0,0,0];var W=1/0,ra=S[0];return S.forEach(function(wa){var va=Q(wa);va=(0,q.Z)(va,4);va=(0,w.LW)((va[0]+va[2])/2,(va[1]+va[3])/2,ha.x,ha.y);va=ob.length?{done:!0}:{done:!1, value:ob[hb++]}},e:function(dc){throw dc;},f:Ja}}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 Qb,ub=!0,Yb=!1;return{s:function(){bb=bb.call(ob)},n:function(){var dc=bb.next();return ub=dc.done,dc},e:function(dc){Yb=!0;Qb=dc},f:function(){try{ub||null==bb.return||bb.return()}finally{if(Yb)throw Qb;}}}}function m(ob,Ja){(null==Ja||Ja>ob.length)&&(Ja=ob.length);for(var bb=0,hb=Array(Ja);bb< Ja;bb++)hb[bb]=ob[bb];return hb}c.d(h,{uu:function(){return wa},T_:function(){return sa},j_:function(){return Ea},oT:function(){return Ba},wX:function(){return S},MZ:function(){return Qa},wB:function(){return ha},Qu:function(){return W},pX:function(){return ra},fb:function(){return va}});var q=c(2577),E=function(ob,Ja){return[0,0,0,0,Ja,ob,1,0]};g=function(){var ob=0Ja||7ob[6]?-1:1)/Ja)},aa=(g(1,1),g(1,2),g(1,3),g(1,4),g(1,5),g(1,6),g(1,7),function(ob,Ja,bb){return M([0,bb,ob,Ja,0,0,0,0])}),O=function(ob,Ja){return bb=ob,[(hb=Ja)[0]*bb[0]+hb[2]*bb[2]+hb[3]*bb[3]-hb[6]*bb[6],hb[1]*bb[0]+hb[0]*bb[1]-hb[4]*bb[2]+hb[5]*bb[3]+hb[2]*bb[4]-hb[3]*bb[5]-hb[7]*bb[6]-hb[6]*bb[7],hb[2]*bb[0]+hb[0]*bb[2]-hb[6]*bb[3]+hb[3]*bb[6],hb[3]*bb[0]+hb[6]*bb[2]+hb[0]*bb[3]-hb[2]*bb[6], hb[4]*bb[0]+hb[7]*bb[3]+hb[0]*bb[4]+hb[3]*bb[7],hb[5]*bb[0]+hb[7]*bb[2]+hb[0]*bb[5]+hb[2]*bb[7],hb[6]*bb[0]+hb[0]*bb[6],hb[7]*bb[0]+hb[0]*bb[7]];var bb,hb},U=function(ob){ob=(0,q.Z)(ob,2);return[0,0,0,0,ob[1],ob[0],1,0]},P=function(ob){return[ob[5],ob[4]]},V=function(ob,Ja){return bb=r(ob,Math.sin(Ja/2)),hb=Math.cos(Ja/2),"number"==typeof hb?[bb[0]+hb,bb[1],bb[2],bb[3],bb[4],bb[5],bb[6],bb[7]]:[bb[0]+hb[0],bb[1]+hb[1],bb[2]+hb[2],bb[3]+hb[3],bb[4]+hb[4],bb[5]+hb[5],bb[6]+hb[6],bb[7]+hb[7]];var bb, hb},T=function(ob,Ja){return M(r(r(ob,Ja),w(ob)))},K=c(6552),D=c(1493),L=c(8925),Q=c(3063),N=c(1974),la=c(1047),R=c(6340),Z=c(267),X=c(5710),S=function ub(Ja,bb,hb,Qb){var Yb=10/bb.zoom.value,dc=[hb,Qb];return bb.selectedElementIds[Ja.id]&&(0,Z.oY)([Ja],bb)?ra(Ja,dc,Yb):(Yb=(0,X.WJ)(Ja))&&ub(Yb,bb,hb,Qb)?!0:W(Ja,bb,dc)},ha=function(Ja,bb,hb,Qb){var ub=10/bb.zoom.value,Yb=(0,X.WJ)(Ja);return(!Yb||!S(Yb,bb,hb,Qb))&&!W(Ja,bb,[hb,Qb])&&ra(Ja,[hb,Qb],ub)},W=function(Ja,bb,hb){bb=10/bb.zoom.value;if((0,la.iB)(Ja))var Qb= Ka;else"arrow"===Ja.type?Qb=!1:"freedraw"===Ja.type?Qb=!0:(Qb=!(0,R.Qm)(Ja.backgroundColor)||(0,N.Xo)(Ja),Qb="line"===Ja.type?Qb&&(0,K.g6)(Ja.points):Qb||(0,N.pC)(Ja)),Qb=Qb?Oa:Va;return Fa({element:Ja,point:hb,threshold:bb,check:Qb})},ra=function(Ja,bb,hb){bb=(0,q.Z)(bb,2);var Qb=bb[0],ub=bb[1];bb=(0,L.qf)(Ja);var Yb=(0,q.Z)(bb,4);bb=Yb[0];var dc=Yb[1],uc=Yb[2];Yb=Yb[3];Ja=(0,K.U1)(Qb,ub,(bb+uc)/2,(dc+Yb)/2,-Ja.angle);Qb=(0,q.Z)(Ja,2);Ja=Qb[0];Qb=Qb[1];return Ja>bb-hb&&Jadc-hb&&Qbxc?Yb:Gbxc?ub:uc,Math.hypot(hb-uc[1],Qb-uc[0])Ja},Oa=function(Ja,bb){return Ja=vc)uc=[];else{vc=Math.sqrt(vc);var Fc=dc*xc*xc-Ab*uc*xc-uc*Gb;Gb=Ab*uc*uc-dc*uc*xc-xc*Gb;uc=[E((Fc+xc*vc)/lc,(Gb-uc*vc)/lc),E((Fc-xc*vc)/lc,(Gb+uc*vc)/lc)]}}return uc}));break;case "ellipse":Yb=cb(Ja,Qb,bb)}if(2>Yb.length)return[];Yb=Yb.sort(function(dc,uc){return C(f(dc,hb))-C(f(uc,hb))});return[Yb[0],Yb[Yb.length- 1]]},Pa=function(Ja){var bb=1=dc)return[];dc=Math.sqrt(dc);var uc=-Qb*Qb*bb*Yb;Yb*=-Ja*Ja*ub;return[E((uc+ Qb*Ja*ub*dc)/hb,(Yb-Qb*Ja*bb*dc)/hb),E((uc-Qb*Ja*ub*dc)/hb,(Yb+Qb*Ja*bb*dc)/hb)]},tb=function(Ja,bb,hb){var Qb=Math.sign(bb),ub=0,Yb=null;return Pa(Ja,Math.abs(bb)).forEach(function(dc){var uc=Qb*M(f(dc,hb))[1];uc>ub&&(ub=uc,Yb=dc)}),Yb},Mb=function(Ja,bb,hb,Qb){var ub,Yb=[],dc=!1;Ja=p((0,L.CM)(Ja));try{for(Ja.s();!(ub=Ja.n()).done;){var uc=ub.value;"move"===uc.op?(dc=!dc)&&Yb.push([uc.data[0],uc.data[1]]):"bcurveTo"===uc.op?dc&&(Yb.push([uc.data[0],uc.data[1]]),Yb.push([uc.data[2],uc.data[3]]),Yb.push([uc.data[4], uc.data[5]])):"lineTo"===uc.op&&dc&&Yb.push([uc.data[0],uc.data[1]])}}catch(xc){Ja.e(xc)}finally{Ja.f()}if(4<=Yb.length){if("sharp"===Qb)return(0,K.c9)(Yb,bb,hb);Qb=(0,D.s)(Yb,10,5);return(0,K.c9)(Qb,bb,hb)}return!1},yb=function(Ja,bb,hb,Qb){var ub=[0,0];return(0,L.CM)(Ja).some(function(Yb,dc){dc=Yb.op;var uc=Yb.data;if("move"===dc)ub=uc;else{if("bcurveTo"===dc){Yb=[uc[0],uc[1]];dc=[uc[2],uc[3]];uc=[uc[4],uc[5]];var xc=ub;ub=uc;return function(Gb,lc,Ab,vc,Fc,tc){var Oc=(0,q.Z)(Fc,2);Fc=Oc[0];Oc=Oc[1]; for(var dd=function($b,Wb){return Math.pow(1-$b,3)*vc[Wb]+3*$b*Math.pow(1-$b,2)*Ab[Wb]+3*Math.pow($b,2)*(1-$b)*lc[Wb]+Gb[Wb]*Math.pow($b,3)},Vc=0;1>=Vc;){var jd=dd(Vc,0),Cb=dd(Vc,1);if(Math.sqrt(Math.pow(jd-Fc,2)+Math.pow(Cb-Oc,2))ma.points.length:0===ma.width&&0===ma.height},f=function(ma,ja,oa){var ia=Math.abs(ja),sa=Math.abs(oa);"line"===ma||"arrow"===ma||"freedraw"=== ma?(ma=Math.round(Math.atan(sa/ia)/t.ay)*t.ay,0===ma?oa=0:ma===Math.PI/2?ja=0:oa=ia*Math.tan(ma)*Math.sign(oa)||oa):"selection"!==ma&&(oa=ia*Math.sign(oa));return{width:ja,height:oa}},F=function(ma,ja,oa,ia){var sa=oa-ma,Ea=ia-ja,Qa=Math.round(Math.atan(Ea/sa)/t.ay)*t.ay;if(0===Qa)Ea=0;else if(Qa===Math.PI/2)sa=0;else{Ea=Math.tan(Qa);Qa=ja-Ea*ma;var Xa=-1/Ea;oa=ia-Xa*oa;sa=(-1*oa- -1*Qa)/(-1*Ea- -1*Xa)-ma;Ea=(Qa*Xa-oa*Ea)/(-1*Ea- -1*Xa)-ja}return{width:sa,height:Ea}},C=function(ma){var ja={width:ma.width, height:ma.height,x:ma.x,y:ma.y};if(0>ma.width){var oa=Math.abs(ma.width);ja.width=oa;ja.x=ma.x-oa}0>ma.height&&(oa=Math.abs(ma.height),ja.height=oa,ja.y=ma.y-oa);return ja},M=c(2791),aa=c(8925),O=c(267),U=c(2325),P=c(2577),V=c(2726),T=["rotation"],K=function(ma,ja,oa){return ja>=ma[0]&&ja<=ma[0]+ma[2]&&oa>=ma[1]&&oa<=ma[1]+ma[3]},D=function(ma,ja,oa,ia,sa,Ea){return ma.reduce(function(Qa,Xa){return Qa?Qa:(Qa=function(Pa,cb,tb,Mb,yb,ob){if(!cb.selectedElementIds[Pa.id])return!1;Pa=(0,O.PC)(Pa,yb,ob); cb=Pa.rotation;var Ja=(0,V.Z)(Pa,T);if(cb&&K(cb,tb,Mb))return"rotation";Pa=Object.keys(Ja).filter(function(bb){bb=Ja[bb];return!!bb&&K(bb,tb,Mb)});return 0oa;ia=ia.originalElements.get(sa.id);Qa=Qa&&ia?ia.x:sa.x+Ea.x;Ea=ma&&ia?ia.y:sa.y+Ea.y}else Qa=sa.x+Ea.x,Ea=sa.y+Ea.y;(0,E.DR)(sa,{x:Qa,y:Ea})},W=function(ma,ja,oa){ma=(0,aa.KP)(ma);ma=(0,P.Z)(ma,2);return[ja-ma[0],oa-ma[1]]},ra=function(ma,ja,oa,ia,sa,Ea,Qa,Xa,Pa,cb,tb){Pa&&"selection"!==ma.type&&(tb?Xa=Qa/tb:(Math.abs(Ea-ia)>Math.abs(sa-oa)?(Xa=f(ja,Xa,sa Xa&&(Xa=-Xa)));sa=sa=S.length?{done:!0}:{done:!1,value:S[ra++]}},e:function(Ba){throw Ba;},f:ha}}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 wa,va=!0,Fa=!1;return{s:function(){W=W.call(S)},n:function(){var Ba=W.next();return va=Ba.done,Ba},e:function(Ba){Fa=!0;wa=Ba},f:function(){try{va||null==W.return||W.return()}finally{if(Fa)throw wa;}}}}function m(S,ha){(null==ha||ha>S.length)&&(ha=S.length);for(var W=0,ra=Array(ha);W=Ba&&Ua[0]<=Oa&&Ua[1]>=Ka&&Ua[1]<=Va||ha.shiftKey&&null!=va&&va.includes(La))&&Ya.push(La),Ya},[]);ra({editingLinearElement:E(E({},wa),{},{selectedPointsIndices:Fa.length?Fa:null})})}},{key:"handlePointDragging",value:function(ha,W,ra,wa,va,Fa){if(!Fa)return!1;var Ba=Fa.selectedPointsIndices,Ka=S.getElement(Fa.elementId);if(!Ka)return!1;var Oa= Ka.points[Fa.pointerDownState.lastClickedPoint];if(Ba&&Oa){if((0,K.Ge)(ha)&&1===Ba.length&&1W?ha.points.length+W:W;W=(0,M.qf)(ha);var wa=(0,r.Z)(W,4);W=(wa[0]+wa[2])/2;wa=(wa[1]+wa[3])/2;ra=ha.points[ra];var va=ha.x,Fa=ha.y;return ra?(0,C.U1)(va+ra[0],Fa+ra[1],W,wa,ha.angle):(0,C.U1)(va,Fa,W,wa,ha.angle)}},{key:"pointFromAbsoluteCoords",value:function(ha,W){var ra=(0,M.qf)(ha);ra=(0,r.Z)(ra,4);W=(0,C.U1)(W[0],W[1],(ra[0]+ra[2])/2,(ra[1]+ra[3])/2,-ha.angle);W=(0,r.Z)(W,2);return[W[0]- ha.x,W[1]-ha.y]}},{key:"getPointIndexUnderCursor",value:function(ha,W,ra,wa){ha=S.getPointsGlobalCoordinates(ha);for(var va=ha.length;-1<--va;){var Fa=ha[va];if((0,C.LW)(ra,wa,Fa[0],Fa[1])*W.valueW.length&&(0,O.DR)(ha,{isDeleted:!0});if(1==S.points.length%2){var ra=Z.getPointGlobalCoordinates(S,S.points[Math.floor(S.points.length/2)]);S=ra[0]-ha.width/2;ha=ra[1]-ha.height/2}else{var wa=S.points.length/2-1;ra=la[wa];2===S.points.length&&(ra=(0,C.H5)(W[0],W[1]));ra&&N===S.version||(ra=Z.getSegmentMidPoint(S,W[wa],W[wa+1],wa+1));S=ra[0]- ha.width/2;ha=ra[1]-ha.height/2}return{x:S,y:ha}};Z.getMinMaxXYWithBoundText=function(S,ha,W){var ra=(0,r.Z)(ha,4);ha=ra[0];var wa=ra[1],va=ra[2];ra=ra[3];var Fa=(ha+va)/2,Ba=(wa+ra)/2,Ka=Z.getBoundTextElementPosition(S,W),Oa=Ka.x,Va=Ka.y;Ka=Oa+W.width;var Ya=Va+W.height;W=(0,C.xj)([ha,wa],[Fa,Ba],S.angle);var Ua=(0,C.xj)([va,wa],[Fa,Ba],S.angle),La=(0,C.xj)([Oa,Va],[Fa,Ba],-S.angle);Va=(0,C.xj)([Ka,Va],[Fa,Ba],-S.angle);Oa=(0,C.xj)([Oa,Ya],[Fa,Ba],-S.angle);S=(0,C.xj)([Ka,Ya],[Fa,Ba],-S.angle);return W[0]< Ua[0]&&W[1]>=Ua[1]?(ha=Math.min(ha,Oa[0]),va=Math.max(va,Math.max(Va[0],S[0])),wa=Math.min(wa,La[1]),ra=Math.max(ra,S[1])):W[0]>=Ua[0]&&W[1]>Ua[1]?(ha=Math.min(ha,S[0]),va=Math.max(va,Math.max(La[0],Va[0])),wa=Math.min(wa,Oa[1]),ra=Math.max(ra,Va[1])):W[0]>=Ua[0]?(ha=Math.min(ha,Va[0]),va=Math.max(va,Oa[0]),wa=Math.min(wa,S[1]),ra=Math.max(ra,La[1])):W[1]<=Ua[1]&&(ha=Math.min(ha,Math.min(Va[0],La[0])),va=Math.max(va,S[0]),wa=Math.min(wa,Va[1]),ra=Math.max(ra,Oa[1])),[ha,wa,va,ra,Fa,Ba]};Z.getElementAbsoluteCoords= function(S){var ha=1S.points.length||!(0,L.R2)(S)){var W=S.points.reduce(function(Ba,Ka){var Oa=(0,r.Z)(Ka,2);Ka=Oa[0];Oa=Oa[1];return Ba.minY=Math.min(Ba.minY,Oa),Ba.minX=Math.min(Ba.minX,Ka),Ba.maxX=Math.max(Ba.maxX,Ka),Ba.maxY=Math.max(Ba.maxY,Oa),Ba},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});var ra=W.minY;var wa=W.maxX;var va=W.maxY;W=W.minX+S.x;ra+=S.y;wa+=S.x;var Fa=va+S.y}else W=(0,L.R2)(S),W=(0,aa.CM)(W[0]),W=(0,aa.IX)(W),W=(0,r.Z)(W, 4),ra=W[1],wa=W[2],va=W[3],W=W[0]+S.x,ra+=S.y,wa+=S.x,Fa=va+S.y;if(va=[W,ra,wa,Fa,(W+wa)/2,(ra+Fa)/2],!ha)return va;ha=(0,D.WJ)(S);return ha&&(va=Z.getMinMaxXYWithBoundText(S,[W,ra,wa,Fa],ha)),va};var X=function(S){S=(0,w.Z)(new Set(S.filter(function(ha){return null!==ha&&-1!==ha})));return(S=S.sort(function(ha,W){return ha-W})).length?S:null}},1935:function(g,h,c){function p(O,U){var P=Object.keys(O);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(O);U&&(V=V.filter(function(T){return Object.getOwnPropertyDescriptor(O, T).enumerable}));P.push.apply(P,V)}return P}function m(O){for(var U=1;U=Ba.length?{done:!0}:{done:!1,value:Ba[Va++]}},e:function(ma){throw ma;},f:Ka}}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 Ya,Ua=!0,La=!1;return{s:function(){Oa=Oa.call(Ba)},n:function(){var ma=Oa.next();return Ua=ma.done,ma},e:function(ma){La=!0;Ya=ma},f:function(){try{Ua|| null==Oa.return||Oa.return()}finally{if(La)throw Ya;}}}}function m(Ba,Ka){(null==Ka||Ka>Ba.length)&&(Ka=Ba.length);for(var Oa=0,Va=Array(Ka);Oaja-2*oa&&(ja=Ua+2*oa),Va>sa-2*oa&&(sa=Va+2*oa),(0,K.Yv)(Oa)||ja===ia.height&&sa===ia.width||(0,M.DR)(Oa,{height:ja,width:sa}));Oa={width:Va,height:Ua,baseline:Ya,x:Number.isFinite(La)?La:Ba.x,y:Number.isFinite(ma)?ma:Ba.y};return E({text:Ka},Oa)}},Z=function(Ba,Ka){Ka.text;var Oa=Ka.isDeleted;Ka=Ka.originalText;return(0,M.BE)(Ba,E({originalText:Ka,isDeleted:null!=Oa?Oa:Ba.isDeleted},R(Ba,Ka)))},X=function(Ba){return E(E({},L(Ba.type, Ba)),{},{points:Ba.points||[],pressures:[],simulatePressure:Ba.simulatePressure,lastCommittedPoint:null})},S=function(Ba){return E(E({},L(Ba.type,Ba)),{},{points:Ba.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:Ba.startArrowhead,endArrowhead:Ba.endArrowhead})},ha=function(Ba){var Ka,Oa,Va;return E(E({},L("image",Ba)),{},{strokeColor:"transparent",status:null!==(Ka=Ba.status)&&void 0!==Ka?Ka:"pending",fileId:null!==(Oa=Ba.fileId)&&void 0!==Oa?Oa:null,scale:null!== (Va=Ba.scale)&&void 0!==Va?Va:[1,1]})},W=function Oa(Ka){var Va=1=2*Math.PI?R-2*Math.PI:R},T=function(R,Z,X,S,ha,W,ra,wa,va,Fa,Ba){if(1===X.length){X=(0,w.Z)(X,1)[0];if("rotation"===Z){Z=(0,F.qf)(X);Z=(0,w.Z)(Z,4);Z=5*Math.PI/2+ Math.atan2(va-(Z[1]+Z[3])/2,wa-(Z[0]+Z[2])/2);ha&&(Z+=t.ay/2,Z-=Z%t.ay);Z=V(Z);W=(0,P.xB)(X);if((0,M.DR)(X,{angle:Z}),W){var Ka,Oa=null===(Ka=U.Z.getScene(X))||void 0===Ka?void 0:Ka.getElement(W);Oa&&!(0,C.Yv)(X)&&(0,M.DR)(Oa,{angle:Z})}(0,O.Ww)(X)}else if(!(0,C.iB)(X)||"nw"!==Z&&"ne"!==Z&&"sw"!==Z&&"se"!==Z)Z&&D(R.originalElements,ra,X,Z,W,wa,va);else{Ka=(0,F.qf)(X);ha=(0,w.Z)(Ka,4);ra=ha[0];R=ha[1];Ka=ha[2];ha=ha[3];wa=(0,f.U1)(wa,va,(ra+Ka)/2,(R+ha)/2,-X.angle);va=(0,w.Z)(wa,2);wa=va[0];va=va[1]; switch(Z){case "se":Oa=Math.max((wa-ra)/(Ka-ra),(va-R)/(ha-R));break;case "nw":Oa=Math.max((Ka-wa)/(Ka-ra),(ha-va)/(ha-R));break;case "ne":Oa=Math.max((wa-ra)/(Ka-ra),(ha-va)/(ha-R));break;case "sw":Oa=Math.max((Ka-wa)/(Ka-ra),(va-R)/(ha-R))}0Z)return null;R=(0,P.X1)(R.text,(0,aa.mO)({fontSize:Z,fontFamily:R.fontFamily}),R.lineHeight);return{size:Z,baseline:R.baseline+(X-R.height)}},D=function(R,Z,X,S,ha,W,ra){var wa=R.get(X.id),va=(0,F.wC)(wa,wa.width,wa.height,!0);va=(0,w.Z)(va,4);var Fa=[va[0],va[1]],Ba=[va[2],va[3]];va=(0,f.H5)(Fa,Ba);var Ka=(0,f.xj)([W,ra],va,-wa.angle);W=(0,F.wC)(X,X.width,X.height,!0);W=(0,w.Z)(W,4);var Oa=W[2]-W[0],Va=W[3]-W[1],Ya=(Ba[0]-Fa[0])/Oa,Ua=(Ba[1]-Fa[1])/Va;ra={};W=(0,P.WJ)(X);S.includes("e")&& (Ya=(Ka[0]-Fa[0])/Oa);S.includes("s")&&(Ua=(Ka[1]-Fa[1])/Va);S.includes("w")&&(Ya=(Ba[0]-Ka[0])/Oa);S.includes("n")&&(Ua=(Ba[1]-Ka[1])/Va);Oa=wa.width;Va=wa.height;Ka=X.width*Ya;Ua*=X.height;if(ha&&(Ka=2*Ka-Oa,Ua=2*Ua-Va),Z){Ya=Math.abs(Ka)/Oa;var La=Math.abs(Ua)/Va;if(1===S.length&&(Ua*=Ya,Ka*=La),2===S.length)Ya=Math.max(Ya,La),Ka=Oa*Ya*Math.sign(Ka),Ua=Va*Ya*Math.sign(Ua)}if(W)if(R=R.get(W.id),R&&(ra={fontSize:R.fontSize,baseline:R.baseline}),Z){ra=m(m({},X),{},{width:Ka,height:Ua});ra=K(W,(0,P.jd)(ra), (0,P.N2)(ra));if(null===ra)return;ra={fontSize:ra.size,baseline:ra.baseline}}else R=(0,P.AT)((0,aa.mO)(W),W.lineHeight),Oa=(0,P.w_)(W.fontSize,W.lineHeight),Ka=Math.ceil(Math.max(Ka,R)),Ua=Math.ceil(Math.max(Ua,Oa));R=(0,F.wC)(wa,Ka,Ua,!0);Ya=(0,w.Z)(R,4);Oa=Ya[0];Va=Ya[1];R=Ya[2];Ya=Ya[3];La=R-Oa;var ma=Ya-Va,ja=[].concat(Fa);if(["n","w","nw"].includes(S)&&(ja=[Ba[0]-Math.abs(La),Ba[1]-Math.abs(ma)]),"ne"===S)ja=[Fa[0],Ba[1]],ja=[ja[0],ja[1]-Math.abs(ma)];"sw"===S&&(Fa=[Ba[0],Fa[1]],ja=[Fa[0]-Math.abs(La), Fa[1]]);Z&&(["s","n"].includes(S)&&(ja[0]=va[0]-La/2),["e","w"].includes(S)&&(ja[1]=va[1]-ma/2));0>Ka&&(S.includes("e")&&(ja[0]-=Math.abs(La)),S.includes("w")&&(ja[0]+=Math.abs(La)));0>Ua&&(S.includes("s")&&(ja[1]-=Math.abs(ma)),S.includes("n")&&(ja[1]+=Math.abs(ma)));ha&&(ja[0]=va[0]-Math.abs(La)/2,ja[1]=va[1]-Math.abs(ma)/2);var oa,ia;Z=wa.angle;ha=(0,f.xj)(ja,va,Z);va=(0,f.xj)([ja[0]+Math.abs(La)/2,ja[1]+Math.abs(ma)/2],va,Z);ja=(0,f.xj)(ha,va,-Z);((0,C.bt)(X)||(0,C.F9)(X))&&(oa=(0,r.z)(1,Ua,wa.points, !0),ia=(0,r.z)(0,Ka,oa,!0));oa=(0,q.Z)(ja);oa[0]+=wa.x-Oa;oa[1]+=wa.y-Va;ia={width:Math.abs(Ka),height:Math.abs(Ua),x:oa[0],y:oa[1],points:ia};"scale"in X&&"scale"in wa&&(0,M.DR)(X,{scale:[(Math.sign(R-wa.x)||wa.scale[0])*wa.scale[0],(Math.sign(Ya-wa.y)||wa.scale[1])*wa.scale[1]]});0!==ia.width&&0!==ia.height&&Number.isFinite(ia.x)&&Number.isFinite(ia.y)&&((0,O.Ww)(X,{newSize:{width:ia.width,height:ia.height}}),(0,M.DR)(X,ia),W&&null!=ra&&(0,M.DR)(W,{fontSize:ra.fontSize,baseline:ra.baseline}),(0,P.RB)(X, S))},L=function(R,Z,X,S,ha,W){Z=Z.reduce(function(Ua,La){var ma=R.originalElements.get(La.id);return ma&&Ua.push({orig:ma,latest:La}),Ua},[]);var ra=(0,F.v2)(Z.map(function(Ua){return Ua.orig})),wa=ra.minX,va=ra.minY,Fa=ra.maxX,Ba=ra.maxY,Ka=ra.midX;ra=ra.midY;Ka=(0,w.Z)(S?[Ka,ra]:{ne:[wa,Ba],se:[wa,va],sw:[Fa,va],nw:[Fa,Ba]}[X],2);var Oa=Ka[0],Va=Ka[1];Ka={ne:[ha>=Oa,W<=Va],se:[ha>=Oa,W>=Va],sw:[ha<=Oa,W>=Va],nw:[ha<=Oa,W<=Va]}[X].map(function(Ua){return Ua?1:-1});ra=(0,w.Z)(Ka,2);Ka=ra[0];ra=ra[1]; if(!(0>Ka&&0>ra)){var Ya=Math.max(Ka*Math.abs(ha-Oa)/(Fa-wa),ra*Math.abs(W-Va)/(Ba-va))*(S?2:1);0!==Ya&&Z.forEach(function(Ua){var La=Ua.orig.width*Ya,ma=Ua.orig.height*Ya,ja=Oa+(Ua.orig.x-Oa)*Ya,oa=Va+(Ua.orig.y-Va)*Ya;var ia=Ua.orig;ia=(0,C.bt)(ia)||(0,C.F9)(ia)?{points:(0,r.z)(0,La,(0,r.z)(1,ma,ia.points,!1),!1)}:{};ja=m({width:La,height:ma,x:ja,y:oa},ia);oa=null;if((ia=(0,P.WJ)(Ua.latest))||(0,C.iB)(Ua.orig)){var sa=m(m({},Ua.latest),{},{width:La,height:ma});sa=K(null!=ia?ia:Ua.orig,ia?(0,P.jd)(sa): sa.width,ia?(0,P.N2)(sa):sa.height);if(!sa)return;(0,C.iB)(Ua.orig)&&(ja.fontSize=sa.size,ja.baseline=sa.baseline);ia&&(oa={fontSize:sa.size,baseline:sa.baseline})}(0,O.Ww)(Ua.latest,{newSize:{width:La,height:ma}});(0,M.DR)(Ua.latest,ja);ia&&oa&&((0,M.DR)(ia,oa),(0,P.RB)(Ua.latest,X))})}},Q=function(R,Z,X,S,ha,W,ra){var wa=5*Math.PI/2+Math.atan2(S-ra,X-W);ha&&(wa+=t.ay/2,wa-=wa%t.ay);Z.forEach(function(va){var Fa,Ba,Ka=(0,F.qf)(va),Oa=(0,w.Z)(Ka,4);Ka=(Oa[0]+Oa[2])/2;Oa=(Oa[1]+Oa[3])/2;var Va=null!== (Fa=null===(Ba=R.originalElements.get(va.id))||void 0===Ba?void 0:Ba.angle)&&void 0!==Fa?Fa:va.angle;Fa=(0,f.U1)(Ka,Oa,W,ra,wa+Va-va.angle);Ba=(0,w.Z)(Fa,2);Fa=Ba[0];Ba=Ba[1];(0,M.DR)(va,{x:va.x+(Fa-Ka),y:va.y+(Ba-Oa),angle:V(wa+Va)});var Ya=(0,P.xB)(va);if(Ya){var Ua,La=null===(Ua=U.Z.getScene(va))||void 0===Ua?void 0:Ua.getElement(Ya);La&&!(0,C.Yv)(va)&&(0,M.DR)(La,{x:La.x+(Fa-Ka),y:La.y+(Ba-Oa),angle:V(wa+Va)})}})},N=function(R,Z,X,S){var ha=1===Z.length?(0,F.qf)(Z[0]):(0,F.KP)(Z),W=(0,w.Z)(ha, 4);ha=W[0];var ra=W[1],wa=W[2];W=W[3];Z=1===Z.length?Z[0].angle:0;X=(0,f.U1)(X,S,(ha+wa)/2,(ra+W)/2,-Z);var va=(0,w.Z)(X,2);switch(X=va[0],S=va[1],R){case "n":return(0,f.U1)(X-(ha+wa)/2,S-ra,0,0,Z);case "s":return(0,f.U1)(X-(ha+wa)/2,S-W,0,0,Z);case "w":return(0,f.U1)(X-ha,S-(ra+W)/2,0,0,Z);case "e":return(0,f.U1)(X-wa,S-(ra+W)/2,0,0,Z);case "nw":return(0,f.U1)(X-ha,S-ra,0,0,Z);case "ne":return(0,f.U1)(X-wa,S-ra,0,0,Z);case "sw":return(0,f.U1)(X-ha,S-W,0,0,Z);case "se":return(0,f.U1)(X-wa,S-W,0,0, Z);default:return[0,0]}},la=function(R,Z){Z=(0,w.Z)(Z.points,2);var X=(0,w.Z)(Z[1],2);Z=X[0];X=X[1];return"nw"===R&&(0>Z||0>X)||"ne"===R&&0<=Z||"sw"===R&&0>=Z||"se"===R&&(0Yb&&(dc=cb(Qb.height,hb.type),(0,f.DR)(hb,{height:dc}),Mb(hb),(0,V.h_)(hb.id,dc));Qb=m(m({},bb),ub);hb=la(hb,Qb);Qb=hb.y;ub.x=hb.x;ub.y=Qb}(0,f.DR)(bb,ub)},Q=function(bb,hb,Qb){var ub=(0,r.xn)(bb);hb.forEach(function(Yb){var dc=Qb.get(Yb.id),uc=Va(Yb);if(uc){var xc=Qb.get(uc); if(xc){var Gb=ub.get(dc);Gb&&(0,f.DR)(Gb,{boundElements:(Yb.boundElements||[]).filter(function(lc){return lc.id!==xc&&lc.id!==uc}).concat({type:"text",id:xc})});(Yb=ub.get(xc))&&(0,M.iB)(Yb)&&(0,f.DR)(Yb,{containerId:Gb?dc:null})}}})},N=function(bb,hb){var Qb=Va(bb);if(Qb){(0,V.kT)(bb.id);var ub=C.Z.getScene(bb).getElement(Qb);if(ub&&ub.text&&bb){Qb=(ub=C.Z.getScene(bb).getElement(Qb)).text;var Yb=ub.height,dc=ub.width,uc=La(bb),xc=tb(bb),Gb=Mb(bb),lc=ub.baseline;"n"!==hb&&"s"!==hb&&(Qb&&=va(ub.originalText, (0,r.mO)(ub),xc),lc=R(Qb,(0,r.mO)(ub),ub.lineHeight),Yb=lc.height,dc=lc.width,lc=lc.baseline);Yb>Gb&&(xc=(Gb=cb(Yb,bb.type))-uc.height,hb=(0,aa.Yv)(bb)||"ne"!==hb&&"nw"!==hb&&"n"!==hb?bb.y:bb.y-xc,(0,f.DR)(bb,{height:Gb,y:hb}));(0,f.DR)(ub,{text:Qb,width:dc,height:Yb,baseline:lc});(0,aa.Yv)(bb)||(0,f.DR)(ub,la(bb,ub))}}},la=function(bb,hb){if((0,aa.Yv)(bb))return O._.getBoundTextElementPosition(bb,hb);var Qb,ub=ja(bb),Yb=Mb(bb);bb=tb(bb);return Qb=hb.verticalAlign===F.oX.TOP?ub.y:hb.verticalAlign=== F.oX.BOTTOM?ub.y+(Yb-hb.height):ub.y+(Yb/2-hb.height/2),{x:hb.textAlign===F.I8.LEFT?ub.x:hb.textAlign===F.I8.RIGHT?ub.x+(bb-hb.width):ub.x+(bb/2-hb.width/2),y:Qb}},R=function(bb,hb,Qb){bb=bb.split("\n").map(function(Yb){return Yb||" "}).join("\n");var ub=parseFloat(hb);ub=wa(bb,ub,Qb);return{width:ra(bb,hb),height:ub,baseline:Z(bb,hb,Qb)}},Z=function(bb,hb,Qb,ub){var Yb=document.createElement("div");Yb.style.position="absolute";Yb.style.whiteSpace="pre";Yb.style.font=hb;Yb.style.minHeight="1em";ub&& (Yb.style.overflow="hidden",Yb.style.wordBreak="break-word",Yb.style.whiteSpace="pre-wrap");Yb.style.lineHeight=String(Qb);Yb.innerText=bb;document.body.appendChild(Yb);ub=document.createElement("span");ub.style.display="inline-block";ub.style.overflow="hidden";ub.style.width="1px";ub.style.height="1px";Yb.appendChild(ub);ub=ub.offsetTop+ub.offsetHeight;var dc=Yb.offsetHeight;if(F.G6){var uc=wa(bb,parseFloat(hb),Qb);hb=parseFloat(hb);bb=wa(bb,Math.round(hb),Qb);uc>dc&&(ub+=uc-bb);dc>uc&&(ub-=bb-uc)}return document.body.removeChild(Yb), ub},X=function(bb){var hb=D(bb.text).split("\n").length;return bb.height/hb/bb.fontSize},S=function(bb,hb){return bb*hb},ha=function(bb,hb){return bb*hb+2*F.gK},W=function(bb,hb){T||=document.createElement("canvas");var Qb=T.getContext("2d");Qb.font=hb;bb=Qb.measureText(bb).width;return(0,r.h2)()?10*bb:bb},ra=function(bb,hb){var Qb=0;return D(bb).split("\n").forEach(function(ub){Qb=Math.max(Qb,W(ub,hb))}),Qb},wa=function(bb,hb,Qb){bb=D(bb).split("\n").length;return hb*Qb*bb},va=function(bb,hb,Qb){if(!Number.isFinite(Qb)|| 0>Qb)return bb;var ub=[];bb=bb.split("\n");var Yb=W(" ",hb),dc="",uc=0,xc=function(lc){lc.trim()&&ub.push(lc)},Gb=function(){dc="";uc=0};return bb.forEach(function(lc){if(ra(lc,hb)<=Qb)ub.push(lc);else{lc=function(tc){var Oc=tc.split("-");return 1Qb){xc(dc);for(Gb();0=Qb?(xc(dc),dc=vc,uc=Fc):dc+=vc}uc+Yb>=Qb?(xc(dc),Gb()):dc.endsWith("-")||(dc+=" ",uc+=Yb);Ab++}else for(;ucQb){xc(dc);Gb();break}Ab++;Fc=!vc.endsWith("-");if(dc+=vc,Fc&&(dc+=" "),uc+Yb>=Qb){Fc?ub.push(dc.slice(0,-1)):ub.push(dc);Gb();break}}}" "===dc.slice(-1)&&(dc=dc.slice(0,-1),xc(dc))}}),ub.join("\n")},Fa=(K={},{calculate:function(bb,hb){var Qb=bb.charCodeAt(0);(K[hb]||(K[hb]= []),K[hb][Qb])||(bb=W(bb,hb),K[hb][Qb]=bb);return K[hb][Qb]},getCache:function(bb){return K[bb]}}),Ba="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Ka=function(bb,hb){var Qb=Oa(bb);return 0===Qb?R(Ba.split("").join("\n"),bb,hb).width+2*F.gK:Qb+2*F.gK},Oa=function(bb){bb=Fa.getCache(bb);if(!bb)return 0;bb=bb.filter(function(hb){return void 0!==hb});return Math.max.apply(Math,(0,w.Z)(bb))},Va=function(bb){var hb,Qb,ub;return null!=bb&&null!==(hb=bb.boundElements)&&void 0!==hb&&hb.length&& (null==bb||null===(Qb=bb.boundElements)||void 0===Qb||null===(ub=Qb.filter(function(Yb){return"text"===Yb.type})[0])||void 0===ub?void 0:ub.id)||null},Ya=function(bb){if(!bb)return null;var hb,Qb=Va(bb);return Qb&&(null===(hb=C.Z.getScene(bb))||void 0===hb?void 0:hb.getElement(Qb))||null},Ua=function(bb){return bb&&bb.containerId&&(null===(hb=C.Z.getScene(bb))||void 0===hb?void 0:hb.getElement(bb.containerId))||null;var hb},La=function(bb){return(0,aa.Yv)(bb)?{width:Math.max(bb.width,300),height:bb.height}: {width:bb.width,height:bb.height}},ma=function(bb,hb){if(!(0,aa.Yv)(bb))return{x:bb.x+bb.width/2,y:bb.y+bb.height/2};var Qb=O._.getPointsGlobalCoordinates(bb);if(1==Qb.length%2)return bb=O._.getPointGlobalCoordinates(bb,bb.points[Math.floor(bb.points.length/2)]),{x:bb[0],y:bb[1]};var ub=bb.points.length/2-1;hb=O._.getEditorMidPoints(bb,hb)[ub];return hb||=O._.getSegmentMidPoint(bb,Qb[ub],Qb[ub+1],ub+1),{x:hb[0],y:hb[1]}},ja=function(bb){var hb=F.gK,Qb=F.gK;return"ellipse"===bb.type&&(hb+=bb.width/ 2*(1-Math.sqrt(2)/2),Qb+=bb.height/2*(1-Math.sqrt(2)/2)),"diamond"===bb.type&&(hb+=bb.width/4,Qb+=bb.height/4),{x:bb.x+hb,y:bb.y+Qb}},oa=function(bb){var hb=Ua(bb);return!hb||(0,aa.Yv)(hb)?bb.angle:hb.angle},ia=function(bb){var hb=Ua(bb);return hb&&bb?(0,aa.Yv)(hb)?8*F.gK:F.gK:0},sa=function(bb){return bb.some(function(hb){if((0,aa.Xh)(hb)){var Qb=Ua(hb);return!(0,M.iB)(hb)||!(0,aa.Yv)(Qb)}return!1})},Ea=function(bb){return bb.some(function(hb){if((0,aa.Xh)(hb)){var Qb=Ua(hb);return!(0,M.iB)(hb)|| !(0,aa.Yv)(Qb)}return(0,M.iB)(hb)})},Qa=function(bb,hb,Qb,ub){var Yb=(0,U.eD)(bb,hb);if(1===Yb.length)return(0,aa.mG)(Yb[0],!1)?Yb[0]:null;Yb=null;for(var dc=bb.length-1;0<=dc;--dc)if(!bb[dc].isDeleted){var uc=(0,M.qf)(bb[dc]),xc=(0,E.Z)(uc,4);uc=xc[0];var Gb=xc[1],lc=xc[2];xc=xc[3];if((0,aa.Yv)(bb[dc])&&(0,P.Qu)(bb[dc],hb,[Qb,ub])){Yb=bb[dc];break}if(uc=hb?(bb=Ya(bb))?bb.width:16*F.gK:hb):"ellipse"===bb.type?Math.round(hb/2*Math.sqrt(2))-2*F.gK:"diamond"===bb.type?Math.round(hb/2)-2*F.gK:hb-2*F.gK},Mb=function(bb){var hb=La(bb).height;return(0,aa.Yv)(bb)?0>=hb-16*F.gK?(bb=Ya(bb))?bb.height:16*F.gK:hb:"ellipse"===bb.type? Math.round(hb/2*Math.sqrt(2))-2*F.gK:"diamond"===bb.type?Math.round(hb/2)-2*F.gK:hb-2*F.gK},yb=function(){return 0bb)return cb=(0,O.NS)(Qb,ob.type),void(0,aa.DR)(ob,{height:cb});!(0,C.Yv)(ob)&&dc.height>ub.height&&QbJa&&1!==Pa.value&&(Fc=Ja*(Pa.value-1)/2),Qb>ob&&1!==Pa.value&&(tc=ob*(Pa.value-1)/2),"translate(".concat(Fc,"px, ").concat(tc,"px) scale(").concat(Pa.value,") rotate(").concat(vc,"deg)"));ub.call(bb,Yb,{font:dc,lineHeight:Gb,width:lc,height:Ab,left:uc,top:xc,transform:hb,textAlign:Xa,verticalAlign:tb,color:cb.strokeColor, opacity:cb.opacity/100,filter:"var(--theme-filter)",maxHeight:"".concat(ob,"px")});Fa.scrollTop=0;(0,f.h2)()&&(Fa.style.fontFamily=(0,f.$g)(cb));(0,aa.DR)(cb,{x:Mb,y:yb})}}},Fa=document.createElement("textarea");Fa.dir="auto";Fa.tabIndex=0;Fa.dataset.type="wysiwyg";Fa.wrap="off";Fa.classList.add("excalidraw-wysiwyg");la="pre";var Ba="normal";(0,C.Xh)(ha)&&(la="pre-wrap",Ba="break-word");Object.assign(Fa.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden", margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:Ba,whiteSpace:la,overflowWrap:"break-word",boxSizing:"content-box"});va();Z&&(Fa.onpaste=function(){var Xa=(0,q.Z)(t().mark(function tb(cb){var Mb,yb,ob,Ja,bb,hb;return t().wrap(function(Qb){for(;;)switch(Qb.prev=Qb.next){case 0:return Qb.next=2,(0,T.mQ)(cb,!0);case 2:if((Mb=Qb.sent).text){Qb.next=5;break}return Qb.abrupt("return");case 5:if(yb=(0,O.bG)(Mb.text)){Qb.next= 8;break}return Qb.abrupt("return");case 8:ob=(0,O.tl)(ha),Ja=(0,f.mO)({fontSize:wa.state.currentItemFontSize,fontFamily:wa.state.currentItemFontFamily}),ob&&(bb=(0,O.lD)("".concat(Fa.value).concat(yb),Ja,(0,O.jd)(ob)),hb=(0,O.mY)(bb,Ja),Fa.style.width="".concat(hb,"px"));case 11:case "end":return Qb.stop()}},tb)}));return function(cb){return Xa.apply(this,arguments)}}(),Fa.oninput=function(){var Xa,Pa=null===(Xa=F.Z.getScene(ha))||void 0===Xa?void 0:Xa.getElement(R);Xa=(0,f.mO)(Pa);if((0,C.Xh)(ha)){var cb= (0,O.tl)(ha);cb=(0,O.lD)((0,O.bG)(Fa.value),Xa,(0,O.jd)(cb));Pa=(0,O.X1)(cb,Xa,Pa.lineHeight);Xa=Pa.height;Fa.style.width="".concat(Pa.width,"px");Fa.style.height="".concat(Xa,"px")}Z((0,O.bG)(Fa.value))});Fa.onkeydown=function(Xa){!Xa.shiftKey&&P.Lo.keyTest(Xa)?(Xa.preventDefault(),wa.actionManager.executeAction(P.Lo),va()):!Xa.shiftKey&&P.CZ.keyTest(Xa)?(Xa.preventDefault(),wa.actionManager.executeAction(P.CZ),va()):U.Tu.keyTest(Xa)?wa.actionManager.executeAction(U.Tu):U.Zq.keyTest(Xa)?wa.actionManager.executeAction(U.Zq): Xa.key===r.tW.ESCAPE?(Xa.preventDefault(),ma=!0,ja()):Xa.key===r.tW.ENTER&&Xa[r.tW.CTRL_OR_CMD]?(Xa.preventDefault(),Xa.isComposing||229===Xa.keyCode)||(ma=!0,ja()):Xa.key!==r.tW.TAB&&(!Xa[r.tW.CTRL_OR_CMD]||Xa.code!==r.aU.BRACKET_LEFT&&Xa.code!==r.aU.BRACKET_RIGHT)||(Xa.preventDefault(),Xa.isComposing)||(Xa.shiftKey||Xa.code===r.aU.BRACKET_LEFT?Ya():Va(),Fa.dispatchEvent(new Event("input")))};var Ka=" ".repeat(4),Oa=new RegExp("^ {1,".concat(4,"}")),Va=function(){var Xa=Fa.selectionStart,Pa=Fa.selectionEnd, cb=Ua(),tb=Fa.value;cb.forEach(function(Mb){var yb=tb.slice(0,Mb);Mb=tb.slice(Mb);tb="".concat(yb).concat(Ka).concat(Mb)});Fa.value=tb;Fa.selectionStart=Xa+4;Fa.selectionEnd=Pa+4*cb.length},Ya=function(){var Xa=Fa.selectionStart,Pa=Fa.selectionEnd,cb=Ua(),tb=[],Mb=Fa.value;cb.forEach(function(yb){var ob=Mb.slice(yb,yb+4).match(Oa);if(ob){var Ja=Mb.slice(0,yb);ob=Mb.slice(yb+ob[0].length);Mb="".concat(Ja).concat(ob);tb.push(yb)}});Fa.value=Mb;tb.length&&(Xa>tb[tb.length-1]?Fa.selectionStart=Math.max(Xa- 4,tb[tb.length-1]):Fa.selectionStart=Xa,Fa.selectionEnd=Math.max(Fa.selectionStart,Pa-4*tb.length))},Ua=function(){var Xa=Fa.selectionStart,Pa=Fa.selectionEnd,cb=Fa.value,tb=cb.slice(0,Xa).match(/[^\n]*$/)[0].length;return Xa-=tb,cb.slice(Xa,Pa).split("\n").reduce(function(Mb,yb,ob,Ja){return Mb.concat(ob?Mb[ob-1]+Ja[ob-1].length+1:Xa)},[]).reverse()},La=function(Xa){Xa.preventDefault();Xa.stopPropagation()},ma=!1,ja=function(){var Xa;Ea||(Ea=!0,Fa.onblur=null,Fa.oninput=null,Fa.onkeydown=null,Qa&& Qa.disconnect(),window.removeEventListener("resize",va),window.removeEventListener("wheel",La,!0),window.removeEventListener("pointerdown",ia),window.removeEventListener("pointerup",oa),window.removeEventListener("blur",ja),sa(),Fa.remove());var Pa=null===(Xa=F.Z.getScene(ha))||void 0===Xa?void 0:Xa.getElement(ha.id);if(Pa){Xa=Fa.value;var cb=(0,O.tl)(Pa);if(cb){if(Xa=Pa.text,Fa.value.trim()){var tb=(0,O.xB)(cb);tb&&tb===ha.id||(0,aa.DR)(cb,{boundElements:(cb.boundElements||[]).concat({type:"text", id:ha.id})})}else(0,aa.DR)(cb,{boundElements:null===(tb=cb.boundElements)||void 0===tb?void 0:tb.filter(function(Mb){return!(0,C.iB)(Mb)})});(0,O.oN)(Pa,cb)}X({text:Xa,viaKeyboard:ma,originalText:Fa.value})}},oa=function cb(Pa){window.removeEventListener("pointerup",cb);var tb=null==Pa?void 0:Pa.target,Mb=tb instanceof HTMLInputElement&&tb.closest(".color-picker-input")&&(0,f.s)(tb);setTimeout(function(){Fa.onblur=ja;tb&&Mb&&(tb.onblur=function(){Fa.focus()});Mb||Fa.focus()})},ia=function(Pa){var cb= Pa.target instanceof HTMLInputElement&&Pa.target.closest(".color-picker-input")&&(0,f.s)(Pa.target);((Pa.target instanceof HTMLElement||Pa.target instanceof SVGElement)&&Pa.target.closest(".".concat(M.$C.SHAPE_ACTIONS_MENU))&&!(0,f.s)(Pa.target)||cb)&&(Fa.onblur=null,window.addEventListener("pointerup",oa),window.addEventListener("blur",ja))},sa=F.Z.getScene(ha).addCallback(function(){var Pa;va();null!==(Pa=document.activeElement)&&void 0!==Pa&&Pa.closest(".color-picker-input")||Fa.focus()}),Ea=!1; Fa.select();oa();var Qa=null;W&&"ResizeObserver"in window?(Qa=new window.ResizeObserver(function(){va()})).observe(W):window.addEventListener("resize",va);window.addEventListener("pointerdown",ia);window.addEventListener("wheel",La,{passive:!1,capture:!0});null==ra||ra.querySelector(".excalidraw-textEditorContainer").appendChild(Fa)}},267:function(g,h,c){c.d(h,{PC:function(){return U},kK:function(){return O},oY:function(){return P},ox:function(){return f}});var p=c(2577),m=c(8925),q=c(6552),E=c(1047), w=c(1974),t=c(3547),r={mouse:8,pen:16,touch:28},f={e:!0,s:!0,n:!0,w:!0},F={e:!0,s:!0,n:!0,w:!0},C={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},M={e:!0,s:!0,n:!0,w:!0},aa=function(V,T,K,D,L,Q,N){V=(0,q.U1)(V+K/2,T+D/2,L,Q,N);V=(0,p.Z)(V,2);return[V[0]-K/2,V[1]-D/2,K,D]},O=function(V,T,K,D){var L=(0,p.Z)(V,6),Q=L[0],N=L[1],la=L[2],R=L[3],Z=L[4];L=L[5];var X=4Oa&&(X.n||(Ka.n=aa(Q+va/2-ha/2,N-Ba-wa+S,ha,W,Z,L,T)),X.s||(Ka.s=aa(Q+va/2-ha/2,R+Ba-S,ha,W,Z,L,T))),Math.abs(Fa)>Oa&& (X.w||(Ka.w=aa(Q-Ba-ra+S,N+Fa/2-W/2,ha,W,Z,L,T)),X.e||(Ka.e=aa(la+Ba-S,N+Fa/2-W/2,ha,W,Z,L,T))),Ka},U=function(V,T){var K=2L[1]?D=C:0L[0]&&0L[0]&&0>L[1]&&(D=M)}}else(0,E.iB)(V)&&(D=F);L=(0,w.bt)(V)?t.Lu+8:t.Lu;return O((0,m.qf)(V,!0),V.angle,T,K,D,L)},P= function(V,T){if(T.editingLinearElement)return!1;if(1=la.length?{done:!0}:{done:!1,value:la[X++]}},e:function(ra){throw ra;},f:R}}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 S,ha=!0,W=!1;return{s:function(){Z=Z.call(la)},n:function(){var ra=Z.next();return ha=ra.done,ra},e:function(ra){W=!0;S=ra},f:function(){try{ha||null==Z.return||Z.return()}finally{if(W)throw S;}}}}function m(la,R){(null==R||R>la.length)&&(R=la.length);for(var Z=0,X=Array(R);ZZ.length?R.selectedGroupIds[la]||R.editingGroupId===la?E(E({},R),{},{selectedGroupIds:E(E({},R.selectedGroupIds),{},(0,r.Z)({},la,!1)),editingGroupId:null}):R:E(E({},R),{}, {selectedGroupIds:E(E({},R.selectedGroupIds),{},(0,r.Z)({},la,!0)),selectedElementIds:E(E({},R.selectedElementIds),Object.fromEntries(Z.map(function(X){return[X.id,!0]})))})},M=function(la,R){return null!=aa(la,R)},aa=function(la,R){return R.groupIds.filter(function(Z){return Z!==la.editingGroupId}).find(function(Z){return la.selectedGroupIds[Z]})},O=function(la){return Object.entries(la.selectedGroupIds).filter(function(R){R=(0,t.Z)(R,2);R[0];return R[1]}).map(function(R){R=(0,t.Z)(R,2);var Z=R[0]; R[1];return Z})},U=function(la,R){var Z=E(E({},la),{},{selectedGroupIds:{}}),X=(0,f.eD)(R,la);if(!X.length)return E(E({},Z),{},{editingGroupId:null});var S;X=p(X);try{for(X.s();!(S=X.n()).done;){var ha=S.value.groupIds;if(la.editingGroupId){var W=ha.indexOf(la.editingGroupId);-1K.label?1:-1}).filter(function(T){return 85<=E[T.code]});"production"===g.Vi.DEVELOPMENT&&f.unshift({code:"__test__", label:"test language"},{code:"".concat("__test__",".rtl"),label:"‪test language (rtl)‬",rtl:!0});var F=r,C={},M=function(){var T=(0,p.Z)(m().mark(function L(D){return m().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(F=D,document.documentElement.dir=F.rtl?"rtl":"ltr",document.documentElement.lang=F.code,!D.code.startsWith("__test__")){Q.next=7;break}C={};Q.next=17;break;case 7:return Q.prev=7,Q.next=10,c(940)("./".concat(F.code,".json"));case 10:C=Q.sent;Q.next=17;break;case 13:Q.prev=13, Q.t0=Q.catch(7),console.error("Failed to load language ".concat(D.code,":"),Q.t0.message),C=q;case 17:w.e_.set(P,D.code);case 18:case "end":return Q.stop()}},L,null,[[7,13]])}));return function(D){return T.apply(this,arguments)}}(),aa=function(){return F},O=function(T,K){for(var D=0;DZ)return!1;var X=[Number.MAX_SAFE_INTEGER,R];la=[la,R];for(var S=R=0;S=Math.min(N[0],R[0])&&la[1]<=Math.max(N[1],R[1])&&la[1]>=Math.min(N[1],R[1])},aa=function(N,la,R){N=(la[1]-N[1])*(R[0]-la[0])-(la[0]-N[0])*(R[1]-la[1]);return 0===N?0:0R&&S--,N[S]===R?S/la:1-(S+(R-N[S])/(N[S+1]-N[S]))/la},L=function(N,la){return N[0]===la[0]&&N[1]===la[1]},Q=function(N){return 0==Math.round(N/Math.PI*1E4)%5E3}},3024:function(g,h,c){function p(la,R){var Z=Object.keys(la);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(la); R&&(X=X.filter(function(S){return Object.getOwnPropertyDescriptor(la,S).enumerable}));Z.push.apply(Z,X)}return Z}function m(la){for(var R=1;Rub){return Ja*Qb(.5-bb*(.5-hb))}function m(Ja,bb){return[Ja[0]+bb[0],Ja[1]+bb[1]]} function q(Ja,bb){return[Ja[0]-bb[0],Ja[1]-bb[1]]}function E(Ja,bb){return[Ja[0]*bb,Ja[1]*bb]}function w(Ja){return[Ja[1],-Ja[0]]}function t(Ja,bb){return Ja[0]===bb[0]&&Ja[1]===bb[1]}function r(Ja,bb){Ja=q(Ja,bb);return Ja[0]*Ja[0]+Ja[1]*Ja[1]}function f(Ja){var bb=Math.hypot(Ja[0],Ja[1]);return[Ja[0]/bb,Ja[1]/bb]}function F(Ja,bb){return Math.hypot(Ja[1]-bb[1],Ja[0]-bb[0])}function C(Ja,bb,hb){let Qb=Math.sin(hb);hb=Math.cos(hb);let ub=Ja[0]-bb[0];Ja=Ja[1]-bb[1];return[ub*hb-Ja*Qb+bb[0],ub*Qb+Ja* hb+bb[1]]}function M(Ja,bb,hb){return m(Ja,E(q(bb,Ja),hb))}function aa(Ja,bb,hb){return m(Ja,E(bb,hb))}function O(Ja,bb={}){return function(hb,Qb={}){let {size:ub=16,smoothing:Yb=.5,thinning:dc=.5,simulatePressure:uc=!0,easing:xc=Kc=>Kc,start:Gb={},end:lc={},last:Ab=!1}=Qb,{cap:vc=!0,easing:Fc=Kc=>Kc*(2-Kc)}=Gb,{cap:tc=!0,easing:Oc=Kc=>--Kc*Kc*Kc+1}=lc;if(0===hb.length||0>=ub)return[];var dd,Vc=hb[hb.length-1].runningLength;let jd=!1===Gb.taper?0:!0===Gb.taper?Math.max(ub,Vc):Gb.taper,Cb=!1===lc.taper? 0:!0===lc.taper?Math.max(ub,Vc):lc.taper;var $b=Math.pow(ub*Yb,2);Qb=[];let Wb=[];var jb=hb.slice(0,10).reduce((Kc,Ce)=>{var mh=Ce.pressure;uc&&(Ce=ha(1,Ce.distance/ub),mh=ha(1,1-Ce),mh=ha(1,Kc+.275*Ce*(mh-Kc)));return(Kc+mh)/2},hb[0].pressure),sb=p(ub,dc,hb[hb.length-1].pressure,xc);let ac=hb[0].vector;var Ac=hb[0].point;let fd=Ac;var kd=Ac;let wd=fd;var Wd=!1;for(var Qd=0;QdVc-fg)continue;dc?(uc&&(sb=ha(1,mh/ub),Ge=ha(1,1-sb),Ge=ha(1,jb+.275*sb*(Ge-jb))),sb=p(ub,dc,Ge,xc)):sb=ub/2;void 0===dd&&(dd=sb);var de=fgYf;if(0>Ce[0]*ac[0]+Ce[1]*ac[1]&&!Wd||de){Ac=E(w(ac),sb);for(let re=1/13,xf=0;1>=xf;xf+=re)kd=C(q(Kc,Ac),Kc,ra*xf),Qb.push(kd),wd=C(m(Kc,Ac),Kc,ra*-xf),Wb.push(wd);Ac=kd;fd= wd;de&&(Wd=!0)}else(Wd=!1,Qd===hb.length-1)?(Ge=E(w(Ce),sb),Qb.push(q(Kc,Ge)),Wb.push(m(Kc,Ge))):(jb=E(w(M($c,Ce,Yf)),sb),kd=q(Kc,jb),(1>=Qd||r(Ac,kd)>$b)&&(Qb.push(kd),Ac=kd),wd=m(Kc,jb),(1>=Qd||r(fd,wd)>$b)&&(Wb.push(wd),fd=wd),jb=Ge,ac=Ce)}Vc=hb[0].point.slice(0,2);$b=1=Ce;Ce+=Kc)Qb.push(C(hb,Vc,2*ra*Ce));return Qb}}else{if(!(jd|| Cb&&1===hb.length))if(vc)for(let Kc=1/13,Ce=Kc;1>=Ce;Ce+=Kc)dd=C(Wb[0],Vc,ra*Ce),kd.push(dd);else Qd=q(Qb[0],Wb[0]),dd=E(Qd,.5),Qd=E(Qd,.51),kd.push(q(Vc,dd),q(Vc,Qd),m(Vc,Qd),m(Vc,dd));dd=w(function(Kc){return[-Kc[0],-Kc[1]]}(hb[hb.length-1].vector));if(Cb||jd&&1===hb.length)Wd.push($b);else if(tc){hb=aa($b,dd,sb);for(let Kc=1/29,Ce=Kc;1>Ce;Ce+=Kc)Wd.push(C(hb,$b,3*ra*Ce))}else Wd.push(m($b,E(dd,sb)),m($b,E(dd,.99*sb)),q($b,E(dd,.99*sb)),q($b,E(dd,sb)))}return Qb.concat(Wd,Wb.reverse(),kd)}(function(hb, Qb={}){var ub;let {streamline:Yb=.5,size:dc=16,last:uc=!1}=Qb;if(0===hb.length)return[];Qb=.15+.85*(1-Yb);hb=Array.isArray(hb[0])?hb:hb.map(({x:Fc,y:tc,pressure:Oc=.5})=>[Fc,tc,Oc]);if(2===hb.length){var xc=hb[1];hb=hb.slice(0,-1);for(var Gb=1;5>Gb;Gb++)hb.push(M(hb[0],xc,Gb/4))}1===hb.length&&(hb=[...hb,[...m(hb[0],[1,1]),...hb[0].slice(2)]]);xc=[{point:[hb[0][0],hb[0][1]],pressure:0<=hb[0][2]?hb[0][2]:.25,vector:[1,1],distance:0,runningLength:0}];Gb=!1;let lc=0,Ab=xc[0],vc=hb.length-1;for(let Fc= 1;Fcxc?(0,R.TE)(Ja.x,xc)*window.devicePixelRatio*dc:0,lc=Ja.y>lc?(0,R.TE)(Ja.y,lc)*window.devicePixelRatio*dc:0,ub.translate(xc,lc);ub.save();ub.translate(Yb*dc,Yb*dc);ub.scale(window.devicePixelRatio*dc,window.devicePixelRatio*dc); Yb=X.Z.canvas(hb);bb=(Oa(Ja,bb)&&(ub.filter="invert(100%) hue-rotate(180deg) saturate(1.25)"),ma(Ja,Yb,ub,bb),ub.restore(),{element:Ja,canvas:hb,theme:bb.theme,scale:dc,zoomValue:Qb.value,canvasOffsetX:xc,canvasOffsetY:lc,boundTextElementVersion:(null===(uc=(0,wa.WJ)(Ja))||void 0===uc?void 0:uc.version)||null});return ja.set(Ja,bb),bb}return ub},Pa=function(Ja,bb,hb,Qb){bb=Ja.element;var ub=Va(bb),Yb=Ja.scale,dc=(0,la.qf)(bb),uc=(0,Q.Z)(dc,4);dc=uc[0];var xc=uc[1],Gb=uc[2];uc=uc[3];(0,N.F9)(bb)&& (dc=Math.floor(dc),Gb=Math.ceil(Gb),xc=Math.floor(xc),uc=Math.ceil(uc));var lc=((dc+Gb)/2+Qb.scrollX)*window.devicePixelRatio,Ab=((xc+uc)/2+Qb.scrollY)*window.devicePixelRatio;hb.save();hb.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);var vc=(0,wa.WJ)(bb);if((0,N.Yv)(bb)&&vc){Qb=document.createElement("canvas");var Fc=Qb.getContext("2d"),tc=Math.max((0,R.TE)(dc,Gb),(0,R.TE)(xc,uc));Qb.width=tc*window.devicePixelRatio*Yb+ub*Ja.scale*10;Qb.height=tc*window.devicePixelRatio*Yb+ub*Ja.scale* 10;tc=(Qb.width-Ja.canvas.width)/2;var Oc=(Qb.height-Ja.canvas.height)/2;Fc.translate(Qb.width/2,Qb.height/2);Fc.rotate(bb.angle);Fc.drawImage(Ja.canvas,-Ja.canvas.width/2,-Ja.canvas.height/2,Ja.canvas.width,Ja.canvas.height);Ja=(0,la.qf)(vc);var dd=(0,Q.Z)(Ja,6);Ja=dd[4];dd=dd[5];Fc.rotate(-bb.angle);Fc.translate(-(Qb.width/2-(Ja-dc)*window.devicePixelRatio*Yb-tc-ub*Yb),-(Qb.height/2-(dd-xc)*window.devicePixelRatio*Yb-Oc-ub*Yb));Fc.clearRect(-(vc.width/2+S.gK)*window.devicePixelRatio*Yb,-(vc.height/ 2+S.gK)*window.devicePixelRatio*Yb,(vc.width+2*S.gK)*window.devicePixelRatio*Yb,(vc.height+2*S.gK)*window.devicePixelRatio*Yb);hb.translate(lc,Ab);hb.drawImage(Qb,-(Gb-dc)/2*window.devicePixelRatio-tc/Yb-ub,-(uc-xc)/2*window.devicePixelRatio-Oc/Yb-ub,Qb.width/Yb,Qb.height/Yb)}else if(hb.translate(lc,Ab),hb.rotate(bb.angle),"scale"in Ja.element&&!Ka(bb,Qb)&&hb.scale(Ja.element.scale[0],Ja.element.scale[1]),hb.translate(-lc,-Ab),hb.drawImage(Ja.canvas,(dc+Qb.scrollX)*window.devicePixelRatio-ub*Ja.scale/ Ja.scale,(xc+Qb.scrollY)*window.devicePixelRatio-ub*Ja.scale/Ja.scale,Ja.canvas.width/Ja.scale,Ja.canvas.height/Ja.scale),"true"==={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_PORTAL_URL:"https://portal.excalidraw.com",REACT_APP_WS_SERVER_URL:"", REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13",REACT_APP_MATOMO_URL:"https://excalidraw.matomo.cloud/",REACT_APP_CDN_MATOMO_TRACKER_URL:"//cdn.matomo.cloud/excalidraw.matomo.cloud/matomo.js", REACT_APP_MATOMO_SITE_ID:"1",REACT_APP_PLUS_APP:"https://app.excalidraw.com",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.15.3",IS_EXCALIDRAW_NPM_PACKAGE:!0}.REACT_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX&&(0,N.Xo)(bb))ub=(0,wa.cw)(bb),hb.strokeStyle="#c92a2a",hb.lineWidth=3,hb.strokeRect((ub.x+Qb.scrollX)*window.devicePixelRatio,(ub.y+Qb.scrollY)*window.devicePixelRatio,(0,wa.jd)(bb)*window.devicePixelRatio,(0,wa.N2)(bb)*window.devicePixelRatio);hb.restore()},cb=function(Ja,bb,hb,Qb,ub){var Yb= bb.generator;switch(Ja.type){case "selection":hb.save();hb.translate(Ja.x+Qb.scrollX,Ja.y+Qb.scrollY);hb.fillStyle="rgba(0, 0, 200, 0.04)";bb=.5/Qb.zoom.value;hb.fillRect(bb,bb,Ja.width,Ja.height);hb.lineWidth=1/Qb.zoom.value;hb.strokeStyle="rgb(105, 101, 219)";hb.strokeRect(bb,bb,Ja.width,Ja.height);hb.restore();break;case "freedraw":if(Qa(Ja,Yb),Qb.isExporting){ub=(0,la.qf)(Ja);Yb=(0,Q.Z)(ub,4);var dc=Yb[0];ub=Yb[1];var uc=Yb[2],xc=Yb[3];Yb=(dc+uc)/2+Qb.scrollX;var Gb=(ub+xc)/2+Qb.scrollY;dc=(uc- dc)/2-(Ja.x-dc);ub=(xc-ub)/2-(Ja.y-ub);hb.save();hb.translate(Yb,Gb);hb.rotate(Ja.angle);hb.translate(-dc,-ub);ma(Ja,bb,hb,Qb);hb.restore()}else Ja=Xa(Ja,Qb),Pa(Ja,0,hb,Qb);break;case "rectangle":case "diamond":case "ellipse":case "line":case "arrow":case "image":case "text":if(Qa(Ja,Yb),Qb.isExporting){Yb=(0,la.qf)(Ja);uc=(0,Q.Z)(Yb,4);Yb=uc[0];Gb=uc[1];dc=uc[2];uc=uc[3];var lc=(Yb+dc)/2+Qb.scrollX,Ab=(Gb+uc)/2+Qb.scrollY;xc=(dc-Yb)/2-(Ja.x-Yb);var vc=(uc-Gb)/2-(Ja.y-Gb);if((0,N.iB)(Ja)){var Fc= (0,wa.tl)(Ja);(0,N.Yv)(Fc)&&(vc=va._.getBoundTextElementPosition(Fc,Ja),xc=(dc-Yb)/2-(vc.x-Yb),vc=(uc-Gb)/2-(vc.y-Gb))}hb.save();hb.translate(lc,Ab);Oa(Ja,Qb)&&(hb.filter="none");lc=(0,wa.WJ)(Ja);(0,N.Yv)(Ja)&&lc?(bb=document.createElement("canvas"),Ab=bb.getContext("2d"),xc=Math.max((0,R.TE)(Yb,dc),(0,R.TE)(Gb,uc)),vc=Va(Ja),bb.width=xc*ub.exportScale+10*vc*ub.exportScale,bb.height=xc*ub.exportScale+10*vc*ub.exportScale,Ab.translate(bb.width/2,bb.height/2),Ab.scale(ub.exportScale,ub.exportScale), xc=Ja.width/2-(Ja.x-Yb),vc=Ja.height/2-(Ja.y-Gb),Ab.rotate(Ja.angle),Fc=X.Z.canvas(bb),Ab.translate(-xc,-vc),ma(Ja,Fc,Ab,Qb),Ab.translate(xc,vc),Ab.rotate(-Ja.angle),Qb=(0,la.qf)(lc),Qb=(0,Q.Z)(Qb,6),Ab.translate(-((Yb+dc)/2-Qb[4]),-((Gb+uc)/2-Qb[5])),Ab.clearRect(-lc.width/2,-lc.height/2,lc.width,lc.height),hb.scale(1/ub.exportScale,1/ub.exportScale),hb.drawImage(bb,-bb.width/2,-bb.height/2,bb.width,bb.height)):(hb.rotate(Ja.angle),"image"===Ja.type&&hb.scale(Ja.scale[0],Ja.scale[1]),hb.translate(-xc, -vc),ma(Ja,bb,hb,Qb));hb.restore()}else bb=Xa(Ja,Qb),ub=hb.imageSmoothingEnabled,null!=Qb&&Qb.shouldCacheIgnoreZoom||Ja.angle&&!(0,Z.EK)(Ja.angle)||(hb.imageSmoothingEnabled=!1),Pa(bb,0,hb,Qb),hb.imageSmoothingEnabled=ub;break;default:throw Error("Unimplemented type ".concat(Ja.type));}},tb=function(Ja,bb,hb){if(void 0===hb)return Ja.draw(bb);bb={sets:bb.sets,shape:bb.shape,options:P(P({},bb.options),{},{fixedDecimalPlaceDigits:hb})};return Ja.draw(bb)},Mb=function(Ja,bb,hb,Qb,ub,Yb,dc){var uc=(0,la.qf)(Ja); uc=(0,Q.Z)(uc,4);var xc=uc[0],Gb=uc[1],lc=(uc[2]-xc)/2-(Ja.x-xc),Ab=(uc[3]-Gb)/2-(Ja.y-Gb);if((0,N.iB)(Ja)&&(uc=(0,wa.tl)(Ja),(0,N.Yv)(uc))){xc=(0,la.qf)(uc);var vc=(0,Q.Z)(xc,4);xc=vc[0];Gb=vc[1];var Fc=vc[2];vc=vc[3];uc=va._.getBoundTextElementPosition(uc,Ja);lc=(Fc-xc)/2-(uc.x-xc);Ab=(vc-Gb)/2-(uc.y-Gb);ub=ub+uc.x-Ja.x;Yb=Yb+uc.y-Ja.y}var tc=180*Ja.angle/Math.PI;xc=bb.generator;uc=hb;Ja.link&&(Gb=hb.ownerDocument.createElementNS(S.hR,"a"),Gb.setAttribute("href",(0,Fa.$)(Ja.link)),uc.appendChild(Gb), uc=Gb);switch(Ja.type){case "selection":throw Error("Selection rendering is not supported for SVG");case "rectangle":case "diamond":case "ellipse":Qa(Ja,xc);hb=tb(bb,ia(Ja),S.zK);dc=Ja.opacity/100;1!==dc&&(hb.setAttribute("stroke-opacity","".concat(dc)),hb.setAttribute("fill-opacity","".concat(dc)));hb.setAttribute("stroke-linecap","round");hb.setAttribute("transform","translate(".concat(ub||0," ").concat(Yb||0,") rotate(").concat(tc," ").concat(lc," ").concat(Ab,")"));uc.appendChild(hb);break;case "line":case "arrow":dc= (0,wa.WJ)(Ja);Qb=hb.ownerDocument.createElementNS(S.hR,"mask");dc&&(Qb.setAttribute("id","mask-".concat(Ja.id)),Gb=hb.ownerDocument.createElementNS(S.hR,"rect"),ub=ub||0,Yb=Yb||0,Gb.setAttribute("x","0"),Gb.setAttribute("y","0"),Gb.setAttribute("fill","#fff"),Gb.setAttribute("width","".concat(Ja.width+100+ub)),Gb.setAttribute("height","".concat(Ja.height+100+Yb)),Qb.appendChild(Gb),Gb=hb.ownerDocument.createElementNS(S.hR,"rect"),Fc=va._.getBoundTextElementPosition(Ja,dc),vc=Yb+Fc.y-Ja.y,Gb.setAttribute("x", (ub+Fc.x-Ja.x).toString()),Gb.setAttribute("y",vc.toString()),Gb.setAttribute("fill","#000"),Gb.setAttribute("width","".concat(dc.width)),Gb.setAttribute("height","".concat(dc.height)),Gb.setAttribute("opacity","1"),Qb.appendChild(Gb));Qa(Ja,xc);var Oc=hb.ownerDocument.createElementNS(S.hR,"g");dc&&Oc.setAttribute("mask","url(#mask-".concat(Ja.id,")"));var dd=Ja.opacity/100;Oc.setAttribute("stroke-linecap","round");ia(Ja).forEach(function(Cb){Cb=tb(bb,Cb,S.zK);1!==dd&&(Cb.setAttribute("stroke-opacity", "".concat(dd)),Cb.setAttribute("fill-opacity","".concat(dd)));Cb.setAttribute("transform","translate(".concat(ub||0," ").concat(Yb||0,") rotate(").concat(tc," ").concat(lc," ").concat(Ab,")"));"line"===Ja.type&&(0,Z.g6)(Ja.points)&&"transparent"!==Ja.backgroundColor&&Cb.setAttribute("fill-rule","evenodd");Oc.appendChild(Cb)});uc.appendChild(Oc);uc.append(Qb);break;case "freedraw":Qa(Ja,xc);V(Ja);dc=Ja.opacity/100;Qb=(Qb=ia(Ja))?tb(bb,Qb,S.zK):hb.ownerDocument.createElementNS(S.hR,"g");1!==dc&&(Qb.setAttribute("stroke-opacity", "".concat(dc)),Qb.setAttribute("fill-opacity","".concat(dc)));Qb.setAttribute("transform","translate(".concat(ub||0," ").concat(Yb||0,") rotate(").concat(tc," ").concat(lc," ").concat(Ab,")"));Qb.setAttribute("stroke","none");hb=hb.ownerDocument.createElementNS(S.hR,"path");hb.setAttribute("fill",Ja.strokeColor);hb.setAttribute("d",T(Ja));Qb.appendChild(hb);uc.appendChild(Qb);break;case "image":Gb=Math.round(Ja.width);xc=Math.round(Ja.height);if(Fc=(0,N.wi)(Ja)&&Qb[Ja.fileId]){vc="image-".concat(Fc.id); Qb=hb.querySelector("#".concat(vc));if(!Qb){(Qb=hb.ownerDocument.createElementNS(S.hR,"symbol")).id=vc;var Vc=hb.ownerDocument.createElementNS(S.hR,"image");Vc.setAttribute("width","100%");Vc.setAttribute("height","100%");Vc.setAttribute("href",Fc.dataURL);Qb.appendChild(Vc);uc.prepend(Qb)}Qb=hb.ownerDocument.createElementNS(S.hR,"use");if(Qb.setAttribute("href","#".concat(vc)),dc&&Fc.mimeType!==S.LO.svg&&Qb.setAttribute("filter","invert(100%) hue-rotate(180deg) saturate(1.25)"),Qb.setAttribute("width", "".concat(Gb)),Qb.setAttribute("height","".concat(xc)),1!==Ja.scale[0]||1!==Ja.scale[1])dc=1!==Ja.scale[0]?-Gb:0,xc=1!==Ja.scale[1]?-xc:0,Qb.setAttribute("transform","scale(".concat(Ja.scale[0],", ").concat(Ja.scale[1],") translate(").concat(dc," ").concat(xc,")"));hb=hb.ownerDocument.createElementNS(S.hR,"g");hb.appendChild(Qb);hb.setAttribute("transform","translate(".concat(ub||0," ").concat(Yb||0,") rotate(").concat(tc," ").concat(lc," ").concat(Ab,")"));uc.appendChild(hb)}break;default:if(!(0,N.iB)(Ja))throw Error("Unimplemented type ".concat(Ja.type)); Qb=Ja.opacity/100;dc=hb.ownerDocument.createElementNS(S.hR,"g");1!==Qb&&(dc.setAttribute("stroke-opacity","".concat(Qb)),dc.setAttribute("fill-opacity","".concat(Qb)));dc.setAttribute("transform","translate(".concat(ub||0," ").concat(Yb||0,") rotate(").concat(tc," ").concat(lc," ").concat(Ab,")"));Qb=Ja.text.replace(/\r\n?/g,"\n").split("\n");xc=(0,wa.Rg)(Ja.fontSize,Ja.lineHeight);Gb="center"===Ja.textAlign?Ja.width/2:"right"===Ja.textAlign?Ja.width:0;Fc=(0,R.dZ)(Ja.text)?"rtl":"ltr";vc="center"=== Ja.textAlign?"middle":"right"===Ja.textAlign||"rtl"===Fc?"end":"start";for(Vc=0;Vc=Va.length?{done:!0}:{done:!1,value:Va[La++]}},e:function(ia){throw ia;},f:Ya}}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 ma,ja=!0,oa=!1;return{s:function(){Ua=Ua.call(Va)},n:function(){var ia=Ua.next(); return ja=ia.done,ia},e:function(ia){oa=!0;ma=ia},f:function(){try{ja||null==Ua.return||Ua.return()}finally{if(oa)throw ma;}}}}function m(Va,Ya){(null==Ya||Ya>Va.length)&&(Ya=Va.length);for(var Ua=0,La=Array(Ya);Ua=xc&&Gb.y>=Ab});var Mb=void 0;if(ma.forEach(function(xc){try{var Gb; (0,C.lw)(xc,ja,Pa,ia,La);(null===(Gb=La.editingLinearElement)||void 0===Gb?void 0:Gb.elementId)===xc.id&&xc&&(Mb=xc);if(!Qa&&xc.link&&!La.selectedElementIds[xc.id]){var lc=(0,r.qf)(xc),Ab=(0,E.Z)(lc,4),vc=(0,D.sw)([Ab[0],Ab[1],Ab[2],Ab[3]],xc.angle,La),Fc=(0,E.Z)(vc,4),tc=Fc[0],Oc=Fc[1],dd=Fc[2],Vc=Fc[3];Gb=tc+dd/2;lc=Oc+Vc/2;if(Pa.save(),Pa.translate(La.scrollX+Gb,La.scrollY+lc),Pa.rotate(xc.angle),!Q||Q.zoom!==La.zoom.value){(Q=document.createElement("canvas")).zoom=La.zoom.value;Q.width=dd*window.devicePixelRatio* La.zoom.value;Q.height=Vc*window.devicePixelRatio*La.zoom.value;var jd=Q.getContext("2d");jd.scale(window.devicePixelRatio*La.zoom.value,window.devicePixelRatio*La.zoom.value);jd.fillStyle="#fff";jd.fillRect(0,0,dd,Vc);jd.drawImage(D.rj,0,0,dd,Vc);jd.restore()}Pa.drawImage(Q,tc-Gb,Oc-lc,dd,Vc);Pa.restore()}}catch(Cb){console.error(Cb)}}),Mb&&S(Pa,La,ia,Mb),La.selectionElement)try{(0,C.lw)(La.selectionElement,ja,Pa,ia,La)}catch(xc){console.error(xc)}(0,P.N1)(La)&&La.suggestedBindings.filter(function(xc){return null!= xc}).forEach(function(xc){var Gb=Array.isArray(xc)?Ka:Ba;Pa.save();Pa.translate(ia.scrollX,ia.scrollY);Gb(Pa,xc);Pa.restore()});var yb;oa=(0,F.eD)(Ua,La);if(1===oa.length&&(null===(Ya=La.editingLinearElement)||void 0===Ya?void 0:Ya.elementId)===oa[0].id&&S(Pa,La,ia,oa[0]),La.selectedLinearElement&&0<=La.selectedLinearElement.hoverPointIndex&&function(xc,Gb,lc){var Ab,vc,Fc=Gb.selectedLinearElement,tc=Fc.elementId;Fc=Fc.hoverPointIndex;if(null===(Ab=Gb.editingLinearElement)||void 0===Ab||null===(vc= Ab.selectedPointsIndices)||void 0===vc||!vc.includes(Fc))if(Gb=aa._.getElement(tc))Gb=aa._.getPointAtIndexGlobalCoordinates(Gb,Fc),xc.save(),xc.translate(lc.scrollX,lc.scrollY),ha(Gb,xc,lc),xc.restore()}(Pa,La,ia),sa&&!La.multiElement&&!La.editingLinearElement){var ob;Ya=(0,V.oY)(oa,La);var Ja=oa.map(function(xc){return xc.id});if(1===oa.length&&(0,L.bt)(oa[0])&&(null===(ob=La.selectedLinearElement)||void 0===ob?void 0:ob.elementId)===oa[0].id&&!oa[0].locked&&S(Pa,La,ia,oa[0]),Ya){var bb,hb=Ua.reduce(function(xc, Gb){var lc=[];if(Ja.includes(Gb.id)&&!(0,O.zq)(La,Gb)&&lc.push(Xa),ia.remoteSelectedElementIds[Gb.id]&&lc.push.apply(lc,(0,w.Z)(ia.remoteSelectedElementIds[Gb.id].map(function(vc){return(0,M.X)(vc,La).background}))),lc.length){var Ab=(0,r.qf)(Gb,!0);Ab=(0,E.Z)(Ab,6);xc.push({angle:Gb.angle,elementX1:Ab[0],elementY1:Ab[1],elementX2:Ab[2],elementY2:Ab[3],selectionColors:lc,dashed:!!ia.remoteSelectedElementIds[Gb.id],cx:Ab[4],cy:Ab[5]})}return xc},[]);ob=function(xc){xc=(0,O.Fb)(Ua,xc);xc=(0,r.KP)(xc); var Gb=(0,E.Z)(xc,4);xc=Gb[0];var lc=Gb[1],Ab=Gb[2];Gb=Gb[3];hb.push({angle:0,elementX1:xc,elementX2:Ab,elementY1:lc,elementY2:Gb,selectionColors:[t.black],dashed:!0,cx:xc+(Ab-xc)/2,cy:lc+(Gb-lc)/2})};sa=p((0,O.iJ)(La));try{for(sa.s();!(bb=sa.n()).done;)ob(bb.value)}catch(xc){sa.e(xc)}finally{sa.f()}La.editingGroupId&&ob(La.editingGroupId);hb.forEach(function(xc){return Fa(Pa,ia,xc)})}if(Pa.save(),Pa.translate(ia.scrollX,ia.scrollY),1===oa.length)Pa.fillStyle=t.white,bb=(0,r.PC)(oa[0],ia.zoom,"mouse"), !La.viewModeEnabled&&Ya&&va(Pa,ia,bb,oa[0].angle);else if(1Ya||Ya>cb-9||0>sa||sa>tb-14;Ya=Math.max(Ya,0);Ya=Math.min(Ya,cb-9);sa=Math.max(sa,0);sa=Math.min(sa,tb-14);bb=(0,M.X)(Yb,La);oa=bb.background;bb=bb.stroke;Pa.save();Pa.strokeStyle=bb;Pa.fillStyle=oa;ob=ia.remotePointerUserStates[Yb];(Ea||ob===q.AWAY)&&(Pa.globalAlpha=.48);ia.remotePointerButton&&"down"===ia.remotePointerButton[Yb]&& (Pa.beginPath(),Pa.arc(Ya,sa,15,0,2*Math.PI,!1),Pa.lineWidth=3,Pa.strokeStyle="#ffffff88",Pa.stroke(),Pa.closePath(),Pa.beginPath(),Pa.arc(Ya,sa,15,0,2*Math.PI,!1),Pa.lineWidth=1,Pa.strokeStyle=bb,Pa.stroke(),Pa.closePath());Pa.beginPath();Pa.moveTo(Ya,sa);Pa.lineTo(Ya+1,sa+14);Pa.lineTo(Ya+4,sa+9);Pa.lineTo(Ya+9,sa+10);Pa.lineTo(Ya,sa);Pa.fill();Pa.stroke();Qb=ia.remotePointerUsernames[Yb];ub="";ob===q.AWAY?ub=N?"⚫️":" (".concat(q.AWAY,")"):ob===q.IDLE&&(ub=N?"\ud83d\udca4":" (".concat(q.IDLE,")")); ob="".concat(Qb||"").concat(ub?" ".concat(ub):"");if(!Ea&&ob){Ya+=9;sa+=14;Ea=Pa.measureText(ob);Qb=Ya-1;ub=sa-1;var dc=Ea.width+8+2,uc=Ea.actualBoundingBoxDescent+Ea.actualBoundingBoxAscent+8+2;Pa.roundRect?(Pa.beginPath(),Pa.roundRect(Qb,ub,dc,uc,4/ia.zoom.value),Pa.fillStyle=oa,Pa.fill(),Pa.fillStyle=bb,Pa.stroke()):(Pa.fillStyle=bb,Pa.fillRect(Qb,ub,dc,uc),Pa.fillStyle=oa,Pa.fillRect(Ya,sa,dc-2,uc-2));Pa.fillStyle=t.white;Pa.fillText(ob,Ya+4,sa+4+Ea.actualBoundingBoxAscent)}Pa.restore();Pa.closePath()}return Va&& (yb=(0,f.tJ)(Ua,cb,tb,ia),Pa.save(),Pa.fillStyle=f.w1,Pa.strokeStyle="rgba(255,255,255,0.8)",[yb.horizontal,yb.vertical].forEach(function(xc){if(xc){var Gb=xc.x,lc=xc.y,Ab=xc.width;xc=xc.height;var vc=f.nn/2;Pa.beginPath();Pa.moveTo(Gb+vc,lc);Pa.lineTo(Gb+Ab-vc,lc);Pa.quadraticCurveTo(Gb+Ab,lc,Gb+Ab,lc+vc);Pa.lineTo(Gb+Ab,lc+xc-vc);Pa.quadraticCurveTo(Gb+Ab,lc+xc,Gb+Ab-vc,lc+xc);Pa.lineTo(Gb+vc,lc+xc);Pa.quadraticCurveTo(Gb,lc+xc,Gb,lc+xc-vc);Pa.lineTo(Gb,lc+vc);Pa.quadraticCurveTo(Gb,lc,Gb+vc,lc); Pa.closePath();Pa.fill();Pa.stroke()}}),Pa.restore()),Pa.restore(),{atLeastOneVisibleElement:0r)throw Error("insertElementAtIndex can only be called with index \x3e\x3d 0");t=[].concat((0,p.Z)(this.elements.slice(0,r)),[t],(0,p.Z)(this.elements.slice(r)));this.replaceAllElements(t)}},{key:"getElementIndex",value:function(t){return this.elements.findIndex(function(r){return r.id===t})}}],[{key:"mapElementToScene",value:function(t,r){"string"==typeof t?this.sceneMapById.set(t, r):(this.sceneMapByElement.set(t,r),this.sceneMapById.set(t.id,r))}},{key:"getScene",value:function(t){return"string"==typeof t?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}}]),w}();g.sceneMapByElement=new WeakMap;g.sceneMapById=new Map;h.Z=g},8120:function(g,h,c){c.d(h,{$b:function(){return p},CJ:function(){return F},M9:function(){return E},PD:function(){return m},QG:function(){return f},Un:function(){return r},Zd:function(){return q},bZ:function(){return t},sh:function(){return w}}); var p=function(C){return"rectangle"===C||"ellipse"===C||"diamond"===C||"line"===C||"freedraw"===C},m=function(C){return"image"!==C},q=function(C){return"rectangle"===C||"ellipse"===C||"diamond"===C||"freedraw"===C||"arrow"===C||"line"===C},E=function(C){return"rectangle"===C||"ellipse"===C||"diamond"===C||"arrow"===C||"line"===C},w=function(C){return"rectangle"===C||"arrow"===C||"line"===C||"diamond"===C},t=function(C){return"text"===C},r=function(C){return"arrow"===C},f=function(C,M){for(var aa= null,O=C.length-1;0<=O;--O){var U=C[O];if(!U.isDeleted&&M(U)){aa=U;break}}return aa},F=function(C,M){return C.filter(function(aa){return!aa.isDeleted&&M(aa)})}},4162:function(g,h,c){c.d(h,{$D:function(){return U},Cg:function(){return V},NL:function(){return O},oj:function(){return aa}});var p=c(2577),m=c(8950);g=c(2975);var q=c.n(g),E=c(8234),w=c(8925),t=c(3547),r=c(6340),f=c(2335),F=c(8897),C=c(5523),M=c(5637),aa="\x3c!-- svg-source:excalidraw --\x3e",O=function(){var T=(0,m.Z)(q().mark(function la(D, L,Q,N){var R,Z,X,S,ha,W,ra,wa,va,Fa,Ba,Ka,Oa,Va,Ya,Ua,La,ma,ja=arguments;return q().wrap(function(oa){for(;;)switch(oa.prev=oa.next){case 0:return R=N.exportBackground,Z=N.exportPadding,X=void 0===Z?f.qy:Z,S=N.viewBackgroundColor,ha=4r.width||U-P>r.height)t=(0,m.os)(t,(0,q.dE)({clientX:r.scrollX,clientY:r.scrollY},r)),t=(0,p.Z)(t,4),f=t[0],C=t[1],M=t[2],F=t[3];return E({scenePoint:{x:(f+M)/2,y:(C+F)/2},viewportDimensions:{width:r.width,height:r.height},zoom:r.zoom})}},756:function(g,h,c){c.d(h,{WM:function(){return w},_4:function(){return F},nn:function(){return t},tJ:function(){return f},w1:function(){return r}}); var p=c(2577),m=c(1047),q=c(6340),E=c(8211),w=4,t=6,r="rgba(0,0,0,0.3)",f=function(C,M,aa,O){var U=O.scrollX,P=O.scrollY,V=O.zoom;if(0===C.length)return{horizontal:null,vertical:null};C=(0,m.KP)(C);O=(0,p.Z)(C,4);var T=O[0],K=O[1];C=O[2];O=O[3];var D=M/V.value,L=aa/V.value,Q=M-D,N=aa-L;V=parseInt((0,q.IH)("sat"));var la=parseInt((0,q.IH)("sab")),R=parseInt((0,q.IH)("sal")),Z=parseInt((0,q.IH)("sar")),X=(0,E.G3)().rtl;U=Q/2-U+R;P=N/2-P+V;D=U+D-Z;L=P+L-la;T=Math.min(T,U);K=Math.min(K,P);C=Math.max(C, D);O=Math.max(O,L);return{horizontal:U===T&&D===C?null:{x:Math.max(R,w)+(U-T)/(C-T)*M,y:aa-t-Math.max(w,la),width:(D-U)/(C-T)*M-Math.max(2*w,R+Z),height:t},vertical:P===K&&L===O?null:{x:X?Math.max(R,w):M-t-Math.max(Z,w),y:(P-K)/(O-K)*aa+Math.max(V,w),width:t,height:(L-P)/(O-K)*aa-Math.max(2*w,V+la)}}},F=function(C,M,aa){C=[C.horizontal,C.vertical].map(function(U){return null!=U&&U.x<=M&&M<=U.x+U.width&&U.y<=aa&&aa<=U.y+U.height});var O=(0,p.Z)(C,2);C=O[0];O=O[1];return{isOverEither:C||O,isOverHorizontal:C, isOverVertical:O}}},1868:function(g,h,c){c.d(h,{N:function(){return w},PR:function(){return t},Yp:function(){return E},Zs:function(){return f},eD:function(){return r}});var p=c(2577),m=c(1047),q=c(1974),E=function(F,C){C=(0,m.qf)(C);C=(0,p.Z)(C,4);var M=C[0],aa=C[1],O=C[2],U=C[3];return F.filter(function(P){var V=(0,m.Pi)(P),T=(0,p.Z)(V,4);V=T[0];var K=T[1],D=T[2];T=T[3];return!1===P.locked&&"selection"!==P.type&&!(0,q.Xh)(P)&&M<=V&&aa<=K&&O>=D&&U>=T})},w=function(F,C){return F.some(function(M){return C.selectedElementIds[M.id]})}, t=function(F,C,M){F=Array.from(new Set(r(F,C).map(function(aa){return M(aa)})));return 1===F.length?F[0]:null},r=function(F,C){var M=2lc)return[];for(var Ab=0,vc=0,Fc=Array(Math.ceil(Gb.length/lc));AbAb&&(Ab=Gb.length+Ab);for(Ab=Math.min(Gb.length,Math.max(Ab,0))-1;++AbAb&&(Ab=Gb.length+Ab);for(Ab=Math.min(Gb.length-1,Math.max(Ab,0))+1;-1<--Ab;)if(lc(Gb[Ab],Ab,Gb))return Ab;return-1},sa=function(Gb){var lc=5===Gb.length&&"0"===Gb.substr(4,1),Ab=9===Gb.length&&"00"===Gb.substr(7,2);return lc||Ab||Gb===F.Z.elementBackground[0]},Ea=function(){var Gb,lc,Ab=new Promise(function(vc,Fc){Gb=vc;lc=Fc});return Ab.resolve=Gb,Ab.reject=lc,Ab},Qa=function(Gb){return function(lc){(0,M.unstable_batchedUpdates)(Gb, lc)}},Xa=function(Gb){return Q(function(lc){(0,M.unstable_batchedUpdates)(Gb,lc)})},Pa=function(){var Gb=document.createElement("canvas").getContext("2d");return Gb?(Gb.fillStyle="#f00",Gb.textBaseline="top",Gb.font="32px Arial",Gb.fillText("\ud83d\ude00",0,0),0!==Gb.getImageData(12,12,1,1).data[0]):!1},cb=function(Gb){for(Gb=Gb.parentElement;Gb&&Gb!==document.body;){var lc=window.getComputedStyle(Gb).overflowY;if(Gb.scrollHeight>Gb.clientHeight&&("auto"===lc||"scroll"===lc||"overlay"===lc))return Gb; Gb=Gb.parentElement}return document},tb=function(Gb){for(Gb=Gb.parentElement;Gb;){if(-1m.length)&&(q=m.length);for(var E=0,w=Array(q);Ecrypto.getRandomValues(new Uint8Array(m)).reduce((q,E)=>q+(36>(E&=63)?E.toString(36):62>E?(E-26).toString(36).toUpperCase():62(tc=Math.trunc(tc)||0)&&(tc+=this.length),!(0>tc||tc>=this.length))return this[tc]},writable:!0,enumerable:!1,configurable:!0})})()}(),J}()})}; 'use strict';var yvd=function(a,b){var c=$APP.aB();$APP.n(c)&&$APP.hIa($APP.Ivb(c,a),function(d){return b.A?b.A(d):b.call(null,d)},function(d){return $APP.cl.F($APP.F(["Error loading ",a,": ",d]))})},Avd=function(a){var b=$APP.Qr(a);if($APP.n(b)){for(b=b.querySelector(".draw-wrap");;){if(null!=b&&void 0!==b&&void 0!==b.classList)if($APP.n(b.classList.contains("block-content"))){var c=b.clientWidth;b=0===c?b.getBoundingClientRect.width:c;$APP.dg(zvd.A(a),b)}else{b=b.parentNode;continue}break}return a}return null}, Bvd=new $APP.N(null,"view-mode-enabled","view-mode-enabled",-588220561),Cvd=new $APP.N("frontend.extensions.excalidraw","grid-mode?","frontend.extensions.excalidraw/grid-mode?",-1189627787),Dvd=new $APP.N(null,"grid-mode-enabled","grid-mode-enabled",584978327),Evd=new $APP.N(null,"on-pointer-down","on-pointer-down",573334138),Fvd=new $APP.N("frontend.extensions.excalidraw","elements","frontend.extensions.excalidraw/elements",1745667967),Gvd=new $APP.N("frontend.extensions.excalidraw","resize-observer", "frontend.extensions.excalidraw/resize-observer",1997499684),Hvd=new $APP.N("frontend.extensions.excalidraw","data","frontend.extensions.excalidraw/data",-1371036113),Ivd=new $APP.N(null,"zen-mode-enabled","zen-mode-enabled",-955634269),Jvd=new $APP.N("frontend.extensions.excalidraw","zen-mode?","frontend.extensions.excalidraw/zen-mode?",1559773511),zvd=new $APP.N("frontend.extensions.excalidraw","draw-width","frontend.extensions.excalidraw/draw-width",-681100043),Kvd=new $APP.N("frontend.extensions.excalidraw", "view-mode?","frontend.extensions.excalidraw/view-mode?",525380621),Lvd=new $APP.N("frontend.extensions.excalidraw","loading?","frontend.extensions.excalidraw/loading?",-1335058663),Mvd=new $APP.N(null,"initial-data","initial-data",-1315709804);$APP.gda("excalidraw");var Nvd=$APP.Hm(595);var Ovd,Pvd,Qvd;$APP.Ljd={};Ovd=$APP.fP(Nvd.Excalidraw); Pvd=$APP.Jr($APP.Or,function(a,b,c){var d=$APP.Wr(),e=$APP.G.j(a,zvd),f=$APP.G.j(a,Jvd),g=$APP.G.j(a,Kvd),h=$APP.G.j(a,Cvd),m=$APP.iB($APP.Njb),p=$APP.G.j(a,Fvd);a=$APP.Nf(c);var q=$APP.G.j(a,$APP.dq),r=$APP.G.j(a,$APP.iO);return $APP.n(b)?$APP.W("div",{onMouseDown:function(u){return $APP.nw(u)},className:"overflow-hidden"},[$APP.W("div",{style:{fontSize:10},className:"my-1"},[$APP.W("a",{onClick:$APP.Ojb,className:"mr-2"},[$APP.xr($APP.dw("Wide Mode (%s)",$APP.F([$APP.n(m)?"ON":"OFF"])))]),$APP.W("a", {onClick:function(){return $APP.ui.j(f,$APP.xb)},className:"mr-2"},[$APP.xr($APP.dw("Zen Mode (%s)",$APP.F([$APP.n($APP.v(f))?"ON":"OFF"])))]),$APP.W("a",{onClick:function(){return $APP.ui.j(g,$APP.xb)},className:"mr-2"},[$APP.xr($APP.dw("View Mode (%s)",$APP.F([$APP.n($APP.v(g))?"ON":"OFF"])))]),$APP.W("a",{onClick:function(){return $APP.ui.j(h,$APP.xb)},className:"mr-2"},[$APP.xr($APP.dw("Grid Mode (%s)",$APP.F([$APP.n($APP.v(h))?"ON":"OFF"])))]),$APP.W("a",{onClick:function(){var u=new $APP.O(null, 2,5,$APP.P,[$APP.$B,r],null);u=$APP.yE.A?$APP.yE.A(u):$APP.yE.call(null,u);return $APP.n(u)?$APP.iN?$APP.iN(u,$APP.no,r):$APP.jN.call(null,u,$APP.no,r):null},className:"mr-2"},["Edit Block"])]),$APP.W("div",{ref:d,onMouseDown:function(u){$APP.nw(u);return $APP.bB($APP.t1,!0)},onBlur:function(){return $APP.bB($APP.t1,!1)},style:{width:$APP.v(e),height:$APP.n(m)?650:500},className:"draw-wrap"},[$APP.xr(function(){var u=$APP.jm.F($APP.F([new $APP.l(null,7,[$APP.nP,function(y,z){if($APP.n(function(){var H= $APP.B.j("down",$APP.sa(z,"cursorButton"));if(H)return H;H=$APP.sa(z,"draggingElement");if($APP.n(H))return H;H=$APP.sa(z,"editingElement");if($APP.n(H))return H;H=$APP.sa(z,"editingGroupId");return $APP.n(H)?H:$APP.sa(z,"editingLinearElement")}()))return null;var E=$APP.zq.F(y,$APP.F([new $APP.l(null,1,[$APP.Aq,!0],null)]));return $APP.x(E)&&$APP.Bh.j(E,$APP.v(p))?($APP.dg(p,E),$APP.iwb(q,Nvd.serializeAsJSON(y,z))):null},Ivd,$APP.v(f),Bvd,$APP.v(g),Dvd,$APP.v(h),Evd,function(){return d.current.firstChild.focus()}, Mvd,b,$APP.HC,$APP.iB($APP.aC)],null)]));return Ovd.A?Ovd.A(u):Ovd.call(null,u)}())])]):null},new $APP.O(null,8,5,$APP.P,[$APP.L8,$APP.Rr(800,zvd),$APP.Rr(!0,Jvd),$APP.Rr(!1,Kvd),$APP.Rr(!1,Cvd),$APP.Rr(null,Fvd),$APP.Rr(null,Gvd),new $APP.l(null,3,[$APP.Fr,function(a){$APP.dg(Gvd.A(a),new ResizeObserver($APP.Taa(function(){return $APP.dg(zvd.A(a),0)},300)));$APP.v(Gvd.A(a)).observe($APP.RPb());return Avd(a)},$APP.Gr,Avd,$APP.Hr,function(a){return $APP.v(Gvd.A(a)).disconnect()}],null)],null),"frontend.extensions.excalidraw/draw-inner"); Qvd=$APP.Jr($APP.Or,function(a,b){var c=$APP.G.j(a,Hvd);a=$APP.G.j(a,Lvd);a=$APP.Sr(a);c=$APP.Sr(c);var d=$APP.iB($APP.EKb);return $APP.n($APP.dq.A(b))?$APP.n(d)?(b=$APP.LQb(),$APP.W("div",$APP.Cd(b)?$APP.wr($APP.tr($APP.F([new $APP.l(null,1,[$APP.rr,new $APP.O(null,1,5,$APP.P,["ls-center"],null)],null),b]))):{className:"ls-center"},$APP.Cd(b)?null:[$APP.xr(b)])):!1===a?Pvd(c,b):null:null},new $APP.O(null,2,5,$APP.P,[$APP.L8,new $APP.l(null,1,[$APP.Dr,function(a){var b=$APP.Lr.A(a);b=$APP.C.C(b,0, null);b=$APP.dq.A(b);var c=$APP.ti.A(null),d=$APP.ti.A(!0);$APP.n(b)&&yvd(b,function(e){if($APP.xk(e))var f=null;else try{f=JSON.parse(e)}catch(g){e=g,$APP.cl.F($APP.F(["from json error:"])),console.dir(e),f=$APP.Bm($APP.fIa("Could not load this invalid excalidraw file"),$APP.Iv)}$APP.dg(c,f);return $APP.dg(d,!1)});return $APP.T.F(a,Hvd,c,$APP.F([Lvd,d]))}],null)],null),"frontend.extensions.excalidraw/draw-container"); $APP.Mjd=$APP.Jr($APP.Nr,function(a){var b=$APP.aB(),c=$APP.iB(new $APP.O(null,2,5,$APP.P,[$APP.pXa,b],null));return $APP.aD(b)&&$APP.xb(c)&&$APP.xb((0,$APP.Pw)())&&$APP.xb($APP.wq())?null:Qvd(a)},new $APP.O(null,1,5,$APP.P,[$APP.L8],null),"frontend.extensions.excalidraw/draw");$APP.Ra.Wi(); }).call(this);