@ninesstudios/whiteboard 0.1.1 β†’ 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,30 @@
1
- (function(pe,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],M):(pe=typeof globalThis<"u"?globalThis:pe||self,M(pe.Whiteboard={},pe.React,pe.ReactDOM))})(this,(function(pe,M,Fn){"use strict";function Xn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Oe=Xn(M);var St={exports:{}},et={};/*
1
+ (function(Ee,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],P):(Ee=typeof globalThis<"u"?globalThis:Ee||self,P(Ee.Whiteboard={},Ee.React,Ee.ReactDOM))})(this,(function(Ee,P,yo){"use strict";function mo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const $e=mo(P);var Yt={exports:{}},mt={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var $t,Sr;function Cr(){if(Sr)return $t;Sr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var f={},h=0;h<10;h++)f["_"+String.fromCharCode(h)]=h;var p=Object.getOwnPropertyNames(f).map(function(u){return f[u]});if(p.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return $t=i()?Object.assign:function(a,f){for(var h,p=n(a),l,u=1;u<arguments.length;u++){h=Object(arguments[u]);for(var g in h)t.call(h,g)&&(p[g]=h[g]);if(e){l=e(h);for(var m=0;m<l.length;m++)r.call(h,l[m])&&(p[l[m]]=h[l[m]])}}return p},$t}/** @license React v17.0.2
5
+ */var or,Br;function Ur(){if(Br)return or;Br=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var l={},c=0;c<10;c++)l["_"+String.fromCharCode(c)]=c;var f=Object.getOwnPropertyNames(l).map(function(v){return l[v]});if(f.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(v){s[v]=v}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return or=o()?Object.assign:function(a,l){for(var c,f=n(a),s,v=1;v<arguments.length;v++){c=Object(arguments[v]);for(var y in c)t.call(c,y)&&(f[y]=c[y]);if(e){s=e(c);for(var m=0;m<s.length;m++)r.call(c,s[m])&&(f[s[m]]=c[s[m]])}}return f},or}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var _r;function Bn(){if(_r)return et;_r=1,Cr();var e=M,t=60103;if(et.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var r=Symbol.for;t=r("react.element"),et.Fragment=r("react.fragment")}var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function f(h,p,l){var u,g={},m=null,E=null;l!==void 0&&(m=""+l),p.key!==void 0&&(m=""+p.key),p.ref!==void 0&&(E=p.ref);for(u in p)i.call(p,u)&&!a.hasOwnProperty(u)&&(g[u]=p[u]);if(h&&h.defaultProps)for(u in p=h.defaultProps,p)g[u]===void 0&&(g[u]=p[u]);return{$$typeof:t,type:h,key:m,ref:E,props:g,_owner:n.current}}return et.jsx=f,et.jsxs=f,et}var Ft={};/** @license React v17.0.2
12
+ */var qr;function go(){if(qr)return mt;qr=1,Ur();var e=P,t=60103;if(mt.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var r=Symbol.for;t=r("react.element"),mt.Fragment=r("react.fragment")}var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,s){var v,y={},m=null,E=null;s!==void 0&&(m=""+s),f.key!==void 0&&(m=""+f.key),f.ref!==void 0&&(E=f.ref);for(v in f)o.call(f,v)&&!a.hasOwnProperty(v)&&(y[v]=f[v]);if(c&&c.defaultProps)for(v in f=c.defaultProps,f)y[v]===void 0&&(y[v]=f[v]);return{$$typeof:t,type:c,key:m,ref:E,props:y,_owner:n.current}}return mt.jsx=l,mt.jsxs=l,mt}var ir={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Or;function Un(){return Or||(Or=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=M,r=Cr(),n=60103,i=60106;e.Fragment=60107;var a=60108,f=60114,h=60109,p=60110,l=60112,u=60113,g=60120,m=60115,E=60116,v=60121,d=60122,S=60117,T=60129,k=60131;if(typeof Symbol=="function"&&Symbol.for){var P=Symbol.for;n=P("react.element"),i=P("react.portal"),e.Fragment=P("react.fragment"),a=P("react.strict_mode"),f=P("react.profiler"),h=P("react.provider"),p=P("react.context"),l=P("react.forward_ref"),u=P("react.suspense"),g=P("react.suspense_list"),m=P("react.memo"),E=P("react.lazy"),v=P("react.block"),d=P("react.server.block"),S=P("react.fundamental"),P("react.scope"),P("react.opaque.id"),T=P("react.debug_trace_mode"),P("react.offscreen"),k=P("react.legacy_hidden")}var N=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function R(o){if(o===null||typeof o!="object")return null;var y=N&&o[N]||o[c];return typeof y=="function"?y:null}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(o){{for(var y=arguments.length,x=new Array(y>1?y-1:0),O=1;O<y;O++)x[O-1]=arguments[O];Z("error",o,x)}}function Z(o,y,x){{var O=j.ReactDebugCurrentFrame,_=O.getStackAddendum();_!==""&&(y+="%s",x=x.concat([_]));var A=x.map(function(W){return""+W});A.unshift("Warning: "+y),Function.prototype.apply.call(console[o],console,A)}}var q=!1;function H(o){return!!(typeof o=="string"||typeof o=="function"||o===e.Fragment||o===f||o===T||o===a||o===u||o===g||o===k||q||typeof o=="object"&&o!==null&&(o.$$typeof===E||o.$$typeof===m||o.$$typeof===h||o.$$typeof===p||o.$$typeof===l||o.$$typeof===S||o.$$typeof===v||o[0]===d))}function ie(o,y,x){var O=y.displayName||y.name||"";return o.displayName||(O!==""?x+"("+O+")":x)}function G(o){return o.displayName||"Context"}function ee(o){if(o==null)return null;if(typeof o.tag=="number"&&Y("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case e.Fragment:return"Fragment";case i:return"Portal";case f:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case g:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case p:var y=o;return G(y)+".Consumer";case h:var x=o;return G(x._context)+".Provider";case l:return ie(o,o.render,"ForwardRef");case m:return ee(o.type);case v:return ee(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return ee(A(_))}catch{return null}}}return null}var fe=0,Te,Se,ye,be,we,Me,Le;function ke(){}ke.__reactDisabledLog=!0;function qe(){{if(fe===0){Te=console.log,Se=console.info,ye=console.warn,be=console.error,we=console.group,Me=console.groupCollapsed,Le=console.groupEnd;var o={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}fe++}}function Ye(){{if(fe--,fe===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},o,{value:Te}),info:r({},o,{value:Se}),warn:r({},o,{value:ye}),error:r({},o,{value:be}),group:r({},o,{value:we}),groupCollapsed:r({},o,{value:Me}),groupEnd:r({},o,{value:Le})})}fe<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=j.ReactCurrentDispatcher,Ce;function _e(o,y,x){{if(Ce===void 0)try{throw Error()}catch(_){var O=_.stack.trim().match(/\n( *(at )?)/);Ce=O&&O[1]||""}return`
20
- `+Ce+o}}var ae=!1,se;{var ce=typeof WeakMap=="function"?WeakMap:Map;se=new ce}function D(o,y){if(!o||ae)return"";{var x=se.get(o);if(x!==void 0)return x}var O;ae=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=ge.current,ge.current=null,qe();try{if(y){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Re){O=Re}Reflect.construct(o,[],W)}else{try{W.call()}catch(Re){O=Re}o.call(W.prototype)}}else{try{throw Error()}catch(Re){O=Re}o()}}catch(Re){if(Re&&O&&typeof Re.stack=="string"){for(var I=Re.stack.split(`
21
- `),U=O.stack.split(`
22
- `),V=I.length-1,L=U.length-1;V>=1&&L>=0&&I[V]!==U[L];)L--;for(;V>=1&&L>=0;V--,L--)if(I[V]!==U[L]){if(V!==1||L!==1)do if(V--,L--,L<0||I[V]!==U[L]){var J=`
23
- `+I[V].replace(" at new "," at ");return typeof o=="function"&&se.set(o,J),J}while(V>=1&&L>=0);break}}}finally{ae=!1,ge.current=A,Ye(),Error.prepareStackTrace=_}var re=o?o.displayName||o.name:"",xe=re?_e(re):"";return typeof o=="function"&&se.set(o,xe),xe}function le(o,y,x){return D(o,!1)}function z(o){var y=o.prototype;return!!(y&&y.isReactComponent)}function de(o,y,x){if(o==null)return"";if(typeof o=="function")return D(o,z(o));if(typeof o=="string")return _e(o);switch(o){case u:return _e("Suspense");case g:return _e("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return le(o.render);case m:return de(o.type,y,x);case v:return le(o._render);case E:{var O=o,_=O._payload,A=O._init;try{return de(A(_),y,x)}catch{}}}return""}var he={},Ve=j.ReactDebugCurrentFrame;function He(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ve.setExtraStackFrame(x)}else Ve.setExtraStackFrame(null)}function at(o,y,x,O,_){{var A=Function.call.bind(Object.prototype.hasOwnProperty);for(var W in o)if(A(o,W)){var I=void 0;try{if(typeof o[W]!="function"){var U=Error((O||"React class")+": "+x+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw U.name="Invariant Violation",U}I=o[W](y,W,O,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(V){I=V}I&&!(I instanceof Error)&&(He(_),Y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",O||"React class",x,W,typeof I),He(null)),I instanceof Error&&!(I.message in he)&&(he[I.message]=!0,He(_),Y("Failed %s type: %s",x,I.message),He(null))}}}var Ge=j.ReactCurrentOwner,$e=Object.prototype.hasOwnProperty,It={key:!0,ref:!0,__self:!0,__source:!0},Ke,Je;function st(o){if($e.call(o,"ref")){var y=Object.getOwnPropertyDescriptor(o,"ref").get;if(y&&y.isReactWarning)return!1}return o.ref!==void 0}function ct(o){if($e.call(o,"key")){var y=Object.getOwnPropertyDescriptor(o,"key").get;if(y&&y.isReactWarning)return!1}return o.key!==void 0}function lt(o,y){typeof o.ref=="string"&&Ge.current}function ut(o,y){{var x=function(){Ke||(Ke=!0,Y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",y))};x.isReactWarning=!0,Object.defineProperty(o,"key",{get:x,configurable:!0})}}function ft(o,y){{var x=function(){Je||(Je=!0,Y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",y))};x.isReactWarning=!0,Object.defineProperty(o,"ref",{get:x,configurable:!0})}}var dt=function(o,y,x,O,_,A,W){var I={$$typeof:n,type:o,key:y,ref:x,props:W,_owner:A};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function bt(o,y,x,O,_){{var A,W={},I=null,U=null;x!==void 0&&(I=""+x),ct(y)&&(I=""+y.key),st(y)&&(U=y.ref,lt(y,_));for(A in y)$e.call(y,A)&&!It.hasOwnProperty(A)&&(W[A]=y[A]);if(o&&o.defaultProps){var V=o.defaultProps;for(A in V)W[A]===void 0&&(W[A]=V[A])}if(I||U){var L=typeof o=="function"?o.displayName||o.name||"Unknown":o;I&&ut(W,L),U&&ft(W,L)}return dt(o,I,U,_,O,Ge.current,W)}}var ht=j.ReactCurrentOwner,Ze=j.ReactDebugCurrentFrame;function Fe(o){if(o){var y=o._owner,x=de(o.type,o._source,y?y.type:null);Ze.setExtraStackFrame(x)}else Ze.setExtraStackFrame(null)}var wt;wt=!1;function Qe(o){return typeof o=="object"&&o!==null&&o.$$typeof===n}function xt(){{if(ht.current){var o=ee(ht.current.type);if(o)return`
19
+ */var Hr;function bo(){return Hr||(Hr=1,(function(e){process.env.NODE_ENV!=="production"&&(function(){var t=P,r=Ur(),n=60103,o=60106;e.Fragment=60107;var a=60108,l=60114,c=60109,f=60110,s=60112,v=60113,y=60120,m=60115,E=60116,h=60121,b=60122,d=60117,C=60129,N=60131;if(typeof Symbol=="function"&&Symbol.for){var M=Symbol.for;n=M("react.element"),o=M("react.portal"),e.Fragment=M("react.fragment"),a=M("react.strict_mode"),l=M("react.profiler"),c=M("react.provider"),f=M("react.context"),s=M("react.forward_ref"),v=M("react.suspense"),y=M("react.suspense_list"),m=M("react.memo"),E=M("react.lazy"),h=M("react.block"),b=M("react.server.block"),d=M("react.fundamental"),M("react.scope"),M("react.opaque.id"),C=M("react.debug_trace_mode"),M("react.offscreen"),N=M("react.legacy_hidden")}var A=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function T(u){if(u===null||typeof u!="object")return null;var R=A&&u[A]||u[x];return typeof R=="function"?R:null}var _=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(u){{for(var R=arguments.length,z=new Array(R>1?R-1:0),B=1;B<R;B++)z[B-1]=arguments[B];k("error",u,z)}}function k(u,R,z){{var B=_.ReactDebugCurrentFrame,ne=B.getStackAddendum();ne!==""&&(R+="%s",z=z.concat([ne]));var te=z.map(function(U){return""+U});te.unshift("Warning: "+R),Function.prototype.apply.call(console[u],console,te)}}var oe=!1;function ie(u){return!!(typeof u=="string"||typeof u=="function"||u===e.Fragment||u===l||u===C||u===a||u===v||u===y||u===N||oe||typeof u=="object"&&u!==null&&(u.$$typeof===E||u.$$typeof===m||u.$$typeof===c||u.$$typeof===f||u.$$typeof===s||u.$$typeof===d||u.$$typeof===h||u[0]===b))}function fe(u,R,z){var B=R.displayName||R.name||"";return u.displayName||(B!==""?z+"("+B+")":z)}function je(u){return u.displayName||"Context"}function de(u){if(u==null)return null;if(typeof u.tag=="number"&&$("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case e.Fragment:return"Fragment";case o:return"Portal";case l:return"Profiler";case a:return"StrictMode";case v:return"Suspense";case y:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case f:var R=u;return je(R)+".Consumer";case c:var z=u;return je(z._context)+".Provider";case s:return fe(u,u.render,"ForwardRef");case m:return de(u.type);case h:return de(u._render);case E:{var B=u,ne=B._payload,te=B._init;try{return de(te(ne))}catch{return null}}}return null}var Me=0,Be,ze,ke,Re,Pe,We,Le;function Ue(){}Ue.__reactDisabledLog=!0;function st(){{if(Me===0){Be=console.log,ze=console.info,ke=console.warn,Re=console.error,Pe=console.group,We=console.groupCollapsed,Le=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Ue,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}Me++}}function et(){{if(Me--,Me===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:r({},u,{value:Be}),info:r({},u,{value:ze}),warn:r({},u,{value:ke}),error:r({},u,{value:Re}),group:r({},u,{value:Pe}),groupCollapsed:r({},u,{value:We}),groupEnd:r({},u,{value:Le})})}Me<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var qe=_.ReactCurrentDispatcher,Ye;function xe(u,R,z){{if(Ye===void 0)try{throw Error()}catch(ne){var B=ne.stack.trim().match(/\n( *(at )?)/);Ye=B&&B[1]||""}return`
20
+ `+Ye+u}}var Ve=!1,Ne;{var Ce=typeof WeakMap=="function"?WeakMap:Map;Ne=new Ce}function V(u,R){if(!u||Ve)return"";{var z=Ne.get(u);if(z!==void 0)return z}var B;Ve=!0;var ne=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=qe.current,qe.current=null,st();try{if(R){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Te){B=Te}Reflect.construct(u,[],U)}else{try{U.call()}catch(Te){B=Te}u.call(U.prototype)}}else{try{throw Error()}catch(Te){B=Te}u()}}catch(Te){if(Te&&B&&typeof Te.stack=="string"){for(var G=Te.stack.split(`
21
+ `),ge=B.stack.split(`
22
+ `),ce=G.length-1,le=ge.length-1;ce>=1&&le>=0&&G[ce]!==ge[le];)le--;for(;ce>=1&&le>=0;ce--,le--)if(G[ce]!==ge[le]){if(ce!==1||le!==1)do if(ce--,le--,le<0||G[ce]!==ge[le]){var Ie=`
23
+ `+G[ce].replace(" at new "," at ");return typeof u=="function"&&Ne.set(u,Ie),Ie}while(ce>=1&&le>=0);break}}}finally{Ve=!1,qe.current=te,et(),Error.prepareStackTrace=ne}var rt=u?u.displayName||u.name:"",nr=rt?xe(rt):"";return typeof u=="function"&&Ne.set(u,nr),nr}function ve(u,R,z){return V(u,!1)}function F(u){var R=u.prototype;return!!(R&&R.isReactComponent)}function ye(u,R,z){if(u==null)return"";if(typeof u=="function")return V(u,F(u));if(typeof u=="string")return xe(u);switch(u){case v:return xe("Suspense");case y:return xe("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case s:return ve(u.render);case m:return ye(u.type,R,z);case h:return ve(u._render);case E:{var B=u,ne=B._payload,te=B._init;try{return ye(te(ne),R,z)}catch{}}}return""}var _e={},ct=_.ReactDebugCurrentFrame;function lt(u){if(u){var R=u._owner,z=ye(u.type,u._source,R?R.type:null);ct.setExtraStackFrame(z)}else ct.setExtraStackFrame(null)}function me(u,R,z,B,ne){{var te=Function.call.bind(Object.prototype.hasOwnProperty);for(var U in u)if(te(u,U)){var G=void 0;try{if(typeof u[U]!="function"){var ge=Error((B||"React class")+": "+z+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}G=u[U](R,U,B,z,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){G=ce}G&&!(G instanceof Error)&&(lt(ne),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",B||"React class",z,U,typeof G),lt(null)),G instanceof Error&&!(G.message in _e)&&(_e[G.message]=!0,lt(ne),$("Failed %s type: %s",z,G.message),lt(null))}}}var It=_.ReactCurrentOwner,ut=Object.prototype.hasOwnProperty,Qt={key:!0,ref:!0,__self:!0,__source:!0},Dt,zt;function St(u){if(ut.call(u,"ref")){var R=Object.getOwnPropertyDescriptor(u,"ref").get;if(R&&R.isReactWarning)return!1}return u.ref!==void 0}function er(u){if(ut.call(u,"key")){var R=Object.getOwnPropertyDescriptor(u,"key").get;if(R&&R.isReactWarning)return!1}return u.key!==void 0}function ae(u,R){typeof u.ref=="string"&&It.current}function Wt(u,R){{var z=function(){Dt||(Dt=!0,$("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",R))};z.isReactWarning=!0,Object.defineProperty(u,"key",{get:z,configurable:!0})}}function Yr(u,R){{var z=function(){zt||(zt=!0,$("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",R))};z.isReactWarning=!0,Object.defineProperty(u,"ref",{get:z,configurable:!0})}}var ft=function(u,R,z,B,ne,te,U){var G={$$typeof:n,type:u,key:R,ref:z,props:U,_owner:te};return G._store={},Object.defineProperty(G._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(G,"_self",{configurable:!1,enumerable:!1,writable:!1,value:B}),Object.defineProperty(G,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ne}),Object.freeze&&(Object.freeze(G.props),Object.freeze(G)),G};function tr(u,R,z,B,ne){{var te,U={},G=null,ge=null;z!==void 0&&(G=""+z),er(R)&&(G=""+R.key),St(R)&&(ge=R.ref,ae(R,ne));for(te in R)ut.call(R,te)&&!Qt.hasOwnProperty(te)&&(U[te]=R[te]);if(u&&u.defaultProps){var ce=u.defaultProps;for(te in ce)U[te]===void 0&&(U[te]=ce[te])}if(G||ge){var le=typeof u=="function"?u.displayName||u.name||"Unknown":u;G&&Wt(U,le),ge&&Yr(U,le)}return ft(u,G,ge,ne,B,It.current,U)}}var Ct=_.ReactCurrentOwner,dt=_.ReactDebugCurrentFrame;function Ae(u){if(u){var R=u._owner,z=ye(u.type,u._source,R?R.type:null);dt.setExtraStackFrame(z)}else dt.setExtraStackFrame(null)}var tt;tt=!1;function _t(u){return typeof u=="object"&&u!==null&&u.$$typeof===n}function ht(){{if(Ct.current){var u=de(Ct.current.type);if(u)return`
24
24
 
25
- Check the render method of \``+o+"`."}return""}}function Dt(o){return""}var me={};function Et(o){{var y=xt();if(!y){var x=typeof o=="string"?o:o.displayName||o.name;x&&(y=`
25
+ Check the render method of \``+u+"`."}return""}}function Ot(u){return""}var pt={};function jt(u){{var R=ht();if(!R){var z=typeof u=="string"?u:u.displayName||u.name;z&&(R=`
26
26
 
27
- Check the top-level render call using <`+x+">.")}return y}}function zt(o,y){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var x=Et(y);if(me[x])return;me[x]=!0;var O="";o&&o._owner&&o._owner!==ht.current&&(O=" It was passed a child from "+ee(o._owner.type)+"."),Fe(o),Y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',x,O),Fe(null)}}function Wt(o,y){{if(typeof o!="object")return;if(Array.isArray(o))for(var x=0;x<o.length;x++){var O=o[x];Qe(O)&&zt(O,y)}else if(Qe(o))o._store&&(o._store.validated=!0);else if(o){var _=R(o);if(typeof _=="function"&&_!==o.entries)for(var A=_.call(o),W;!(W=A.next()).done;)Qe(W.value)&&zt(W.value,y)}}}function Lt(o){{var y=o.type;if(y==null||typeof y=="string")return;var x;if(typeof y=="function")x=y.propTypes;else if(typeof y=="object"&&(y.$$typeof===l||y.$$typeof===m))x=y.propTypes;else return;if(x){var O=ee(y);at(x,o.props,"prop",O,o)}else if(y.PropTypes!==void 0&&!wt){wt=!0;var _=ee(y);Y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof y.getDefaultProps=="function"&&!y.getDefaultProps.isReactClassApproved&&Y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Er(o){{for(var y=Object.keys(o.props),x=0;x<y.length;x++){var O=y[x];if(O!=="children"&&O!=="key"){Fe(o),Y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",O),Fe(null);break}}o.ref!==null&&(Fe(o),Y("Invalid attribute `ref` supplied to `React.Fragment`."),Fe(null))}}function Yt(o,y,x,O,_,A){{var W=H(o);if(!W){var I="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var U=Dt();U?I+=U:I+=xt();var V;o===null?V="null":Array.isArray(o)?V="array":o!==void 0&&o.$$typeof===n?(V="<"+(ee(o.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):V=typeof o,Y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",V,I)}var L=bt(o,y,x,_,A);if(L==null)return L;if(W){var J=y.children;if(J!==void 0)if(O)if(Array.isArray(J)){for(var re=0;re<J.length;re++)Wt(J[re],o);Object.freeze&&Object.freeze(J)}else Y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Wt(J,o)}return o===e.Fragment?Er(L):Lt(L),L}}function Vt(o,y,x){return Yt(o,y,x,!0)}function s(o,y,x){return Yt(o,y,x,!1)}var b=s,C=Vt;e.jsx=b,e.jsxs=C})()})(Ft)),Ft}var jr;function qn(){return jr||(jr=1,process.env.NODE_ENV==="production"?St.exports=Bn():St.exports=Un()),St.exports}var w=qn(),Ct={exports:{}},Xt={};/**
27
+ Check the top-level render call using <`+z+">.")}return R}}function vt(u,R){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var z=jt(R);if(pt[z])return;pt[z]=!0;var B="";u&&u._owner&&u._owner!==Ct.current&&(B=" It was passed a child from "+de(u._owner.type)+"."),Ae(u),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',z,B),Ae(null)}}function yt(u,R){{if(typeof u!="object")return;if(Array.isArray(u))for(var z=0;z<u.length;z++){var B=u[z];_t(B)&&vt(B,R)}else if(_t(u))u._store&&(u._store.validated=!0);else if(u){var ne=T(u);if(typeof ne=="function"&&ne!==u.entries)for(var te=ne.call(u),U;!(U=te.next()).done;)_t(U.value)&&vt(U.value,R)}}}function Pt(u){{var R=u.type;if(R==null||typeof R=="string")return;var z;if(typeof R=="function")z=R.propTypes;else if(typeof R=="object"&&(R.$$typeof===s||R.$$typeof===m))z=R.propTypes;else return;if(z){var B=de(R);me(z,u.props,"prop",B,u)}else if(R.PropTypes!==void 0&&!tt){tt=!0;var ne=de(R);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ne||"Unknown")}typeof R.getDefaultProps=="function"&&!R.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(u){{for(var R=Object.keys(u.props),z=0;z<R.length;z++){var B=R[z];if(B!=="children"&&B!=="key"){Ae(u),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",B),Ae(null);break}}u.ref!==null&&(Ae(u),$("Invalid attribute `ref` supplied to `React.Fragment`."),Ae(null))}}function Mt(u,R,z,B,ne,te){{var U=ie(u);if(!U){var G="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(G+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ge=Ot();ge?G+=ge:G+=ht();var ce;u===null?ce="null":Array.isArray(u)?ce="array":u!==void 0&&u.$$typeof===n?(ce="<"+(de(u.type)||"Unknown")+" />",G=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof u,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,G)}var le=tr(u,R,z,ne,te);if(le==null)return le;if(U){var Ie=R.children;if(Ie!==void 0)if(B)if(Array.isArray(Ie)){for(var rt=0;rt<Ie.length;rt++)yt(Ie[rt],u);Object.freeze&&Object.freeze(Ie)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else yt(Ie,u)}return u===e.Fragment?Tt(le):Pt(le),le}}function rr(u,R,z){return Mt(u,R,z,!0)}function kt(u,R,z){return Mt(u,R,z,!1)}var Vr=kt,$r=rr;e.jsx=Vr,e.jsxs=$r})()})(ir)),ir}var Gr;function wo(){return Gr||(Gr=1,process.env.NODE_ENV==="production"?Yt.exports=go():Yt.exports=bo()),Yt.exports}var g=wo(),Vt={exports:{}},ar={};/**
28
28
  * @license React
29
29
  * use-sync-external-store-shim.production.js
30
30
  *
@@ -32,7 +32,7 @@ Check the top-level render call using <`+x+">.")}return y}}function zt(o,y){{if(
32
32
  *
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
- */var Pr;function Hn(){if(Pr)return Xt;Pr=1;var e=M;function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,f=e.useDebugValue;function h(g,m){var E=m(),v=n({inst:{value:E,getSnapshot:m}}),d=v[0].inst,S=v[1];return a(function(){d.value=E,d.getSnapshot=m,p(d)&&S({inst:d})},[g,E,m]),i(function(){return p(d)&&S({inst:d}),g(function(){p(d)&&S({inst:d})})},[g]),f(E),E}function p(g){var m=g.getSnapshot;g=g.value;try{var E=m();return!r(g,E)}catch{return!0}}function l(g,m){return m()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:h;return Xt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Xt}var Bt={};/**
35
+ */var Kr;function xo(){if(Kr)return ar;Kr=1;var e=P;function t(y,m){return y===m&&(y!==0||1/y===1/m)||y!==y&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(y,m){var E=m(),h=n({inst:{value:E,getSnapshot:m}}),b=h[0].inst,d=h[1];return a(function(){b.value=E,b.getSnapshot=m,f(b)&&d({inst:b})},[y,E,m]),o(function(){return f(b)&&d({inst:b}),y(function(){f(b)&&d({inst:b})})},[y]),l(E),E}function f(y){var m=y.getSnapshot;y=y.value;try{var E=m();return!r(y,E)}catch{return!0}}function s(y,m){return m()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:c;return ar.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,ar}var sr={};/**
36
36
  * @license React
37
37
  * use-sync-external-store-shim.development.js
38
38
  *
@@ -40,7 +40,7 @@ Check the top-level render call using <`+x+">.")}return y}}function zt(o,y){{if(
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */var Tr;function Gn(){return Tr||(Tr=1,process.env.NODE_ENV!=="production"&&(function(){function e(E,v){return E===v&&(E!==0||1/E===1/v)||E!==E&&v!==v}function t(E,v){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=v();if(!g){var S=v();a(d,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}S=f({inst:{value:d,getSnapshot:v}});var T=S[0].inst,k=S[1];return p(function(){T.value=d,T.getSnapshot=v,r(T)&&k({inst:T})},[E,d,v]),h(function(){return r(T)&&k({inst:T}),E(function(){r(T)&&k({inst:T})})},[E]),l(d),d}function r(E){var v=E.getSnapshot;E=E.value;try{var d=v();return!a(E,d)}catch{return!0}}function n(E,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=M,a=typeof Object.is=="function"?Object.is:e,f=i.useState,h=i.useEffect,p=i.useLayoutEffect,l=i.useDebugValue,u=!1,g=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Bt.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Bt}var Mr;function Ut(){return Mr||(Mr=1,process.env.NODE_ENV==="production"?Ct.exports=Hn():Ct.exports=Gn()),Ct.exports}Ut();var _t={exports:{}},qt={};/**
43
+ */var Jr;function Eo(){return Jr||(Jr=1,process.env.NODE_ENV!=="production"&&(function(){function e(E,h){return E===h&&(E!==0||1/E===1/h)||E!==E&&h!==h}function t(E,h){v||o.startTransition===void 0||(v=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=h();if(!y){var d=h();a(b,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),y=!0)}d=l({inst:{value:b,getSnapshot:h}});var C=d[0].inst,N=d[1];return f(function(){C.value=b,C.getSnapshot=h,r(C)&&N({inst:C})},[E,b,h]),c(function(){return r(C)&&N({inst:C}),E(function(){r(C)&&N({inst:C})})},[E]),s(b),b}function r(E){var h=E.getSnapshot;E=E.value;try{var b=h();return!a(E,b)}catch{return!0}}function n(E,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=P,a=typeof Object.is=="function"?Object.is:e,l=o.useState,c=o.useEffect,f=o.useLayoutEffect,s=o.useDebugValue,v=!1,y=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;sr.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),sr}var Zr;function cr(){return Zr||(Zr=1,process.env.NODE_ENV==="production"?Vt.exports=xo():Vt.exports=Eo()),Vt.exports}cr();var $t={exports:{}},lr={};/**
44
44
  * @license React
45
45
  * use-sync-external-store-shim/with-selector.production.js
46
46
  *
@@ -48,7 +48,7 @@ Check the top-level render call using <`+x+">.")}return y}}function zt(o,y){{if(
48
48
  *
49
49
  * This source code is licensed under the MIT license found in the
50
50
  * LICENSE file in the root directory of this source tree.
51
- */var kr;function Kn(){if(kr)return qt;kr=1;var e=M,t=Ut();function r(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,f=e.useEffect,h=e.useMemo,p=e.useDebugValue;return qt.useSyncExternalStoreWithSelector=function(l,u,g,m,E){var v=a(null);if(v.current===null){var d={hasValue:!1,value:null};v.current=d}else d=v.current;v=h(function(){function T(R){if(!k){if(k=!0,P=R,R=m(R),E!==void 0&&d.hasValue){var j=d.value;if(E(j,R))return N=j}return N=R}if(j=N,n(P,R))return j;var Y=m(R);return E!==void 0&&E(j,Y)?(P=R,j):(P=R,N=Y)}var k=!1,P,N,c=g===void 0?null:g;return[function(){return T(u())},c===null?void 0:function(){return T(c())}]},[u,g,m,E]);var S=i(l,v[0],v[1]);return f(function(){d.hasValue=!0,d.value=S},[S]),p(S),S},qt}var Ht={};/**
51
+ */var Qr;function So(){if(Qr)return lr;Qr=1;var e=P,t=cr();function r(s,v){return s===v&&(s!==0||1/s===1/v)||s!==s&&v!==v}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return lr.useSyncExternalStoreWithSelector=function(s,v,y,m,E){var h=a(null);if(h.current===null){var b={hasValue:!1,value:null};h.current=b}else b=h.current;h=c(function(){function C(T){if(!N){if(N=!0,M=T,T=m(T),E!==void 0&&b.hasValue){var _=b.value;if(E(_,T))return A=_}return A=T}if(_=A,n(M,T))return _;var $=m(T);return E!==void 0&&E(_,$)?(M=T,_):(M=T,A=$)}var N=!1,M,A,x=y===void 0?null:y;return[function(){return C(v())},x===null?void 0:function(){return C(x())}]},[v,y,m,E]);var d=o(s,h[0],h[1]);return l(function(){b.hasValue=!0,b.value=d},[d]),f(d),d},lr}var ur={};/**
52
52
  * @license React
53
53
  * use-sync-external-store-shim/with-selector.development.js
54
54
  *
@@ -56,23 +56,23 @@ Check the top-level render call using <`+x+">.")}return y}}function zt(o,y){{if(
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var Rr;function Jn(){return Rr||(Rr=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=M,r=Ut(),n=typeof Object.is=="function"?Object.is:e,i=r.useSyncExternalStore,a=t.useRef,f=t.useEffect,h=t.useMemo,p=t.useDebugValue;Ht.useSyncExternalStoreWithSelector=function(l,u,g,m,E){var v=a(null);if(v.current===null){var d={hasValue:!1,value:null};v.current=d}else d=v.current;v=h(function(){function T(R){if(!k){if(k=!0,P=R,R=m(R),E!==void 0&&d.hasValue){var j=d.value;if(E(j,R))return N=j}return N=R}if(j=N,n(P,R))return j;var Y=m(R);return E!==void 0&&E(j,Y)?(P=R,j):(P=R,N=Y)}var k=!1,P,N,c=g===void 0?null:g;return[function(){return T(u())},c===null?void 0:function(){return T(c())}]},[u,g,m,E]);var S=i(l,v[0],v[1]);return f(function(){d.hasValue=!0,d.value=S},[S]),p(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ht}var Nr;function Zn(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?_t.exports=Kn():_t.exports=Jn()),_t.exports}var Qn=Zn();function eo(e){e()}let Ar=eo;const to=e=>Ar=e,ro=()=>Ar,Ir=Symbol.for("react-redux-context"),Dr=typeof globalThis<"u"?globalThis:{};function no(){var e;if(!Oe.createContext)return{};const t=(e=Dr[Ir])!=null?e:Dr[Ir]=new Map;let r=t.get(Oe.createContext);return r||(r=Oe.createContext(null),process.env.NODE_ENV!=="production"&&(r.displayName="ReactRedux"),t.set(Oe.createContext,r)),r}const Ne=no();function Gt(e=Ne){return function(){const r=M.useContext(e);if(process.env.NODE_ENV!=="production"&&!r)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return r}}const zr=Gt();let Wr=()=>{throw new Error("uSES not initialized!")};const oo=e=>{Wr=e},io=(e,t)=>e===t;function ao(e=Ne){const t=e===Ne?zr:Gt(e);return function(n,i={}){const{equalityFn:a=io,stabilityCheck:f=void 0,noopCheck:h=void 0}=typeof i=="function"?{equalityFn:i}:i;if(process.env.NODE_ENV!=="production"){if(!n)throw new Error("You must pass a selector to useSelector");if(typeof n!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof a!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:p,subscription:l,getServerState:u,stabilityCheck:g,noopCheck:m}=t(),E=M.useRef(!0),v=M.useCallback({[n.name](S){const T=n(S);if(process.env.NODE_ENV!=="production"){const k=typeof f>"u"?g:f;if(k==="always"||k==="once"&&E.current){const N=n(S);if(!a(T,N)){let c;try{throw new Error}catch(R){({stack:c}=R)}console.warn("Selector "+(n.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
60
- Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:S,selected:T,selected2:N,stack:c})}}const P=typeof h>"u"?m:h;if((P==="always"||P==="once"&&E.current)&&T===S){let N;try{throw new Error}catch(c){({stack:N}=c)}console.warn("Selector "+(n.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
61
- Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:N})}E.current&&(E.current=!1)}return T}}[n.name],[n,g,f]),d=Wr(l.addNestedSub,p.getState,u||p.getState,v,a);return M.useDebugValue(d),d}}const oe=ao();var Ot={exports:{}},$={};/** @license React v16.13.1
59
+ */var en;function Co(){return en||(en=1,process.env.NODE_ENV!=="production"&&(function(){function e(s,v){return s===v&&(s!==0||1/s===1/v)||s!==s&&v!==v}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=P,r=cr(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,a=t.useRef,l=t.useEffect,c=t.useMemo,f=t.useDebugValue;ur.useSyncExternalStoreWithSelector=function(s,v,y,m,E){var h=a(null);if(h.current===null){var b={hasValue:!1,value:null};h.current=b}else b=h.current;h=c(function(){function C(T){if(!N){if(N=!0,M=T,T=m(T),E!==void 0&&b.hasValue){var _=b.value;if(E(_,T))return A=_}return A=T}if(_=A,n(M,T))return _;var $=m(T);return E!==void 0&&E(_,$)?(M=T,_):(M=T,A=$)}var N=!1,M,A,x=y===void 0?null:y;return[function(){return C(v())},x===null?void 0:function(){return C(x())}]},[v,y,m,E]);var d=o(s,h[0],h[1]);return l(function(){b.hasValue=!0,b.value=d},[d]),f(d),d},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ur}var tn;function _o(){return tn||(tn=1,process.env.NODE_ENV==="production"?$t.exports=So():$t.exports=Co()),$t.exports}var Oo=_o();function jo(e){e()}let rn=jo;const Po=e=>rn=e,To=()=>rn,nn=Symbol.for("react-redux-context"),on=typeof globalThis<"u"?globalThis:{};function Mo(){var e;if(!$e.createContext)return{};const t=(e=on[nn])!=null?e:on[nn]=new Map;let r=t.get($e.createContext);return r||(r=$e.createContext(null),process.env.NODE_ENV!=="production"&&(r.displayName="ReactRedux"),t.set($e.createContext,r)),r}const He=Mo();function fr(e=He){return function(){const r=P.useContext(e);if(process.env.NODE_ENV!=="production"&&!r)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return r}}const an=fr();let sn=()=>{throw new Error("uSES not initialized!")};const ko=e=>{sn=e},Ro=(e,t)=>e===t;function No(e=He){const t=e===He?an:fr(e);return function(n,o={}){const{equalityFn:a=Ro,stabilityCheck:l=void 0,noopCheck:c=void 0}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!n)throw new Error("You must pass a selector to useSelector");if(typeof n!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof a!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:f,subscription:s,getServerState:v,stabilityCheck:y,noopCheck:m}=t(),E=P.useRef(!0),h=P.useCallback({[n.name](d){const C=n(d);if(process.env.NODE_ENV!=="production"){const N=typeof l>"u"?y:l;if(N==="always"||N==="once"&&E.current){const A=n(d);if(!a(C,A)){let x;try{throw new Error}catch(T){({stack:x}=T)}console.warn("Selector "+(n.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
60
+ Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:d,selected:C,selected2:A,stack:x})}}const M=typeof c>"u"?m:c;if((M==="always"||M==="once"&&E.current)&&C===d){let A;try{throw new Error}catch(x){({stack:A}=x)}console.warn("Selector "+(n.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
61
+ Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:A})}E.current&&(E.current=!1)}return C}}[n.name],[n,y,l]),b=sn(s.addNestedSub,f.getState,v||f.getState,h,a);return P.useDebugValue(b),b}}const we=No();var Ft={exports:{}},J={};/** @license React v16.13.1
62
62
  * react-is.production.min.js
63
63
  *
64
64
  * Copyright (c) Facebook, Inc. and its affiliates.
65
65
  *
66
66
  * This source code is licensed under the MIT license found in the
67
67
  * LICENSE file in the root directory of this source tree.
68
- */var Lr;function so(){if(Lr)return $;Lr=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,h=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,d=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function P(c){if(typeof c=="object"&&c!==null){var R=c.$$typeof;switch(R){case t:switch(c=c.type,c){case p:case l:case n:case a:case i:case g:return c;default:switch(c=c&&c.$$typeof,c){case h:case u:case v:case E:case f:return c;default:return R}}case r:return R}}}function N(c){return P(c)===l}return $.AsyncMode=p,$.ConcurrentMode=l,$.ContextConsumer=h,$.ContextProvider=f,$.Element=t,$.ForwardRef=u,$.Fragment=n,$.Lazy=v,$.Memo=E,$.Portal=r,$.Profiler=a,$.StrictMode=i,$.Suspense=g,$.isAsyncMode=function(c){return N(c)||P(c)===p},$.isConcurrentMode=N,$.isContextConsumer=function(c){return P(c)===h},$.isContextProvider=function(c){return P(c)===f},$.isElement=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===t},$.isForwardRef=function(c){return P(c)===u},$.isFragment=function(c){return P(c)===n},$.isLazy=function(c){return P(c)===v},$.isMemo=function(c){return P(c)===E},$.isPortal=function(c){return P(c)===r},$.isProfiler=function(c){return P(c)===a},$.isStrictMode=function(c){return P(c)===i},$.isSuspense=function(c){return P(c)===g},$.isValidElementType=function(c){return typeof c=="string"||typeof c=="function"||c===n||c===l||c===a||c===i||c===g||c===m||typeof c=="object"&&c!==null&&(c.$$typeof===v||c.$$typeof===E||c.$$typeof===f||c.$$typeof===h||c.$$typeof===u||c.$$typeof===S||c.$$typeof===T||c.$$typeof===k||c.$$typeof===d)},$.typeOf=P,$}var F={};/** @license React v16.13.1
68
+ */var cn;function Ao(){if(cn)return J;cn=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,v=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,d=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function M(x){if(typeof x=="object"&&x!==null){var T=x.$$typeof;switch(T){case t:switch(x=x.type,x){case f:case s:case n:case a:case o:case y:return x;default:switch(x=x&&x.$$typeof,x){case c:case v:case h:case E:case l:return x;default:return T}}case r:return T}}}function A(x){return M(x)===s}return J.AsyncMode=f,J.ConcurrentMode=s,J.ContextConsumer=c,J.ContextProvider=l,J.Element=t,J.ForwardRef=v,J.Fragment=n,J.Lazy=h,J.Memo=E,J.Portal=r,J.Profiler=a,J.StrictMode=o,J.Suspense=y,J.isAsyncMode=function(x){return A(x)||M(x)===f},J.isConcurrentMode=A,J.isContextConsumer=function(x){return M(x)===c},J.isContextProvider=function(x){return M(x)===l},J.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},J.isForwardRef=function(x){return M(x)===v},J.isFragment=function(x){return M(x)===n},J.isLazy=function(x){return M(x)===h},J.isMemo=function(x){return M(x)===E},J.isPortal=function(x){return M(x)===r},J.isProfiler=function(x){return M(x)===a},J.isStrictMode=function(x){return M(x)===o},J.isSuspense=function(x){return M(x)===y},J.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===s||x===a||x===o||x===y||x===m||typeof x=="object"&&x!==null&&(x.$$typeof===h||x.$$typeof===E||x.$$typeof===l||x.$$typeof===c||x.$$typeof===v||x.$$typeof===d||x.$$typeof===C||x.$$typeof===N||x.$$typeof===b)},J.typeOf=M,J}var Z={};/** @license React v16.13.1
69
69
  * react-is.development.js
70
70
  *
71
71
  * Copyright (c) Facebook, Inc. and its affiliates.
72
72
  *
73
73
  * This source code is licensed under the MIT license found in the
74
74
  * LICENSE file in the root directory of this source tree.
75
- */var Yr;function co(){return Yr||(Yr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,h=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,d=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function P(D){return typeof D=="string"||typeof D=="function"||D===n||D===l||D===a||D===i||D===g||D===m||typeof D=="object"&&D!==null&&(D.$$typeof===v||D.$$typeof===E||D.$$typeof===f||D.$$typeof===h||D.$$typeof===u||D.$$typeof===S||D.$$typeof===T||D.$$typeof===k||D.$$typeof===d)}function N(D){if(typeof D=="object"&&D!==null){var le=D.$$typeof;switch(le){case t:var z=D.type;switch(z){case p:case l:case n:case a:case i:case g:return z;default:var de=z&&z.$$typeof;switch(de){case h:case u:case v:case E:case f:return de;default:return le}}case r:return le}}}var c=p,R=l,j=h,Y=f,Z=t,q=u,H=n,ie=v,G=E,ee=r,fe=a,Te=i,Se=g,ye=!1;function be(D){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),we(D)||N(D)===p}function we(D){return N(D)===l}function Me(D){return N(D)===h}function Le(D){return N(D)===f}function ke(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function qe(D){return N(D)===u}function Ye(D){return N(D)===n}function ge(D){return N(D)===v}function Ce(D){return N(D)===E}function _e(D){return N(D)===r}function ae(D){return N(D)===a}function se(D){return N(D)===i}function ce(D){return N(D)===g}F.AsyncMode=c,F.ConcurrentMode=R,F.ContextConsumer=j,F.ContextProvider=Y,F.Element=Z,F.ForwardRef=q,F.Fragment=H,F.Lazy=ie,F.Memo=G,F.Portal=ee,F.Profiler=fe,F.StrictMode=Te,F.Suspense=Se,F.isAsyncMode=be,F.isConcurrentMode=we,F.isContextConsumer=Me,F.isContextProvider=Le,F.isElement=ke,F.isForwardRef=qe,F.isFragment=Ye,F.isLazy=ge,F.isMemo=Ce,F.isPortal=_e,F.isProfiler=ae,F.isStrictMode=se,F.isSuspense=ce,F.isValidElementType=P,F.typeOf=N})()),F}var Vr;function lo(){return Vr||(Vr=1,process.env.NODE_ENV==="production"?Ot.exports=so():Ot.exports=co()),Ot.exports}var Kt,$r;function uo(){if($r)return Kt;$r=1;var e=lo(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=i;function f(v){return e.isMemo(v)?i:a[v.$$typeof]||t}var h=Object.defineProperty,p=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=Object.prototype;function E(v,d,S){if(typeof d!="string"){if(m){var T=g(d);T&&T!==m&&E(v,T,S)}var k=p(d);l&&(k=k.concat(l(d)));for(var P=f(v),N=f(d),c=0;c<k.length;++c){var R=k[c];if(!r[R]&&!(S&&S[R])&&!(N&&N[R])&&!(P&&P[R])){var j=u(d,R);try{h(v,R,j)}catch{}}}}return v}return Kt=E,Kt}uo();var jt={exports:{}},X={};/**
75
+ */var ln;function Io(){return ln||(ln=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,v=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,d=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function M(V){return typeof V=="string"||typeof V=="function"||V===n||V===s||V===a||V===o||V===y||V===m||typeof V=="object"&&V!==null&&(V.$$typeof===h||V.$$typeof===E||V.$$typeof===l||V.$$typeof===c||V.$$typeof===v||V.$$typeof===d||V.$$typeof===C||V.$$typeof===N||V.$$typeof===b)}function A(V){if(typeof V=="object"&&V!==null){var ve=V.$$typeof;switch(ve){case t:var F=V.type;switch(F){case f:case s:case n:case a:case o:case y:return F;default:var ye=F&&F.$$typeof;switch(ye){case c:case v:case h:case E:case l:return ye;default:return ve}}case r:return ve}}}var x=f,T=s,_=c,$=l,k=t,oe=v,ie=n,fe=h,je=E,de=r,Me=a,Be=o,ze=y,ke=!1;function Re(V){return ke||(ke=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Pe(V)||A(V)===f}function Pe(V){return A(V)===s}function We(V){return A(V)===c}function Le(V){return A(V)===l}function Ue(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function st(V){return A(V)===v}function et(V){return A(V)===n}function qe(V){return A(V)===h}function Ye(V){return A(V)===E}function xe(V){return A(V)===r}function Ve(V){return A(V)===a}function Ne(V){return A(V)===o}function Ce(V){return A(V)===y}Z.AsyncMode=x,Z.ConcurrentMode=T,Z.ContextConsumer=_,Z.ContextProvider=$,Z.Element=k,Z.ForwardRef=oe,Z.Fragment=ie,Z.Lazy=fe,Z.Memo=je,Z.Portal=de,Z.Profiler=Me,Z.StrictMode=Be,Z.Suspense=ze,Z.isAsyncMode=Re,Z.isConcurrentMode=Pe,Z.isContextConsumer=We,Z.isContextProvider=Le,Z.isElement=Ue,Z.isForwardRef=st,Z.isFragment=et,Z.isLazy=qe,Z.isMemo=Ye,Z.isPortal=xe,Z.isProfiler=Ve,Z.isStrictMode=Ne,Z.isSuspense=Ce,Z.isValidElementType=M,Z.typeOf=A})()),Z}var un;function Do(){return un||(un=1,process.env.NODE_ENV==="production"?Ft.exports=Ao():Ft.exports=Io()),Ft.exports}var dr,fn;function zo(){if(fn)return dr;fn=1;var e=Do(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=n,a[e.Memo]=o;function l(h){return e.isMemo(h)?o:a[h.$$typeof]||t}var c=Object.defineProperty,f=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,v=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,m=Object.prototype;function E(h,b,d){if(typeof b!="string"){if(m){var C=y(b);C&&C!==m&&E(h,C,d)}var N=f(b);s&&(N=N.concat(s(b)));for(var M=l(h),A=l(b),x=0;x<N.length;++x){var T=N[x];if(!r[T]&&!(d&&d[T])&&!(A&&A[T])&&!(M&&M[T])){var _=v(b,T);try{c(h,T,_)}catch{}}}}return h}return dr=E,dr}zo();var Xt={exports:{}},Q={};/**
76
76
  * @license React
77
77
  * react-is.production.min.js
78
78
  *
@@ -80,7 +80,7 @@ Selectors that return the entire state are almost certainly a mistake, as they w
80
80
  *
81
81
  * This source code is licensed under the MIT license found in the
82
82
  * LICENSE file in the root directory of this source tree.
83
- */var Fr;function fo(){if(Fr)return X;Fr=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function d(S){if(typeof S=="object"&&S!==null){var T=S.$$typeof;switch(T){case e:switch(S=S.type,S){case r:case i:case n:case l:case u:return S;default:switch(S=S&&S.$$typeof,S){case h:case f:case p:case m:case g:case a:return S;default:return T}}case t:return T}}}return X.ContextConsumer=f,X.ContextProvider=a,X.Element=e,X.ForwardRef=p,X.Fragment=r,X.Lazy=m,X.Memo=g,X.Portal=t,X.Profiler=i,X.StrictMode=n,X.Suspense=l,X.SuspenseList=u,X.isAsyncMode=function(){return!1},X.isConcurrentMode=function(){return!1},X.isContextConsumer=function(S){return d(S)===f},X.isContextProvider=function(S){return d(S)===a},X.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},X.isForwardRef=function(S){return d(S)===p},X.isFragment=function(S){return d(S)===r},X.isLazy=function(S){return d(S)===m},X.isMemo=function(S){return d(S)===g},X.isPortal=function(S){return d(S)===t},X.isProfiler=function(S){return d(S)===i},X.isStrictMode=function(S){return d(S)===n},X.isSuspense=function(S){return d(S)===l},X.isSuspenseList=function(S){return d(S)===u},X.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===i||S===n||S===l||S===u||S===E||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===g||S.$$typeof===a||S.$$typeof===f||S.$$typeof===p||S.$$typeof===v||S.getModuleId!==void 0)},X.typeOf=d,X}var B={};/**
83
+ */var dn;function Wo(){if(dn)return Q;dn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),h;h=Symbol.for("react.module.reference");function b(d){if(typeof d=="object"&&d!==null){var C=d.$$typeof;switch(C){case e:switch(d=d.type,d){case r:case o:case n:case s:case v:return d;default:switch(d=d&&d.$$typeof,d){case c:case l:case f:case m:case y:case a:return d;default:return C}}case t:return C}}}return Q.ContextConsumer=l,Q.ContextProvider=a,Q.Element=e,Q.ForwardRef=f,Q.Fragment=r,Q.Lazy=m,Q.Memo=y,Q.Portal=t,Q.Profiler=o,Q.StrictMode=n,Q.Suspense=s,Q.SuspenseList=v,Q.isAsyncMode=function(){return!1},Q.isConcurrentMode=function(){return!1},Q.isContextConsumer=function(d){return b(d)===l},Q.isContextProvider=function(d){return b(d)===a},Q.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===e},Q.isForwardRef=function(d){return b(d)===f},Q.isFragment=function(d){return b(d)===r},Q.isLazy=function(d){return b(d)===m},Q.isMemo=function(d){return b(d)===y},Q.isPortal=function(d){return b(d)===t},Q.isProfiler=function(d){return b(d)===o},Q.isStrictMode=function(d){return b(d)===n},Q.isSuspense=function(d){return b(d)===s},Q.isSuspenseList=function(d){return b(d)===v},Q.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===r||d===o||d===n||d===s||d===v||d===E||typeof d=="object"&&d!==null&&(d.$$typeof===m||d.$$typeof===y||d.$$typeof===a||d.$$typeof===l||d.$$typeof===f||d.$$typeof===h||d.getModuleId!==void 0)},Q.typeOf=b,Q}var ee={};/**
84
84
  * @license React
85
85
  * react-is.development.js
86
86
  *
@@ -88,12 +88,13 @@ Selectors that return the entire state are almost certainly a mistake, as they w
88
88
  *
89
89
  * This source code is licensed under the MIT license found in the
90
90
  * LICENSE file in the root directory of this source tree.
91
- */var Xr;function ho(){return Xr||(Xr=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),v=!1,d=!1,S=!1,T=!1,k=!1,P;P=Symbol.for("react.module.reference");function N(z){return!!(typeof z=="string"||typeof z=="function"||z===r||z===i||k||z===n||z===l||z===u||T||z===E||v||d||S||typeof z=="object"&&z!==null&&(z.$$typeof===m||z.$$typeof===g||z.$$typeof===a||z.$$typeof===f||z.$$typeof===p||z.$$typeof===P||z.getModuleId!==void 0))}function c(z){if(typeof z=="object"&&z!==null){var de=z.$$typeof;switch(de){case e:var he=z.type;switch(he){case r:case i:case n:case l:case u:return he;default:var Ve=he&&he.$$typeof;switch(Ve){case h:case f:case p:case m:case g:case a:return Ve;default:return de}}case t:return de}}}var R=f,j=a,Y=e,Z=p,q=r,H=m,ie=g,G=t,ee=i,fe=n,Te=l,Se=u,ye=!1,be=!1;function we(z){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Me(z){return be||(be=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Le(z){return c(z)===f}function ke(z){return c(z)===a}function qe(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Ye(z){return c(z)===p}function ge(z){return c(z)===r}function Ce(z){return c(z)===m}function _e(z){return c(z)===g}function ae(z){return c(z)===t}function se(z){return c(z)===i}function ce(z){return c(z)===n}function D(z){return c(z)===l}function le(z){return c(z)===u}B.ContextConsumer=R,B.ContextProvider=j,B.Element=Y,B.ForwardRef=Z,B.Fragment=q,B.Lazy=H,B.Memo=ie,B.Portal=G,B.Profiler=ee,B.StrictMode=fe,B.Suspense=Te,B.SuspenseList=Se,B.isAsyncMode=we,B.isConcurrentMode=Me,B.isContextConsumer=Le,B.isContextProvider=ke,B.isElement=qe,B.isForwardRef=Ye,B.isFragment=ge,B.isLazy=Ce,B.isMemo=_e,B.isPortal=ae,B.isProfiler=se,B.isStrictMode=ce,B.isSuspense=D,B.isSuspenseList=le,B.isValidElementType=N,B.typeOf=c})()),B}var Br;function po(){return Br||(Br=1,process.env.NODE_ENV==="production"?jt.exports=fo():jt.exports=ho()),jt.exports}po();function vo(){const e=ro();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){let n=[],i=t;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!i||t===null||(i=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}const Ur={notify(){},get:()=>[]};function yo(e,t){let r,n=Ur,i=0,a=!1;function f(d){u();const S=n.subscribe(d);let T=!1;return()=>{T||(T=!0,S(),g())}}function h(){n.notify()}function p(){v.onStateChange&&v.onStateChange()}function l(){return a}function u(){i++,r||(r=e.subscribe(p),n=vo())}function g(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=Ur)}function m(){a||(a=!0,u())}function E(){a&&(a=!1,g())}const v={addNestedSub:f,notifyNestedSubs:h,handleChangeWrapper:p,isSubscribed:l,trySubscribe:m,tryUnsubscribe:E,getListeners:()=>n};return v}const go=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Oe.useLayoutEffect:Oe.useEffect;function mo({store:e,context:t,children:r,serverState:n,stabilityCheck:i="once",noopCheck:a="once"}){const f=Oe.useMemo(()=>{const l=yo(e);return{store:e,subscription:l,getServerState:n?()=>n:void 0,stabilityCheck:i,noopCheck:a}},[e,n,i,a]),h=Oe.useMemo(()=>e.getState(),[e]);go(()=>{const{subscription:l}=f;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),h!==e.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[f,h]);const p=t||Ne;return Oe.createElement(p.Provider,{value:f},r)}function qr(e=Ne){const t=e===Ne?zr:Gt(e);return function(){const{store:n}=t();return n}}const bo=qr();function wo(e=Ne){const t=e===Ne?bo:qr(e);return function(){return t().dispatch}}const Jt=wo();oo(Qn.useSyncExternalStoreWithSelector),to(Fn.unstable_batchedUpdates);const xo={en:{pointer:"Pointer",text:"Text",image:"Image",pencil:"Pencil",rectangle:"Rectangle",circle:"Circle",eraser:"Eraser",fitToView:"Fit to view",exportAsPng:"Export as PNG",moreShapes:"More Shapes",triangle:"Triangle",diamond:"Diamond",star:"Star",heart:"Heart",hexagon:"Hexagon",octagon:"Octagon",arrow:"Arrow",fontSize:"Font Size",fontColor:"Font Color",layerOrder:"Layer Order",bringToFront:"Bring to Front",sendToBack:"Send to Back",brushColor:"Brush Color",brushSize:"Brush Size",strokeColor:"Stroke Color",fillColor:"Fill Color",strokeWidth:"Stroke Width",language:"Language",english:"English",turkish:"Turkish"},tr:{pointer:"İşaretΓ§i",text:"Metin",image:"Resim",pencil:"Kalem",rectangle:"DikdΓΆrtgen",circle:"Daire",eraser:"Silgi",fitToView:"Ekrana sığdΔ±r",exportAsPng:"PNG olarak dışa aktar",moreShapes:"Daha Fazla Şekil",triangle:"Üçgen",diamond:"Elmas",star:"YΔ±ldΔ±z",heart:"Kalp",hexagon:"AltΔ±gen",octagon:"Sekizgen",arrow:"Ok",fontSize:"YazΔ± Boyutu",fontColor:"YazΔ± Rengi",layerOrder:"Katman SΔ±rasΔ±",bringToFront:"Γ–ne Getir",sendToBack:"Arkaya GΓΆnder",brushColor:"FΔ±rΓ§a Rengi",brushSize:"FΔ±rΓ§a Boyutu",strokeColor:"Γ‡izgi Rengi",fillColor:"Dolgu Rengi",strokeWidth:"Γ‡izgi KalΔ±nlığı",language:"Dil",english:"Δ°ngilizce",turkish:"TΓΌrkΓ§e"}},Hr=M.createContext(),Gr="whiteboard-language",Eo=()=>(navigator.language||navigator.userLanguage).startsWith("tr")?"tr":"en",So=()=>{const e=localStorage.getItem(Gr);return e&&(e==="en"||e==="tr")?e:Eo()},Co=({children:e})=>{const[t,r]=M.useState(So);M.useEffect(()=>{localStorage.setItem(Gr,t)},[t]);const n=a=>xo[t][a]||a,i=a=>{(a==="en"||a==="tr")&&r(a)};return w.jsx(Hr.Provider,{value:{language:t,t:n,changeLanguage:i},children:e})},Kr=()=>{const e=M.useContext(Hr);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function te(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(process.env.NODE_ENV!=="production"){var i=No[e],a=i?typeof i=="function"?i.apply(null,r):i:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(f){return"'"+f+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ae(e){return!!e&&!!e[K]}function je(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Ao})(e)||Array.isArray(e)||!!e[sn]||!!(!((t=e.constructor)===null||t===void 0)&&t[sn])||Zt(e)||Qt(e))}function Xe(e,t,r){r===void 0&&(r=!1),tt(e)===0?(r?Object.keys:ot)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function tt(e){var t=e[K];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Zt(e)?2:Qt(e)?3:0}function rt(e,t){return tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _o(e,t){return tt(e)===2?e.get(t):e[t]}function Jr(e,t,r){var n=tt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Zr(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Zt(e){return ko&&e instanceof Map}function Qt(e){return Ro&&e instanceof Set}function Ie(e){return e.o||e.t}function er(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=cn(e);delete t[K];for(var r=ot(t),n=0;n<r.length;n++){var i=r[n],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function tr(e,t){return t===void 0&&(t=!1),rr(e)||Ae(e)||!je(e)||(tt(e)>1&&(e.set=e.add=e.clear=e.delete=Oo),Object.freeze(e),t&&Xe(e,(function(r,n){return tr(n,!0)}),!0)),e}function Oo(){te(2)}function rr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ee(e){var t=fr[e];return t||te(18,e),t}function jo(e,t){fr[e]||(fr[e]=t)}function nr(){return process.env.NODE_ENV==="production"||nt||te(0),nt}function or(e,t){t&&(Ee("Patches"),e.u=[],e.s=[],e.v=t)}function Pt(e){ir(e),e.p.forEach(Po),e.p=null}function ir(e){e===nt&&(nt=e.l)}function Qr(e){return nt={p:[],l:nt,h:e,m:!0,_:0}}function Po(e){var t=e[K];t.i===0||t.i===1?t.j():t.g=!0}function ar(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||Ee("ES5").S(t,e,n),n?(r[K].P&&(Pt(t),te(4)),je(e)&&(e=Tt(t,e),t.l||Mt(t,e)),t.u&&Ee("Patches").M(r[K].t,e,t.u,t.s)):e=Tt(t,r,[]),Pt(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Tt(e,t,r){if(rr(t))return t;var n=t[K];if(!n)return Xe(t,(function(h,p){return en(e,n,t,h,p,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return Mt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=er(n.k):n.o,a=i,f=!1;n.i===3&&(a=new Set(i),i.clear(),f=!0),Xe(a,(function(h,p){return en(e,n,i,h,p,r,f)})),Mt(e,i,!1),r&&e.u&&Ee("Patches").N(n,r,e.u,e.s)}return n.o}function en(e,t,r,n,i,a,f){if(process.env.NODE_ENV!=="production"&&i===r&&te(5),Ae(i)){var h=Tt(e,i,a&&t&&t.i!==3&&!rt(t.R,n)?a.concat(n):void 0);if(Jr(r,n,h),!Ae(h))return;e.m=!1}else f&&r.add(i);if(je(i)&&!rr(i)){if(!e.h.D&&e._<1)return;Tt(e,i),t&&t.A.l||Mt(e,i)}}function Mt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&tr(t,r)}function sr(e,t){var r=e[K];return(r?Ie(r):e)[t]}function tn(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function De(e){e.P||(e.P=!0,e.l&&De(e.l))}function cr(e){e.o||(e.o=er(e.t))}function lr(e,t,r){var n=Zt(t)?Ee("MapSet").F(t,r):Qt(t)?Ee("MapSet").T(t,r):e.O?(function(i,a){var f=Array.isArray(i),h={i:f?1:0,A:a?a.A:nr(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=h,l=pt;f&&(p=[h],l=vt);var u=Proxy.revocable(p,l),g=u.revoke,m=u.proxy;return h.k=m,h.j=g,m})(t,r):Ee("ES5").J(t,r);return(r?r.A:nr()).p.push(n),n}function To(e){return Ae(e)||te(22,e),(function t(r){if(!je(r))return r;var n,i=r[K],a=tt(r);if(i){if(!i.P&&(i.i<4||!Ee("ES5").K(i)))return i.t;i.I=!0,n=rn(r,a),i.I=!1}else n=rn(r,a);return Xe(n,(function(f,h){i&&_o(i.t,f)===h||Jr(n,f,t(h))})),a===3?new Set(n):n})(e)}function rn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return er(e)}function Mo(){function e(f,h){var p=a[f];return p?p.enumerable=h:a[f]=p={configurable:!0,enumerable:h,get:function(){var l=this[K];return process.env.NODE_ENV!=="production"&&i(l),pt.get(l,f)},set:function(l){var u=this[K];process.env.NODE_ENV!=="production"&&i(u),pt.set(u,f,l)}},p}function t(f){for(var h=f.length-1;h>=0;h--){var p=f[h][K];if(!p.P)switch(p.i){case 5:n(p)&&De(p);break;case 4:r(p)&&De(p)}}}function r(f){for(var h=f.t,p=f.k,l=ot(p),u=l.length-1;u>=0;u--){var g=l[u];if(g!==K){var m=h[g];if(m===void 0&&!rt(h,g))return!0;var E=p[g],v=E&&E[K];if(v?v.t!==m:!Zr(E,m))return!0}}var d=!!h[K];return l.length!==ot(h).length+(d?0:1)}function n(f){var h=f.k;if(h.length!==f.t.length)return!0;var p=Object.getOwnPropertyDescriptor(h,h.length-1);if(p&&!p.get)return!0;for(var l=0;l<h.length;l++)if(!h.hasOwnProperty(l))return!0;return!1}function i(f){f.g&&te(3,JSON.stringify(Ie(f)))}var a={};jo("ES5",{J:function(f,h){var p=Array.isArray(f),l=(function(g,m){if(g){for(var E=Array(m.length),v=0;v<m.length;v++)Object.defineProperty(E,""+v,e(v,!0));return E}var d=cn(m);delete d[K];for(var S=ot(d),T=0;T<S.length;T++){var k=S[T];d[k]=e(k,g||!!d[k].enumerable)}return Object.create(Object.getPrototypeOf(m),d)})(p,f),u={i:p?5:4,A:h?h.A:nr(),P:!1,I:!1,R:{},l:h,t:f,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,K,{value:u,writable:!0}),l},S:function(f,h,p){p?Ae(h)&&h[K].A===f&&t(f.p):(f.u&&(function l(u){if(u&&typeof u=="object"){var g=u[K];if(g){var m=g.t,E=g.k,v=g.R,d=g.i;if(d===4)Xe(E,(function(N){N!==K&&(m[N]!==void 0||rt(m,N)?v[N]||l(E[N]):(v[N]=!0,De(g)))})),Xe(m,(function(N){E[N]!==void 0||rt(E,N)||(v[N]=!1,De(g))}));else if(d===5){if(n(g)&&(De(g),v.length=!0),E.length<m.length)for(var S=E.length;S<m.length;S++)v[S]=!1;else for(var T=m.length;T<E.length;T++)v[T]=!0;for(var k=Math.min(E.length,m.length),P=0;P<k;P++)E.hasOwnProperty(P)||(v[P]=!0),v[P]===void 0&&l(E[P])}}}})(f.p[0]),t(f.p))},K:function(f){return f.i===4?r(f):n(f)}})}var nn,nt,ur=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ko=typeof Map<"u",Ro=typeof Set<"u",on=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",an=ur?Symbol.for("immer-nothing"):((nn={})["immer-nothing"]=!0,nn),sn=ur?Symbol.for("immer-draftable"):"__$immer_draftable",K=ur?Symbol.for("immer-state"):"__$immer_state",No={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Ao=""+Object.prototype.constructor,ot=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,cn=Object.getOwnPropertyDescriptors||function(e){var t={};return ot(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},fr={},pt={get:function(e,t){if(t===K)return e;var r=Ie(e);if(!rt(r,t))return(function(i,a,f){var h,p=tn(a,f);return p?"value"in p?p.value:(h=p.get)===null||h===void 0?void 0:h.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!je(n)?n:n===sr(e.t,t)?(cr(e),e.o[t]=lr(e.A.h,n,e)):n},has:function(e,t){return t in Ie(e)},ownKeys:function(e){return Reflect.ownKeys(Ie(e))},set:function(e,t,r){var n=tn(Ie(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=sr(Ie(e),t),a=i==null?void 0:i[K];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Zr(r,i)&&(r!==void 0||rt(e.t,t)))return!0;cr(e),De(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return sr(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,cr(e),De(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Ie(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){te(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){te(12)}},vt={};Xe(pt,(function(e,t){vt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),vt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&te(13),vt.set.call(this,e,t,void 0)},vt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&te(14),pt.set.call(this,e[0],t,r,e[0])};var Io=(function(){function e(r){var n=this;this.O=on,this.D=!0,this.produce=function(i,a,f){if(typeof i=="function"&&typeof a!="function"){var h=a;a=i;var p=n;return function(d){var S=this;d===void 0&&(d=h);for(var T=arguments.length,k=Array(T>1?T-1:0),P=1;P<T;P++)k[P-1]=arguments[P];return p.produce(d,(function(N){var c;return(c=a).call.apply(c,[S,N].concat(k))}))}}var l;if(typeof a!="function"&&te(6),f!==void 0&&typeof f!="function"&&te(7),je(i)){var u=Qr(n),g=lr(n,i,void 0),m=!0;try{l=a(g),m=!1}finally{m?Pt(u):ir(u)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(d){return or(u,f),ar(d,u)}),(function(d){throw Pt(u),d})):(or(u,f),ar(l,u))}if(!i||typeof i!="object"){if((l=a(i))===void 0&&(l=i),l===an&&(l=void 0),n.D&&tr(l,!0),f){var E=[],v=[];Ee("Patches").M(i,l,E,v),f(E,v)}return l}te(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(l){for(var u=arguments.length,g=Array(u>1?u-1:0),m=1;m<u;m++)g[m-1]=arguments[m];return n.produceWithPatches(l,(function(E){return i.apply(void 0,[E].concat(g))}))};var f,h,p=n.produce(i,a,(function(l,u){f=l,h=u}));return typeof Promise<"u"&&p instanceof Promise?p.then((function(l){return[l,f,h]})):[p,f,h]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){je(r)||te(8),Ae(r)&&(r=To(r));var n=Qr(this),i=lr(this,r,void 0);return i[K].C=!0,ir(n),i},t.finishDraft=function(r,n){var i=r&&r[K];process.env.NODE_ENV!=="production"&&(i&&i.C||te(9),i.I&&te(10));var a=i.A;return or(a,n),ar(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!on&&te(20),this.O=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var f=Ee("Patches").$;return Ae(r)?f(r,n):this.produce(r,(function(h){return f(h,n)}))},e})(),ue=new Io,ln=ue.produce;ue.produceWithPatches.bind(ue),ue.setAutoFreeze.bind(ue),ue.setUseProxies.bind(ue),ue.applyPatches.bind(ue),ue.createDraft.bind(ue),ue.finishDraft.bind(ue);function yt(e){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}function Do(e,t){if(yt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zo(e){var t=Do(e,"string");return yt(t)=="symbol"?t:t+""}function Wo(e,t,r){return(t=zo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?un(Object(r),!0).forEach(function(n){Wo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ne(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var dn=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),dr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Be={INIT:"@@redux/INIT"+dr(),REPLACE:"@@redux/REPLACE"+dr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+dr()}};function hn(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Lo(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($o(e))return"date";if(Vo(e))return"error";var r=Yo(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Yo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Vo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $o(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ue(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Lo(e)),t}function pn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ne(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?ne(1):"Expected the enhancer to be a function. Instead, received: '"+Ue(r)+"'");return r(pn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ne(2):"Expected the root reducer to be a function. Instead, received: '"+Ue(e)+"'");var i=e,a=t,f=[],h=f,p=!1;function l(){h===f&&(h=f.slice())}function u(){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function g(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(4):"Expected the listener to be a function. Instead, received: '"+Ue(d)+"'");if(p)throw new Error(process.env.NODE_ENV==="production"?ne(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var S=!0;return l(),h.push(d),function(){if(S){if(p)throw new Error(process.env.NODE_ENV==="production"?ne(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,l();var k=h.indexOf(d);h.splice(k,1),f=null}}}function m(d){if(!hn(d))throw new Error(process.env.NODE_ENV==="production"?ne(7):"Actions must be plain objects. Instead, the actual type was: '"+Ue(d)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof d.type>"u")throw new Error(process.env.NODE_ENV==="production"?ne(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(p)throw new Error(process.env.NODE_ENV==="production"?ne(9):"Reducers may not dispatch actions.");try{p=!0,a=i(a,d)}finally{p=!1}for(var S=f=h,T=0;T<S.length;T++){var k=S[T];k()}return d}function E(d){if(typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?ne(10):"Expected the nextReducer to be a function. Instead, received: '"+Ue(d));i=d,m({type:Be.REPLACE})}function v(){var d,S=g;return d={subscribe:function(k){if(typeof k!="object"||k===null)throw new Error(process.env.NODE_ENV==="production"?ne(11):"Expected the observer to be an object. Instead, received: '"+Ue(k)+"'");function P(){k.next&&k.next(u())}P();var N=S(P);return{unsubscribe:N}}},d[dn]=function(){return this},d}return m({type:Be.INIT}),n={dispatch:m,subscribe:g,getState:u,replaceReducer:E},n[dn]=v,n}function vn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Fo(e,t,r,n){var i=Object.keys(t),a=r&&r.type===Be.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!hn(e))return"The "+a+' has unexpected type of "'+Ue(e)+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var f=Object.keys(e).filter(function(h){return!t.hasOwnProperty(h)&&!n[h]});if(f.forEach(function(h){n[h]=!0}),!(r&&r.type===Be.REPLACE)&&f.length>0)return"Unexpected "+(f.length>1?"keys":"key")+" "+('"'+f.join('", "')+'" found in '+a+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.')}function Xo(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Be.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?ne(12):'The slice reducer for key "'+t+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Be.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ne(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Be.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function Bo(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&vn('No reducer provided for key "'+i+'"'),typeof e[i]=="function"&&(r[i]=e[i])}var a=Object.keys(r),f;process.env.NODE_ENV!=="production"&&(f={});var h;try{Xo(r)}catch(p){h=p}return function(l,u){if(l===void 0&&(l={}),h)throw h;if(process.env.NODE_ENV!=="production"){var g=Fo(l,r,u,f);g&&vn(g)}for(var m=!1,E={},v=0;v<a.length;v++){var d=a[v],S=r[d],T=l[d],k=S(T,u);if(typeof k>"u"){var P=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?ne(14):"When called with an action of type "+(P?'"'+String(P)+'"':"(unknown type)")+', the slice reducer for key "'+d+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}E[d]=k,m=m||k!==T}return m=m||a.length!==Object.keys(l).length,m?E:l}}function kt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function Uo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?ne(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},f={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},h=t.map(function(p){return p(f)});return a=kt.apply(void 0,h)(i.dispatch),fn(fn({},i),{},{dispatch:a})}}}function yn(e){var t=function(n){var i=n.dispatch,a=n.getState;return function(f){return function(h){return typeof h=="function"?h(i,a,e):f(h)}}};return t}var hr=yn();hr.withExtraArgument=yn;var gn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),qo=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(l){return function(u){return p([l,u])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},it=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Ho=Object.defineProperty,Go=Object.defineProperties,Ko=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,bn=function(e,t,r){return t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},ze=function(e,t){for(var r in t||(t={}))Jo.call(t,r)&&bn(e,r,t[r]);if(mn)for(var n=0,i=mn(t);n<i.length;n++){var r=i[n];Zo.call(t,r)&&bn(e,r,t[r])}return e},pr=function(e,t){return Go(e,Ko(t))},Qo=function(e,t,r){return new Promise(function(n,i){var a=function(p){try{h(r.next(p))}catch(l){i(l)}},f=function(p){try{h(r.throw(p))}catch(l){i(l)}},h=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,f)};h((r=r.apply(e,t)).next())})},ei=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kt:kt.apply(null,arguments)};function wn(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}var ti=function(e){return e&&typeof e.match=="function"};function We(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var a=t.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ze(ze({type:e,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function ri(e){return typeof e=="function"&&"type"in e&&ti(e)}function ni(e){var t=e?(""+e).split("/"):[],r=t[t.length-1]||"actionCreator";return'Detected an action creator with type "'+(e||"unknown")+`" being dispatched.
92
- Make sure you're calling the action creator before dispatching, i.e. \`dispatch(`+r+"())` instead of `dispatch("+r+")`. This is necessary even if the action has no payload."}function oi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(n){return function(i){return n(i)}}};var t=e.isActionCreator,r=t===void 0?ri:t;return function(){return function(n){return function(i){return r(i)&&console.warn(ni(i.type)),n(i)}}}}function xn(e,t){var r=0;return{measureTime:function(n){var i=Date.now();try{return n()}finally{var a=Date.now();r+=a-i}},warnIfExceeded:function(){r>e&&console.warn(t+" took "+r+"ms, which is more than the warning threshold of "+e+`ms.
91
+ */var hn;function Lo(){return hn||(hn=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),h=!1,b=!1,d=!1,C=!1,N=!1,M;M=Symbol.for("react.module.reference");function A(F){return!!(typeof F=="string"||typeof F=="function"||F===r||F===o||N||F===n||F===s||F===v||C||F===E||h||b||d||typeof F=="object"&&F!==null&&(F.$$typeof===m||F.$$typeof===y||F.$$typeof===a||F.$$typeof===l||F.$$typeof===f||F.$$typeof===M||F.getModuleId!==void 0))}function x(F){if(typeof F=="object"&&F!==null){var ye=F.$$typeof;switch(ye){case e:var _e=F.type;switch(_e){case r:case o:case n:case s:case v:return _e;default:var ct=_e&&_e.$$typeof;switch(ct){case c:case l:case f:case m:case y:case a:return ct;default:return ye}}case t:return ye}}}var T=l,_=a,$=e,k=f,oe=r,ie=m,fe=y,je=t,de=o,Me=n,Be=s,ze=v,ke=!1,Re=!1;function Pe(F){return ke||(ke=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function We(F){return Re||(Re=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Le(F){return x(F)===l}function Ue(F){return x(F)===a}function st(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function et(F){return x(F)===f}function qe(F){return x(F)===r}function Ye(F){return x(F)===m}function xe(F){return x(F)===y}function Ve(F){return x(F)===t}function Ne(F){return x(F)===o}function Ce(F){return x(F)===n}function V(F){return x(F)===s}function ve(F){return x(F)===v}ee.ContextConsumer=T,ee.ContextProvider=_,ee.Element=$,ee.ForwardRef=k,ee.Fragment=oe,ee.Lazy=ie,ee.Memo=fe,ee.Portal=je,ee.Profiler=de,ee.StrictMode=Me,ee.Suspense=Be,ee.SuspenseList=ze,ee.isAsyncMode=Pe,ee.isConcurrentMode=We,ee.isContextConsumer=Le,ee.isContextProvider=Ue,ee.isElement=st,ee.isForwardRef=et,ee.isFragment=qe,ee.isLazy=Ye,ee.isMemo=xe,ee.isPortal=Ve,ee.isProfiler=Ne,ee.isStrictMode=Ce,ee.isSuspense=V,ee.isSuspenseList=ve,ee.isValidElementType=A,ee.typeOf=x})()),ee}var pn;function Yo(){return pn||(pn=1,process.env.NODE_ENV==="production"?Xt.exports=Wo():Xt.exports=Lo()),Xt.exports}Yo();function Vo(){const e=To();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){let n=[],o=t;for(;o;)n.push(o),o=o.next;return n},subscribe(n){let o=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!o||t===null||(o=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}const vn={notify(){},get:()=>[]};function $o(e,t){let r,n=vn,o=0,a=!1;function l(b){v();const d=n.subscribe(b);let C=!1;return()=>{C||(C=!0,d(),y())}}function c(){n.notify()}function f(){h.onStateChange&&h.onStateChange()}function s(){return a}function v(){o++,r||(r=e.subscribe(f),n=Vo())}function y(){o--,r&&o===0&&(r(),r=void 0,n.clear(),n=vn)}function m(){a||(a=!0,v())}function E(){a&&(a=!1,y())}const h={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:s,trySubscribe:m,tryUnsubscribe:E,getListeners:()=>n};return h}const Fo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?$e.useLayoutEffect:$e.useEffect;function Xo({store:e,context:t,children:r,serverState:n,stabilityCheck:o="once",noopCheck:a="once"}){const l=$e.useMemo(()=>{const s=$o(e);return{store:e,subscription:s,getServerState:n?()=>n:void 0,stabilityCheck:o,noopCheck:a}},[e,n,o,a]),c=$e.useMemo(()=>e.getState(),[e]);Fo(()=>{const{subscription:s}=l;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),c!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[l,c]);const f=t||He;return $e.createElement(f.Provider,{value:l},r)}function yn(e=He){const t=e===He?an:fr(e);return function(){const{store:n}=t();return n}}const mn=yn();function Bo(e=He){const t=e===He?mn:yn(e);return function(){return t().dispatch}}const hr=Bo();ko(Oo.useSyncExternalStoreWithSelector),Po(yo.unstable_batchedUpdates);const Uo={en:{pointer:"Pointer",text:"Text",image:"Image",pencil:"Pencil",rectangle:"Rectangle",circle:"Circle",eraser:"Eraser",fitToView:"Fit to view",exportAsPng:"Export as PNG",moreShapes:"More Shapes",triangle:"Triangle",diamond:"Diamond",star:"Star",heart:"Heart",hexagon:"Hexagon",octagon:"Octagon",arrow:"Arrow",fontSize:"Font Size",fontColor:"Font Color",layerOrder:"Layer Order",bringToFront:"Bring to Front",sendToBack:"Send to Back",brushColor:"Brush Color",brushSize:"Brush Size",strokeColor:"Stroke Color",fillColor:"Fill Color",strokeWidth:"Stroke Width",language:"Language",english:"English",turkish:"Turkish"},tr:{pointer:"İşaretΓ§i",text:"Metin",image:"Resim",pencil:"Kalem",rectangle:"DikdΓΆrtgen",circle:"Daire",eraser:"Silgi",fitToView:"Ekrana sığdΔ±r",exportAsPng:"PNG olarak dışa aktar",moreShapes:"Daha Fazla Şekil",triangle:"Üçgen",diamond:"Elmas",star:"YΔ±ldΔ±z",heart:"Kalp",hexagon:"AltΔ±gen",octagon:"Sekizgen",arrow:"Ok",fontSize:"YazΔ± Boyutu",fontColor:"YazΔ± Rengi",layerOrder:"Katman SΔ±rasΔ±",bringToFront:"Γ–ne Getir",sendToBack:"Arkaya GΓΆnder",brushColor:"FΔ±rΓ§a Rengi",brushSize:"FΔ±rΓ§a Boyutu",strokeColor:"Γ‡izgi Rengi",fillColor:"Dolgu Rengi",strokeWidth:"Γ‡izgi KalΔ±nlığı",language:"Dil",english:"Δ°ngilizce",turkish:"TΓΌrkΓ§e"}},gn=P.createContext(void 0),bn="whiteboard-language",qo=()=>{const e=navigator.language;return e&&e.startsWith("tr")?"tr":"en"},Ho=()=>{const e=localStorage.getItem(bn);return e&&(e==="en"||e==="tr")?e:qo()},Go=({children:e})=>{const[t,r]=P.useState(Ho);P.useEffect(()=>{localStorage.setItem(bn,t)},[t]);const n=a=>Uo[t][a]||a,o=a=>{r(a)};return g.jsx(gn.Provider,{value:{language:t,t:n,changeLanguage:o},children:e})},wn=()=>{const e=P.useContext(gn);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function pe(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(process.env.NODE_ENV!=="production"){var o=oi[e],a=o?typeof o=="function"?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(l){return"'"+l+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ge(e){return!!e&&!!e[se]}function Fe(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var o=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===ii})(e)||Array.isArray(e)||!!e[Mn]||!!(!((t=e.constructor)===null||t===void 0)&&t[Mn])||pr(e)||vr(e))}function nt(e,t,r){r===void 0&&(r=!1),gt(e)===0?(r?Object.keys:xt)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,o){return t(o,n,e)}))}function gt(e){var t=e[se];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:pr(e)?2:vr(e)?3:0}function bt(e,t){return gt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ko(e,t){return gt(e)===2?e.get(t):e[t]}function xn(e,t,r){var n=gt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function En(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function pr(e){return ri&&e instanceof Map}function vr(e){return ni&&e instanceof Set}function Ke(e){return e.o||e.t}function yr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=kn(e);delete t[se];for(var r=xt(t),n=0;n<r.length;n++){var o=r[n],a=t[o];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function mr(e,t){return t===void 0&&(t=!1),gr(e)||Ge(e)||!Fe(e)||(gt(e)>1&&(e.set=e.add=e.clear=e.delete=Jo),Object.freeze(e),t&&nt(e,(function(r,n){return mr(n,!0)}),!0)),e}function Jo(){pe(2)}function gr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function De(e){var t=jr[e];return t||pe(18,e),t}function Zo(e,t){jr[e]||(jr[e]=t)}function br(){return process.env.NODE_ENV==="production"||wt||pe(0),wt}function wr(e,t){t&&(De("Patches"),e.u=[],e.s=[],e.v=t)}function Bt(e){xr(e),e.p.forEach(Qo),e.p=null}function xr(e){e===wt&&(wt=e.l)}function Sn(e){return wt={p:[],l:wt,h:e,m:!0,_:0}}function Qo(e){var t=e[se];t.i===0||t.i===1?t.j():t.g=!0}function Er(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||De("ES5").S(t,e,n),n?(r[se].P&&(Bt(t),pe(4)),Fe(e)&&(e=Ut(t,e),t.l||qt(t,e)),t.u&&De("Patches").M(r[se].t,e,t.u,t.s)):e=Ut(t,r,[]),Bt(t),t.u&&t.v(t.u,t.s),e!==Tn?e:void 0}function Ut(e,t,r){if(gr(t))return t;var n=t[se];if(!n)return nt(t,(function(c,f){return Cn(e,n,t,c,f,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return qt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=n.i===4||n.i===5?n.o=yr(n.k):n.o,a=o,l=!1;n.i===3&&(a=new Set(o),o.clear(),l=!0),nt(a,(function(c,f){return Cn(e,n,o,c,f,r,l)})),qt(e,o,!1),r&&e.u&&De("Patches").N(n,r,e.u,e.s)}return n.o}function Cn(e,t,r,n,o,a,l){if(process.env.NODE_ENV!=="production"&&o===r&&pe(5),Ge(o)){var c=Ut(e,o,a&&t&&t.i!==3&&!bt(t.R,n)?a.concat(n):void 0);if(xn(r,n,c),!Ge(c))return;e.m=!1}else l&&r.add(o);if(Fe(o)&&!gr(o)){if(!e.h.D&&e._<1)return;Ut(e,o),t&&t.A.l||qt(e,o)}}function qt(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&mr(t,r)}function Sr(e,t){var r=e[se];return(r?Ke(r):e)[t]}function _n(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Je(e){e.P||(e.P=!0,e.l&&Je(e.l))}function Cr(e){e.o||(e.o=yr(e.t))}function _r(e,t,r){var n=pr(t)?De("MapSet").F(t,r):vr(t)?De("MapSet").T(t,r):e.O?(function(o,a){var l=Array.isArray(o),c={i:l?1:0,A:a?a.A:br(),P:!1,I:!1,R:{},l:a,t:o,k:null,o:null,j:null,C:!1},f=c,s=Rt;l&&(f=[c],s=Nt);var v=Proxy.revocable(f,s),y=v.revoke,m=v.proxy;return c.k=m,c.j=y,m})(t,r):De("ES5").J(t,r);return(r?r.A:br()).p.push(n),n}function ei(e){return Ge(e)||pe(22,e),(function t(r){if(!Fe(r))return r;var n,o=r[se],a=gt(r);if(o){if(!o.P&&(o.i<4||!De("ES5").K(o)))return o.t;o.I=!0,n=On(r,a),o.I=!1}else n=On(r,a);return nt(n,(function(l,c){o&&Ko(o.t,l)===c||xn(n,l,t(c))})),a===3?new Set(n):n})(e)}function On(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return yr(e)}function ti(){function e(l,c){var f=a[l];return f?f.enumerable=c:a[l]=f={configurable:!0,enumerable:c,get:function(){var s=this[se];return process.env.NODE_ENV!=="production"&&o(s),Rt.get(s,l)},set:function(s){var v=this[se];process.env.NODE_ENV!=="production"&&o(v),Rt.set(v,l,s)}},f}function t(l){for(var c=l.length-1;c>=0;c--){var f=l[c][se];if(!f.P)switch(f.i){case 5:n(f)&&Je(f);break;case 4:r(f)&&Je(f)}}}function r(l){for(var c=l.t,f=l.k,s=xt(f),v=s.length-1;v>=0;v--){var y=s[v];if(y!==se){var m=c[y];if(m===void 0&&!bt(c,y))return!0;var E=f[y],h=E&&E[se];if(h?h.t!==m:!En(E,m))return!0}}var b=!!c[se];return s.length!==xt(c).length+(b?0:1)}function n(l){var c=l.k;if(c.length!==l.t.length)return!0;var f=Object.getOwnPropertyDescriptor(c,c.length-1);if(f&&!f.get)return!0;for(var s=0;s<c.length;s++)if(!c.hasOwnProperty(s))return!0;return!1}function o(l){l.g&&pe(3,JSON.stringify(Ke(l)))}var a={};Zo("ES5",{J:function(l,c){var f=Array.isArray(l),s=(function(y,m){if(y){for(var E=Array(m.length),h=0;h<m.length;h++)Object.defineProperty(E,""+h,e(h,!0));return E}var b=kn(m);delete b[se];for(var d=xt(b),C=0;C<d.length;C++){var N=d[C];b[N]=e(N,y||!!b[N].enumerable)}return Object.create(Object.getPrototypeOf(m),b)})(f,l),v={i:f?5:4,A:c?c.A:br(),P:!1,I:!1,R:{},l:c,t:l,k:s,o:null,g:!1,C:!1};return Object.defineProperty(s,se,{value:v,writable:!0}),s},S:function(l,c,f){f?Ge(c)&&c[se].A===l&&t(l.p):(l.u&&(function s(v){if(v&&typeof v=="object"){var y=v[se];if(y){var m=y.t,E=y.k,h=y.R,b=y.i;if(b===4)nt(E,(function(A){A!==se&&(m[A]!==void 0||bt(m,A)?h[A]||s(E[A]):(h[A]=!0,Je(y)))})),nt(m,(function(A){E[A]!==void 0||bt(E,A)||(h[A]=!1,Je(y))}));else if(b===5){if(n(y)&&(Je(y),h.length=!0),E.length<m.length)for(var d=E.length;d<m.length;d++)h[d]=!1;else for(var C=m.length;C<E.length;C++)h[C]=!0;for(var N=Math.min(E.length,m.length),M=0;M<N;M++)E.hasOwnProperty(M)||(h[M]=!0),h[M]===void 0&&s(E[M])}}}})(l.p[0]),t(l.p))},K:function(l){return l.i===4?r(l):n(l)}})}var jn,wt,Or=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ri=typeof Map<"u",ni=typeof Set<"u",Pn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Tn=Or?Symbol.for("immer-nothing"):((jn={})["immer-nothing"]=!0,jn),Mn=Or?Symbol.for("immer-draftable"):"__$immer_draftable",se=Or?Symbol.for("immer-state"):"__$immer_state",oi={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},ii=""+Object.prototype.constructor,xt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,kn=Object.getOwnPropertyDescriptors||function(e){var t={};return xt(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},jr={},Rt={get:function(e,t){if(t===se)return e;var r=Ke(e);if(!bt(r,t))return(function(o,a,l){var c,f=_n(a,l);return f?"value"in f?f.value:(c=f.get)===null||c===void 0?void 0:c.call(o.k):void 0})(e,r,t);var n=r[t];return e.I||!Fe(n)?n:n===Sr(e.t,t)?(Cr(e),e.o[t]=_r(e.A.h,n,e)):n},has:function(e,t){return t in Ke(e)},ownKeys:function(e){return Reflect.ownKeys(Ke(e))},set:function(e,t,r){var n=_n(Ke(e),t);if(n!=null&&n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=Sr(Ke(e),t),a=o==null?void 0:o[se];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(En(r,o)&&(r!==void 0||bt(e.t,t)))return!0;Cr(e),Je(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return Sr(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Cr(e),Je(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Ke(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){pe(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){pe(12)}},Nt={};nt(Rt,(function(e,t){Nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Nt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&pe(13),Nt.set.call(this,e,t,void 0)},Nt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&pe(14),Rt.set.call(this,e[0],t,r,e[0])};var ai=(function(){function e(r){var n=this;this.O=Pn,this.D=!0,this.produce=function(o,a,l){if(typeof o=="function"&&typeof a!="function"){var c=a;a=o;var f=n;return function(b){var d=this;b===void 0&&(b=c);for(var C=arguments.length,N=Array(C>1?C-1:0),M=1;M<C;M++)N[M-1]=arguments[M];return f.produce(b,(function(A){var x;return(x=a).call.apply(x,[d,A].concat(N))}))}}var s;if(typeof a!="function"&&pe(6),l!==void 0&&typeof l!="function"&&pe(7),Fe(o)){var v=Sn(n),y=_r(n,o,void 0),m=!0;try{s=a(y),m=!1}finally{m?Bt(v):xr(v)}return typeof Promise<"u"&&s instanceof Promise?s.then((function(b){return wr(v,l),Er(b,v)}),(function(b){throw Bt(v),b})):(wr(v,l),Er(s,v))}if(!o||typeof o!="object"){if((s=a(o))===void 0&&(s=o),s===Tn&&(s=void 0),n.D&&mr(s,!0),l){var E=[],h=[];De("Patches").M(o,s,E,h),l(E,h)}return s}pe(21,o)},this.produceWithPatches=function(o,a){if(typeof o=="function")return function(s){for(var v=arguments.length,y=Array(v>1?v-1:0),m=1;m<v;m++)y[m-1]=arguments[m];return n.produceWithPatches(s,(function(E){return o.apply(void 0,[E].concat(y))}))};var l,c,f=n.produce(o,a,(function(s,v){l=s,c=v}));return typeof Promise<"u"&&f instanceof Promise?f.then((function(s){return[s,l,c]})):[f,l,c]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Fe(r)||pe(8),Ge(r)&&(r=ei(r));var n=Sn(this),o=_r(this,r,void 0);return o[se].C=!0,xr(n),o},t.finishDraft=function(r,n){var o=r&&r[se];process.env.NODE_ENV!=="production"&&(o&&o.C||pe(9),o.I&&pe(10));var a=o.A;return wr(a,n),Er(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Pn&&pe(20),this.O=r},t.applyPatches=function(r,n){var o;for(o=n.length-1;o>=0;o--){var a=n[o];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}o>-1&&(n=n.slice(o+1));var l=De("Patches").$;return Ge(r)?l(r,n):this.produce(r,(function(c){return l(c,n)}))},e})(),Se=new ai,Rn=Se.produce;Se.produceWithPatches.bind(Se),Se.setAutoFreeze.bind(Se),Se.setUseProxies.bind(Se),Se.applyPatches.bind(Se),Se.createDraft.bind(Se),Se.finishDraft.bind(Se);function At(e){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}function si(e,t){if(At(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(At(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ci(e){var t=si(e,"string");return At(t)=="symbol"?t:t+""}function li(e,t,r){return(t=ci(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function An(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nn(Object(r),!0).forEach(function(n){li(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function be(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var In=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Pr=function(){return Math.random().toString(36).substring(7).split("").join(".")},ot={INIT:"@@redux/INIT"+Pr(),REPLACE:"@@redux/REPLACE"+Pr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Pr()}};function Dn(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ui(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(hi(e))return"date";if(di(e))return"error";var r=fi(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function fi(e){return typeof e.constructor=="function"?e.constructor.name:null}function di(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function hi(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function it(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=ui(e)),t}function zn(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?be(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?be(1):"Expected the enhancer to be a function. Instead, received: '"+it(r)+"'");return r(zn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?be(2):"Expected the root reducer to be a function. Instead, received: '"+it(e)+"'");var o=e,a=t,l=[],c=l,f=!1;function s(){c===l&&(c=l.slice())}function v(){if(f)throw new Error(process.env.NODE_ENV==="production"?be(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function y(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?be(4):"Expected the listener to be a function. Instead, received: '"+it(b)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?be(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var d=!0;return s(),c.push(b),function(){if(d){if(f)throw new Error(process.env.NODE_ENV==="production"?be(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");d=!1,s();var N=c.indexOf(b);c.splice(N,1),l=null}}}function m(b){if(!Dn(b))throw new Error(process.env.NODE_ENV==="production"?be(7):"Actions must be plain objects. Instead, the actual type was: '"+it(b)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof b.type>"u")throw new Error(process.env.NODE_ENV==="production"?be(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?be(9):"Reducers may not dispatch actions.");try{f=!0,a=o(a,b)}finally{f=!1}for(var d=l=c,C=0;C<d.length;C++){var N=d[C];N()}return b}function E(b){if(typeof b!="function")throw new Error(process.env.NODE_ENV==="production"?be(10):"Expected the nextReducer to be a function. Instead, received: '"+it(b));o=b,m({type:ot.REPLACE})}function h(){var b,d=y;return b={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(process.env.NODE_ENV==="production"?be(11):"Expected the observer to be an object. Instead, received: '"+it(N)+"'");function M(){N.next&&N.next(v())}M();var A=d(M);return{unsubscribe:A}}},b[In]=function(){return this},b}return m({type:ot.INIT}),n={dispatch:m,subscribe:y,getState:v,replaceReducer:E},n[In]=h,n}function Wn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function pi(e,t,r,n){var o=Object.keys(t),a=r&&r.type===ot.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Dn(e))return"The "+a+' has unexpected type of "'+it(e)+'". Expected argument to be an object with the following '+('keys: "'+o.join('", "')+'"');var l=Object.keys(e).filter(function(c){return!t.hasOwnProperty(c)&&!n[c]});if(l.forEach(function(c){n[c]=!0}),!(r&&r.type===ot.REPLACE)&&l.length>0)return"Unexpected "+(l.length>1?"keys":"key")+" "+('"'+l.join('", "')+'" found in '+a+". ")+"Expected to find one of the known reducer keys instead: "+('"'+o.join('", "')+'". Unexpected keys will be ignored.')}function vi(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:ot.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?be(12):'The slice reducer for key "'+t+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:ot.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?be(13):'The slice reducer for key "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle '"+ot.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function yi(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];process.env.NODE_ENV!=="production"&&typeof e[o]>"u"&&Wn('No reducer provided for key "'+o+'"'),typeof e[o]=="function"&&(r[o]=e[o])}var a=Object.keys(r),l;process.env.NODE_ENV!=="production"&&(l={});var c;try{vi(r)}catch(f){c=f}return function(s,v){if(s===void 0&&(s={}),c)throw c;if(process.env.NODE_ENV!=="production"){var y=pi(s,r,v,l);y&&Wn(y)}for(var m=!1,E={},h=0;h<a.length;h++){var b=a[h],d=r[b],C=s[b],N=d(C,v);if(typeof N>"u"){var M=v&&v.type;throw new Error(process.env.NODE_ENV==="production"?be(14):"When called with an action of type "+(M?'"'+String(M)+'"':"(unknown type)")+', the slice reducer for key "'+b+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}E[b]=N,m=m||N!==C}return m=m||a.length!==Object.keys(s).length,m?E:s}}function Ht(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,o){return function(){return n(o.apply(void 0,arguments))}})}function mi(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var o=n.apply(void 0,arguments),a=function(){throw new Error(process.env.NODE_ENV==="production"?be(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},l={getState:o.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=t.map(function(f){return f(l)});return a=Ht.apply(void 0,c)(o.dispatch),An(An({},o),{},{dispatch:a})}}}function Ln(e){var t=function(n){var o=n.dispatch,a=n.getState;return function(l){return function(c){return typeof c=="function"?c(o,a,e):l(c)}}};return t}var Tr=Ln();Tr.withExtraArgument=Ln;var Yn=(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),gi=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(s){return function(v){return f([s,v])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1],a=s;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(s);break}a[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(v){s=[6,v],o=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},Et=function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},bi=Object.defineProperty,wi=Object.defineProperties,xi=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,$n=function(e,t,r){return t in e?bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Ze=function(e,t){for(var r in t||(t={}))Ei.call(t,r)&&$n(e,r,t[r]);if(Vn)for(var n=0,o=Vn(t);n<o.length;n++){var r=o[n];Si.call(t,r)&&$n(e,r,t[r])}return e},Mr=function(e,t){return wi(e,xi(t))},Ci=function(e,t,r){return new Promise(function(n,o){var a=function(f){try{c(r.next(f))}catch(s){o(s)}},l=function(f){try{c(r.throw(f))}catch(s){o(s)}},c=function(f){return f.done?n(f.value):Promise.resolve(f.value).then(a,l)};c((r=r.apply(e,t)).next())})},_i=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ht:Ht.apply(null,arguments)};function Fn(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}var Oi=function(e){return e&&typeof e.match=="function"};function Qe(e,t){function r(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(t){var a=t.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return Ze(Ze({type:e,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}function ji(e){return typeof e=="function"&&"type"in e&&Oi(e)}function Pi(e){var t=e?(""+e).split("/"):[],r=t[t.length-1]||"actionCreator";return'Detected an action creator with type "'+(e||"unknown")+`" being dispatched.
92
+ Make sure you're calling the action creator before dispatching, i.e. \`dispatch(`+r+"())` instead of `dispatch("+r+")`. This is necessary even if the action has no payload."}function Ti(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(n){return function(o){return n(o)}}};var t=e.isActionCreator,r=t===void 0?ji:t;return function(){return function(n){return function(o){return r(o)&&console.warn(Pi(o.type)),n(o)}}}}function Xn(e,t){var r=0;return{measureTime:function(n){var o=Date.now();try{return n()}finally{var a=Date.now();r+=a-o}},warnIfExceeded:function(){r>e&&console.warn(t+" took "+r+"ms, which is more than the warning threshold of "+e+`ms.
93
93
  If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
94
- It is disabled in production builds, so you don't need to worry about that.`)}}}var ii=(function(e){gn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,it([void 0],r[0].concat(this)))):new(t.bind.apply(t,it([void 0],r.concat(this))))},t})(Array),ai=(function(e){gn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,it([void 0],r[0].concat(this)))):new(t.bind.apply(t,it([void 0],r.concat(this))))},t})(Array);function vr(e){return je(e)?ln(e,function(){}):e}var si=process.env.NODE_ENV==="production",En="Invariant failed";function Sn(e,t){if(!e)throw si?new Error(En):new Error(En+": "+(t||""))}function ci(e,t,r,n){return JSON.stringify(e,li(t,n),r)}function li(e,t){var r=[],n=[];return t||(t=function(i,a){return r[0]===a?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(a)).join(".")+"]"}),function(i,a){if(r.length>0){var f=r.indexOf(this);~f?r.splice(f+1):r.push(this),~f?n.splice(f,1/0,i):n.push(i),~r.indexOf(a)&&(a=t.call(this,i,a))}else r.push(a);return e==null?a:e.call(this,i,a)}}function ui(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function fi(e,t,r){var n=Cn(e,t,r);return{detectMutations:function(){return _n(e,t,n,r)}}}function Cn(e,t,r,n,i){t===void 0&&(t=[]),n===void 0&&(n=""),i===void 0&&(i=new Set);var a={value:r};if(!e(r)&&!i.has(r)){i.add(r),a.children={};for(var f in r){var h=n?n+"."+f:f;t.length&&t.indexOf(h)!==-1||(a.children[f]=Cn(e,t,r[f],h))}}return a}function _n(e,t,r,n,i,a){t===void 0&&(t=[]),i===void 0&&(i=!1),a===void 0&&(a="");var f=r?r.value:void 0,h=f===n;if(i&&!h&&!Number.isNaN(n))return{wasMutated:!0,path:a};if(e(f)||e(n))return{wasMutated:!1};var p={};for(var l in r.children)p[l]=!0;for(var l in n)p[l]=!0;var u=t.length>0,g=function(E){var v=a?a+"."+E:E;if(u){var d=t.some(function(T){return T instanceof RegExp?T.test(v):v===T});if(d)return"continue"}var S=_n(e,t,r.children[E],n[E],h,v);if(S.wasMutated)return{value:S}};for(var l in p){var m=g(l);if(typeof m=="object")return m.value}return{wasMutated:!1}}function di(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(p){return function(l){return p(l)}}};var t=e.isImmutable,r=t===void 0?ui:t,n=e.ignoredPaths,i=e.warnAfter,a=i===void 0?32:i,f=e.ignore;n=n||f;var h=fi.bind(null,r,n);return function(p){var l=p.getState,u=l(),g=h(u),m;return function(E){return function(v){var d=xn(a,"ImmutableStateInvariantMiddleware");d.measureTime(function(){u=l(),m=g.detectMutations(),g=h(u),Sn(!m.wasMutated,"A state mutation was detected between dispatches, in the path '"+(m.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var S=E(v);return d.measureTime(function(){u=l(),m=g.detectMutations(),g=h(u),m.wasMutated&&Sn(!m.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(m.path||"")+". Take a look at the reducer(s) handling the action "+ci(v)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),d.warnIfExceeded(),S}}}}function On(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||wn(e)}function yr(e,t,r,n,i,a){t===void 0&&(t=""),r===void 0&&(r=On),i===void 0&&(i=[]);var f;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||a!=null&&a.has(e))return!1;for(var h=n!=null?n(e):Object.entries(e),p=i.length>0,l=function(S,T){var k=t?t+"."+S:S;if(p){var P=i.some(function(N){return N instanceof RegExp?N.test(k):k===N});if(P)return"continue"}if(!r(T))return{value:{keyPath:k,value:T}};if(typeof T=="object"&&(f=yr(T,k,r,n,i,a),f))return{value:f}},u=0,g=h;u<g.length;u++){var m=g[u],E=m[0],v=m[1],d=l(E,v);if(typeof d=="object")return d.value}return a&&jn(e)&&a.add(e),!1}function jn(e){if(!Object.isFrozen(e))return!1;for(var t=0,r=Object.values(e);t<r.length;t++){var n=r[t];if(!(typeof n!="object"||n===null)&&!jn(n))return!1}return!0}function hi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(P){return function(N){return P(N)}}};var t=e.isSerializable,r=t===void 0?On:t,n=e.getEntries,i=e.ignoredActions,a=i===void 0?[]:i,f=e.ignoredActionPaths,h=f===void 0?["meta.arg","meta.baseQueryMeta"]:f,p=e.ignoredPaths,l=p===void 0?[]:p,u=e.warnAfter,g=u===void 0?32:u,m=e.ignoreState,E=m===void 0?!1:m,v=e.ignoreActions,d=v===void 0?!1:v,S=e.disableCache,T=S===void 0?!1:S,k=!T&&WeakSet?new WeakSet:void 0;return function(P){return function(N){return function(c){var R=N(c),j=xn(g,"SerializableStateInvariantMiddleware");return!d&&!(a.length&&a.indexOf(c.type)!==-1)&&j.measureTime(function(){var Y=yr(c,"",r,n,h,k);if(Y){var Z=Y.keyPath,q=Y.value;console.error("A non-serializable value was detected in an action, in the path: `"+Z+"`. Value:",q,`
95
- Take a look at the logic that dispatched this action: `,c,`
94
+ It is disabled in production builds, so you don't need to worry about that.`)}}}var Mi=(function(e){Yn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,Et([void 0],r[0].concat(this)))):new(t.bind.apply(t,Et([void 0],r.concat(this))))},t})(Array),ki=(function(e){Yn(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(t.bind.apply(t,Et([void 0],r[0].concat(this)))):new(t.bind.apply(t,Et([void 0],r.concat(this))))},t})(Array);function kr(e){return Fe(e)?Rn(e,function(){}):e}var Ri=process.env.NODE_ENV==="production",Bn="Invariant failed";function Un(e,t){if(!e)throw Ri?new Error(Bn):new Error(Bn+": "+(t||""))}function Ni(e,t,r,n){return JSON.stringify(e,Ai(t,n),r)}function Ai(e,t){var r=[],n=[];return t||(t=function(o,a){return r[0]===a?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(a)).join(".")+"]"}),function(o,a){if(r.length>0){var l=r.indexOf(this);~l?r.splice(l+1):r.push(this),~l?n.splice(l,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return e==null?a:e.call(this,o,a)}}function Ii(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function Di(e,t,r){var n=qn(e,t,r);return{detectMutations:function(){return Hn(e,t,n,r)}}}function qn(e,t,r,n,o){t===void 0&&(t=[]),n===void 0&&(n=""),o===void 0&&(o=new Set);var a={value:r};if(!e(r)&&!o.has(r)){o.add(r),a.children={};for(var l in r){var c=n?n+"."+l:l;t.length&&t.indexOf(c)!==-1||(a.children[l]=qn(e,t,r[l],c))}}return a}function Hn(e,t,r,n,o,a){t===void 0&&(t=[]),o===void 0&&(o=!1),a===void 0&&(a="");var l=r?r.value:void 0,c=l===n;if(o&&!c&&!Number.isNaN(n))return{wasMutated:!0,path:a};if(e(l)||e(n))return{wasMutated:!1};var f={};for(var s in r.children)f[s]=!0;for(var s in n)f[s]=!0;var v=t.length>0,y=function(E){var h=a?a+"."+E:E;if(v){var b=t.some(function(C){return C instanceof RegExp?C.test(h):h===C});if(b)return"continue"}var d=Hn(e,t,r.children[E],n[E],c,h);if(d.wasMutated)return{value:d}};for(var s in f){var m=y(s);if(typeof m=="object")return m.value}return{wasMutated:!1}}function zi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(f){return function(s){return f(s)}}};var t=e.isImmutable,r=t===void 0?Ii:t,n=e.ignoredPaths,o=e.warnAfter,a=o===void 0?32:o,l=e.ignore;n=n||l;var c=Di.bind(null,r,n);return function(f){var s=f.getState,v=s(),y=c(v),m;return function(E){return function(h){var b=Xn(a,"ImmutableStateInvariantMiddleware");b.measureTime(function(){v=s(),m=y.detectMutations(),y=c(v),Un(!m.wasMutated,"A state mutation was detected between dispatches, in the path '"+(m.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var d=E(h);return b.measureTime(function(){v=s(),m=y.detectMutations(),y=c(v),m.wasMutated&&Un(!m.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(m.path||"")+". Take a look at the reducer(s) handling the action "+Ni(h)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),b.warnIfExceeded(),d}}}}function Gn(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||Fn(e)}function Rr(e,t,r,n,o,a){t===void 0&&(t=""),r===void 0&&(r=Gn),o===void 0&&(o=[]);var l;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||a!=null&&a.has(e))return!1;for(var c=n!=null?n(e):Object.entries(e),f=o.length>0,s=function(d,C){var N=t?t+"."+d:d;if(f){var M=o.some(function(A){return A instanceof RegExp?A.test(N):N===A});if(M)return"continue"}if(!r(C))return{value:{keyPath:N,value:C}};if(typeof C=="object"&&(l=Rr(C,N,r,n,o,a),l))return{value:l}},v=0,y=c;v<y.length;v++){var m=y[v],E=m[0],h=m[1],b=s(E,h);if(typeof b=="object")return b.value}return a&&Kn(e)&&a.add(e),!1}function Kn(e){if(!Object.isFrozen(e))return!1;for(var t=0,r=Object.values(e);t<r.length;t++){var n=r[t];if(!(typeof n!="object"||n===null)&&!Kn(n))return!1}return!0}function Wi(e){if(e===void 0&&(e={}),process.env.NODE_ENV==="production")return function(){return function(M){return function(A){return M(A)}}};var t=e.isSerializable,r=t===void 0?Gn:t,n=e.getEntries,o=e.ignoredActions,a=o===void 0?[]:o,l=e.ignoredActionPaths,c=l===void 0?["meta.arg","meta.baseQueryMeta"]:l,f=e.ignoredPaths,s=f===void 0?[]:f,v=e.warnAfter,y=v===void 0?32:v,m=e.ignoreState,E=m===void 0?!1:m,h=e.ignoreActions,b=h===void 0?!1:h,d=e.disableCache,C=d===void 0?!1:d,N=!C&&WeakSet?new WeakSet:void 0;return function(M){return function(A){return function(x){var T=A(x),_=Xn(y,"SerializableStateInvariantMiddleware");return!b&&!(a.length&&a.indexOf(x.type)!==-1)&&_.measureTime(function(){var $=Rr(x,"",r,n,c,N);if($){var k=$.keyPath,oe=$.value;console.error("A non-serializable value was detected in an action, in the path: `"+k+"`. Value:",oe,`
95
+ Take a look at the logic that dispatched this action: `,x,`
96
96
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
97
- (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),E||(j.measureTime(function(){var Y=P.getState(),Z=yr(Y,"",r,n,l,k);if(Z){var q=Z.keyPath,H=Z.value;console.error("A non-serializable value was detected in the state, in the path: `"+q+"`. Value:",H,`
98
- Take a look at the reducer(s) handling this action type: `+c.type+`.
99
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),j.warnIfExceeded()),R}}}}function Rt(e){return typeof e=="boolean"}function pi(){return function(t){return vi(t)}}function vi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,a=e.serializableCheck,f=a===void 0?!0:a,h=e.actionCreatorCheck,p=h===void 0?!0:h,l=new ii;if(r&&(Rt(r)?l.push(hr):l.push(hr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(i){var u={};Rt(i)||(u=i),l.unshift(di(u))}if(f){var g={};Rt(f)||(g=f),l.push(hi(g))}if(p){var m={};Rt(p)||(m=p),l.unshift(oi(m))}}return l}var gr=process.env.NODE_ENV==="production";function yi(e){var t=pi(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,a=r.middleware,f=a===void 0?t():a,h=r.devTools,p=h===void 0?!0:h,l=r.preloadedState,u=l===void 0?void 0:l,g=r.enhancers,m=g===void 0?void 0:g,E;if(typeof i=="function")E=i;else if(wn(i))E=Bo(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=f;if(typeof v=="function"&&(v=v(t),!gr&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!gr&&v.some(function(N){return typeof N!="function"}))throw new Error("each middleware provided to configureStore must be a function");var d=Uo.apply(void 0,v),S=kt;p&&(S=ei(ze({trace:!gr},typeof p=="object"&&p)));var T=new ai(d),k=T;Array.isArray(m)?k=it([d],m):typeof m=="function"&&(k=m(T));var P=S.apply(void 0,k);return pn(E,u,P)}function Pn(e){var t={},r=[],n,i={addCase:function(a,f){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var h=typeof a=="string"?a:a.type;if(!h)throw new Error("`builder.addCase` cannot be called with an empty action type");if(h in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[h]=f,i},addMatcher:function(a,f){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:a,reducer:f}),i},addDefaultCase:function(a){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=a,i}};return e(i),[t,r,n]}function gi(e){return typeof e=="function"}var Tn=!1;function mi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(Tn||(Tn=!0,console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer")));var i=typeof t=="function"?Pn(t):[t,r,n],a=i[0],f=i[1],h=i[2],p;if(gi(e))p=function(){return vr(e())};else{var l=vr(e);p=function(){return l}}function u(g,m){g===void 0&&(g=p());var E=it([a[m.type]],f.filter(function(v){var d=v.matcher;return d(m)}).map(function(v){var d=v.reducer;return d}));return E.filter(function(v){return!!v}).length===0&&(E=[h]),E.reduce(function(v,d){if(d)if(Ae(v)){var S=v,T=d(S,m);return T===void 0?v:T}else{if(je(v))return ln(v,function(k){return d(k,m)});var T=d(v,m);if(T===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return T}return v},g)}return u.getInitialState=p,u}var Mn=!1;function bi(e,t){return e+"/"+t}function wi(e){var t=e.name;typeof process<"u"&&process.env.NODE_ENV==="development"&&e.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");var r=typeof e.initialState=="function"?e.initialState:vr(e.initialState),n=e.reducers||{},i=Object.keys(n),a={},f={},h={};i.forEach(function(u){var g=n[u],m=bi(t,u),E,v;"reducer"in g?(E=g.reducer,v=g.prepare):E=g,a[u]=E,f[m]=E,h[u]=v?We(m,v):We(m)});function p(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Mn||(Mn=!0,console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice")));var u=typeof e.extraReducers=="function"?Pn(e.extraReducers):[e.extraReducers],g=u[0],m=g===void 0?{}:g,E=u[1],v=E===void 0?[]:E,d=u[2],S=d===void 0?void 0:d,T=ze(ze({},m),f);return mi(r,function(k){for(var P in T)k.addCase(P,T[P]);for(var N=0,c=v;N<c.length;N++){var R=c[N];k.addMatcher(R.matcher,R.reducer)}S&&k.addDefaultCase(S)})}var l;return{name:t,reducer:function(u,g){return l||(l=p()),l(u,g)},actions:h,caseReducers:a,getInitialState:function(){return l||(l=p()),l.getInitialState()}}}var xi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ei=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=xi[Math.random()*64|0];return t},Si=["name","message","stack","code"],mr=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),kn=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Ci=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Si;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}};(function(){function e(t,r,n){var i=We(t+"/fulfilled",function(u,g,m,E){return{payload:u,meta:pr(ze({},E||{}),{arg:m,requestId:g,requestStatus:"fulfilled"})}}),a=We(t+"/pending",function(u,g,m){return{payload:void 0,meta:pr(ze({},m||{}),{arg:g,requestId:u,requestStatus:"pending"})}}),f=We(t+"/rejected",function(u,g,m,E,v){return{payload:E,error:(n&&n.serializeError||Ci)(u||"Rejected"),meta:pr(ze({},v||{}),{arg:m,requestId:g,rejectedWithValue:!!E,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),h=!1,p=typeof AbortController<"u"?AbortController:(function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(h||(h=!0,console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.")))},u})();function l(u){return function(g,m,E){var v=n!=null&&n.idGenerator?n.idGenerator(u):Ei(),d=new p,S;function T(P){S=P,d.abort()}var k=(function(){return Qo(this,null,function(){var P,N,c,R,j,Y,Z;return qo(this,function(q){switch(q.label){case 0:return q.trys.push([0,4,,5]),R=(P=n==null?void 0:n.condition)==null?void 0:P.call(n,u,{getState:m,extra:E}),Oi(R)?[4,R]:[3,2];case 1:R=q.sent(),q.label=2;case 2:if(R===!1||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return j=new Promise(function(H,ie){return d.signal.addEventListener("abort",function(){return ie({name:"AbortError",message:S||"Aborted"})})}),g(a(v,u,(N=n==null?void 0:n.getPendingMeta)==null?void 0:N.call(n,{requestId:v,arg:u},{getState:m,extra:E}))),[4,Promise.race([j,Promise.resolve(r(u,{dispatch:g,getState:m,extra:E,requestId:v,signal:d.signal,abort:T,rejectWithValue:function(H,ie){return new mr(H,ie)},fulfillWithValue:function(H,ie){return new kn(H,ie)}})).then(function(H){if(H instanceof mr)throw H;return H instanceof kn?i(H.payload,v,u,H.meta):i(H,v,u)})])];case 3:return c=q.sent(),[3,5];case 4:return Y=q.sent(),c=Y instanceof mr?f(null,v,u,Y.payload,Y.meta):f(Y,v,u),[3,5];case 5:return Z=n&&!n.dispatchConditionRejection&&f.match(c)&&c.meta.condition,Z||g(c),[2,c]}})})})();return Object.assign(k,{abort:T,requestId:v,arg:u,unwrap:function(){return k.then(_i)}})}}return Object.assign(l,{pending:a,rejected:f,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function _i(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Oi(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var br="listenerMiddleware";We(br+"/add"),We(br+"/removeAll"),We(br+"/remove");var Rn;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),Mo();function ji(e){const t=[],r=new Set;for(const n of e){const i=n==null?void 0:n.id;if(i==null){t.push(n);continue}r.has(i)||(r.add(i),t.push(n))}return t}const wr=wi({name:"whiteboard",initialState:{grid:{size:20,color:"#ccc",enabled:!0},toolbar:{selectedTool:"pointer"},toolProperties:{pencil:{strokeColor:"#000000",lineWidth:4},rectangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},circle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},triangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},diamond:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},star:{strokeColor:"#000000",fillColor:"#ffff00",lineWidth:2},heart:{strokeColor:"#000000",fillColor:"#ff6b6b",lineWidth:2},hexagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},octagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},arrow:{strokeColor:"#000000",fillColor:"#000000",lineWidth:2},text:{fontSize:16,fontColor:"#000000"}},elements:[],selectedElementId:null,viewport:{panX:0,panY:0,zoom:1},watermark:{text:"Nines Studios",url:"https://github.com/huzeyfecoskun",visible:!0},lock:{isLocked:!0,text:"Whiteboard drawing is only for moderator"}},reducers:{toggleGrid(e){e.grid.enabled=!e.grid.enabled},setGridSize(e,t){e.grid.size=t.payload},setGridColor(e,t){e.grid.color=t.payload},setSelectedTool(e,t){e.toolbar.selectedTool=t.payload},setToolProperty(e,t){const{tool:r,property:n,value:i}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=i)},addElement(e,t){const r=t.payload,n=r==null?void 0:r.id;n!=null&&e.elements.some(a=>(a==null?void 0:a.id)===n)||e.elements.push(r)},updateElement(e,t){const{id:r,updates:n}=t.payload,i=e.elements.findIndex(a=>a.id===r);i!==-1&&(e.elements[i]={...e.elements[i],...n})},removeElement(e,t){const r=t.payload;e.elements=e.elements.filter(n=>n.id!==r),e.selectedElementId===r&&(e.selectedElementId=null)},setSelectedElement(e,t){e.selectedElementId=t.payload},clearElements(e){e.elements=[]},setElements(e,t){const r=Array.isArray(t.payload)?t.payload:[];e.elements=ji(r),e.selectedElementId=null},setPan(e,t){e.viewport.panX=t.payload.x,e.viewport.panY=t.payload.y},setZoom(e,t){e.viewport.zoom=Math.max(.1,Math.min(5,t.payload))},resetViewport(e){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1},bringToFront(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n!==-1&&n<e.elements.length-1){const[i]=e.elements.splice(n,1);e.elements.push(i)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(i=>i.id===r);if(n>0){const[i]=e.elements.splice(n,1);e.elements.unshift(i)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:i=50}=t.payload,a=e.elements;if(a.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let f=1/0,h=1/0,p=-1/0,l=-1/0;a.forEach(c=>{c.type==="rectangle"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="circle"?(f=Math.min(f,c.centerX-c.radius),h=Math.min(h,c.centerY-c.radius),p=Math.max(p,c.centerX+c.radius),l=Math.max(l,c.centerY+c.radius)):c.type==="pencil"&&c.points.length>0?c.points.forEach(R=>{f=Math.min(f,R.x),h=Math.min(h,R.y),p=Math.max(p,R.x),l=Math.max(l,R.y)}):c.type==="triangle"||c.type==="diamond"||c.type==="hexagon"||c.type==="octagon"?(f=Math.min(f,c.x),h=Math.min(h,c.y),p=Math.max(p,c.x+c.width),l=Math.max(l,c.y+c.height)):c.type==="star"||c.type==="heart"?(f=Math.min(f,c.centerX-c.size),h=Math.min(h,c.centerY-c.size),p=Math.max(p,c.centerX+c.size),l=Math.max(l,c.centerY+c.size)):c.type==="arrow"&&(f=Math.min(f,c.startX,c.endX),h=Math.min(h,c.startY,c.endY),p=Math.max(p,c.startX,c.endX),l=Math.max(l,c.startY,c.endY))});const u=p-f,g=l-h;if(u<=0||g<=0)return;const m=r-i*2,E=n-i*2,v=m/u,d=E/g,S=Math.min(v,d,5),T=(f+p)/2,k=(h+l)/2,P=r/2-T*S,N=n/2-k*S;e.viewport.zoom=Math.max(.1,S),e.viewport.panX=P,e.viewport.panY=N},setLocked(e,t){e.lock.isLocked=t.payload,t.payload&&(e.toolbar.selectedTool="pointer",e.selectedElementId=null)},setWatermarkEnabled(e,t){e.watermark.visible=t.payload},setWatermarkText(e,t){e.watermark.text=t.payload}}}),{toggleGrid:_a,setGridSize:Oa,setGridColor:ja,setSelectedTool:Pe,setToolProperty:Pi,addElement:ve,updateElement:gt,removeElement:Ti,setSelectedElement:mt,clearElements:Nn,setElements:An,setPan:Mi,setZoom:ki,resetViewport:Pa,fitToView:Ri,bringToFront:Ni,sendToBack:Ai,setLocked:In,setWatermarkEnabled:Ii,setWatermarkText:Di}=wr.actions,zi=wr.actions,Dn=wr.reducer;let xr=null;const Wi=new Set(["rectangle","circle","pencil","triangle","diamond","star","heart","hexagon","octagon","arrow","text"]),Li=new Set(["strokeColor","fillColor","lineWidth","fontSize","fontColor","textColor"]),Yi=e=>{var t,r;if(!e||typeof e.type!="string"||e.type.startsWith("@@redux/"))return!1;if(e.type==="whiteboard/addElement"){const n=(t=e==null?void 0:e.payload)==null?void 0:t.type;return typeof n=="string"&&Wi.has(n)}if(e.type==="whiteboard/removeElement"||e.type==="whiteboard/clearElements"||e.type==="whiteboard/bringToFront"||e.type==="whiteboard/sendToBack")return!0;if(e.type==="whiteboard/setToolProperty"){const{tool:n,property:i}=(e==null?void 0:e.payload)??{};return typeof n!="string"||typeof i!="string"?!1:Li.has(i)}if(e.type==="whiteboard/updateElement"){const n=(r=e==null?void 0:e.payload)==null?void 0:r.updates;if(!n||typeof n!="object")return!1;const i=a=>Object.prototype.hasOwnProperty.call(n,a);return!!(i("text")||i("fontSize")||i("fontColor")||i("textColor")||i("strokeColor")||i("fillColor")||i("lineWidth")||i("x")||i("y")||i("centerX")||i("centerY")||i("startX")||i("startY")||i("endX")||i("endY")||i("points"))}return!1},Vi=e=>{xr=e},$i=e=>t=>r=>{var i;const n=t(r);return!((i=r.meta)!=null&&i.fromRemote)&&xr&&Yi(r)&&xr(r,e.getState()),n},zn=yi({reducer:{whiteboard:Dn},middleware:e=>e().concat($i)}),Fi=()=>{const e=oe(t=>t.whiteboard.watermark);return w.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:w.jsx("div",{className:"wb-watermark",children:e.text})})};var Wn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ln=M.createContext&&M.createContext(Wn),Xi=["attr","size","title"];function Bi(e,t){if(e==null)return{};var r=Ui(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ui(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nt.apply(this,arguments)}function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(r),!0).forEach(function(n){qi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qi(e,t,r){return t=Hi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){var t=Gi(e,"string");return typeof t=="symbol"?t:t+""}function Gi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vn(e){return e&&e.map((t,r)=>M.createElement(t.tag,At({key:r},t.attr),Vn(t.child)))}function Q(e){return t=>M.createElement(Ki,Nt({attr:At({},e.attr)},t),Vn(e.child))}function Ki(e){var t=r=>{var{attr:n,size:i,title:a}=e,f=Bi(e,Xi),h=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),M.createElement("svg",Nt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,f,{className:p,style:At(At({color:e.color||r.color},r.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),a&&M.createElement("title",null,a),e.children)};return Ln!==void 0?M.createElement(Ln.Consumer,null,r=>t(r)):t(Wn)}function Ji(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(e)}function Zi(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"},child:[]}]})(e)}function Qi(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function ea(e){return Q({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"},child:[]}]})(e)}function ta(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function ra(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(e)}function na(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function oa(e){return Q({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"},child:[]}]})(e)}function ia(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function aa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function sa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"},child:[]}]})(e)}function ca(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function la(e){return Q({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const ua=({text:e})=>w.jsxs("div",{style:{position:"absolute",top:"10px",left:"10px",backgroundColor:"rgba(255, 68, 68, 0.9)",color:"white",padding:"8px 16px",borderRadius:"4px",display:"flex",alignItems:"center",gap:"8px",boxShadow:"0 2px 4px rgba(0,0,0,0.2)",zIndex:1e3,pointerEvents:"none",userSelect:"none",fontFamily:"sans-serif",fontSize:"14px",fontWeight:"500"},children:[w.jsx(na,{}),w.jsx("span",{children:e||"Locked"})]});function fa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"},child:[]}]})(e)}function da(e){return Q({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"},child:[]}]})(e)}function ha(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"},child:[]}]})(e)}function pa(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"},child:[]}]})(e)}function va(e){return Q({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"},child:[]}]})(e)}function ya(e){return Q({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"},child:[]}]})(e)}function ga(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.5.134a1 1 0 0 0-1 0l-6 3.577a1 1 0 0 0-.5.866v6.846a1 1 0 0 0 .5.866l6 3.577a1 1 0 0 0 1 0l6-3.577a1 1 0 0 0 .5-.866V4.577a1 1 0 0 0-.5-.866z"},child:[]}]})(e)}function ma(e){return Q({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.107 0a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353L4.54.146A.5.5 0 0 1 4.893 0z"},child:[]}]})(e)}const ba=({onExport:e,onFitToView:t,mode:r})=>{const n=Jt(),{t:i,language:a,changeLanguage:f}=Kr(),h=oe(R=>R.whiteboard.toolbar.selectedTool),p=oe(R=>R.whiteboard.lock.isLocked),[l,u]=M.useState(!1),[g,m]=M.useState(!1),E=M.useRef(null),v=M.useRef(null),d=M.useRef(null),S=M.useRef(null),T=M.useRef(null),k=R=>{const j=R.target.files[0];if(!j)return;const Y=new FileReader;Y.onload=Z=>{const q=new Image;q.onload=()=>{const H=Date.now().toString();n(ve({id:H,type:"image",x:100,y:100,width:q.width,height:q.height,src:Z.target.result})),n(Pe("pointer")),n(mt(H))},q.src=Z.target.result},Y.readAsDataURL(j),R.target.value=""};M.useEffect(()=>{const R=j=>{E.current&&!E.current.contains(j.target)&&v.current&&!v.current.contains(j.target)&&u(!1),S.current&&!S.current.contains(j.target)&&d.current&&!d.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);const P=[{name:"triangle",icon:w.jsx(aa,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:w.jsx(da,{})},{name:"star",icon:w.jsx(la,{})},{name:"heart",icon:w.jsx(ta,{})},{name:"hexagon",icon:w.jsx(ga,{})},{name:"octagon",icon:w.jsx(ma,{})},{name:"arrow",icon:w.jsx(fa,{})}],N=R=>{n(Pe(R)),u(!1)},c=R=>{f(R),m(!1)};return w.jsxs("div",{className:"wb-toolbar",children:[w.jsx("button",{className:h==="pointer"?"wb-active":"",onClick:()=>n(Pe("pointer")),title:i("pointer"),disabled:p,children:w.jsx(oa,{})}),w.jsx("button",{className:h==="text"?"wb-active":"",onClick:()=>n(Pe("text")),title:i("text"),disabled:p,children:w.jsx(va,{})}),w.jsx("button",{onClick:()=>{var R;return(R=T.current)==null?void 0:R.click()},title:i("image"),disabled:p,children:w.jsx(ra,{})}),w.jsx("input",{type:"file",ref:T,style:{display:"none"},accept:"image/*",onChange:k}),w.jsx("button",{className:h==="pencil"?"wb-active":"",onClick:()=>n(Pe("pencil")),title:i("pencil"),disabled:p,children:w.jsx(ia,{})}),w.jsx("button",{className:h==="rectangle"?"wb-active":"",onClick:()=>n(Pe("rectangle")),title:i("rectangle"),disabled:p,children:w.jsx(ca,{})}),w.jsx("button",{className:h==="circle"?"wb-active":"",onClick:()=>n(Pe("circle")),title:i("circle"),disabled:p,children:w.jsx(Ji,{})}),w.jsxs("div",{className:"wb-ellipsis-container",children:[w.jsx("button",{ref:v,className:P.some(R=>R.name===h)?"wb-active":"",onClick:()=>u(!l),title:i("moreShapes"),disabled:p,children:w.jsx(ha,{})}),l&&w.jsxs("div",{className:"wb-shapes-popup",ref:E,children:[w.jsx("div",{className:"wb-shapes-popup-header",children:i("moreShapes")}),w.jsx("div",{className:"wb-shapes-popup-grid",children:P.map(R=>w.jsx("button",{className:h===R.name?"wb-active":"",onClick:()=>N(R.name),title:i(R.name),children:R.icon},R.name))})]})]}),w.jsx("button",{className:h==="eraser"?"wb-active":"",onClick:()=>n(Pe("eraser")),title:i("eraser"),disabled:p,children:w.jsx(Zi,{})}),w.jsx("button",{onClick:t,title:i("fitToView"),children:w.jsx(Qi,{})}),w.jsx("button",{onClick:e,title:i("exportAsPng"),children:w.jsx(sa,{})}),w.jsxs("div",{className:"wb-language-container",children:[w.jsx("button",{ref:d,onClick:()=>m(!g),title:i("language"),children:w.jsx(ea,{})}),g&&w.jsxs("div",{className:"wb-language-popup",ref:S,children:[w.jsx("div",{className:"wb-language-popup-header",children:i("language")}),w.jsxs("div",{className:"wb-language-options",children:[w.jsxs("button",{className:a==="en"?"wb-active":"",onClick:()=>c("en"),children:["πŸ‡ΊπŸ‡Έ ",i("english")]}),w.jsxs("button",{className:a==="tr"?"wb-active":"",onClick:()=>c("tr"),children:["πŸ‡ΉπŸ‡· ",i("turkish")]})]})]})]}),r==="moderator"&&w.jsx("button",{onClick:()=>n(In(!p)),title:p?"Unlock":"Lock",style:{color:p?"red":"inherit"},children:p?w.jsx(pa,{}):w.jsx(ya,{})})]})},wa=()=>{const e=Jt(),{t}=Kr(),r=oe(g=>g.whiteboard.toolbar.selectedTool),n=oe(g=>g.whiteboard.toolProperties),i=oe(g=>g.whiteboard.selectedElementId),a=oe(g=>g.whiteboard.elements),f=i?a.find(g=>g.id===i):null,h=(g,m,E)=>{e(Pi({tool:g,property:m,value:E}))},p=(g,m)=>{i&&e(gt({id:i,updates:{[g]:m}}))},l=()=>{i&&e(Ni(i))},u=()=>{i&&e(Ai(i))};if(r==="pointer"&&f&&f.type==="text")return w.jsxs("div",{className:"wb-prop-tools",children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:f.fontSize||16,onChange:g=>p("fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:f.fontColor||"#000000",onChange:g=>p("fontColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(r==="pointer"&&f){const g=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(f.type),m=f.type==="pencil";return w.jsxs("div",{className:"wb-prop-tools",children:[g&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:f.fillColor,onChange:E=>p("fillColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]}),m&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:f.strokeColor,onChange:E=>p("strokeColor",E.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:f.lineWidth,onChange:E=>p("lineWidth",parseInt(E.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("layerOrder")}),w.jsxs("div",{className:"wb-layer-buttons",children:[w.jsx("button",{onClick:l,title:t("bringToFront"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),w.jsx("button",{onClick:u,title:t("sendToBack"),children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return w.jsxs("div",{className:"wb-prop-tools",children:[r==="text"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontSize")}),w.jsxs("select",{className:"font-size-selector",value:n.text.fontSize,onChange:g=>h("text","fontSize",parseInt(g.target.value)),children:[w.jsx("option",{value:"12",children:"12 px"}),w.jsx("option",{value:"14",children:"14 px"}),w.jsx("option",{value:"16",children:"16 px"}),w.jsx("option",{value:"18",children:"18 px"}),w.jsx("option",{value:"24",children:"24 px"}),w.jsx("option",{value:"32",children:"32 px"}),w.jsx("option",{value:"48",children:"48 px"}),w.jsx("option",{value:"64",children:"64 px"}),w.jsx("option",{value:"72",children:"72 px"})]})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fontColor")}),w.jsx("input",{type:"color",value:n.text.fontColor,onChange:g=>h("text","fontColor",g.target.value)})]})]}),r==="pencil"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushColor")}),w.jsx("input",{type:"color",value:n.pencil.strokeColor,onChange:g=>h("pencil","strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("brushSize")}),w.jsxs("select",{className:"brush-size-selector",value:n.pencil.lineWidth,onChange:g=>h("pencil","lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"}),w.jsx("option",{value:"16",children:"16 px"})]})]})]}),(r==="rectangle"||r==="circle"||r==="triangle"||r==="diamond"||r==="star"||r==="heart"||r==="hexagon"||r==="octagon"||r==="arrow")&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeColor")}),w.jsx("input",{type:"color",value:n[r].strokeColor,onChange:g=>h(r,"strokeColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("fillColor")}),w.jsx("input",{type:"color",value:n[r].fillColor,onChange:g=>h(r,"fillColor",g.target.value)})]}),w.jsxs("div",{className:"wb-prop-tool-item",children:[w.jsx("span",{children:t("strokeWidth")}),w.jsxs("select",{className:"stroke-width-selector",value:n[r].lineWidth,onChange:g=>h(r,"lineWidth",parseInt(g.target.value)),children:[w.jsx("option",{value:"1",children:"1 px"}),w.jsx("option",{value:"2",children:"2 px"}),w.jsx("option",{value:"4",children:"4 px"}),w.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},$n=M.forwardRef(({onAction:e,watermark:t,isLocked:r,lockText:n,onLockChange:i,isWatermarkEnabled:a,watermarkText:f,mode:h},p)=>{var Vt;const l=M.useRef(null),u=Jt(),g=oe(s=>s.whiteboard.grid),m=oe(s=>s.whiteboard.toolbar.selectedTool),E=oe(s=>s.whiteboard.elements),v=oe(s=>s.whiteboard.viewport),d=oe(s=>s.whiteboard.toolProperties),S=oe(s=>s.whiteboard.selectedElementId),T=oe(s=>s.whiteboard.lock),k=T.isLocked,[P,N]=M.useState(!1),[c,R]=M.useState({x:0,y:0}),[j,Y]=M.useState({x:0,y:0}),[Z,q]=M.useState([]),[H,ie]=M.useState(!1),[G,ee]=M.useState({x:0,y:0}),[fe,Te]=M.useState(!1),[Se,ye]=M.useState(!1),[be,we]=M.useState(!1),[Me,Le]=M.useState({x:0,y:0}),[ke,qe]=M.useState({y:0,initialZoom:1}),[Ye,ge]=M.useState(!1),[Ce,_e]=M.useState({x:0,y:0}),[ae,se]=M.useState(""),[ce,D]=M.useState(null),le=M.useRef(null),z=M.useRef(null),de=M.useCallback(s=>{ce&&s.trim()&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce&&s!==z.current&&(z.current=s,u(gt({id:ce,updates:{text:s}})))},150))},[u,ce]);M.useEffect(()=>()=>{le.current&&clearTimeout(le.current)},[]),M.useEffect(()=>{e&&Vi(e)},[e]),M.useImperativeHandle(p,()=>({canvas:l.current,applyAction:s=>{u({...s,meta:{...s.meta,fromRemote:!0}})},getElems:()=>E,getElements:()=>E,setElems:s=>{u({...An(s),meta:{fromRemote:!0}})},setElements:s=>{u({...An(s),meta:{fromRemote:!0}})},clearElems:()=>{u({...Nn(),meta:{fromRemote:!0}})},clearElements:()=>{u({...Nn(),meta:{fromRemote:!0}})}})),M.useEffect(()=>{r!==void 0&&r!==k&&u(In(r))},[r,k,u]),M.useEffect(()=>{i&&i(k)},[k,i]);const he=oe(s=>s.whiteboard.watermark);M.useEffect(()=>{a!==void 0&&a!==he.visible&&u(Ii(a))},[a,he.visible,u]),M.useEffect(()=>{f!==void 0&&f!==he.text&&u(Di(f))},[f,he.text,u]);const Ve=M.useCallback((s,b,C)=>{const o=s.canvas,y=o.width,x=o.height,O=Math.floor(-v.panX/v.zoom/b)*b,_=Math.floor(-v.panY/v.zoom/b)*b,A=Math.ceil((y/v.zoom-v.panX/v.zoom)/b)*b,W=Math.ceil((x/v.zoom-v.panY/v.zoom)/b)*b;s.strokeStyle=C,s.lineWidth=.5/v.zoom;for(let I=O;I<=A;I+=b)s.beginPath(),s.moveTo(I,_),s.lineTo(I,W),s.stroke();for(let I=_;I<=W;I+=b)s.beginPath(),s.moveTo(O,I),s.lineTo(A,I),s.stroke()},[v]),He=M.useCallback((s,b,C)=>{const o=Math.min(b.x,C.x),y=Math.min(b.y,C.y),x=Math.abs(C.x-b.x),O=Math.abs(C.y-b.y);s.strokeStyle="#0066cc",s.lineWidth=1,s.setLineDash([5,5]),s.strokeRect(o,y,x,O),s.fillStyle="rgba(0, 102, 204, 0.1)",s.fillRect(o,y,x,O),s.setLineDash([])},[]),at=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b;s.fillStyle=O,s.fillRect(C,o,y,x),s.strokeStyle=_,s.lineWidth=A,s.strokeRect(C,o,y,x)},[]),Ge=M.useCallback((s,b)=>{const{centerX:C,centerY:o,radius:y,fillColor:x="#000",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath(),s.arc(C,o,y,0,Math.PI*2),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),$e=M.useCallback((s,b)=>{const{points:C,strokeColor:o="#000",lineWidth:y=2}=b;if(!(C.length<2)){s.strokeStyle=o,s.lineWidth=y,s.lineCap="round",s.lineJoin="round",s.beginPath(),s.moveTo(C[0].x,C[0].y);for(let x=1;x<C.length;x++)s.lineTo(C[x].x,C[x].y);s.stroke()}},[]),It=M.useCallback((s,b)=>{const{x:C,y:o,text:y,fontSize:x=16,fontColor:O="#000"}=b;s.font=`${x}px sans-serif`,s.fillStyle=O,s.textBaseline="top",s.fillText(y,C,o)},[]),Ke=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x),s.lineTo(C,o+x),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),Je=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b;s.beginPath(),s.moveTo(C+y/2,o),s.lineTo(C+y,o+x/2),s.lineTo(C+y/2,o+x),s.lineTo(C,o+x/2),s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),st=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ffff00",strokeColor:O="#000",lineWidth:_=2}=b,A=5,W=y,I=y/2;s.beginPath();for(let U=0;U<A*2;U++){const V=U%2===0?W:I,L=Math.PI/A*U-Math.PI/2,J=C+Math.cos(L)*V,re=o+Math.sin(L)*V;U===0?s.moveTo(J,re):s.lineTo(J,re)}s.closePath(),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),ct=M.useCallback((s,b)=>{const{centerX:C,centerY:o,size:y,fillColor:x="#ff6b6b",strokeColor:O="#000",lineWidth:_=2}=b;s.beginPath();const A=o-y/2;s.moveTo(C,A+y/4),s.bezierCurveTo(C-y/2,A,C-y,A+y/2,C,o+y/2),s.bezierCurveTo(C+y,A+y/2,C+y/2,A,C,A+y/4),s.fillStyle=x,s.fill(),s.strokeStyle=O,s.lineWidth=_,s.stroke()},[]),lt=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<6;L++){const J=Math.PI/3*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ut=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,fillColor:O="#fff",strokeColor:_="#000",lineWidth:A=2}=b,W=C+y/2,I=o+x/2,U=y/2,V=x/2;s.beginPath();for(let L=0;L<8;L++){const J=Math.PI/4*L-Math.PI/2,re=W+Math.cos(J)*U,xe=I+Math.sin(J)*V;L===0?s.moveTo(re,xe):s.lineTo(re,xe)}s.closePath(),s.fillStyle=O,s.fill(),s.strokeStyle=_,s.lineWidth=A,s.stroke()},[]),ft=M.useCallback((s,b)=>{const{startX:C,startY:o,endX:y,endY:x,fillColor:O="#000",strokeColor:_="#000",lineWidth:A=2}=b,W=15,I=Math.atan2(x-o,y-C);s.beginPath(),s.moveTo(C,o),s.lineTo(y,x),s.strokeStyle=_,s.lineWidth=A,s.stroke(),s.beginPath(),s.moveTo(y,x),s.lineTo(y-W*Math.cos(I-Math.PI/6),x-W*Math.sin(I-Math.PI/6)),s.lineTo(y-W*Math.cos(I+Math.PI/6),x-W*Math.sin(I+Math.PI/6)),s.closePath(),s.fillStyle=O,s.fill()},[]),dt=M.useRef({}),bt=M.useRef(null),ht=M.useCallback((s,b)=>{const{x:C,y:o,width:y,height:x,src:O}=b;if(dt.current[O]){const _=dt.current[O];_.complete&&s.drawImage(_,C,o,y,x)}else{const _=new Image;_.onload=()=>{dt.current[O]=_,bt.current&&bt.current()},_.src=O,dt.current[O]=_}},[]),Ze=M.useCallback((s,b)=>{switch(b.type){case"rectangle":at(s,b);break;case"circle":Ge(s,b);break;case"pencil":$e(s,b);break;case"text":It(s,b);break;case"triangle":Ke(s,b);break;case"diamond":Je(s,b);break;case"star":st(s,b);break;case"heart":ct(s,b);break;case"hexagon":lt(s,b);break;case"octagon":ut(s,b);break;case"arrow":ft(s,b);break;case"image":ht(s,b);break}},[at,Ge,$e,It,Ke,Je,st,ct,lt,ut,ft,ht]),Fe=M.useCallback(()=>{const s=l.current;if(!s)return;const b=document.createElement("canvas");b.width=s.width,b.height=s.height;const C=b.getContext("2d");C.fillStyle="#ffffff",C.fillRect(0,0,b.width,b.height),C.save(),C.translate(v.panX,v.panY),C.scale(v.zoom,v.zoom),E.forEach(x=>{Ze(C,x)}),C.restore();const o=b.toDataURL("image/png"),y=document.createElement("a");y.download=`whiteboard-${Date.now()}.png`,y.href=o,y.click()},[v,E,Ze]),wt=M.useCallback(()=>{const s=l.current;s&&u(Ri({canvasWidth:s.width,canvasHeight:s.height,padding:50}))},[u]),Qe=M.useCallback((s,b)=>{for(let C=E.length-1;C>=0;C--){const o=E[C];if(o.type==="rectangle"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="circle"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.radius)return o}else if(o.type==="pencil")for(let x=1;x<o.points.length;x++){const O=o.points[x-1],_=o.points[x];if(xt(s,b,O.x,O.y,_.x,_.y)<=5)return o}else if(o.type==="text"){const y=o.fontSize||16,x=o.text.length*y*.6,O=y;if(s>=o.x&&s<=o.x+x&&b>=o.y&&b<=o.y+O)return o}else if(o.type==="triangle"||o.type==="diamond"||o.type==="hexagon"||o.type==="octagon"){if(s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}else if(o.type==="star"||o.type==="heart"){if(Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(b-o.centerY,2))<=o.size)return o}else if(o.type==="arrow"){if(xt(s,b,o.startX,o.startY,o.endX,o.endY)<=10)return o}else if(o.type==="image"&&s>=o.x&&s<=o.x+o.width&&b>=o.y&&b<=o.y+o.height)return o}return null},[E]),xt=(s,b,C,o,y,x)=>{const O=s-C,_=b-o,A=y-C,W=x-o,I=O*A+_*W,U=A*A+W*W;let V=-1;U!==0&&(V=I/U);let L,J;V<0?(L=C,J=o):V>1?(L=y,J=x):(L=C+V*A,J=o+V*W);const re=s-L,xe=b-J;return Math.sqrt(re*re+xe*xe)},Dt=M.useCallback((s,b)=>{if(s.strokeStyle="#0066cc",s.lineWidth=2,s.setLineDash([5,5]),b.type==="rectangle")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="circle")s.beginPath(),s.arc(b.centerX,b.centerY,b.radius+4,0,Math.PI*2),s.stroke();else if(b.type==="pencil"&&b.points.length>0){const C=Math.min(...b.points.map(O=>O.x)),o=Math.max(...b.points.map(O=>O.x)),y=Math.min(...b.points.map(O=>O.y)),x=Math.max(...b.points.map(O=>O.y));s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else if(b.type==="text"){const C=b.fontSize||16,o=b.text.length*C*.6,y=C;s.strokeRect(b.x-4,b.y-4,o+8,y+8)}else if(b.type==="triangle"||b.type==="diamond"||b.type==="hexagon"||b.type==="octagon")s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);else if(b.type==="star"||b.type==="heart")s.beginPath(),s.arc(b.centerX,b.centerY,b.size+4,0,Math.PI*2),s.stroke();else if(b.type==="arrow"){const C=Math.min(b.startX,b.endX),o=Math.max(b.startX,b.endX),y=Math.min(b.startY,b.endY),x=Math.max(b.startY,b.endY);s.strokeRect(C-4,y-4,o-C+8,x-y+8)}else b.type==="image"&&s.strokeRect(b.x-4,b.y-4,b.width+8,b.height+8);s.setLineDash([])},[]),me=M.useCallback(()=>{const s=l.current;if(!s)return;const b=s.getContext("2d");b.clearRect(0,0,s.width,s.height),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),g.enabled&&Ve(b,g.size,g.color),E.forEach(C=>{Ze(b,C),C.id===S&&Dt(b,C)}),b.restore()},[g,Ve,E,Ze,S,Dt,v]);M.useEffect(()=>{bt.current=me},[me]),M.useEffect(()=>{const s=l.current;if(!s)return;const b=s.parentElement;if(!b)return;const C=()=>{const y=b.getBoundingClientRect();s.width=y.width,s.height=y.height,me()};C();const o=new ResizeObserver(()=>{C()});return o.observe(b),()=>{o.disconnect()}},[me]),M.useEffect(()=>{me()},[me]),M.useEffect(()=>{const s=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&!C.repeat&&(C.preventDefault(),Te(!0))},b=C=>{C.target.tagName==="INPUT"||C.target.tagName==="TEXTAREA"||C.code==="Space"&&(C.preventDefault(),Te(!1),ye(!1),we(!1))};return window.addEventListener("keydown",s),window.addEventListener("keyup",b),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",b)}},[]);const Et=M.useCallback((s,b)=>({x:(s-v.panX)/v.zoom,y:(b-v.panY)/v.zoom}),[v]);M.useEffect(()=>{const s=l.current;if(!s||!P)return;const b=s.getContext("2d");if(me(),b.save(),b.translate(v.panX,v.panY),b.scale(v.zoom,v.zoom),m==="pointer")He(b,c,j);else if(m==="rectangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);at(b,{x:C,y:o,width:y,height:x,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth})}else if(m==="circle"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));Ge(b,{centerX:C,centerY:o,radius:y,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth})}else if(m==="pencil")$e(b,{points:Z,strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth});else if(m==="triangle"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Ke(b,{x:C,y:o,width:y,height:x,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth})}else if(m==="diamond"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);Je(b,{x:C,y:o,width:y,height:x,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth})}else if(m==="star"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));st(b,{centerX:C,centerY:o,size:y,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth})}else if(m==="heart"){const C=c.x,o=c.y,y=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));ct(b,{centerX:C,centerY:o,size:y,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth})}else if(m==="hexagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);lt(b,{x:C,y:o,width:y,height:x,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth})}else if(m==="octagon"){const C=Math.min(c.x,j.x),o=Math.min(c.y,j.y),y=Math.abs(j.x-c.x),x=Math.abs(j.y-c.y);ut(b,{x:C,y:o,width:y,height:x,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth})}else m==="arrow"&&ft(b,{startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth});b.restore()},[P,m,c,j,Z,me,He,at,Ge,$e,Ke,Je,st,ct,lt,ut,ft,v,d]);const zt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(Ye)return;if(fe){s.preventDefault(),s.button===0?(ye(!0),Le({x:o-v.panX,y:y-v.panY})):s.button===2&&(we(!0),qe({y,initialZoom:v.zoom}));return}if(k)return;const{x,y:O}=Et(o,y);if(m==="pointer"){const _=Qe(x,O);if(_)if(u(mt(_.id)),ie(!0),_.type==="rectangle")ee({x:x-_.x,y:O-_.y});else if(_.type==="circle")ee({x:x-_.centerX,y:O-_.centerY});else if(_.type==="pencil"){const A=Math.min(..._.points.map(I=>I.x)),W=Math.min(..._.points.map(I=>I.y));ee({x:x-A,y:O-W})}else _.type==="text"?ee({x:x-_.x,y:O-_.y}):_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon"?ee({x:x-_.x,y:O-_.y}):_.type==="star"||_.type==="heart"?ee({x:x-_.centerX,y:O-_.centerY}):_.type==="arrow"?ee({x:x-_.startX,y:O-_.startY}):_.type==="image"&&ee({x:x-_.x,y:O-_.y});else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O})}else if(m==="text"){const _=Date.now().toString();u(ve({id:_,type:"text",x,y:O,text:"Text",fontSize:d.text.fontSize,fontColor:d.text.fontColor})),u(Pe("pointer")),u(mt(_))}else if(m==="eraser"){const _=Qe(x,O);_&&u(Ti(_.id))}else u(mt(null)),N(!0),R({x,y:O}),Y({x,y:O}),m==="pencil"&&q([{x,y:O}])},Wt=s=>{const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top;if(Se){u(Mi({x:o-Me.x,y:y-Me.y}));return}if(be){const _=ke.y-y,W=ke.initialZoom*(1+_*.005);u(ki(W));return}if(k)return;const{x,y:O}=Et(o,y);if(H&&S){const _=E.find(W=>W.id===S);if(!_)return;let A={};if(_.type==="rectangle")A={x:x-G.x,y:O-G.y};else if(_.type==="circle")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="pencil"){const W=Math.min(..._.points.map(L=>L.x)),I=Math.min(..._.points.map(L=>L.y)),U=x-G.x-W,V=O-G.y-I;A={points:_.points.map(L=>({x:L.x+U,y:L.y+V}))}}else if(_.type==="text")A={x:x-G.x,y:O-G.y};else if(_.type==="triangle"||_.type==="diamond"||_.type==="hexagon"||_.type==="octagon")A={x:x-G.x,y:O-G.y};else if(_.type==="star"||_.type==="heart")A={centerX:x-G.x,centerY:O-G.y};else if(_.type==="arrow"){const W=_.endX-_.startX,I=_.endY-_.startY;A={startX:x-G.x,startY:O-G.y,endX:x-G.x+W,endY:O-G.y+I}}else _.type==="image"&&(A={x:x-G.x,y:O-G.y});u(gt({id:S,updates:A}));return}P&&(Y({x,y:O}),m==="pencil"&&q(_=>[..._,{x,y:O}]))},Lt=()=>{if(Se||be){ye(!1),we(!1);return}if(k){ie(!1),N(!1);return}if(H){ie(!1);return}if(P){if(m==="pointer")me();else if(m==="rectangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"rectangle",x:s,y:b,width:C,height:o,strokeColor:d.rectangle.strokeColor,fillColor:d.rectangle.fillColor,lineWidth:d.rectangle.lineWidth}))}else if(m==="circle"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"circle",centerX:s,centerY:b,radius:C,strokeColor:d.circle.strokeColor,fillColor:d.circle.fillColor,lineWidth:d.circle.lineWidth}))}else if(m==="pencil")Z.length>1&&u(ve({id:Date.now().toString(),type:"pencil",points:[...Z],strokeColor:d.pencil.strokeColor,lineWidth:d.pencil.lineWidth})),q([]);else if(m==="triangle"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"triangle",x:s,y:b,width:C,height:o,strokeColor:d.triangle.strokeColor,fillColor:d.triangle.fillColor,lineWidth:d.triangle.lineWidth}))}else if(m==="diamond"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"diamond",x:s,y:b,width:C,height:o,strokeColor:d.diamond.strokeColor,fillColor:d.diamond.fillColor,lineWidth:d.diamond.lineWidth}))}else if(m==="star"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"star",centerX:s,centerY:b,size:C,strokeColor:d.star.strokeColor,fillColor:d.star.fillColor,lineWidth:d.star.lineWidth}))}else if(m==="heart"){const s=c.x,b=c.y,C=Math.sqrt(Math.pow(j.x-c.x,2)+Math.pow(j.y-c.y,2));C>0&&u(ve({id:Date.now().toString(),type:"heart",centerX:s,centerY:b,size:C,strokeColor:d.heart.strokeColor,fillColor:d.heart.fillColor,lineWidth:d.heart.lineWidth}))}else if(m==="hexagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"hexagon",x:s,y:b,width:C,height:o,strokeColor:d.hexagon.strokeColor,fillColor:d.hexagon.fillColor,lineWidth:d.hexagon.lineWidth}))}else if(m==="octagon"){const s=Math.min(c.x,j.x),b=Math.min(c.y,j.y),C=Math.abs(j.x-c.x),o=Math.abs(j.y-c.y);C>0&&o>0&&u(ve({id:Date.now().toString(),type:"octagon",x:s,y:b,width:C,height:o,strokeColor:d.octagon.strokeColor,fillColor:d.octagon.fillColor,lineWidth:d.octagon.lineWidth}))}else if(m==="arrow"){const s=j.x-c.x,b=j.y-c.y;Math.sqrt(s*s+b*b)>5&&u(ve({id:Date.now().toString(),type:"arrow",startX:c.x,startY:c.y,endX:j.x,endY:j.y,strokeColor:d.arrow.strokeColor,fillColor:d.arrow.fillColor,lineWidth:d.arrow.lineWidth}))}N(!1)}},Er=s=>{fe&&s.preventDefault()},Yt=()=>fe?Se?"grabbing":be?"ns-resize":"grab":"default";return w.jsxs("div",{id:"wb-canvas-container",style:{backgroundColor:"#fff",position:"relative",width:"100%",height:"100%"},children:[w.jsx("canvas",{ref:l,onMouseDown:zt,onMouseMove:Wt,onMouseUp:Lt,onMouseLeave:Lt,onDoubleClick:s=>{if(k)return;const C=l.current.getBoundingClientRect(),o=s.clientX-C.left,y=s.clientY-C.top,{x,y:O}=Et(o,y),_=Qe(x,O);_&&_.type==="text"&&(D(_.id),_e({x:_.x,y:_.y}),se(_.text),z.current=_.text,ge(!0))},onContextMenu:Er,style:{cursor:Yt()}}),k&&w.jsx(ua,{text:n||((Vt=t==null?void 0:t.lock)==null?void 0:Vt.text)||T.text}),Ye&&w.jsx("input",{type:"text",value:ae,onChange:s=>{const b=s.target.value;se(b),de(b)},onKeyDown:s=>{s.key==="Enter"&&ae.trim()?(ce&&(u(gt({id:ce,updates:{text:ae}})),z.current=ae),ge(!1),se(""),D(null)):s.key==="Escape"&&(ge(!1),se(""),D(null))},onBlur:()=>{ae.trim()&&ce&&(u(gt({id:ce,updates:{text:ae}})),z.current=ae),ge(!1),se(""),D(null)},onMouseDown:s=>s.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:Ce.x*v.zoom+v.panX,top:Ce.y*v.zoom+v.panY,fontSize:d.text.fontSize*v.zoom,color:d.text.fontColor,background:"white",border:"2px solid #0066cc",outline:"none",fontFamily:"sans-serif",minWidth:"150px",padding:"4px 8px",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}}),w.jsx(ba,{onExport:Fe,onFitToView:wt,mode:h}),w.jsx(wa,{}),he.visible&&w.jsx(Fi,{})]})}),xa=M.forwardRef((e,t)=>w.jsx(mo,{store:zn,children:w.jsx(Co,{children:w.jsx($n,{ref:t,...e})})}));pe.WhiteboardComponent=$n,pe.default=xa,pe.store=zn,pe.whiteboardActions=zi,pe.whiteboardReducer=Dn,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
97
+ (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),E||(_.measureTime(function(){var $=M.getState(),k=Rr($,"",r,n,s,N);if(k){var oe=k.keyPath,ie=k.value;console.error("A non-serializable value was detected in the state, in the path: `"+oe+"`. Value:",ie,`
98
+ Take a look at the reducer(s) handling this action type: `+x.type+`.
99
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),_.warnIfExceeded()),T}}}}function Gt(e){return typeof e=="boolean"}function Li(){return function(t){return Yi(t)}}function Yi(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,o=n===void 0?!0:n,a=e.serializableCheck,l=a===void 0?!0:a,c=e.actionCreatorCheck,f=c===void 0?!0:c,s=new Mi;if(r&&(Gt(r)?s.push(Tr):s.push(Tr.withExtraArgument(r.extraArgument))),process.env.NODE_ENV!=="production"){if(o){var v={};Gt(o)||(v=o),s.unshift(zi(v))}if(l){var y={};Gt(l)||(y=l),s.push(Wi(y))}if(f){var m={};Gt(f)||(m=f),s.unshift(Ti(m))}}return s}var Nr=process.env.NODE_ENV==="production";function Vi(e){var t=Li(),r=e||{},n=r.reducer,o=n===void 0?void 0:n,a=r.middleware,l=a===void 0?t():a,c=r.devTools,f=c===void 0?!0:c,s=r.preloadedState,v=s===void 0?void 0:s,y=r.enhancers,m=y===void 0?void 0:y,E;if(typeof o=="function")E=o;else if(Fn(o))E=yi(o);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var h=l;if(typeof h=="function"&&(h=h(t),!Nr&&!Array.isArray(h)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Nr&&h.some(function(A){return typeof A!="function"}))throw new Error("each middleware provided to configureStore must be a function");var b=mi.apply(void 0,h),d=Ht;f&&(d=_i(Ze({trace:!Nr},typeof f=="object"&&f)));var C=new ki(b),N=C;Array.isArray(m)?N=Et([b],m):typeof m=="function"&&(N=m(C));var M=d.apply(void 0,N);return zn(E,v,M)}function Jn(e){var t={},r=[],n,o={addCase:function(a,l){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var c=typeof a=="string"?a:a.type;if(!c)throw new Error("`builder.addCase` cannot be called with an empty action type");if(c in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[c]=l,o},addMatcher:function(a,l){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:a,reducer:l}),o},addDefaultCase:function(a){if(process.env.NODE_ENV!=="production"&&n)throw new Error("`builder.addDefaultCase` can only be called once");return n=a,o}};return e(o),[t,r,n]}function $i(e){return typeof e=="function"}var Zn=!1;function Fi(e,t,r,n){r===void 0&&(r=[]),process.env.NODE_ENV!=="production"&&typeof t=="object"&&(Zn||(Zn=!0,console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer")));var o=typeof t=="function"?Jn(t):[t,r,n],a=o[0],l=o[1],c=o[2],f;if($i(e))f=function(){return kr(e())};else{var s=kr(e);f=function(){return s}}function v(y,m){y===void 0&&(y=f());var E=Et([a[m.type]],l.filter(function(h){var b=h.matcher;return b(m)}).map(function(h){var b=h.reducer;return b}));return E.filter(function(h){return!!h}).length===0&&(E=[c]),E.reduce(function(h,b){if(b)if(Ge(h)){var d=h,C=b(d,m);return C===void 0?h:C}else{if(Fe(h))return Rn(h,function(N){return b(N,m)});var C=b(h,m);if(C===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}return h},y)}return v.getInitialState=f,v}var Qn=!1;function Xi(e,t){return e+"/"+t}function Bi(e){var t=e.name;typeof process<"u"&&process.env.NODE_ENV==="development"&&e.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");var r=typeof e.initialState=="function"?e.initialState:kr(e.initialState),n=e.reducers||{},o=Object.keys(n),a={},l={},c={};o.forEach(function(v){var y=n[v],m=Xi(t,v),E,h;"reducer"in y?(E=y.reducer,h=y.prepare):E=y,a[v]=E,l[m]=E,c[v]=h?Qe(m,h):Qe(m)});function f(){process.env.NODE_ENV!=="production"&&typeof e.extraReducers=="object"&&(Qn||(Qn=!0,console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice")));var v=typeof e.extraReducers=="function"?Jn(e.extraReducers):[e.extraReducers],y=v[0],m=y===void 0?{}:y,E=v[1],h=E===void 0?[]:E,b=v[2],d=b===void 0?void 0:b,C=Ze(Ze({},m),l);return Fi(r,function(N){for(var M in C)N.addCase(M,C[M]);for(var A=0,x=h;A<x.length;A++){var T=x[A];N.addMatcher(T.matcher,T.reducer)}d&&N.addDefaultCase(d)})}var s;return{name:t,reducer:function(v,y){return s||(s=f()),s(v,y)},actions:c,caseReducers:a,getInitialState:function(){return s||(s=f()),s.getInitialState()}}}var Ui="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",qi=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=Ui[Math.random()*64|0];return t},Hi=["name","message","stack","code"],Ar=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),eo=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Gi=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Hi;r<n.length;r++){var o=n[r];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}};(function(){function e(t,r,n){var o=Qe(t+"/fulfilled",function(v,y,m,E){return{payload:v,meta:Mr(Ze({},E||{}),{arg:m,requestId:y,requestStatus:"fulfilled"})}}),a=Qe(t+"/pending",function(v,y,m){return{payload:void 0,meta:Mr(Ze({},m||{}),{arg:y,requestId:v,requestStatus:"pending"})}}),l=Qe(t+"/rejected",function(v,y,m,E,h){return{payload:E,error:(n&&n.serializeError||Gi)(v||"Rejected"),meta:Mr(Ze({},h||{}),{arg:m,requestId:y,rejectedWithValue:!!E,requestStatus:"rejected",aborted:(v==null?void 0:v.name)==="AbortError",condition:(v==null?void 0:v.name)==="ConditionError"})}}),c=!1,f=typeof AbortController<"u"?AbortController:(function(){function v(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return v.prototype.abort=function(){process.env.NODE_ENV!=="production"&&(c||(c=!0,console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.")))},v})();function s(v){return function(y,m,E){var h=n!=null&&n.idGenerator?n.idGenerator(v):qi(),b=new f,d;function C(M){d=M,b.abort()}var N=(function(){return Ci(this,null,function(){var M,A,x,T,_,$,k;return gi(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,4,,5]),T=(M=n==null?void 0:n.condition)==null?void 0:M.call(n,v,{getState:m,extra:E}),Ji(T)?[4,T]:[3,2];case 1:T=oe.sent(),oe.label=2;case 2:if(T===!1||b.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=new Promise(function(ie,fe){return b.signal.addEventListener("abort",function(){return fe({name:"AbortError",message:d||"Aborted"})})}),y(a(h,v,(A=n==null?void 0:n.getPendingMeta)==null?void 0:A.call(n,{requestId:h,arg:v},{getState:m,extra:E}))),[4,Promise.race([_,Promise.resolve(r(v,{dispatch:y,getState:m,extra:E,requestId:h,signal:b.signal,abort:C,rejectWithValue:function(ie,fe){return new Ar(ie,fe)},fulfillWithValue:function(ie,fe){return new eo(ie,fe)}})).then(function(ie){if(ie instanceof Ar)throw ie;return ie instanceof eo?o(ie.payload,h,v,ie.meta):o(ie,h,v)})])];case 3:return x=oe.sent(),[3,5];case 4:return $=oe.sent(),x=$ instanceof Ar?l(null,h,v,$.payload,$.meta):l($,h,v),[3,5];case 5:return k=n&&!n.dispatchConditionRejection&&l.match(x)&&x.meta.condition,k||y(x),[2,x]}})})})();return Object.assign(N,{abort:C,requestId:h,arg:v,unwrap:function(){return N.then(Ki)}})}}return Object.assign(s,{pending:a,rejected:l,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e})();function Ki(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ji(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Ir="listenerMiddleware";Qe(Ir+"/add"),Qe(Ir+"/removeAll"),Qe(Ir+"/remove");var to;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis),ti();const Zi={grid:{size:20,color:"#ccc",enabled:!0},toolbar:{selectedTool:"pointer"},toolProperties:{pencil:{strokeColor:"#000000",lineWidth:4},rectangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},circle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},triangle:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},diamond:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},star:{strokeColor:"#000000",fillColor:"#ffff00",lineWidth:2},heart:{strokeColor:"#000000",fillColor:"#ff6b6b",lineWidth:2},hexagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},octagon:{strokeColor:"#000000",fillColor:"#ffffff",lineWidth:2},arrow:{strokeColor:"#000000",fillColor:"#000000",lineWidth:2},text:{fontSize:16,fontColor:"#000000"}},elements:[],selectedElementIds:[],viewport:{panX:0,panY:0,zoom:1},watermark:{text:"Nines Studios",url:"https://github.com/huzeyfecoskun",visible:!0},lock:{isLocked:!1,text:"Whiteboard drawing is only for moderator"}};function Qi(e){const t=[],r=new Set;for(const n of e){const o=n==null?void 0:n.id;if(o==null){t.push(n);continue}r.has(o)||(r.add(o),t.push(n))}return t}const Dr=Bi({name:"whiteboard",initialState:Zi,reducers:{toggleGrid(e){e.grid.enabled=!e.grid.enabled},setGridSize(e,t){e.grid.size=t.payload},setGridColor(e,t){e.grid.color=t.payload},setSelectedTool(e,t){e.toolbar.selectedTool=t.payload},setToolProperty(e,t){const{tool:r,property:n,value:o}=t.payload;e.toolProperties[r]&&(e.toolProperties[r][n]=o)},addElement(e,t){const r=t.payload,n=r==null?void 0:r.id;n!=null&&e.elements.some(a=>(a==null?void 0:a.id)===n)||e.elements.push(r)},updateElement(e,t){const{id:r,updates:n}=t.payload,o=e.elements.findIndex(a=>a.id===r);o!==-1&&(e.elements[o]={...e.elements[o],...n})},updateElements(e,t){t.payload.forEach(({id:n,updates:o})=>{const a=e.elements.findIndex(l=>l.id===n);a!==-1&&(e.elements[a]={...e.elements[a],...o})})},removeElement(e,t){const r=t.payload;e.elements=e.elements.filter(n=>n.id!==r),e.selectedElementIds=e.selectedElementIds.filter(n=>n!==r)},setSelectedElements(e,t){e.selectedElementIds=t.payload},clearElements(e){e.elements=[],e.selectedElementIds=[]},setElements(e,t){const r=Array.isArray(t.payload)?t.payload:[];e.elements=Qi(r),e.selectedElementIds=[]},setPan(e,t){e.viewport.panX=t.payload.x,e.viewport.panY=t.payload.y},setZoom(e,t){e.viewport.zoom=Math.max(.1,Math.min(5,t.payload))},resetViewport(e){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1},bringToFront(e,t){const r=t.payload,n=e.elements.findIndex(o=>o.id===r);if(n!==-1&&n<e.elements.length-1){const[o]=e.elements.splice(n,1);e.elements.push(o)}},sendToBack(e,t){const r=t.payload,n=e.elements.findIndex(o=>o.id===r);if(n>0){const[o]=e.elements.splice(n,1);e.elements.unshift(o)}},fitToView(e,t){const{canvasWidth:r,canvasHeight:n,padding:o=50}=t.payload,a=e.elements;if(a.length===0){e.viewport.panX=0,e.viewport.panY=0,e.viewport.zoom=1;return}let l=1/0,c=1/0,f=-1/0,s=-1/0;if(a.forEach(x=>{const T=_=>_??0;if(x.type==="rectangle"){const _=T(x.x),$=T(x.y),k=T(x.width),oe=T(x.height);l=Math.min(l,_),c=Math.min(c,$),f=Math.max(f,_+k),s=Math.max(s,$+oe)}else if(x.type==="circle"){const _=T(x.centerX),$=T(x.centerY),k=T(x.radius);l=Math.min(l,_-k),c=Math.min(c,$-k),f=Math.max(f,_+k),s=Math.max(s,$+k)}else if(x.type==="pencil"&&x.points&&x.points.length>0)x.points.forEach(_=>{l=Math.min(l,_.x),c=Math.min(c,_.y),f=Math.max(f,_.x),s=Math.max(s,_.y)});else if(x.type==="triangle"||x.type==="diamond"||x.type==="hexagon"||x.type==="octagon"){const _=T(x.x),$=T(x.y),k=T(x.width),oe=T(x.height);l=Math.min(l,_),c=Math.min(c,$),f=Math.max(f,_+k),s=Math.max(s,$+oe)}else if(x.type==="star"||x.type==="heart"){const _=T(x.centerX),$=T(x.centerY),k=T(x.size);l=Math.min(l,_-k),c=Math.min(c,$-k),f=Math.max(f,_+k),s=Math.max(s,$+k)}else if(x.type==="arrow"){const _=T(x.startX),$=T(x.startY),k=T(x.endX),oe=T(x.endY);l=Math.min(l,_,k),c=Math.min(c,$,oe),f=Math.max(f,_,k),s=Math.max(s,$,oe)}}),l===1/0)return;const v=f-l,y=s-c;if(v<=0||y<=0)return;const m=r-o*2,E=n-o*2,h=m/v,b=E/y,d=Math.min(h,b,5),C=(l+f)/2,N=(c+s)/2,M=r/2-C*d,A=n/2-N*d;e.viewport.zoom=Math.max(.1,d),e.viewport.panX=M,e.viewport.panY=A},setLocked(e,t){e.lock.isLocked=t.payload,t.payload&&(e.toolbar.selectedTool="pointer",e.selectedElementIds=[])},setWatermarkEnabled(e,t){e.watermark.visible=t.payload},setWatermarkText(e,t){e.watermark.text=t.payload}}}),{toggleGrid:Za,setGridSize:Qa,setGridColor:es,setSelectedTool:Xe,setToolProperty:ea,addElement:Oe,updateElement:Kt,updateElements:ro,removeElement:ta,setSelectedElements:at,clearElements:no,setElements:zr,setPan:ra,setZoom:na,resetViewport:ts,fitToView:oa,bringToFront:ia,sendToBack:aa,setLocked:oo,setWatermarkEnabled:sa,setWatermarkText:ca}=Dr.actions,la=Dr.actions,io=Dr.reducer,ua=new Set(["rectangle","circle","pencil","triangle","diamond","star","heart","hexagon","octagon","arrow","text"]),fa=new Set(["strokeColor","fillColor","lineWidth","fontSize","fontColor","textColor"]),da=e=>{var t,r;if(!e||typeof e.type!="string"||e.type.startsWith("@@redux/"))return!1;if(e.type==="whiteboard/addElement"){const n=(t=e==null?void 0:e.payload)==null?void 0:t.type;return typeof n=="string"&&ua.has(n)}if(e.type==="whiteboard/removeElement"||e.type==="whiteboard/clearElements"||e.type==="whiteboard/bringToFront"||e.type==="whiteboard/sendToBack")return!0;if(e.type==="whiteboard/setToolProperty"){const{tool:n,property:o}=(e==null?void 0:e.payload)??{};return typeof n!="string"||typeof o!="string"?!1:fa.has(o)}if(e.type==="whiteboard/updateElement")return ao((r=e==null?void 0:e.payload)==null?void 0:r.updates);if(e.type==="whiteboard/updateElements"){const n=e==null?void 0:e.payload;return Array.isArray(n)?n.some(o=>ao(o.updates)):!1}return!1},ao=e=>{if(!e||typeof e!="object")return!1;const t=r=>Object.prototype.hasOwnProperty.call(e,r);return!!(t("text")||t("fontSize")||t("fontColor")||t("textColor")||t("strokeColor")||t("fillColor")||t("lineWidth")||t("x")||t("y")||t("width")||t("height")||t("centerX")||t("centerY")||t("radius")||t("size")||t("startX")||t("startY")||t("endX")||t("endY")||t("points"))},ha=e=>t=>r=>n=>{var a;const o=r(n);return!((a=n.meta)!=null&&a.fromRemote)&&e&&e.current&&da(n)&&e.current(n,t.getState()),o},Wr=({preloadedState:e,actionHandlerRef:t}={})=>Vi({reducer:{whiteboard:io},middleware:r=>r().concat(ha(t)),preloadedState:e}),pa=Wr(),va=()=>{const e=we(t=>t.whiteboard.watermark);return g.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:g.jsx("div",{className:"wb-watermark",children:e.text})})};var so={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},co=P.createContext&&P.createContext(so),ya=["attr","size","title"];function ma(e,t){if(e==null)return{};var r=ga(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ga(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jt.apply(this,arguments)}function lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lo(Object(r),!0).forEach(function(n){ba(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ba(e,t,r){return t=wa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wa(e){var t=xa(e,"string");return typeof t=="symbol"?t:t+""}function xa(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uo(e){return e&&e.map((t,r)=>P.createElement(t.tag,Zt({key:r},t.attr),uo(t.child)))}function ue(e){return t=>P.createElement(Ea,Jt({attr:Zt({},e.attr)},t),uo(e.child))}function Ea(e){var t=r=>{var{attr:n,size:o,title:a}=e,l=ma(e,ya),c=o||r.size||"1em",f;return r.className&&(f=r.className),e.className&&(f=(f?f+" ":"")+e.className),P.createElement("svg",Jt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:f,style:Zt(Zt({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&P.createElement("title",null,a),e.children)};return co!==void 0?P.createElement(co.Consumer,null,r=>t(r)):t(so)}function Sa(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(e)}function Ca(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"},child:[]}]})(e)}function _a(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function Oa(e){return ue({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"},child:[]}]})(e)}function ja(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function Pa(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"},child:[]}]})(e)}function Ta(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"},child:[]}]})(e)}function Ma(e){return ue({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"},child:[]}]})(e)}function ka(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function Ra(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function Na(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"},child:[]}]})(e)}function Aa(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function Ia(e){return ue({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Da=({text:e,shifted:t})=>g.jsxs("div",{className:`wb-lock-indicator ${t?"wb-shifted":""}`,children:[g.jsx(Ta,{}),g.jsx("span",{children:e||"Locked"})]});function za(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"},child:[]}]})(e)}function Wa(e){return ue({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"},child:[]}]})(e)}function La(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"},child:[]}]})(e)}function Ya(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"},child:[]}]})(e)}function Va(e){return ue({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"},child:[]}]})(e)}function $a(e){return ue({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"},child:[]}]})(e)}function Fa(e){return ue({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.5.134a1 1 0 0 0-1 0l-6 3.577a1 1 0 0 0-.5.866v6.846a1 1 0 0 0 .5.866l6 3.577a1 1 0 0 0 1 0l6-3.577a1 1 0 0 0 .5-.866V4.577a1 1 0 0 0-.5-.866z"},child:[]}]})(e)}function Xa(e){return ue({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.107 0a.5.5 0 0 1 .353.146l4.394 4.394a.5.5 0 0 1 .146.353v6.214a.5.5 0 0 1-.146.353l-4.394 4.394a.5.5 0 0 1-.353.146H4.893a.5.5 0 0 1-.353-.146L.146 11.46A.5.5 0 0 1 0 11.107V4.893a.5.5 0 0 1 .146-.353L4.54.146A.5.5 0 0 1 4.893 0z"},child:[]}]})(e)}const Ba=({onExport:e,onFitToView:t,mode:r="user"})=>{const n=hr(),{t:o,language:a,changeLanguage:l}=wn(),c=we(T=>T.whiteboard.toolbar.selectedTool),f=we(T=>T.whiteboard.lock.isLocked),[s,v]=P.useState(!1),[y,m]=P.useState(!1),E=P.useRef(null),h=P.useRef(null),b=P.useRef(null),d=P.useRef(null),C=P.useRef(null),N=T=>{var k;const _=(k=T.target.files)==null?void 0:k[0];if(!_)return;const $=new FileReader;$.onload=oe=>{var je;const ie=(je=oe.target)==null?void 0:je.result;if(typeof ie!="string")return;const fe=new Image;fe.onload=()=>{const de=Date.now().toString();n(Oe({id:de,type:"image",x:100,y:100,width:fe.width,height:fe.height,src:ie})),n(Xe("pointer")),n(at([de]))},fe.src=ie},$.readAsDataURL(_),T.target.value=""};P.useEffect(()=>{const T=_=>{const $=_.target;E.current&&!E.current.contains($)&&h.current&&!h.current.contains($)&&v(!1),d.current&&!d.current.contains($)&&b.current&&!b.current.contains($)&&m(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const M=[{name:"triangle",icon:g.jsx(Ra,{style:{transform:"rotate(-30deg)"}})},{name:"diamond",icon:g.jsx(Wa,{})},{name:"star",icon:g.jsx(Ia,{})},{name:"heart",icon:g.jsx(ja,{})},{name:"hexagon",icon:g.jsx(Fa,{})},{name:"octagon",icon:g.jsx(Xa,{})},{name:"arrow",icon:g.jsx(za,{})}],A=T=>{n(Xe(T)),v(!1)},x=T=>{l(T),m(!1)};return g.jsxs("div",{className:"wb-toolbar",children:[g.jsx("button",{className:c==="pointer"?"wb-active":"",onClick:()=>n(Xe("pointer")),title:o("pointer"),disabled:f,children:g.jsx(Ma,{})}),g.jsx("button",{className:c==="text"?"wb-active":"",onClick:()=>n(Xe("text")),title:o("text"),disabled:f,children:g.jsx(Va,{})}),g.jsx("button",{onClick:()=>{var T;return(T=C.current)==null?void 0:T.click()},title:o("image"),disabled:f,children:g.jsx(Pa,{})}),g.jsx("input",{type:"file",ref:C,style:{display:"none"},accept:"image/*",onChange:N}),g.jsx("button",{className:c==="pencil"?"wb-active":"",onClick:()=>n(Xe("pencil")),title:o("pencil"),disabled:f,children:g.jsx(ka,{})}),g.jsx("button",{className:c==="rectangle"?"wb-active":"",onClick:()=>n(Xe("rectangle")),title:o("rectangle"),disabled:f,children:g.jsx(Aa,{})}),g.jsx("button",{className:c==="circle"?"wb-active":"",onClick:()=>n(Xe("circle")),title:o("circle"),disabled:f,children:g.jsx(Sa,{})}),g.jsxs("div",{className:"wb-ellipsis-container",children:[g.jsx("button",{ref:h,className:M.some(T=>T.name===c)?"wb-active":"",onClick:()=>v(!s),title:o("moreShapes"),disabled:f,children:g.jsx(La,{})}),s&&g.jsxs("div",{className:"wb-shapes-popup",ref:E,children:[g.jsx("div",{className:"wb-shapes-popup-header",children:o("moreShapes")}),g.jsx("div",{className:"wb-shapes-popup-grid",children:M.map(T=>g.jsx("button",{className:c===T.name?"wb-active":"",onClick:()=>A(T.name),title:o(T.name),children:T.icon},T.name))})]})]}),g.jsx("button",{className:c==="eraser"?"wb-active":"",onClick:()=>n(Xe("eraser")),title:o("eraser"),disabled:f,children:g.jsx(Ca,{})}),g.jsx("button",{onClick:t,title:o("fitToView"),children:g.jsx(_a,{})}),g.jsx("button",{onClick:e,title:o("exportAsPng"),children:g.jsx(Na,{})}),g.jsxs("div",{className:"wb-language-container",children:[g.jsx("button",{ref:b,onClick:()=>m(!y),title:o("language"),children:g.jsx(Oa,{})}),y&&g.jsxs("div",{className:"wb-language-popup",ref:d,children:[g.jsx("div",{className:"wb-language-popup-header",children:o("language")}),g.jsxs("div",{className:"wb-language-options",children:[g.jsxs("button",{className:a==="en"?"wb-active":"",onClick:()=>x("en"),children:["πŸ‡ΊπŸ‡Έ ",o("english")]}),g.jsxs("button",{className:a==="tr"?"wb-active":"",onClick:()=>x("tr"),children:["πŸ‡ΉπŸ‡· ",o("turkish")]})]})]})]}),r==="moderator"&&g.jsx("button",{onClick:()=>n(oo(!f)),title:f?"Unlock":"Lock",style:{color:f?"red":"inherit"},children:f?g.jsx(Ya,{}):g.jsx($a,{})})]})},Ua=({shifted:e})=>{const t=hr(),{t:r}=wn(),n=we(m=>m.whiteboard.toolbar.selectedTool),o=we(m=>m.whiteboard.toolProperties),a=we(m=>m.whiteboard.selectedElementIds||[]),l=we(m=>m.whiteboard.elements),c=a.length>0?l.find(m=>m.id===a[0]):null,f=(m,E,h)=>{t(ea({tool:m,property:E,value:h}))},s=(m,E)=>{if(a.length>0){const h=a.map(b=>({id:b,updates:{[m]:E}}));t(ro(h))}},v=()=>{a.forEach(m=>{t(ia(m))})},y=()=>{[...a].reverse().forEach(m=>{t(aa(m))})};if(n==="pointer"&&c&&c.type==="text")return g.jsxs("div",{className:`wb-prop-tools ${e?"wb-shifted":""}`,children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fontSize")}),g.jsxs("select",{className:"font-size-selector",value:c.fontSize||16,onChange:m=>s("fontSize",parseInt(m.target.value)),children:[g.jsx("option",{value:"12",children:"12 px"}),g.jsx("option",{value:"14",children:"14 px"}),g.jsx("option",{value:"16",children:"16 px"}),g.jsx("option",{value:"18",children:"18 px"}),g.jsx("option",{value:"24",children:"24 px"}),g.jsx("option",{value:"32",children:"32 px"}),g.jsx("option",{value:"48",children:"48 px"}),g.jsx("option",{value:"64",children:"64 px"}),g.jsx("option",{value:"72",children:"72 px"})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fontColor")}),g.jsx("input",{type:"color",value:c.fontColor||"#000000",onChange:m=>s("fontColor",m.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("layerOrder")}),g.jsxs("div",{className:"wb-layer-buttons",children:[g.jsx("button",{onClick:v,title:r("bringToFront"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),g.jsx("button",{onClick:y,title:r("sendToBack"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]});if(n==="pointer"&&c){const m=["rectangle","circle","triangle","diamond","star","heart","hexagon","octagon","arrow"].includes(c.type),E=c.type==="pencil";return g.jsxs("div",{className:`wb-prop-tools ${e?"wb-shifted":""}`,children:[m&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("strokeColor")}),g.jsx("input",{type:"color",value:c.strokeColor,onChange:h=>s("strokeColor",h.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fillColor")}),g.jsx("input",{type:"color",value:c.fillColor,onChange:h=>s("fillColor",h.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("strokeWidth")}),g.jsxs("select",{className:"stroke-width-selector",value:c.lineWidth,onChange:h=>s("lineWidth",parseInt(h.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"})]})]})]}),E&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("brushColor")}),g.jsx("input",{type:"color",value:c.strokeColor,onChange:h=>s("strokeColor",h.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("brushSize")}),g.jsxs("select",{className:"brush-size-selector",value:c.lineWidth,onChange:h=>s("lineWidth",parseInt(h.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"}),g.jsx("option",{value:"16",children:"16 px"})]})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("layerOrder")}),g.jsxs("div",{className:"wb-layer-buttons",children:[g.jsx("button",{onClick:v,title:r("bringToFront"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"white"})]})}),g.jsx("button",{onClick:y,title:r("sendToBack"),children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"1",fill:"#0066cc",stroke:"#0066cc"}),g.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"1",fill:"white"})]})})]})]})]})}return g.jsxs("div",{className:`wb-prop-tools ${e?"wb-shifted":""}`,children:[n==="text"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fontSize")}),g.jsxs("select",{className:"font-size-selector",value:o.text.fontSize,onChange:m=>f("text","fontSize",parseInt(m.target.value)),children:[g.jsx("option",{value:"12",children:"12 px"}),g.jsx("option",{value:"14",children:"14 px"}),g.jsx("option",{value:"16",children:"16 px"}),g.jsx("option",{value:"18",children:"18 px"}),g.jsx("option",{value:"24",children:"24 px"}),g.jsx("option",{value:"32",children:"32 px"}),g.jsx("option",{value:"48",children:"48 px"}),g.jsx("option",{value:"64",children:"64 px"}),g.jsx("option",{value:"72",children:"72 px"})]})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fontColor")}),g.jsx("input",{type:"color",value:o.text.fontColor,onChange:m=>f("text","fontColor",m.target.value)})]})]}),n==="pencil"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("brushColor")}),g.jsx("input",{type:"color",value:o.pencil.strokeColor,onChange:m=>f("pencil","strokeColor",m.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("brushSize")}),g.jsxs("select",{className:"brush-size-selector",value:o.pencil.lineWidth,onChange:m=>f("pencil","lineWidth",parseInt(m.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"}),g.jsx("option",{value:"16",children:"16 px"})]})]})]}),(n==="rectangle"||n==="circle"||n==="triangle"||n==="diamond"||n==="star"||n==="heart"||n==="hexagon"||n==="octagon"||n==="arrow")&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("strokeColor")}),g.jsx("input",{type:"color",value:o[n].strokeColor,onChange:m=>f(n,"strokeColor",m.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("fillColor")}),g.jsx("input",{type:"color",value:o[n].fillColor,onChange:m=>f(n,"fillColor",m.target.value)})]}),g.jsxs("div",{className:"wb-prop-tool-item",children:[g.jsx("span",{children:r("strokeWidth")}),g.jsxs("select",{className:"stroke-width-selector",value:o[n].lineWidth,onChange:m=>f(n,"lineWidth",parseInt(m.target.value)),children:[g.jsx("option",{value:"1",children:"1 px"}),g.jsx("option",{value:"2",children:"2 px"}),g.jsx("option",{value:"4",children:"4 px"}),g.jsx("option",{value:"8",children:"8 px"})]})]})]})]})},Lr=P.forwardRef(({watermark:e,isLocked:t,lockText:r,onLockChange:n,isWatermarkEnabled:o,watermarkText:a,mode:l,initialElements:c,onAfterMount:f},s)=>{var po;const v=P.useRef(null),y=hr(),m=mn(),E=we(i=>i.whiteboard.grid),h=we(i=>i.whiteboard.toolbar.selectedTool),b=we(i=>i.whiteboard.elements),d=we(i=>i.whiteboard.viewport),C=we(i=>i.whiteboard.toolProperties),N=we(i=>i.whiteboard.selectedElementIds||[]),M=we(i=>i.whiteboard.lock),A=M.isLocked,[x,T]=P.useState(!1),[_,$]=P.useState({x:0,y:0}),[k,oe]=P.useState({x:0,y:0}),[ie,fe]=P.useState([]),[je,de]=P.useState(!1),[Me,Be]=P.useState({}),[ze,ke]=P.useState(!1),[Re,Pe]=P.useState(!1),[We,Le]=P.useState(!1),[Ue,st]=P.useState({x:0,y:0}),[et,qe]=P.useState({y:0,initialZoom:1}),[Ye,xe]=P.useState(!1),[Ve,Ne]=P.useState({x:0,y:0}),[Ce,V]=P.useState(""),[ve,F]=P.useState(null),ye=P.useRef(null),_e=P.useRef(null),[ct,lt]=P.useState(!1),[me,It]=P.useState(null),[ut,Qt]=P.useState(null),[Dt,zt]=P.useState(null),[St,er]=P.useState(!1),[ae,Wt]=P.useState(null),Yr=P.useCallback(i=>{ve&&i.trim()&&(ye.current&&clearTimeout(ye.current),ye.current=setTimeout(()=>{ve&&i!==_e.current&&(_e.current=i,y(Kt({id:ve,updates:{text:i}})))},150))},[y,ve]);P.useEffect(()=>()=>{ye.current&&clearTimeout(ye.current)},[]),P.useImperativeHandle(s,()=>({canvas:v.current,applyAction:i=>{y({...i,meta:{...i.meta,fromRemote:!0}})},getElems:()=>m.getState().whiteboard.elements,getElements:()=>m.getState().whiteboard.elements,setElems:i=>{y({...zr(i),meta:{fromRemote:!0}})},setElements:i=>{y({...zr(i),meta:{fromRemote:!0}})},clearElems:()=>{y({...no(),meta:{fromRemote:!0}})},clearElements:()=>{y({...no(),meta:{fromRemote:!0}})}})),P.useEffect(()=>{t!==void 0&&t!==A&&y(oo(t))},[t,A,y]),P.useEffect(()=>{n&&n(A)},[A,n]);const ft=we(i=>i.whiteboard.watermark);P.useEffect(()=>{o!==void 0&&o!==ft.visible&&y(sa(o))},[o,ft.visible,y]),P.useEffect(()=>{a!==void 0&&a!==ft.text&&y(ca(a))},[a,ft.text,y]),P.useEffect(()=>{c&&c.length>0&&y(zr(c))},[y]),P.useEffect(()=>{f&&setTimeout(()=>{f()},0)},[]);const tr=P.useCallback((i,p,w)=>{const S=i.canvas,O=S.width,j=S.height,D=Math.floor(-d.panX/d.zoom/p)*p,I=Math.floor(-d.panY/d.zoom/p)*p,Y=Math.ceil((O/d.zoom-d.panX/d.zoom)/p)*p,X=Math.ceil((j/d.zoom-d.panY/d.zoom)/p)*p;i.strokeStyle=w,i.lineWidth=.5/d.zoom;for(let L=D;L<=Y;L+=p)i.beginPath(),i.moveTo(L,I),i.lineTo(L,X),i.stroke();for(let L=I;L<=X;L+=p)i.beginPath(),i.moveTo(D,L),i.lineTo(Y,L),i.stroke()},[d]),Ct=P.useCallback((i,p,w)=>{const S=Math.min(p.x,w.x),O=Math.min(p.y,w.y),j=Math.abs(w.x-p.x),D=Math.abs(w.y-p.y);i.strokeStyle="#0066cc",i.lineWidth=1,i.setLineDash([5,5]),i.strokeRect(S,O,j,D),i.fillStyle="rgba(0, 102, 204, 0.1)",i.fillRect(S,O,j,D),i.setLineDash([])},[]),dt=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,fillColor:D="#000",strokeColor:I="#000",lineWidth:Y=2}=p;i.fillStyle=D,i.fillRect(w,S,O,j),i.strokeStyle=I,i.lineWidth=Y,i.strokeRect(w,S,O,j)},[]),Ae=P.useCallback((i,p)=>{const{centerX:w=0,centerY:S=0,radius:O=0,fillColor:j="#000",strokeColor:D="#000",lineWidth:I=2}=p;i.beginPath(),i.arc(w,S,O,0,Math.PI*2),i.fillStyle=j,i.fill(),i.strokeStyle=D,i.lineWidth=I,i.stroke()},[]),tt=P.useCallback((i,p)=>{const{points:w=[],strokeColor:S="#000",lineWidth:O=2}=p;if(!(w.length<2)){i.strokeStyle=S,i.lineWidth=O,i.lineCap="round",i.lineJoin="round",i.beginPath(),i.moveTo(w[0].x,w[0].y);for(let j=1;j<w.length;j++)w[j]&&i.lineTo(w[j].x,w[j].y);i.stroke()}},[]),_t=P.useCallback((i,p)=>{const{x:w=0,y:S=0,text:O="",fontSize:j=16,fontColor:D="#000"}=p;i.font=`${j}px sans-serif`,i.fillStyle=D,i.textBaseline="top",i.fillText(O,w,S)},[]),ht=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,fillColor:D="#fff",strokeColor:I="#000",lineWidth:Y=2}=p;i.beginPath(),i.moveTo(w+O/2,S),i.lineTo(w+O,S+j),i.lineTo(w,S+j),i.closePath(),i.fillStyle=D,i.fill(),i.strokeStyle=I,i.lineWidth=Y,i.stroke()},[]),Ot=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,fillColor:D="#fff",strokeColor:I="#000",lineWidth:Y=2}=p;i.beginPath(),i.moveTo(w+O/2,S),i.lineTo(w+O,S+j/2),i.lineTo(w+O/2,S+j),i.lineTo(w,S+j/2),i.closePath(),i.fillStyle=D,i.fill(),i.strokeStyle=I,i.lineWidth=Y,i.stroke()},[]),pt=P.useCallback((i,p)=>{const{centerX:w=0,centerY:S=0,size:O=0,fillColor:j="#ffff00",strokeColor:D="#000",lineWidth:I=2}=p,Y=5,X=O,L=O/2;i.beginPath();for(let W=0;W<Y*2;W++){const q=W%2===0?X:L,H=Math.PI/Y*W-Math.PI/2,K=w+Math.cos(H)*q,re=S+Math.sin(H)*q;W===0?i.moveTo(K,re):i.lineTo(K,re)}i.closePath(),i.fillStyle=j,i.fill(),i.strokeStyle=D,i.lineWidth=I,i.stroke()},[]),jt=P.useCallback((i,p)=>{const{centerX:w=0,centerY:S=0,size:O=0,fillColor:j="#ff6b6b",strokeColor:D="#000",lineWidth:I=2}=p;i.beginPath();const Y=S-O/2;i.moveTo(w,Y+O/4),i.bezierCurveTo(w-O/2,Y,w-O,Y+O/2,w,S+O/2),i.bezierCurveTo(w+O,Y+O/2,w+O/2,Y,w,Y+O/4),i.fillStyle=j,i.fill(),i.strokeStyle=D,i.lineWidth=I,i.stroke()},[]),vt=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,fillColor:D="#fff",strokeColor:I="#000",lineWidth:Y=2}=p,X=w+O/2,L=S+j/2,W=O/2,q=j/2;i.beginPath();for(let H=0;H<6;H++){const K=Math.PI/3*H-Math.PI/2,re=X+Math.cos(K)*W,he=L+Math.sin(K)*q;H===0?i.moveTo(re,he):i.lineTo(re,he)}i.closePath(),i.fillStyle=D,i.fill(),i.strokeStyle=I,i.lineWidth=Y,i.stroke()},[]),yt=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,fillColor:D="#fff",strokeColor:I="#000",lineWidth:Y=2}=p,X=w+O/2,L=S+j/2,W=O/2,q=j/2;i.beginPath();for(let H=0;H<8;H++){const K=Math.PI/4*H-Math.PI/2,re=X+Math.cos(K)*W,he=L+Math.sin(K)*q;H===0?i.moveTo(re,he):i.lineTo(re,he)}i.closePath(),i.fillStyle=D,i.fill(),i.strokeStyle=I,i.lineWidth=Y,i.stroke()},[]),Pt=P.useCallback((i,p)=>{const{startX:w=0,startY:S=0,endX:O=0,endY:j=0,fillColor:D="#000",strokeColor:I="#000",lineWidth:Y=2}=p,X=15,L=Math.atan2(j-S,O-w);i.beginPath(),i.moveTo(w,S),i.lineTo(O,j),i.strokeStyle=I,i.lineWidth=Y,i.stroke(),i.beginPath(),i.moveTo(O,j),i.lineTo(O-X*Math.cos(L-Math.PI/6),j-X*Math.sin(L-Math.PI/6)),i.lineTo(O-X*Math.cos(L+Math.PI/6),j-X*Math.sin(L+Math.PI/6)),i.closePath(),i.fillStyle=D,i.fill()},[]),Tt=P.useRef({}),Mt=P.useRef(null),rr=P.useCallback((i,p)=>{const{x:w=0,y:S=0,width:O=0,height:j=0,src:D=""}=p;if(Tt.current[D]){const I=Tt.current[D];I.complete&&i.drawImage(I,w,S,O,j)}else{const I=new Image;I.onload=()=>{Tt.current[D]=I,Mt.current&&Mt.current()},I.src=D,Tt.current[D]=I}},[]),kt=P.useCallback((i,p)=>{switch(p.type){case"rectangle":dt(i,p);break;case"circle":Ae(i,p);break;case"pencil":tt(i,p);break;case"text":_t(i,p);break;case"triangle":ht(i,p);break;case"diamond":Ot(i,p);break;case"star":pt(i,p);break;case"heart":jt(i,p);break;case"hexagon":vt(i,p);break;case"octagon":yt(i,p);break;case"arrow":Pt(i,p);break;case"image":rr(i,p);break}},[dt,Ae,tt,_t,ht,Ot,pt,jt,vt,yt,Pt,rr]),Vr=P.useCallback(()=>{const i=v.current;if(!i)return;const p=document.createElement("canvas");p.width=i.width,p.height=i.height;const w=p.getContext("2d");if(!w)return;w.fillStyle="#ffffff",w.fillRect(0,0,p.width,p.height),w.save(),w.translate(d.panX,d.panY),w.scale(d.zoom,d.zoom),b.forEach(j=>{kt(w,j)}),w.restore();const S=p.toDataURL("image/png"),O=document.createElement("a");O.download=`whiteboard-${Date.now()}.png`,O.href=S,O.click()},[d,b,kt]),$r=P.useCallback(()=>{const i=v.current;i&&y(oa({canvasWidth:i.width,canvasHeight:i.height,padding:50}))},[y]),u=(i,p,w,S,O,j)=>{const D=i-w,I=p-S,Y=O-w,X=j-S,L=D*Y+I*X,W=Y*Y+X*X;let q=-1;W!==0&&(q=L/W);let H,K;q<0?(H=w,K=S):q>1?(H=O,K=j):(H=w+q*Y,K=S+q*X);const re=i-H,he=p-K;return Math.sqrt(re*re+he*he)},R=P.useCallback((i,p)=>{for(let w=b.length-1;w>=0;w--){const S=b[w],O=S.x??0,j=S.y??0,D=S.width??0,I=S.height??0,Y=S.centerX??0,X=S.centerY??0,L=S.radius??0;if(S.type==="rectangle"){if(i>=O&&i<=O+D&&p>=j&&p<=j+I)return S}else if(S.type==="circle"){if(Math.sqrt(Math.pow(i-Y,2)+Math.pow(p-X,2))<=L)return S}else if(S.type==="pencil"){const q=S.points??[];for(let H=1;H<q.length;H++){const K=q[H-1],re=q[H];if(!K||!re)continue;if(u(i,p,K.x,K.y,re.x,re.y)<=5)return S}}else if(S.type==="text"){const W=S.fontSize||16,H=(S.text||"").length*W*.6,K=W;if(i>=O&&i<=O+H&&p>=j&&p<=j+K)return S}else if(S.type==="triangle"||S.type==="diamond"||S.type==="hexagon"||S.type==="octagon"){if(i>=O&&i<=O+D&&p>=j&&p<=j+I)return S}else if(S.type==="star"||S.type==="heart"){const W=Math.sqrt(Math.pow(i-Y,2)+Math.pow(p-X,2)),q=S.size??0;if(W<=q)return S}else if(S.type==="arrow"){const q=S.startX??0,H=S.startY??0,K=S.endX??0,re=S.endY??0;if(u(i,p,q,H,K,re)<=10)return S}else if(S.type==="image"&&i>=O&&i<=O+D&&p>=j&&p<=j+I)return S}return null},[b]),z=P.useCallback(i=>{let p=0,w=0,S=0,O=0;if(i.type==="rectangle"||i.type==="image"||i.type==="text"||i.type==="triangle"||i.type==="diamond"||i.type==="hexagon"||i.type==="octagon")if(p=i.x??0,w=i.y??0,i.type==="text"){const j=i.fontSize||16;S=(i.text||"").length*j*.6,O=j}else S=i.width??0,O=i.height??0;else if(i.type==="circle"){const j=i.radius??0;p=(i.centerX??0)-j,w=(i.centerY??0)-j,S=j*2,O=j*2}else if(i.type==="star"||i.type==="heart"){const j=i.size??0;p=(i.centerX??0)-j,w=(i.centerY??0)-j,S=j*2,O=j*2}else if(i.type==="pencil"&&i.points&&i.points.length>0){const j=Math.min(...i.points.map(X=>X.x)),D=Math.max(...i.points.map(X=>X.x)),I=Math.min(...i.points.map(X=>X.y)),Y=Math.max(...i.points.map(X=>X.y));p=j,w=I,S=D-j,O=Y-I}else if(i.type==="arrow")return null;return{x:p,y:w,w:S,h:O}},[]),B=P.useCallback(i=>{const p=[];if(i.type==="arrow")return p.push({type:"start",x:i.startX??0,y:i.startY??0}),p.push({type:"end",x:i.endX??0,y:i.endY??0}),p;const w=z(i);if(!w)return[];const{x:S,y:O,w:j,h:D}=w;return p.push({type:"nw",x:S,y:O}),p.push({type:"ne",x:S+j,y:O}),p.push({type:"se",x:S+j,y:O+D}),p.push({type:"sw",x:S,y:O+D}),p.push({type:"n",x:S+j/2,y:O}),p.push({type:"s",x:S+j/2,y:O+D}),p.push({type:"e",x:S+j,y:O+D/2}),p.push({type:"w",x:S,y:O+D/2}),p},[z]),ne=P.useCallback((i,p,w,S)=>{const O=B(w),j=10/S;for(const D of O)if(Math.abs(i-D.x)<=j&&Math.abs(p-D.y)<=j)return D.type;return null},[B]),te=P.useCallback((i,p)=>{i.strokeStyle="#0066cc",i.lineWidth=1/d.zoom,i.setLineDash([5/d.zoom,5/d.zoom]);const w=z(p);w?i.strokeRect(w.x-4/d.zoom,w.y-4/d.zoom,w.w+8/d.zoom,w.h+8/d.zoom):p.type,i.setLineDash([]);const S=B(p),O=8/d.zoom;i.fillStyle="#ffffff",i.strokeStyle="#0066cc",i.lineWidth=1/d.zoom;for(const j of S)i.fillRect(j.x-O/2,j.y-O/2,O,O),i.strokeRect(j.x-O/2,j.y-O/2,O,O)},[d.zoom,z,B]),U=P.useCallback(()=>{const i=v.current;if(!i)return;const p=i.getContext("2d");p&&(p.clearRect(0,0,i.width,i.height),p.save(),p.translate(d.panX,d.panY),p.scale(d.zoom,d.zoom),E.enabled&&tr(p,E.size,E.color),b.forEach(w=>{kt(p,w),N.includes(w.id)&&te(p,w)}),St&&ae&&(p.fillStyle="rgba(0, 102, 204, 0.1)",p.strokeStyle="#0066cc",p.lineWidth=1/d.zoom,p.fillRect(ae.startX,ae.startY,ae.width,ae.height),p.strokeRect(ae.startX,ae.startY,ae.width,ae.height)),p.restore())},[E,tr,b,kt,N,te,d,St,ae]);P.useEffect(()=>{Mt.current=U},[U]),P.useEffect(()=>{const i=v.current;if(!i)return;const p=i.parentElement;if(!p)return;const w=()=>{const O=p.getBoundingClientRect();i.width=O.width,i.height=O.height,U()};w();const S=new ResizeObserver(()=>{w()});return S.observe(p),()=>{S.disconnect()}},[U]),P.useEffect(()=>{U()},[U]),P.useEffect(()=>{const i=w=>{w.target.tagName==="INPUT"||w.target.tagName==="TEXTAREA"||w.code==="Space"&&!w.repeat&&(w.preventDefault(),ke(!0))},p=w=>{w.target.tagName==="INPUT"||w.target.tagName==="TEXTAREA"||w.code==="Space"&&(w.preventDefault(),ke(!1),Pe(!1),Le(!1))};return window.addEventListener("keydown",i),window.addEventListener("keyup",p),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",p)}},[]);const G=P.useCallback((i,p)=>({x:(i-d.panX)/d.zoom,y:(p-d.panY)/d.zoom}),[d]);P.useEffect(()=>{const i=v.current;if(!i||!x)return;const p=i.getContext("2d");if(p){if(U(),p.save(),p.translate(d.panX,d.panY),p.scale(d.zoom,d.zoom),h==="pointer")Ct(p,_,k);else if(h==="rectangle"){const w=Math.min(_.x,k.x),S=Math.min(_.y,k.y),O=Math.abs(k.x-_.x),j=Math.abs(k.y-_.y);dt(p,{id:"preview",type:"rectangle",x:w,y:S,width:O,height:j,fillColor:C.rectangle.fillColor,lineWidth:C.rectangle.lineWidth})}else if(h==="circle"){const w=_.x,S=_.y,O=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));Ae(p,{id:"preview",type:"circle",centerX:w,centerY:S,radius:O,strokeColor:C.circle.strokeColor,fillColor:C.circle.fillColor,lineWidth:C.circle.lineWidth})}else if(h==="pencil")tt(p,{id:"preview",type:"pencil",points:ie,strokeColor:C.pencil.strokeColor,lineWidth:C.pencil.lineWidth});else if(h==="triangle"){const w=Math.min(_.x,k.x),S=Math.min(_.y,k.y),O=Math.abs(k.x-_.x),j=Math.abs(k.y-_.y);ht(p,{id:"preview",type:"triangle",x:w,y:S,width:O,height:j,fillColor:C.triangle.fillColor,lineWidth:C.triangle.lineWidth})}else if(h==="diamond"){const w=Math.min(_.x,k.x),S=Math.min(_.y,k.y),O=Math.abs(k.x-_.x),j=Math.abs(k.y-_.y);Ot(p,{id:"preview",type:"diamond",x:w,y:S,width:O,height:j,fillColor:C.diamond.fillColor,lineWidth:C.diamond.lineWidth})}else if(h==="star"){const w=_.x,S=_.y,O=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));pt(p,{id:"preview",type:"star",centerX:w,centerY:S,size:O,fillColor:C.star.fillColor,lineWidth:C.star.lineWidth})}else if(h==="heart"){const w=_.x,S=_.y,O=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));jt(p,{id:"preview",type:"heart",centerX:w,centerY:S,size:O,fillColor:C.heart.fillColor,lineWidth:C.heart.lineWidth})}else if(h==="hexagon"){const w=Math.min(_.x,k.x),S=Math.min(_.y,k.y),O=Math.abs(k.x-_.x),j=Math.abs(k.y-_.y);vt(p,{id:"preview",type:"hexagon",x:w,y:S,width:O,height:j,fillColor:C.hexagon.fillColor,lineWidth:C.hexagon.lineWidth})}else if(h==="octagon"){const w=Math.min(_.x,k.x),S=Math.min(_.y,k.y),O=Math.abs(k.x-_.x),j=Math.abs(k.y-_.y);yt(p,{id:"preview",type:"octagon",x:w,y:S,width:O,height:j,fillColor:C.octagon.fillColor,lineWidth:C.octagon.lineWidth})}else h==="arrow"&&Pt(p,{id:"preview",type:"arrow",startX:_.x,startY:_.y,endX:k.x,endY:k.y,fillColor:C.arrow.fillColor,lineWidth:C.arrow.lineWidth});p.restore()}},[x,h,_,k,ie,U,Ct,dt,Ae,tt,ht,Ot,pt,jt,vt,yt,Pt,d,C]);const ge=i=>{const p=v.current;if(!p)return;const w=p.getBoundingClientRect(),S=i.clientX-w.left,O=i.clientY-w.top;if(Ye)return;if(ze){i.preventDefault(),i.button===0?(Pe(!0),st({x:S-d.panX,y:O-d.panY})):i.button===2&&(Le(!0),qe({y:O,initialZoom:d.zoom}));return}if(A)return;const{x:j,y:D}=G(S,O);if(h==="pointer"){const I=R(j,D);let Y=null;if(N.length===1){const X=N[0],L=b.find(W=>W.id===X);if(L){const W=ne(j,D,L,d.zoom);W&&(Y={element:L,handle:W})}}if(Y){lt(!0),It(Y.handle),Qt({x:j,y:D}),zt(JSON.parse(JSON.stringify(Y.element)));return}if(I){const X=N.includes(I.id);let L=N;if(i.shiftKey?(X?L=N.filter(W=>W!==I.id):L=[...N,I.id],y(at(L))):X||(L=[I.id],y(at(L))),L.length>0){de(!0),$({x:j,y:D});const W={};L.forEach(q=>{const H=b.find(K=>K.id===q);H&&(W[q]={...H})}),Be(W)}}else{i.shiftKey||y(at([])),er(!0);const{x:X,y:L}=G(S,O);Wt({startX:X,startY:L,width:0,height:0})}}else if(h==="text"){const I=Date.now().toString();y(Oe({id:I,type:"text",x:j,y:D,text:"",fontSize:C.text.fontSize,fontColor:C.text.fontColor})),y(Xe("pointer")),y(at([I])),F(I),V(""),Ne({x:j,y:D}),xe(!0)}else if(h==="eraser"){const I=R(j,D);I&&y(ta(I.id))}else y(at([])),T(!0),$({x:j,y:D}),oe({x:j,y:D}),h==="pencil"&&fe([{x:j,y:D}])},ce=i=>{const p=v.current;if(!p)return;const w=p.getBoundingClientRect(),S=i.clientX-w.left,O=i.clientY-w.top;if(Re){y(ra({x:S-Ue.x,y:O-Ue.y}));return}if(We){const I=et.y-O,X=et.initialZoom*(1+I*.005);y(na(X));return}if(A)return;const{x:j,y:D}=G(S,O);if(St&&ae){const I=j-ae.startX,Y=D-ae.startY;Wt({...ae,width:I,height:Y});return}if(je&&N.length>0){const I=j-_.x,Y=D-_.y,X=[];N.forEach(L=>{const W=Me[L];if(!W)return;let q={};if(W.type==="rectangle")q={x:(W.x??0)+I,y:(W.y??0)+Y};else if(W.type==="circle")q={centerX:(W.centerX??0)+I,centerY:(W.centerY??0)+Y};else if(W.type==="pencil"){const H=W.points||[];if(H.length===0)return;q={points:H.map(K=>({x:K.x+I,y:K.y+Y}))}}else W.type==="text"?q={x:(W.x??0)+I,y:(W.y??0)+Y}:W.type==="triangle"||W.type==="diamond"||W.type==="hexagon"||W.type==="octagon"?q={x:(W.x??0)+I,y:(W.y??0)+Y}:W.type==="star"||W.type==="heart"?q={centerX:(W.centerX??0)+I,centerY:(W.centerY??0)+Y}:W.type==="arrow"?q={startX:(W.startX??0)+I,startY:(W.startY??0)+Y,endX:(W.endX??0)+I,endY:(W.endY??0)+Y}:W.type==="image"&&(q={x:(W.x??0)+I,y:(W.y??0)+Y});X.push({id:L,updates:q})}),X.length>0&&y(ro(X));return}if(ct&&Dt&&ut&&me){let I={};const Y=j-ut.x,X=D-ut.y,L=Dt;if(L.type==="arrow")me==="start"?I={startX:(L.startX??0)+Y,startY:(L.startY??0)+X}:me==="end"&&(I={endX:(L.endX??0)+Y,endY:(L.endY??0)+X});else if(L.type==="circle"||L.type==="star"||L.type==="heart"){let W=L.radius||L.size||0;const q=me.includes("e"),H=me.includes("s"),K=me.includes("w"),re=me.includes("n");let he=0;q&&(he+=Y),K&&(he-=Y),H&&(he+=X),re&&(he-=X);const Lt=Math.max(5,W+he);L.type==="circle"?I={radius:Lt}:I={size:Lt}}else if(L.type==="pencil"&&L.points){const W=z(L);if(W){const{x:q,y:H,w:K,h:re}=W;let he=q,Lt=H,Fr=K,Xr=re;me.includes("e")&&(Fr=Math.max(5,K+Y)),me.includes("w")&&(Fr=Math.max(5,K-Y),he=q+Y),me.includes("s")&&(Xr=Math.max(5,re+X)),me.includes("n")&&(Xr=Math.max(5,re-X),Lt=H+X);const Ha=Fr/K,Ga=Xr/re;I={points:L.points.map(vo=>({x:he+(vo.x-q)*Ha,y:Lt+(vo.y-H)*Ga}))}}}else{let W=L.x??0,q=L.y??0,H=L.width??0,K=L.height??0;if(me.includes("e")&&(H=Math.max(5,(L.width??0)+Y)),me.includes("w")){const re=(L.width??0)-Y;re>5&&(H=re,W=(L.x??0)+Y)}if(me.includes("s")&&(K=Math.max(5,(L.height??0)+X)),me.includes("n")){const re=(L.height??0)-X;re>5&&(K=re,q=(L.y??0)+X)}I={x:W,y:q,width:H,height:K}}Object.keys(I).length>0&&y(Kt({id:L.id,updates:I}));return}x&&(oe({x:j,y:D}),h==="pencil"&&fe(I=>[...I,{x:j,y:D}]))},le=()=>{if(Re||We){Pe(!1),Le(!1);return}if(A){de(!1),T(!1);return}if(je&&de(!1),St&&ae){const i=ae.width>0?ae.startX:ae.startX+ae.width,p=ae.height>0?ae.startY:ae.startY+ae.height,w=Math.abs(ae.width),S=Math.abs(ae.height),O=[];b.forEach(j=>{const D=z(j);D&&D.x<i+w&&D.x+D.w>i&&D.y<p+S&&D.y+D.h>p&&O.push(j.id)}),O.length>0&&y(at(O))}if(T(!1),de(!1),lt(!1),er(!1),Wt(null),It(null),zt(null),fe([]),$({x:0,y:0}),Be({}),Qt(null),Pe(!1),!!x){if(h==="pointer")U();else if(h==="rectangle"){const i=Math.min(_.x,k.x),p=Math.min(_.y,k.y),w=Math.abs(k.x-_.x),S=Math.abs(k.y-_.y);w>0&&S>0&&y(Oe({id:Date.now().toString(),type:"rectangle",x:i,y:p,width:w,height:S,strokeColor:C.rectangle.strokeColor,fillColor:C.rectangle.fillColor,lineWidth:C.rectangle.lineWidth}))}else if(h==="circle"){const i=_.x,p=_.y,w=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));w>0&&y(Oe({id:Date.now().toString(),type:"circle",centerX:i,centerY:p,radius:w,strokeColor:C.circle.strokeColor,fillColor:C.circle.fillColor,lineWidth:C.circle.lineWidth}))}else if(h==="pencil")ie.length>1&&y(Oe({id:Date.now().toString(),type:"pencil",points:[...ie],strokeColor:C.pencil.strokeColor,lineWidth:C.pencil.lineWidth})),fe([]);else if(h==="triangle"){const i=Math.min(_.x,k.x),p=Math.min(_.y,k.y),w=Math.abs(k.x-_.x),S=Math.abs(k.y-_.y);w>0&&S>0&&y(Oe({id:Date.now().toString(),type:"triangle",x:i,y:p,width:w,height:S,strokeColor:C.triangle.strokeColor,fillColor:C.triangle.fillColor,lineWidth:C.triangle.lineWidth}))}else if(h==="diamond"){const i=Math.min(_.x,k.x),p=Math.min(_.y,k.y),w=Math.abs(k.x-_.x),S=Math.abs(k.y-_.y);w>0&&S>0&&y(Oe({id:Date.now().toString(),type:"diamond",x:i,y:p,width:w,height:S,strokeColor:C.diamond.strokeColor,fillColor:C.diamond.fillColor,lineWidth:C.diamond.lineWidth}))}else if(h==="star"){const i=_.x,p=_.y,w=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));w>0&&y(Oe({id:Date.now().toString(),type:"star",centerX:i,centerY:p,size:w,strokeColor:C.star.strokeColor,fillColor:C.star.fillColor,lineWidth:C.star.lineWidth}))}else if(h==="heart"){const i=_.x,p=_.y,w=Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2));w>0&&y(Oe({id:Date.now().toString(),type:"heart",centerX:i,centerY:p,size:w,strokeColor:C.heart.strokeColor,fillColor:C.heart.fillColor,lineWidth:C.heart.lineWidth}))}else if(h==="hexagon"){const i=Math.min(_.x,k.x),p=Math.min(_.y,k.y),w=Math.abs(k.x-_.x),S=Math.abs(k.y-_.y);w>0&&S>0&&y(Oe({id:Date.now().toString(),type:"hexagon",x:i,y:p,width:w,height:S,strokeColor:C.hexagon.strokeColor,fillColor:C.hexagon.fillColor,lineWidth:C.hexagon.lineWidth}))}else if(h==="octagon"){const i=Math.min(_.x,k.x),p=Math.min(_.y,k.y),w=Math.abs(k.x-_.x),S=Math.abs(k.y-_.y);w>0&&S>0&&y(Oe({id:Date.now().toString(),type:"octagon",x:i,y:p,width:w,height:S,strokeColor:C.octagon.strokeColor,fillColor:C.octagon.fillColor,lineWidth:C.octagon.lineWidth}))}else if(h==="arrow"){const i=k.x-_.x,p=k.y-_.y;Math.sqrt(i*i+p*p)>5&&y(Oe({id:Date.now().toString(),type:"arrow",startX:_.x,startY:_.y,endX:k.x,endY:k.y,strokeColor:C.arrow.strokeColor,fillColor:C.arrow.fillColor,lineWidth:C.arrow.lineWidth}))}T(!1)}},Ie=i=>{ze&&i.preventDefault()},rt=(i,p,w)=>{F(i.id),V(i.text||""),Ne({x:i.x||p,y:i.y||w}),_e.current=i.text||"",xe(!0)},nr=()=>{if(ze)return Re?"grabbing":We?"ns-resize":"grab";if(A)return"default";if(N.length===1&&!x&&h==="pointer"){const i=b.find(p=>p.id===N[0]);if(i){const p=ne(k.x,k.y,i,d.zoom);if(p)return p==="n"||p==="s"?"ns-resize":p==="e"||p==="w"?"ew-resize":p==="ne"||p==="sw"?"nesw-resize":p==="nw"||p==="se"?"nwse-resize":"pointer"}}return"default"},[Te,ho]=P.useState({propTools:!1,lockIndicator:!1});return P.useEffect(()=>{const i=()=>{if(window.innerWidth<=768){ho({propTools:!1,lockIndicator:!1});return}const p=document.getElementById("wb-canvas-container");if(!p)return;const w=p.querySelector(".wb-toolbar"),S=p.querySelector(".wb-prop-tools"),O=p.querySelector(".wb-lock-indicator");let j=!1,D=!1;if(w){const I=w.getBoundingClientRect();if(S){const Y=S.getBoundingClientRect();I.bottom>Y.top-10&&(j=!0)}if(O){const Y=O.getBoundingClientRect();I.top<Y.bottom+10&&(D=!0)}}ho({propTools:j,lockIndicator:D})};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[h,A,N]),g.jsxs("div",{id:"wb-canvas-container",style:{backgroundColor:"#fff",position:"relative",width:"100%",height:"100%"},children:[g.jsx("canvas",{ref:v,onMouseDown:ge,onMouseMove:ce,onMouseUp:le,onMouseLeave:le,onDoubleClick:i=>{if(A)return;const p=v.current;if(!p)return;const w=p.getBoundingClientRect(),S=i.clientX-w.left,O=i.clientY-w.top,{x:j,y:D}=G(S,O),I=R(j,D);I&&I.type==="text"&&rt(I,j,D)},onContextMenu:Ie,style:{cursor:nr()}}),A&&g.jsx(Da,{text:r||e&&((po=e.lock)==null?void 0:po.text)||M.text,shifted:Te.lockIndicator}),Ye&&g.jsx("input",{type:"text",value:Ce,onChange:i=>{const p=i.target.value;V(p),Yr(p)},onKeyDown:i=>{i.key==="Enter"&&Ce.trim()?(ve&&(y(Kt({id:ve,updates:{text:Ce}})),_e.current=Ce),xe(!1),V(""),F(null)):i.key==="Escape"&&(xe(!1),V(""),F(null))},onBlur:()=>{Ce.trim()&&ve&&(y(Kt({id:ve,updates:{text:Ce}})),_e.current=Ce),xe(!1),V(""),F(null)},onMouseDown:i=>i.stopPropagation(),autoFocus:!0,style:{position:"absolute",left:Ve.x*d.zoom+d.panX,top:Ve.y*d.zoom+d.panY,fontSize:C.text.fontSize*d.zoom,color:C.text.fontColor,background:"white",border:"2px solid #0066cc",outline:"none",fontFamily:"sans-serif",minWidth:"150px",padding:"4px 8px",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}}),g.jsx(Ba,{onExport:Vr,onFitToView:$r,mode:l}),g.jsx(Ua,{shifted:Te.propTools}),ft.visible&&g.jsx(va,{})]})});Lr.displayName="InternalWhiteboard";class qa extends P.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){console.error("Whiteboard Error:",t,r)}render(){return this.state.hasError?g.jsxs("div",{style:{padding:"20px",textAlign:"center",background:"#fff1f0",border:"1px solid #ffa39e",borderRadius:"4px",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[g.jsx("h3",{children:"Something went wrong in Whiteboard"}),g.jsx("button",{onClick:()=>this.setState({hasError:!1}),style:{marginTop:"10px",padding:"8px 16px",cursor:"pointer",background:"#fff",border:"1px solid #d9d9d9",borderRadius:"2px"},children:"Try Again"})]}):this.props.children}}const fo=P.forwardRef((e,t)=>{const{store:r,onAction:n,...o}=e,a=P.useRef(n);P.useEffect(()=>{a.current=n},[n]);const l=P.useMemo(()=>r??Wr({actionHandlerRef:a}),[r]);return g.jsx(qa,{children:g.jsx(Xo,{store:l,children:g.jsx(Go,{children:g.jsx(Lr,{ref:t,...o})})})})});fo.displayName="Whiteboard",Ee.WhiteboardComponent=Lr,Ee.createWhiteboardStore=Wr,Ee.default=fo,Ee.store=pa,Ee.whiteboardActions=la,Ee.whiteboardReducer=io,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
100
+ //# sourceMappingURL=whiteboard.umd.js.map