1610 lines
628 KiB
JavaScript
1610 lines
628 KiB
JavaScript
|
(function(){
|
|||
|
shadow$provide[586]=function(wa,W,Ta,I){function q(w,B,C){var a,K={},r=null,h=null;void 0!==C&&(r=""+C);void 0!==B.key&&(r=""+B.key);void 0!==B.ref&&(h=B.ref);for(a in B)t.call(B,a)&&!d.hasOwnProperty(a)&&(K[a]=B[a]);if(w&&w.defaultProps)for(a in B=w.defaultProps,B)void 0===K[a]&&(K[a]=B[a]);return{$$typeof:R,type:w,key:r,ref:h,props:K,_owner:A.current}}W(19);wa=W(22);var R=60103;I.Fragment=60107;"function"===typeof Symbol&&Symbol.for&&(W=Symbol.for,R=W("react.element"),I.Fragment=W("react.fragment"));
|
|||
|
var A=wa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};I.jsx=q;I.jsxs=q};
|
|||
|
shadow$provide[588]=function(wa,W,Ta,I){Ta.exports=W(586)};
|
|||
|
shadow$provide[589]=function(wa,W,Ta,I){function q(pc){for(var Dd="https://reactjs.org/docs/error-decoder.html?invariant\x3d"+pc,wd=1;wd<arguments.length;wd++)Dd+="\x26args[]\x3d"+encodeURIComponent(arguments[wd]);return"Minified React error #"+pc+"; visit "+Dd+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function R(pc){if(null==pc)return null;if("function"===typeof pc)return pc.displayName||pc.name||null;if("string"===typeof pc)return pc;
|
|||
|
switch(pc){case M:return"Fragment";case aa:return"Portal";case D:return"Profiler";case S:return"StrictMode";case ba:return"Suspense";case H:return"SuspenseList"}if("object"===typeof pc)switch(pc.$$typeof){case P:return(pc.displayName||"Context")+".Consumer";case O:return(pc._context.displayName||"Context")+".Provider";case da:var Dd=pc.render;Dd=Dd.displayName||Dd.name||"";return pc.displayName||(""!==Dd?"ForwardRef("+Dd+")":"ForwardRef");case ja:return R(pc.type);case ca:return R(pc._render);case N:Dd=
|
|||
|
pc._payload;pc=pc._init;try{return R(pc(Dd))}catch(wd){}}return null}function A(pc,Dd){for(var wd=pc._threadCount|0;wd<=Dd;wd++)pc[wd]=pc._currentValue2,pc._threadCount=wd+1}function t(pc,Dd,wd,Yd){if(Yd&&(Yd=pc.contextType,"object"===typeof Yd&&null!==Yd))return A(Yd,wd),Yd[wd];if(pc=pc.contextTypes){wd={};for(var td in pc)wd[td]=Dd[td];Dd=wd}else Dd=ya;return Dd}function d(pc){if(Ea.call(Xa,pc))return!0;if(Ea.call(Oa,pc))return!1;if(Ua.test(pc))return Xa[pc]=!0;Oa[pc]=!0;return!1}function w(pc,
|
|||
|
Dd,wd,Yd){if(null!==wd&&0===wd.type)return!1;switch(typeof Dd){case "function":case "symbol":return!0;case "boolean":if(Yd)return!1;if(null!==wd)return!wd.acceptsBooleans;pc=pc.toLowerCase().slice(0,5);return"data-"!==pc&&"aria-"!==pc;default:return!1}}function B(pc,Dd,wd,Yd){if(null===Dd||"undefined"===typeof Dd||w(pc,Dd,wd,Yd))return!0;if(Yd)return!1;if(null!==wd)switch(wd.type){case 3:return!Dd;case 4:return!1===Dd;case 5:return isNaN(Dd);case 6:return isNaN(Dd)||1>Dd}return!1}function C(pc,Dd,
|
|||
|
wd,Yd,td,Qd,ld){this.acceptsBooleans=2===Dd||3===Dd||4===Dd;this.attributeName=Yd;this.attributeNamespace=td;this.mustUseProperty=wd;this.propertyName=pc;this.type=Dd;this.sanitizeURL=Qd;this.removeEmptyString=ld}function a(pc){return pc[1].toUpperCase()}function K(pc){if("boolean"===typeof pc||"number"===typeof pc)return""+pc;pc=""+pc;var Dd=db.exec(pc);if(Dd){var wd="",Yd,td=0;for(Yd=Dd.index;Yd<pc.length;Yd++){switch(pc.charCodeAt(Yd)){case 34:Dd="\x26quot;";break;case 38:Dd="\x26amp;";break;case 39:Dd=
|
|||
|
"\x26#x27;";break;case 60:Dd="\x26lt;";break;case 62:Dd="\x26gt;";break;default:continue}td!==Yd&&(wd+=pc.substring(td,Yd));td=Yd+1;wd+=Dd}pc=td!==Yd?wd+pc.substring(td,Yd):wd}return pc}function r(pc,Dd){var wd=Ma.hasOwnProperty(pc)?Ma[pc]:null,Yd;if(Yd="style"!==pc)Yd=null!==wd?0===wd.type:!(2<pc.length)||"o"!==pc[0]&&"O"!==pc[0]||"n"!==pc[1]&&"N"!==pc[1]?!1:!0;if(Yd||B(pc,Dd,wd,!1))return"";if(null!==wd){pc=wd.attributeName;Yd=wd.type;if(3===Yd||4===Yd&&!0===Dd)return pc+'\x3d""';wd.sanitizeURL&&
|
|||
|
(Dd=""+Dd);return pc+'\x3d"'+(K(Dd)+'"')}return d(pc)?pc+'\x3d"'+(K(Dd)+'"'):""}function h(pc,Dd){return pc===Dd&&(0!==pc||1/pc===1/Dd)||pc!==pc&&Dd!==Dd}function k(){if(null===oa)throw Error(q(321));return oa}function f(){if(0<Ab)throw Error(q(312));return{memoizedState:null,queue:null,next:null}}function v(){null===sa?null===Ca?(Aa=!1,Ca=sa=f()):(Aa=!0,sa=Ca):null===sa.next?(Aa=!1,sa=sa.next=f()):(Aa=!0,sa=sa.next);return sa}function x(pc,Dd,wd,Yd){for(;Ja;)Ja=!1,Ab+=1,sa=null,wd=pc(Dd,Yd);L();
|
|||
|
return wd}function L(){oa=null;Ja=!1;Ca=null;Ab=0;sa=Sa=null}function z(pc,Dd){return"function"===typeof Dd?Dd(pc):Dd}function u(pc,Dd,wd){oa=k();sa=v();if(Aa){var Yd=sa.queue;Dd=Yd.dispatch;if(null!==Sa&&(wd=Sa.get(Yd),void 0!==wd)){Sa.delete(Yd);Yd=sa.memoizedState;do Yd=pc(Yd,wd.action),wd=wd.next;while(null!==wd);sa.memoizedState=Yd;return[Yd,Dd]}return[sa.memoizedState,Dd]}pc=pc===z?"function"===typeof Dd?Dd():Dd:void 0!==wd?wd(Dd):Dd;sa.memoizedState=pc;pc=sa.queue={last:null,dispatch:null};
|
|||
|
pc=pc.dispatch=l.bind(null,oa,pc);return[sa.memoizedState,pc]}function m(pc,Dd){oa=k();sa=v();Dd=void 0===Dd?null:Dd;if(null!==sa){var wd=sa.memoizedState;if(null!==wd&&null!==Dd){var Yd=wd[1];a:if(null===Yd)Yd=!1;else{for(var td=0;td<Yd.length&&td<Dd.length;td++)if(!Na(Dd[td],Yd[td])){Yd=!1;break a}Yd=!0}if(Yd)return wd[0]}}pc=pc();sa.memoizedState=[pc,Dd];return pc}function l(pc,Dd,wd){if(!(25>Ab))throw Error(q(301));if(pc===oa)if(Ja=!0,pc={action:wd,next:null},null===Sa&&(Sa=new Map),wd=Sa.get(Dd),
|
|||
|
void 0===wd)Sa.set(Dd,pc);else{for(Dd=wd;null!==Dd.next;)Dd=Dd.next;Dd.next=pc}}function J(){}function X(pc){switch(pc){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function F(pc){if(void 0===pc||null===pc)return pc;var Dd="";E.Children.forEach(pc,function(wd){null!=wd&&(Dd+=wd)});return Dd}function ha(pc,Dd){if(void 0===pc)throw Error(q(152,R(Dd)||"Component"));}function T(pc,Dd,wd){function Yd(ld,
|
|||
|
Sd){var Nb=Sd.prototype&&Sd.prototype.isReactComponent,fc=t(Sd,Dd,wd,Nb),Yb=[],rb=!1,nb={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===Yb)return null},enqueueReplaceState:function(ue,qd){rb=!0;Yb=[qd]},enqueueSetState:function(ue,qd){if(null===Yb)return null;Yb.push(qd)}};if(Nb){if(Nb=new Sd(ld.props,fc,nb),"function"===typeof Sd.getDerivedStateFromProps){var cc=Sd.getDerivedStateFromProps.call(null,ld.props,Nb.state);null!=cc&&(Nb.state=Z({},Nb.state,cc))}}else if(oa={},
|
|||
|
Nb=Sd(ld.props,fc,nb),Nb=x(Sd,ld.props,Nb,fc),null==Nb||null==Nb.render){pc=Nb;ha(pc,Sd);return}Nb.props=ld.props;Nb.context=fc;Nb.updater=nb;nb=Nb.state;void 0===nb&&(Nb.state=nb=null);if("function"===typeof Nb.UNSAFE_componentWillMount||"function"===typeof Nb.componentWillMount)if("function"===typeof Nb.componentWillMount&&"function"!==typeof Sd.getDerivedStateFromProps&&Nb.componentWillMount(),"function"===typeof Nb.UNSAFE_componentWillMount&&"function"!==typeof Sd.getDerivedStateFromProps&&Nb.UNSAFE_componentWillMount(),
|
|||
|
Yb.length){nb=Yb;var uc=rb;Yb=null;rb=!1;if(uc&&1===nb.length)Nb.state=nb[0];else{cc=uc?nb[0]:Nb.state;var Uc=!0;for(uc=uc?1:0;uc<nb.length;uc++){var cd=nb[uc];cd="function"===typeof cd?cd.call(Nb,cc,ld.props,fc):cd;null!=cd&&(Uc?(Uc=!1,cc=Z({},cc,cd)):Z(cc,cd))}Nb.state=cc}}else Yb=null;pc=Nb.render();ha(pc,Sd);if("function"===typeof Nb.getChildContext&&(ld=Sd.childContextTypes,"object"===typeof ld)){var Ld=Nb.getChildContext(),be;for(be in Ld)if(!(be in ld))throw Error(q(108,R(Sd)||"Unknown",be));
|
|||
|
}Ld&&(Dd=Z({},Dd,Ld))}for(;E.isValidElement(pc);){var td=pc,Qd=td.type;if("function"!==typeof Qd)break;Yd(td,Qd)}return{child:pc,context:Dd}}var Z=W(19),E=W(22),aa=60106,M=60107,S=60108,D=60114,O=60109,P=60110,da=60112,ba=60113,H=60120,ja=60115,N=60116,ca=60121,ia=60117,ea=60119,qa=60129,za=60131;"function"===typeof Symbol&&Symbol.for&&(wa=Symbol.for,aa=wa("react.portal"),M=wa("react.fragment"),S=wa("react.strict_mode"),D=wa("react.profiler"),O=wa("react.provider"),P=wa("react.context"),da=wa("react.forward_ref"),
|
|||
|
ba=wa("react.suspense"),H=wa("react.suspense_list"),ja=wa("react.memo"),N=wa("react.lazy"),ca=wa("react.block"),ia=wa("react.fundamental"),ea=wa("react.scope"),qa=wa("react.debug_trace_mode"),za=wa("react.legacy_hidden"));wa=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;var ya={},Ha=new Uint16Array(16);for(W=0;15>W;W++)Ha[W]=W+1;Ha[15]=0;var Ua=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
|
|||
|
Ea=Object.prototype.hasOwnProperty,Oa={},Xa={},Ma={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(pc){Ma[pc]=new C(pc,0,!1,pc,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(pc){var Dd=pc[0];Ma[Dd]=new C(Dd,1,!1,pc[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(pc){Ma[pc]=
|
|||
|
new C(pc,2,!1,pc.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(pc){Ma[pc]=new C(pc,2,!1,pc,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(pc){Ma[pc]=new C(pc,3,!1,pc.toLowerCase(),null,!1,!1)});["checked",
|
|||
|
"multiple","muted","selected"].forEach(function(pc){Ma[pc]=new C(pc,3,!0,pc,null,!1,!1)});["capture","download"].forEach(function(pc){Ma[pc]=new C(pc,4,!1,pc,null,!1,!1)});["cols","rows","size","span"].forEach(function(pc){Ma[pc]=new C(pc,6,!1,pc,null,!1,!1)});["rowSpan","start"].forEach(function(pc){Ma[pc]=new C(pc,5,!1,pc.toLowerCase(),null,!1,!1)});var eb=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(pc){var Dd=
|
|||
|
pc.replace(eb,a);Ma[Dd]=new C(Dd,1,!1,pc,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(pc){var Dd=pc.replace(eb,a);Ma[Dd]=new C(Dd,1,!1,pc,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(pc){var Dd=pc.replace(eb,a);Ma[Dd]=new C(Dd,1,!1,pc,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(pc){Ma[pc]=new C(pc,1,!1,pc.toLowerCase(),null,!1,!1)});
|
|||
|
Ma.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(pc){Ma[pc]=new C(pc,1,!1,pc.toLowerCase(),null,!0,!0)});var db=/["'&<>]/,Na="function"===typeof Object.is?Object.is:h,oa=null,Ca=null,sa=null,Aa=!1,Ja=!1,Sa=null,Ab=0,jb=null,Ob={readContext:function(pc){var Dd=jb.threadID;A(pc,Dd);return pc[Dd]},useContext:function(pc){k();var Dd=jb.threadID;A(pc,Dd);return pc[Dd]},useMemo:m,useReducer:u,useRef:function(pc){oa=
|
|||
|
k();sa=v();var Dd=sa.memoizedState;return null===Dd?(pc={current:pc},sa.memoizedState=pc):Dd},useState:function(pc){return u(z,pc)},useLayoutEffect:function(){},useCallback:function(pc,Dd){return m(function(){return pc},Dd)},useImperativeHandle:J,useEffect:J,useDebugValue:J,useDeferredValue:function(pc){k();return pc},useTransition:function(){k();return[function(pc){pc()},!1]},useOpaqueIdentifier:function(){return(jb.identifierPrefix||"")+"R:"+(jb.uniqueID++).toString(36)},useMutableSource:function(pc,
|
|||
|
Dd){k();return Dd(pc._source)}},Wb={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},hc=Z({menuitem:!0},Wb),Pa={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,
|
|||
|
gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ob=["Webkit","ms","Moz","O"];Object.keys(Pa).forEach(function(pc){ob.forEach(function(Dd){Dd=Dd+pc.charAt(0).toUpperCase()+pc.substring(1);Pa[Dd]=Pa[pc]})});var pb=/([A-Z])/g,Zb=/^ms-/,Jc=E.Children.toArray,
|
|||
|
ad=wa.ReactCurrentDispatcher,Pc={listing:!0,pre:!0,textarea:!0},Fb=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,yc={},Vc={},hd=Object.prototype.hasOwnProperty,Kd={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},Jd=function(){function pc(wd,Yd,td){E.isValidElement(wd)?wd.type!==M?wd=[wd]:(wd=wd.props.children,wd=E.isValidElement(wd)?[wd]:Jc(wd)):wd=Jc(wd);wd={type:null,domNamespace:"http://www.w3.org/1999/xhtml",children:wd,childIndex:0,context:ya,footer:""};
|
|||
|
var Qd=Ha[0];if(0===Qd){var ld=Ha;Qd=ld.length;var Sd=2*Qd;if(!(65536>=Sd))throw Error(q(304));var Nb=new Uint16Array(Sd);Nb.set(ld);Ha=Nb;Ha[0]=Qd+1;for(ld=Qd;ld<Sd-1;ld++)Ha[ld]=ld+1;Ha[Sd-1]=0}else Ha[0]=Ha[Qd];this.threadID=Qd;this.stack=[wd];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup=Yd;this.suspenseDepth=0;this.contextIndex=-1;this.contextStack=[];this.contextValueStack=[];this.uniqueID=0;this.identifierPrefix=td&&td.identifierPrefix||""}
|
|||
|
var Dd=pc.prototype;Dd.destroy=function(){if(!this.exhausted){this.exhausted=!0;this.clearProviders();var wd=this.threadID;Ha[wd]=Ha[0];Ha[0]=wd}};Dd.pushProvider=function(wd){var Yd=++this.contextIndex,td=wd.type._context,Qd=this.threadID;A(td,Qd);var ld=td[Qd];this.contextStack[Yd]=td;this.contextValueStack[Yd]=ld;td[Qd]=wd.props.value};Dd.popProvider=function(){var wd=this.contextIndex,Yd=this.contextStack[wd],td=this.contextValueStack[wd];this.contextStack[wd]=null;this.contextValueStack[wd]=
|
|||
|
null;this.contextIndex--;Yd[this.threadID]=td};Dd.clearProviders=function(){for(var wd=this.contextIndex;0<=wd;wd--)this.contextStack[wd][this.threadID]=this.contextValueStack[wd]};Dd.read=function(wd){if(this.exhausted)return null;var Yd=jb;jb=this;var td=ad.current;ad.current=Ob;try{for(var Qd=[""],ld=!1;Qd[0].length<wd;){if(0===this.stack.length){this.exhausted=!0;var Sd=this.threadID;Ha[Sd]=Ha[0];Ha[0]=Sd;break}var Nb=this.stack[this.stack.length-1];if(ld||Nb.childIndex>=Nb.children.length){var fc=
|
|||
|
Nb.footer;""!==fc&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===Nb.type)this.currentSelectValue=null;else if(null!=Nb.type&&null!=Nb.type.type&&Nb.type.type.$$typeof===O)this.popProvider(Nb.type);else if(Nb.type===ba){this.suspenseDepth--;var Yb=Qd.pop();if(ld){ld=!1;var rb=Nb.fallbackFrame;if(!rb)throw Error(q(303));this.stack.push(rb);Qd[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else Qd[this.suspenseDepth]+=Yb}Qd[this.suspenseDepth]+=fc}else{var nb=Nb.children[Nb.childIndex++],
|
|||
|
cc="";try{cc+=this.render(nb,Nb.context,Nb.domNamespace)}catch(uc){if(null!=uc&&"function"===typeof uc.then)throw Error(q(294));throw uc;}finally{}Qd.length<=this.suspenseDepth&&Qd.push("");Qd[this.suspenseDepth]+=cc}}return Qd[0]}finally{ad.current=td,jb=Yd,L()}};Dd.render=function(wd,Yd,td){if("string"===typeof wd||"number"===typeof wd){td=""+wd;if(""===td)return"";if(this.makeStaticMarkup)return K(td);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+K(td);this.previousWasTextNode=!0;return K(td)}Yd=
|
|||
|
T(wd,Yd,this.threadID);wd=Yd.child;Yd=Yd.context;if(null===wd||!1===wd)return"";if(!E.isValidElement(wd)){if(null!=wd&&null!=wd.$$typeof){td=wd.$$typeof;if(td===aa)throw Error(q(257));throw Error(q(258,td.toString()));}wd=Jc(wd);this.stack.push({type:null,domNamespace:td,children:wd,childIndex:0,context:Yd,footer:""});return""}var Qd=wd.type;if("string"===typeof Qd)return this.renderDOM(wd,Yd,td);switch(Qd){case za:case qa:case S:case D:case H:case M:return wd=Jc(wd.props.children),this.stack.push({type:null,
|
|||
|
domNamespace:td,children:wd,childIndex:0,context:Yd,footer:""}),"";case ba:throw Error(q(294));case ea:throw Error(q(343));}if("object"===typeof Qd&&null!==Qd)switch(Qd.$$typeof){case da:oa={};var ld=Qd.render(wd.props,wd.ref);ld=x(Qd.render,wd.props,ld,wd.ref);ld=Jc(ld);this.stack.push({type:null,domNamespace:td,children:ld,childIndex:0,context:Yd,footer:""});return"";case ja:return wd=[E.createElement(Qd.type,Z({ref:wd.ref},wd.props))],this.stack.push({type:null,domNamespace:td,children:wd,childIndex:0,
|
|||
|
context:Yd,footer:""}),"";case O:return Qd=Jc(wd.props.children),td={type:wd,domNamespace:td,children:Qd,childIndex:0,context:Yd,footer:""},this.pushProvider(wd),this.stack.push(td),"";case P:Qd=wd.type;ld=wd.props;var Sd=this.threadID;A(Qd,Sd);Qd=Jc(ld.children(Qd[Sd]));this.stack.push({type:wd,domNamespace:td,children:Qd,childIndex:0,context:Yd,footer:""});return"";case ia:throw Error(q(338));case N:return Qd=wd.type,ld=Qd._init,Qd=ld(Qd._payload),wd=[E.createElement(Qd,Z({ref:wd.ref},wd.props))],
|
|||
|
this.stack.push({type:null,domNamespace:td,children:wd,childIndex:0,context:Yd,footer:""}),""}throw Error(q(130,null==Qd?Qd:typeof Qd,""));};Dd.renderDOM=function(wd,Yd,td){var Qd=wd.type.toLowerCase();"http://www.w3.org/1999/xhtml"===td&&X(Qd);if(!yc.hasOwnProperty(Qd)){if(!Fb.test(Qd))throw Error(q(65,Qd));yc[Qd]=!0}var ld=wd.props;if("input"===Qd)ld=Z({type:void 0},ld,{defaultChecked:void 0,defaultValue:void 0,value:null!=ld.value?ld.value:ld.defaultValue,checked:null!=ld.checked?ld.checked:ld.defaultChecked});
|
|||
|
else if("textarea"===Qd){var Sd=ld.value;if(null==Sd){Sd=ld.defaultValue;var Nb=ld.children;if(null!=Nb){if(null!=Sd)throw Error(q(92));if(Array.isArray(Nb)){if(!(1>=Nb.length))throw Error(q(93));Nb=Nb[0]}Sd=""+Nb}null==Sd&&(Sd="")}ld=Z({},ld,{value:void 0,children:""+Sd})}else if("select"===Qd)this.currentSelectValue=null!=ld.value?ld.value:ld.defaultValue,ld=Z({},ld,{value:void 0});else if("option"===Qd){Nb=this.currentSelectValue;var fc=F(ld.children);if(null!=Nb){var Yb=null!=ld.value?ld.value+
|
|||
|
"":fc;Sd=!1;if(Array.isArray(Nb))for(var rb=0;rb<Nb.length;rb++){if(""+Nb[rb]===Yb){Sd=!0;break}}else Sd=""+Nb===Yb;ld=Z({selected:void 0,children:void 0},ld,{selected:Sd,children:fc})}}if(Sd=ld){if(hc[Qd]&&(null!=Sd.children||null!=Sd.dangerouslySetInnerHTML))throw Error(q(137,Qd));if(null!=Sd.dangerouslySetInnerHTML){if(null!=Sd.children)throw Error(q(60));if(!("object"===typeof Sd.dangerouslySetInnerHTML&&"__html"in Sd.dangerouslySetInnerHTML))throw Error(q(61));}if(null!=Sd.style&&"object"!==
|
|||
|
typeof Sd.style)throw Error(q(62));}Sd=ld;Nb=this.makeStaticMarkup;fc=1===this.stack.length;Yb="\x3c"+wd.type;a:if(-1===Qd.indexOf("-"))rb="string"===typeof Sd.is;else switch(Qd){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":rb=!1;break a;default:rb=!0}for(qd in Sd)if(hd.call(Sd,qd)){var nb=Sd[qd];if(null!=nb){if("style"===qd){var cc=void 0,uc="",Uc="";for(cc in nb)if(nb.hasOwnProperty(cc)){var cd=
|
|||
|
0===cc.indexOf("--"),Ld=nb[cc];if(null!=Ld){if(cd)var be=cc;else if(be=cc,Vc.hasOwnProperty(be))be=Vc[be];else{var ue=be.replace(pb,"-$1").toLowerCase().replace(Zb,"-ms-");be=Vc[be]=ue}uc+=Uc+be+":";Uc=cc;cd=null==Ld||"boolean"===typeof Ld||""===Ld?"":cd||"number"!==typeof Ld||0===Ld||Pa.hasOwnProperty(Uc)&&Pa[Uc]?(""+Ld).trim():Ld+"px";uc+=cd;Uc=";"}}nb=uc||null}cc=null;rb?Kd.hasOwnProperty(qd)||(cc=qd,cc=d(cc)&&null!=nb?cc+'\x3d"'+(K(nb)+'"'):""):cc=r(qd,nb);cc&&(Yb+=" "+cc)}}Nb||fc&&(Yb+=' data-reactroot\x3d""');
|
|||
|
var qd=Yb;Sd="";Wb.hasOwnProperty(Qd)?qd+="/\x3e":(qd+="\x3e",Sd="\x3c/"+wd.type+"\x3e");a:{Nb=ld.dangerouslySetInnerHTML;if(null!=Nb){if(null!=Nb.__html){Nb=Nb.__html;break a}}else if(Nb=ld.children,"string"===typeof Nb||"number"===typeof Nb){Nb=K(Nb);break a}Nb=null}null!=Nb?(ld=[],Pc.hasOwnProperty(Qd)&&"\n"===Nb.charAt(0)&&(qd+="\n"),qd+=Nb):ld=Jc(ld.children);wd=wd.type;td=null==td||"http://www.w3.org/1999/xhtml"===td?X(wd):"http://www.w3.org/2000/svg"===td&&"foreignObject"===wd?"http://www.w3.org/1999/xhtml":
|
|||
|
td;this.stack.push({domNamespace:td,type:Qd,children:ld,childIndex:0,context:Yd,footer:Sd});this.previousWasTextNode=!1;return qd};return pc}();I.renderToNodeStream=function(){throw Error(q(207));};I.renderToStaticMarkup=function(pc,Dd){pc=new Jd(pc,!0,Dd);try{return pc.read(Infinity)}finally{pc.destroy()}};I.renderToStaticNodeStream=function(){throw Error(q(208));};I.renderToString=function(pc,Dd){pc=new Jd(pc,!1,Dd);try{return pc.read(Infinity)}finally{pc.destroy()}};I.version="17.0.2"};
|
|||
|
shadow$provide[591]=function(wa,W,Ta,I){Ta.exports=W(589)};
|
|||
|
shadow$provide[592]=function(wa,W,Ta,I){function q(){if(!Sp&&(Sp="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sp))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sp(Ls)}function R(b,g=0){return(El[b[g+0]]+El[b[g+1]]+El[b[g+2]]+El[b[g+3]]+"-"+El[b[g+4]]+El[b[g+5]]+"-"+El[b[g+6]]+El[b[g+7]]+"-"+El[b[g+8]]+El[b[g+9]]+"-"+El[b[g+10]]+El[b[g+11]]+El[b[g+12]]+El[b[g+13]]+El[b[g+14]]+
|
|||
|
El[b[g+15]]).toLowerCase()}function A(b){let g=0;var p=0;for(var G of b)g+=G.w*G.h,p=Math.max(p,G.w);b.sort((pa,Ga)=>Ga.h-pa.h);p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(g/.95)),p),h:Infinity}];let Y=G=0;for(const pa of b)for(b=p.length-1;0<=b;b--){var la=p[b];if(!(pa.w>la.w||pa.h>la.h)){pa.x=la.x;pa.y=la.y;Y=Math.max(Y,pa.y+pa.h);G=Math.max(G,pa.x+pa.w);pa.w===la.w&&pa.h===la.h?(la=p.pop(),b<p.length&&(p[b]=la)):pa.h===la.h?(la.x+=pa.w,la.w-=pa.w):(pa.w!==la.w&&p.push({x:la.x+pa.w,y:la.y,w:la.w-
|
|||
|
pa.w,h:pa.h}),la.y+=pa.h,la.h-=pa.h);break}}return{w:G,h:Y,fill:g/(G*Y)||0}}function t(b,...g){return{didIntersect:0<g.length,message:b,points:g}}function d(b,g,p=0){const G=[b[0]+g[0]/2,b[1]+g[1]/2],Y=Id.rotWith(b,G,p),la=Id.rotWith(Id.add(b,[g[0],0]),G,p),pa=Id.rotWith(Id.add(b,g),G,p);b=Id.rotWith(Id.add(b,[0,g[1]]),G,p);return[["top",[Y,la]],["right",[la,pa]],["bottom",[pa,b]],["left",[b,Y]]]}function w(b,g,p,G){const [Y,la]=b,[pa,Ga]=g,[Qa,Za]=p,[fb,mb]=G;return Ga/pa!==(mb-Za)/(fb-Qa)&&(g=pa*
|
|||
|
(mb-Za)-Ga*(fb-Qa),0!==g&&(b=((la-Za)*(fb-Qa)-(Y-Qa)*(mb-Za))/g,g=((la-Za)*pa-(Y-Qa)*Ga)/g,0<=b&&0<=g&&1>=g))?t("intersection",[Y+b*pa,la+b*Ga]):t("no intersection")}function B(b,g,p,G,Y=0){return k(p,G,Y,b,g)}function C(b,g,p,G=0){const {minX:Y,minY:la,width:pa,height:Ga}=p;return B(b,g,[Y,la],[pa,Ga],G)}function a(b,g,p,G){var Y=Id.sub(b,p);p=Id.sub(G,p);g=Id.sub(g,b);G=p[0]*Y[1]-p[1]*Y[0];Y=g[0]*Y[1]-g[1]*Y[0];p=p[1]*g[0]-p[0]*g[1];return 0===G||0===Y?t("coincident"):0===p?t("parallel"):0!==p&&
|
|||
|
(G/=p,Y/=p,0<=G&&1>=G&&0<=Y&&1>=Y)?t("intersection",Id.add(b,Id.mul(g,G))):t("no intersection")}function K(b,g,p,G){var Y=(g[0]-b[0])*(g[0]-b[0])+(g[1]-b[1])*(g[1]-b[1]),la=2*((g[0]-b[0])*(b[0]-p[0])+(g[1]-b[1])*(b[1]-p[1]));p=la*la-4*Y*(p[0]*p[0]+p[1]*p[1]+b[0]*b[0]+b[1]*b[1]-2*(p[0]*b[0]+p[1]*b[1])-G*G);if(0>p)return t("outside");if(0===p)return t("tangent");G=Math.sqrt(p);p=(-la+G)/(2*Y);Y=(-la-G)/(2*Y);if((0>p||1<p)&&(0>Y||1<Y))return 0>p&&0>Y||1<p&&1<Y?t("outside"):t("inside");la=[];0<=p&&1>=
|
|||
|
p&&la.push(Id.lrp(b,g,p));0<=Y&&1>=Y&&la.push(Id.lrp(b,g,Y));return t("intersection",...la)}function r(b,g,p,G,Y,la=0){if(0===G||0===Y||Id.isEqual(b,g))return t("no intersection");G=0>G?G:-G;Y=0>Y?Y:-Y;b=Id.sub(Id.rotWith(b,p,-la),p);g=Id.sub(Id.rotWith(g,p,-la),p);var pa=Id.sub(g,b),Ga=pa[0]*pa[0]/G/G+pa[1]*pa[1]/Y/Y;pa=2*b[0]*pa[0]/G/G+2*b[1]*pa[1]/Y/Y;const Qa=[];G=pa*pa-4*Ga*(b[0]*b[0]/G/G+b[1]*b[1]/Y/Y-1);0===G?Qa.push(-pa/2/Ga):0<G&&(G=Math.sqrt(G),Qa.push((-pa+G)/2/Ga),Qa.push((-pa-G)/2/Ga));
|
|||
|
Ga=Qa.filter(Za=>0<=Za&&1>=Za).map(Za=>Id.add(p,Id.add(b,Id.mul(Id.sub(g,b),Za)))).map(Za=>Id.rotWith(Za,p,la));return t("intersection",...Ga)}function h(b,g,p){const G=[];for(let Y=1;Y<p.length;Y++){const la=a(b,g,p[Y-1],p[Y]);la&&G.push(...la.points)}return 0===G.length?t("no intersection"):t("intersection",...p)}function k(b,g,p,G,Y){return d(b,g,p).reduce((la,[pa,[Ga,Qa]])=>{(Ga=w(G,Y,Ga,Qa))&&la.push(t(pa,...Ga.points));return la},[]).filter(la=>la.didIntersect)}function f(b,g,p,G){return d(b,
|
|||
|
g).reduce((Y,[la,[pa,Ga]])=>{(pa=a(p,G,pa,Ga))&&Y.push(t(la,...pa.points));return Y},[]).filter(Y=>Y.didIntersect)}function v(b,g,p,G){return d(b,g).reduce((Y,[la,[pa,Ga]])=>{(pa=K(pa,Ga,p,G))&&Y.push(hf(pe({},pa),{message:la}));return Y},[]).filter(Y=>Y.didIntersect)}function x(b,g,p,G,Y,la=0){return d(b,g).reduce((pa,[Ga,[Qa,Za]])=>{(Qa=r(Qa,Za,p,G,Y,la))&&pa.push(hf(pe({},Qa),{message:Ga}));return pa},[]).filter(pa=>pa.didIntersect)}function L(b,g,p){return d(b,g).reduce((G,[Y,[la,pa]])=>{la=h(la,
|
|||
|
pa,p);la.didIntersect&&G.push(t(Y,...la.points));return G},[]).filter(G=>G.didIntersect)}function z(b,g,p){return d(b,g).reduce((G,[Y,[la,pa]])=>{{const Ga=[];for(let Qa=1;Qa<p.length+1;Qa++){const Za=a(la,pa,p[Qa-1],p[Qa%p.length]);Za&&Ga.push(...Za.points)}la=0===Ga.length?t("no intersection"):t("intersection",...p)}la.didIntersect&&G.push(t(Y,...la.points));return G},[]).filter(G=>G.didIntersect)}function u(b,g,p,G=0,Y,la){return g===p?v(Y,la,b,g):x(Y,la,b,g,p,G)}function m(b,g,p){const {minX:G,
|
|||
|
minY:Y,width:la,height:pa}=b;return f([G,Y],[la,pa],g,p)}function l(b){for(var g=arguments.length,p=Array(1<g?g-1:0),G=1;G<g;G++)p[G-1]=arguments[G];throw Error("number"===typeof b?"[MobX] minified error nr: "+b+(p.length?" "+p.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+b);}function J(){return"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof wa?wa:"undefined"!==
|
|||
|
typeof self?self:Cv}function X(){Da||l("Proxy not available")}function F(b){var g=!1;return function(){if(!g)return g=!0,b.apply(this,arguments)}}function ha(b){return"function"===typeof b}function T(b){switch(typeof b){case "string":case "symbol":case "number":return!0}return!1}function Z(b){return null!==b&&"object"===typeof b}function E(b){if(!Z(b))return!1;b=Object.getPrototypeOf(b);if(null==b)return!0;b=Object.hasOwnProperty.call(b,"constructor")&&b.constructor;return"function"===typeof b&&b.toString()===
|
|||
|
gb}function aa(b){return(b=null==b?void 0:b.constructor)?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:!1:!1}function M(b,g,p){Mo(b,g,{enumerable:!1,writable:!0,configurable:!0,value:p})}function S(b,g,p){Mo(b,g,{enumerable:!1,writable:!1,configurable:!0,value:p})}function D(b,g){var p="isMobX"+b;g.prototype[p]=!0;return function(G){return Z(G)&&!0===G[p]}}function O(b){return b instanceof Map}function P(b){return b instanceof Set}function da(b){var g=Object.keys(b);if(!rc)return g;
|
|||
|
var p=Object.getOwnPropertySymbols(b);return p.length?[].concat(g,p.filter(function(G){return cp.propertyIsEnumerable.call(b,G)})):g}function ba(b){return null===b?null:"object"===typeof b?""+b:b}function H(b,g){return cp.hasOwnProperty.call(b,g)}function ja(b,g){for(var p=0;p<g.length;p++){var G=g[p];G.enumerable=G.enumerable||!1;G.configurable=!0;"value"in G&&(G.writable=!0);Object.defineProperty(b,G.key,G)}}function N(b,g,p){g&&ja(b.prototype,g);p&&ja(b,p);Object.defineProperty(b,"prototype",{writable:!1});
|
|||
|
return b}function ca(){ca=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var p=arguments[g],G;for(G in p)Object.prototype.hasOwnProperty.call(p,G)&&(b[G]=p[G])}return b};return ca.apply(this,arguments)}function ia(b,g){b.prototype=Object.create(g.prototype);b.prototype.constructor=b;ea(b,g)}function ea(b,g){ea=Object.setPrototypeOf||function(p,G){p.__proto__=G;return p};return ea(b,g)}function qa(b){if(void 0===b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|||
|
return b}function za(b,g){if(b){if("string"===typeof b)return ya(b,g);var p=Object.prototype.toString.call(b).slice(8,-1);"Object"===p&&b.constructor&&(p=b.constructor.name);if("Map"===p||"Set"===p)return Array.from(b);if("Arguments"===p||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return ya(b,g)}}function ya(b,g){if(null==g||g>b.length)g=b.length;for(var p=0,G=Array(g);p<g;p++)G[p]=b[p];return G}function Ha(b,g){var p="undefined"!==typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(p)return(p=
|
|||
|
p.call(b)).next.bind(p);if(Array.isArray(b)||(p=za(b))||g&&b&&"number"===typeof b.length){p&&(b=p);var G=0;return function(){return G>=b.length?{done:!0}:{done:!1,value:b[G++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function Ua(b){return Object.assign(function(g,p){Ea(g,p,b)},b)}function Ea(b,g,p){H(b,Od)||M(b,Od,ca({},b[Od]));p.annotationType_!==Lg&&(b[Od][g]=p)}function Oa(b){H(b,
|
|||
|
Od)||M(b,Od,ca({},b[Od]));return b[Od]}function Xa(b,g,p){void 0===g&&(g=Gb);void 0===p&&(p=Gb);b=new hg(b);g!==Gb&&Nc(mD,b,g,void 0);p!==Gb&&vc(b,p);return b}function Ma(b,g,p){return Vb(b)?b:Array.isArray(b)?Qe.array(b,{name:p}):E(b)?Qe.object(b,void 0,{name:p}):O(b)?Qe.map(b,{name:p}):P(b)?Qe.set(b,{name:p}):"function"!==typeof b||cd(b)||Lc(b)?b:aa(b)?Ps(b):Os(p,b)}function eb(b){return b}function db(b,g){return{annotationType_:b,options_:g,make_:Na,extend_:oa}}function Na(b,g,p,G){var Y;if(null!=
|
|||
|
(Y=this.options_)&&Y.bound)return null===this.extend_(b,g,p,!1)?0:1;if(G===b.target_)return null===this.extend_(b,g,p,!1)?0:2;if(cd(p.value))return 1;b=Ca(b,this,g,p,!1);Mo(G,g,b);return 2}function oa(b,g,p,G){p=Ca(b,this,g,p);return b.defineProperty_(g,p,G)}function Ca(b,g,p,G,Y){var la,pa,Ga,Qa,Za,fb,mb;void 0===Y&&(Y=Ef.safeDescriptors);G=G.value;if(null!=(la=g.options_)&&la.bound){var Lb;G=G.bind(null!=(Lb=b.proxy_)?Lb:b.target_)}return{value:Pc(null!=(pa=null==(Ga=g.options_)?void 0:Ga.name)?
|
|||
|
pa:p.toString(),G,null!=(Qa=null==(Za=g.options_)?void 0:Za.autoAction)?Qa:!1,null!=(fb=g.options_)&&fb.bound?null!=(mb=b.proxy_)?mb:b.target_:void 0),configurable:Y?b.isPlainObject_:!0,enumerable:!1,writable:Y?!1:!0}}function sa(b,g){return{annotationType_:b,options_:g,make_:Aa,extend_:Ja}}function Aa(b,g,p,G){var Y;if(G===b.target_)return null===this.extend_(b,g,p,!1)?0:2;if(null!=(Y=this.options_)&&Y.bound&&(!H(b.target_,g)||!Lc(b.target_[g]))&&null===this.extend_(b,g,p,!1))return 0;if(Lc(p.value))return 1;
|
|||
|
b=Sa(b,this,g,p,!1,!1);Mo(G,g,b);return 2}function Ja(b,g,p,G){var Y;p=Sa(b,this,g,p,null==(Y=this.options_)?void 0:Y.bound);return b.defineProperty_(g,p,G)}function Sa(b,g,p,G,Y,la){void 0===la&&(la=Ef.safeDescriptors);g=G.value;Lc(g)||(g=Ps(g));if(Y){var pa;g=g.bind(null!=(pa=b.proxy_)?pa:b.target_);g.isMobXFlow=!0}return{value:g,configurable:la?b.isPlainObject_:!0,enumerable:!1,writable:la?!1:!0}}function Ab(b,g){return{annotationType_:b,options_:g,make_:jb,extend_:Ob}}function jb(b,g,p){return null===
|
|||
|
this.extend_(b,g,p,!1)?0:1}function Ob(b,g,p,G){return b.defineComputedProperty_(g,ca({},this.options_,{get:p.get,set:p.set}),G)}function Wb(b,g){return{annotationType_:b,options_:g,make_:hc,extend_:Pa}}function hc(b,g,p){return null===this.extend_(b,g,p,!1)?0:1}function Pa(b,g,p,G){var Y,la;return b.defineObservableProperty_(g,p.value,null!=(Y=null==(la=this.options_)?void 0:la.enhancer)?Y:Ma,G)}function ob(b){return{annotationType_:"true",options_:b,make_:pb,extend_:Zb}}function pb(b,g,p,G){var Y,
|
|||
|
la;if(p.get)return wf.make_(b,g,p,G);if(p.set){p=Pc(g.toString(),p.set);if(G===b.target_)return null===b.defineProperty_(g,{configurable:Ef.safeDescriptors?b.isPlainObject_:!0,set:p})?0:2;Mo(G,g,{configurable:!0,set:p});return 2}if(G!==b.target_&&"function"===typeof p.value){var pa;if(aa(p.value)){var Ga;return(null!=(Ga=this.options_)&&Ga.autoBind?Ps.bound:Ps).make_(b,g,p,G)}return(null!=(pa=this.options_)&&pa.autoBind?Os.bound:Os).make_(b,g,p,G)}pa=!1===(null==(Y=this.options_)?void 0:Y.deep)?Qe.ref:
|
|||
|
Qe;if("function"===typeof p.value&&null!=(la=this.options_)&&la.autoBind){var Qa;p.value=p.value.bind(null!=(Qa=b.proxy_)?Qa:b.target_)}return pa.make_(b,g,p,G)}function Zb(b,g,p,G){var Y,la;if(p.get)return wf.extend_(b,g,p,G);if(p.set)return b.defineProperty_(g,{configurable:Ef.safeDescriptors?b.isPlainObject_:!0,set:Pc(g.toString(),p.set)},G);if("function"===typeof p.value&&null!=(Y=this.options_)&&Y.autoBind){var pa;p.value=p.value.bind(null!=(pa=b.proxy_)?pa:b.target_)}return(!1===(null==(la=
|
|||
|
this.options_)?void 0:la.deep)?Qe.ref:Qe).extend_(b,g,p,G)}function Jc(b){if(!0===b.deep)var g=Ma;else{if(!1===b.deep)b=eb;else{b=b.defaultDecorator;var p;b=b?null!=(g=null==(p=b.options_)?void 0:p.enhancer)?g:Ma:Ma}g=b}return g}function ad(b,g,p){if(T(g))Ea(b,g,se);else return Vb(b)?b:E(b)?Qe.object(b,g,p):Array.isArray(b)?Qe.array(b,g):O(b)?Qe.map(b,g):P(b)?Qe.set(b,g):"object"===typeof b&&null!==b?b:Qe.box(b,g)}function Pc(b,g,p,G){function Y(){a:{var la=G||this,pa=arguments,Ga=Ef.trackingDerivation,
|
|||
|
Qa=!p||!Ga;ld();var Za=Ef.allowStateChanges;Qa&&(pc(),Za=yc(!0));var fb=Dd(!0),mb=sD++,Lb=$t;$t=mb;try{var Tb=g.apply(la,pa);break a}catch(lc){var Pb=lc;throw lc;}finally{$t!==mb&&l(30),$t=Lb,void 0!==Pb&&(Ef.suppressReactionErrors=!0),Ef.allowStateChanges=Za,Ef.allowStateReads=fb,Sd(),Qa&&(Ef.trackingDerivation=Ga),Ef.suppressReactionErrors=!1}Tb=void 0}return Tb}void 0===p&&(p=!1);Y.isMobxAction=!0;qD&&(Ay.value=b,Object.defineProperty(Y,"name",Ay));return Y}function Fb(b,g){b=yc(b);try{return g()}finally{Ef.allowStateChanges=
|
|||
|
b}}function yc(b){var g=Ef.allowStateChanges;Ef.allowStateChanges=b;return g}function Vc(b){switch(b.dependenciesState_){case Dj.UP_TO_DATE_:return!1;case Dj.NOT_TRACKING_:case Dj.STALE_:return!0;case Dj.POSSIBLY_STALE_:for(var g=Dd(!0),p=pc(),G=b.observing_,Y=G.length,la=0;la<Y;la++){var pa=G[la];if($s(pa)){if(Ef.disableErrorBoundaries)pa.get();else try{pa.get()}catch(Ga){return Ef.trackingDerivation=p,Ef.allowStateReads=g,!0}if(b.dependenciesState_===Dj.STALE_)return Ef.trackingDerivation=p,Ef.allowStateReads=
|
|||
|
g,!0}}wd(b);Ef.trackingDerivation=p;Ef.allowStateReads=g;return!1}}function hd(b,g,p){var G=Dd(!0);wd(b);b.newObserving_=Array(b.observing_.length+100);b.unboundDepsCount_=0;b.runId_=++Ef.runId;var Y=Ef.trackingDerivation;Ef.trackingDerivation=b;Ef.inBatch++;if(!0===Ef.disableErrorBoundaries)var la=g.call(p);else try{la=g.call(p)}catch(fb){la=new cr(fb)}Ef.inBatch--;Ef.trackingDerivation=Y;var pa=b.observing_;g=b.observing_=b.newObserving_;p=Dj.UP_TO_DATE_;Y=0;for(var Ga=b.unboundDepsCount_,Qa=0;Qa<
|
|||
|
Ga;Qa++){var Za=g[Qa];0===Za.diffValue_&&(Za.diffValue_=1,Y!==Qa&&(g[Y]=Za),Y++);Za.dependenciesState_>p&&(p=Za.dependenciesState_)}g.length=Y;b.newObserving_=null;for(Ga=pa.length;Ga--;)Qa=pa[Ga],0===Qa.diffValue_&&td(Qa,b),Qa.diffValue_=0;for(;Y--;)pa=g[Y],1===pa.diffValue_&&(pa.diffValue_=0,Ga=b,pa.observers_.add(Ga),pa.lowestObserverState_>Ga.dependenciesState_&&(pa.lowestObserverState_=Ga.dependenciesState_));p!==Dj.UP_TO_DATE_&&(b.dependenciesState_=p,b.onBecomeStale_());Ef.allowStateReads=
|
|||
|
G;return la}function Kd(b){var g=b.observing_;b.observing_=[];for(var p=g.length;p--;)td(g[p],b);b.dependenciesState_=Dj.NOT_TRACKING_}function Jd(b){var g=pc();try{return b()}finally{Ef.trackingDerivation=g}}function pc(){var b=Ef.trackingDerivation;Ef.trackingDerivation=null;return b}function Dd(b){var g=Ef.allowStateReads;Ef.allowStateReads=b;return g}function wd(b){if(b.dependenciesState_!==Dj.UP_TO_DATE_){b.dependenciesState_=Dj.UP_TO_DATE_;b=b.observing_;for(var g=b.length;g--;)b[g].lowestObserverState_=
|
|||
|
Dj.UP_TO_DATE_}}function Yd(){(Ef.pendingReactions.length||Ef.inBatch||Ef.isRunningReactions)&&l(36);Cy=!0;if(du){var b=J();0===--b.__mobxInstanceCount&&(b.__mobxGlobals=void 0);Ef=new cu}}function td(b,g){b.observers_["delete"](g);0===b.observers_.size&&Qd(b)}function Qd(b){!1===b.isPendingUnobservation_&&(b.isPendingUnobservation_=!0,Ef.pendingUnobservations.push(b))}function ld(){Ef.inBatch++}function Sd(){if(0===--Ef.inBatch){0<Ef.inBatch||Ef.isRunningReactions||fu(nb);for(var b=Ef.pendingUnobservations,
|
|||
|
g=0;g<b.length;g++){var p=b[g];p.isPendingUnobservation_=!1;0===p.observers_.size&&(p.isBeingObserved_&&(p.isBeingObserved_=!1,p.onBUO()),p instanceof Rs&&p.suspend_())}Ef.pendingUnobservations=[]}}function Nb(b){var g=Ef.trackingDerivation;if(null!==g)return g.runId_!==b.lastAccessedBy_&&(b.lastAccessedBy_=g.runId_,g.newObserving_[g.unboundDepsCount_++]=b,!b.isBeingObserved_&&Ef.trackingContext&&(b.isBeingObserved_=!0,b.onBO())),b.isBeingObserved_;0===b.observers_.size&&0<Ef.inBatch&&Qd(b);return!1}
|
|||
|
function fc(b){b.lowestObserverState_!==Dj.STALE_&&(b.lowestObserverState_=Dj.STALE_,b.observers_.forEach(function(g){if(g.dependenciesState_===Dj.UP_TO_DATE_)g.onBecomeStale_();g.dependenciesState_=Dj.STALE_}))}function Yb(b){b.lowestObserverState_!==Dj.STALE_&&(b.lowestObserverState_=Dj.STALE_,b.observers_.forEach(function(g){g.dependenciesState_===Dj.POSSIBLY_STALE_?g.dependenciesState_=Dj.STALE_:g.dependenciesState_===Dj.UP_TO_DATE_&&(b.lowestObserverState_=Dj.UP_TO_DATE_)}))}function rb(b){b.lowestObserverState_===
|
|||
|
Dj.UP_TO_DATE_&&(b.lowestObserverState_=Dj.POSSIBLY_STALE_,b.observers_.forEach(function(g){g.dependenciesState_===Dj.UP_TO_DATE_&&(g.dependenciesState_=Dj.POSSIBLY_STALE_,g.onBecomeStale_())}))}function nb(){Ef.isRunningReactions=!0;for(var b=Ef.pendingReactions,g=0;0<b.length;){++g===wD&&(console.error("[mobx] cycle in reaction: "+b[0]),b.splice(0));for(var p=b.splice(0),G=0,Y=p.length;G<Y;G++)p[G].runReaction_()}Ef.isRunningReactions=!1}function cc(b){var g=fu;fu=function(p){return b(function(){return g(p)})}}
|
|||
|
function uc(b){console.warn("[mobx.spy] Is a no-op in production builds");return function(){}}function Uc(b){return function(g,p){if(ha(g))return Pc(g.name||"\x3cunnamed action\x3e",g,b);if(ha(p))return Pc(g,p,b);if(T(p))return Ea(g,p,b?By:Ey);if(T(g))return Ua(db(b?"autoAction":Dy,{name:g,autoAction:b}))}}function cd(b){return ha(b)&&!0===b.isMobxAction}function Ld(b,g){function p(){b(Qa)}var G,Y;void 0===g&&(g=ma);var la=null!=(G=null==(Y=g)?void 0:Y.name)?G:"Autorun";if(g.scheduler||g.delay){var pa=
|
|||
|
be(g),Ga=!1;var Qa=new Pr(la,function(){Ga||(Ga=!0,pa(function(){Ga=!1;Qa.isDisposed_||Qa.track(p)}))},g.onError,g.requiresObservable)}else Qa=new Pr(la,function(){this.track(p)},g.onError,g.requiresObservable);Qa.schedule_();return Qa.getDisposer_()}function be(b){return b.scheduler?b.scheduler:b.delay?function(g){return setTimeout(g,b.delay)}:lD}function ue(b,g,p){function G(){fb=!1;if(!Pb.isDisposed_){var lc=!1;Pb.track(function(){var xc=Fb(!1,function(){return b(Pb)});lc=Za||!Tb(mb,xc);Lb=mb;
|
|||
|
mb=xc});Za&&p.fireImmediately?pa(mb,Lb,Pb):!Za&&lc&&pa(mb,Lb,Pb);Za=!1}}var Y;void 0===p&&(p=ma);var la=null!=(Y=p.name)?Y:"Reaction",pa=qg(la,p.onError?qd(p.onError,g):g),Ga=!p.scheduler&&!p.delay,Qa=be(p),Za=!0,fb=!1,mb,Lb,Tb=p.compareStructural?ef.structural:p.equals||ef["default"],Pb=new Pr(la,function(){Za||Ga?G():fb||(fb=!0,Qa(G))},p.onError,p.requiresObservable);Pb.schedule_();return Pb.getDisposer_()}function qd(b,g){return function(){try{return g.apply(this,arguments)}catch(p){b.call(this,
|
|||
|
p)}}}function vc(b,g,p){return Nc(nD,b,g,p)}function Nc(b,g,p,G){var Y="function"===typeof G?Eg(g,p):Eg(g),la=ha(G)?G:p,pa=b+"L";Y[pa]?Y[pa].add(la):Y[pa]=new Set([la]);return function(){var Ga=Y[pa];Ga&&(Ga["delete"](la),0===Ga.size&&delete Y[pa])}}function Ie(b){!0===b.isolateGlobalState&&Yd();var g=b.useProxies,p=b.enforceActions;void 0!==g&&(Ef.useProxies="always"===g?!0:"never"===g?!1:"undefined"!==typeof Proxy);"ifavailable"===g&&(Ef.verifyProxies=!0);void 0!==p&&(g="always"===p?"always":"observed"===
|
|||
|
p,Ef.enforceActions=g,Ef.allowStateChanges=!0===g||"always"===g?!1:!0);["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(G){G in b&&(Ef[G]=!!b[G])});Ef.allowStateReads=!Ef.observableRequiresReaction;b.reactionScheduler&&cc(b.reactionScheduler)}function qc(b,g,p,G){var Y=fd(g),la=Cd(b,G)[ae];ld();try{Ic(Y).forEach(function(pa){la.extend_(pa,Y[pa],p?pa in p?p[pa]:!0:!0)})}finally{Sd()}return b}function He(b){var g=
|
|||
|
{name:b.name_};b.observing_&&0<b.observing_.length&&(g.dependencies=Array.from(new Set(b.observing_)).map(He));return g}function Sb(){this.message="FLOW_CANCELLED"}function Lc(b){return!0===(null==b?void 0:b.isMobXFlow)}function Vb(b,g){return b?void 0!==g?Xd(b)?b[ae].values_.has(g):!1:Xd(b)||!!b[ae]||uh(b)||gu(b)||$s(b):!1}function dd(b){if(Xd(b))return b[ae].ownKeys_();l(38)}function ve(b,g,p){b.set(g,p);return p}function oe(b,g){if(null==b||"object"!==typeof b||b instanceof Date||!Vb(b))return b;
|
|||
|
if(oD(b)||$s(b))return oe(b.get(),g);if(g.has(b))return g.get(b);if(kb(b)){var p=ve(g,b,Array(b.length));b.forEach(function(pa,Ga){p[Ga]=oe(pa,g)});return p}if(Nq(b)){var G=ve(g,b,new Set);b.forEach(function(pa){G.add(oe(pa,g))});return G}if(Xp(b)){var Y=ve(g,b,new Map);b.forEach(function(pa,Ga){Y.set(Ga,oe(pa,g))});return Y}var la=ve(g,b,{});dd(b).forEach(function(pa){cp.propertyIsEnumerable.call(b,pa)&&(la[pa]=oe(b[pa],g))});return la}function Ec(b,g){return oe(b,new Map)}function Bb(){l("trace() is not available in production builds");
|
|||
|
for(var b=!1,g=arguments.length,p=Array(g),G=0;G<g;G++)p[G]=arguments[G];"boolean"===typeof p[p.length-1]&&(b=p.pop());a:{switch(p.length){case 0:g=Ef.trackingDerivation;break a;case 1:g=Eg(p[0]);break a;case 2:g=Eg(p[0],p[1]);break a}g=void 0}if(!g)return l("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");g.isTracing_===Mr.NONE&&console.log("[mobx.trace] '"+g.name_+"' tracing enabled");g.isTracing_=b?
|
|||
|
Mr.BREAK:Mr.LOG}function Hd(b,g){void 0===g&&(g=void 0);ld();try{return b.apply(g)}finally{Sd()}}function ee(b){return void 0!==b.interceptors_&&0<b.interceptors_.length}function pd(b,g){var p=b.interceptors_||(b.interceptors_=[]);p.push(g);return F(function(){var G=p.indexOf(g);-1!==G&&p.splice(G,1)})}function mc(b,g){var p=pc();try{var G=[].concat(b.interceptors_||[]);b=0;for(var Y=G.length;b<Y&&((g=G[b](g))&&!g.type&&l(14),g);b++);return g}finally{Ef.trackingDerivation=p}}function Je(b){return void 0!==
|
|||
|
b.changeListeners_&&0<b.changeListeners_.length}function cg(b,g){var p=b.changeListeners_||(b.changeListeners_=[]);p.push(g);return F(function(){var G=p.indexOf(g);-1!==G&&p.splice(G,1)})}function af(b,g){var p=pc();if(b=b.changeListeners_){b=b.slice();for(var G=0,Y=b.length;G<Y;G++)b[G](g);Ef.trackingDerivation=p}}function Ag(b,g,p){var G=Cd(b,p)[ae];ld();try{var Y;null!=(Y=g)?Y:g=Oa(b);Ic(g).forEach(function(la){return G.make_(la,g[la])})}finally{Sd()}return b}function ab(b,g,p,G){void 0===p&&(p=
|
|||
|
"ObservableArray");void 0===G&&(G=!1);X();g=new Mv(p,g,G,!1);S(g.values_,ae,g);p=new Proxy(g.values_,vD);g.proxy_=p;b&&b.length&&(G=yc(!0),g.spliceWithArray_(0,0,b),Ef.allowStateChanges=G);return p}function Cb(b,g){"function"===typeof Array.prototype[b]&&(Zt[b]=g(b))}function cb(b){return function(){var g=this[ae];g.atom_.reportObserved();g=g.dehanceValues_(g.values_);return g[b].apply(g,arguments)}}function Db(b){return function(g,p){var G=this,Y=this[ae];Y.atom_.reportObserved();return Y.dehanceValues_(Y.values_)[b](function(la,
|
|||
|
pa){return g.call(p,la,pa,G)})}}function gc(b){return function(){var g=this,p=this[ae];p.atom_.reportObserved();p=p.dehanceValues_(p.values_);var G=arguments[0];arguments[0]=function(Y,la,pa){return G(Y,la,pa,g)};return p[b].apply(p,arguments)}}function kb(b){return Z(b)&&hD(b[ae])}function gd(b){if(O(b)||Xp(b))return b;if(Array.isArray(b))return new Map(b);if(E(b)){var g=new Map,p;for(p in b)g.set(p,b[p]);return g}return l(21,b)}function Cd(b,g){var p;if(H(b,ae))return b;var G=null!=(p=null==g?void 0:
|
|||
|
g.name)?p:"ObservableObject";p=my;var Y=new Map;G=String(G);var la;var pa=g?null!=(la=g.defaultDecorator)?la:ob(g):void 0;g=new p(b,Y,G,pa);M(b,ae,g);return b}function me(b){return ly[b]||(ly[b]={get:function(){return this[ae].getObservablePropValue_(b)},set:function(g){return this[ae].setObservablePropValue_(b,g)}})}function Xd(b){return Z(b)?aD(b[ae]):!1}function Ue(b){return{enumerable:!1,configurable:!0,get:function(){return this[ae].get_(b)},set:function(g){this[ae].set_(b,g)}}}function we(b){if(b>
|
|||
|
Kv){for(var g=Kv;g<b+100;g++)Mo(Lv.prototype,""+g,Ue(g));Kv=b}}function gf(b,g,p){return new Lv(b,g,p)}function Eg(b,g){if("object"===typeof b&&null!==b){if(kb(b))return void 0!==g&&l(23),b[ae].atom_;if(Nq(b))return b[ae];if(Xp(b)){if(void 0===g)return b.keysAtom_;var p=b.data_.get(g)||b.hasMap_.get(g);p||l(25,g,zb(b));return p}if(Xd(b)){if(!g)return l(26);(p=b[ae].values_.get(g))||l(27,g,zb(b));return p}if(uh(b)||$s(b)||gu(b))return b}else if(ha(b)&&gu(b[ae]))return b[ae];l(28)}function uf(b,g){b||
|
|||
|
l(29);if(void 0!==g)return uf(Eg(b,g));if(uh(b)||$s(b)||gu(b)||Xp(b)||Nq(b))return b;if(b[ae])return b[ae];l(24,b)}function zb(b,g){if(void 0!==g)b=Eg(b,g);else{if(cd(b))return b.name;b=Xd(b)||Xp(b)||Nq(b)?uf(b):Eg(b)}return b.name_}function ta(b,g,p){void 0===p&&(p=-1);return ra(b,g,p)}function ra(b,g,p,G,Y){if(b===g)return 0!==b||1/b===1/g;if(null==b||null==g)return!1;if(b!==b)return g!==g;var la=typeof b;if("function"!==la&&"object"!==la&&"object"!=typeof g)return!1;la=oy.call(b);if(la!==oy.call(g))return!1;
|
|||
|
switch(la){case "[object RegExp]":case "[object String]":return""+b===""+g;case "[object Number]":return+b!==+b?+g!==+g:0===+b?1/+b===1/g:+b===+g;case "[object Date]":case "[object Boolean]":return+b===+g;case "[object Symbol]":return"undefined"!==typeof Symbol&&Symbol.valueOf.call(b)===Symbol.valueOf.call(g);case "[object Map]":case "[object Set]":0<=p&&p++}b=Ia(b);g=Ia(g);la="[object Array]"===la;if(!la){if("object"!=typeof b||"object"!=typeof g)return!1;var pa=b.constructor,Ga=g.constructor;if(pa!==
|
|||
|
Ga&&!(ha(pa)&&pa instanceof pa&&ha(Ga)&&Ga instanceof Ga)&&"constructor"in b&&"constructor"in g)return!1}if(0===p)return!1;0>p&&(p=-1);G=G||[];Y=Y||[];for(pa=G.length;pa--;)if(G[pa]===b)return Y[pa]===g;G.push(b);Y.push(g);if(la){pa=b.length;if(pa!==g.length)return!1;for(;pa--;)if(!ra(b[pa],g[pa],p-1,G,Y))return!1}else{la=Object.keys(b);pa=la.length;if(Object.keys(g).length!==pa)return!1;for(;pa--;)if(Ga=la[pa],!H(g,Ga)||!ra(b[Ga],g[Ga],p-1,G,Y))return!1}G.pop();Y.pop();return!0}function Ia(b){return kb(b)?
|
|||
|
b.slice():O(b)||Xp(b)||P(b)||Nq(b)?Array.from(b.entries()):b}function bb(b){b[Symbol.iterator]=Ib;return b}function Ib(){return this}function kc(b,g){const p=new Set(g),G=Object.values(b),Y=new Set(G.filter(la=>p.has(la.toId)||p.has(la.fromId)));b=Y.size;for(g=-1;0!==g;)Y.forEach(la=>{la=la.fromId;for(const pa of G)pa.fromId===la&&Y.add(pa),pa.toId===la&&Y.add(pa)}),g=Y.size-b,b=Y.size;return Array.from(Y.values())}function Rc(b,g,p,G,Y,la,pa,Ga){if(Y=g.getBindingPoint(Y,la,pa,Ga))return{id:G,type:"line",
|
|||
|
fromId:b.id,toId:g.id,handleId:p,point:ke.toFixed(Y.point),distance:Y.distance}}function kd(b,g){const p=b.getCenter(),G=g.getCenter();var Y=Gk();Y=hf(pe({},Ms.defaultProps),{id:Y,type:Ms.id,parentId:b.props.parentId,point:p});b=Rc(Y,b,"start",Gk(),p,p,ke.uni(ke.sub(G,p)),!1);g=Rc(Y,g,"end",Gk(),G,G,ke.uni(ke.sub(p,G)),!1);return b&&g?(Y.handles.start.point=[0,0],Y.handles.end.point=ke.sub(G,p),Y.handles.start.bindingId=b.id,Y.handles.end.bindingId=g.id,[Y,[b,g]]):null}function ye(){return new ED}
|
|||
|
function Se(){return new WeakMap}function Nf(b){if(!b)return Qv(null);var g=b.constructor;if(g===Object)return b===Object.prototype?{}:Qv(b);if(~GD.call(g).indexOf("[native code]"))try{return new g}catch(p){}return Qv(b)}function lg(b){var g="";b.global&&(g+="g");b.ignoreCase&&(g+="i");b.multiline&&(g+="m");b.unicode&&(g+="u");b.sticky&&(g+="y");return g}function Lf(b){return b.flags}function Af(b){b=HD.call(b);return b.substring(8,b.length-1)}function Xf(b){return b[Symbol.toStringTag]||Af(b)}function Sg(b){return Qy(b).concat(Pv(b))}
|
|||
|
function ki(b,g,p){for(var G=TD(b),Y=0,la=G.length,pa,Ga;Y<la;++Y)if(pa=G[Y],"callee"!==pa&&"caller"!==pa)if(Ga=BD(b,pa)){Ga.get||Ga.set||(Ga.value=p.copier(Ga.value,p));try{CD(g,pa,Ga)}catch(Qa){g[pa]=Ga.value}}else g[pa]=p.copier(b[pa],p);return g}function vh(b,g){var p=new g.Constructor;g.cache.set(b,p);b.forEach(function(G,Y){p.set(Y,g.copier(G,g))});return p}function ri(b,g){var p=Nf(g.prototype);g.cache.set(b,p);for(var G in b)Ov.call(b,G)&&(p[G]=g.copier(b[G],g));return p}function ci(b,g){var p=
|
|||
|
Nf(g.prototype);g.cache.set(b,p);for(var G in b)Ov.call(b,G)&&(p[G]=g.copier(b[G],g));G=Pv(b);for(var Y=0,la=G.length,pa;Y<la;++Y)pa=G[Y],AD.call(b,pa)&&(p[pa]=g.copier(b[pa],g));return p}function Bg(b,g){return new g.Constructor(b.valueOf())}function Rh(b,g){return b}function bf(b,g){var p=new g.Constructor;g.cache.set(b,p);b.forEach(function(G){p.add(g.copier(G,g))});return p}function Sh(b){function g(la,pa){pa.prototype=pa.Constructor=void 0;if(!la||"object"!==typeof la)return la;if(pa.cache.has(la))return pa.cache.get(la);
|
|||
|
pa.prototype=la.__proto__||VD(la);pa.Constructor=pa.prototype&&pa.prototype.constructor;if(!pa.Constructor||pa.Constructor===Object)return Y(la,pa);if(SD(la))return G(la,pa);var Ga=p[ID(la)];return Ga?Ga(la,pa):"function"===typeof la.then?la:Y(la,pa)}b=Xv({},Zy,b);var p={Arguments:b.object,Array:b.array,ArrayBuffer:b.arrayBuffer,Blob:b.blob,Boolean:Bg,DataView:b.dataView,Date:b.date,Error:b.error,Float32Array:b.arrayBuffer,Float64Array:b.arrayBuffer,Int8Array:b.arrayBuffer,Int16Array:b.arrayBuffer,
|
|||
|
Int32Array:b.arrayBuffer,Map:b.map,Number:Bg,Object:b.object,Promise:Rh,RegExp:b.regExp,Set:b.set,String:Bg,WeakMap:Rh,WeakSet:Rh,Uint8Array:b.arrayBuffer,Uint8ClampedArray:b.arrayBuffer,Uint16Array:b.arrayBuffer,Uint32Array:b.arrayBuffer,Uint64Array:b.arrayBuffer},G=p.Array,Y=p.Object;return function(la){return g(la,{Constructor:void 0,cache:DD(),copier:g,prototype:void 0})}}function Fi(b,g){return(0,YD.default)(b,g,{arrayMerge:(p,G,Y)=>G})}function Rl(b,g,p,G=!1){const [Y,la]=g,[pa,Ga]=p;b=pa+(b-
|
|||
|
Y)/(la-Y)*(Ga-pa);return G?pa<Ga?Math.max(Math.min(b,Ga),pa):Math.max(Math.min(b,pa),Ga):b}function Gj(b,g){return new Promise((p,G)=>{if(g){const Y=document.createElement("video");Y.addEventListener("loadedmetadata",function(){p([this.videoWidth,this.videoHeight])},!1);Y.src=b}else{const Y=new Image;Y.onload=()=>p([Y.width,Y.height]);Y.src=b;Y.onerror=la=>G(la)}})}function jg(b){return Object.values(Mq).includes(b)}function Xg(b,g){return jg(b)||null==b?`var(--ls-wb-${g}-color-${b?b:"default"})`:
|
|||
|
b}function Ik(){var b;null==(b=document.getElementById("__textLabelMeasure"))?void 0:b.remove();b=document.createElement("pre");b.id="__textLabelMeasure";Object.assign(b.style,{whiteSpace:"pre",width:"auto",borderLeft:"2px solid transparent",borderRight:"1px solid transparent",borderBottom:"2px solid transparent",padding:"0px",margin:"0px",opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",userSelect:"none",pointerEvents:"none",font:"var(--ls-font-family)"});b.tabIndex=-1;document.body.appendChild(b);
|
|||
|
return b}function Xh(b,g,p=0){var G,Y,la;if(!b)return[16,32];let pa;pa="string"===typeof g?g:`${null!=(G=g.fontStyle)?G:"normal"} ${null!=(Y=g.fontVariant)?Y:"normal"} ${null!=(la=g.fontWeight)?la:"normal"} ${g.fontSize}px/${g.fontSize*g.lineHeight}px ${g.fontFamily}`;if(!Yv.has(`${b}-${pa}-${p}`)){if(!gq)return[10,10];gq.parentNode||document.body.appendChild(gq);gq.innerHTML=`${b}​`;gq.style.font=pa;gq.style.padding=p+"px";g=gq.getBoundingClientRect();Yv.set(`${b}-${pa}-${p}`,[Math.ceil(g.width||
|
|||
|
1),Math.ceil(g.height||1)])}return Yv.get(`${b}-${pa}-${p}`)}function dk(b){try{if("string"!==typeof b||!wg.test(b))throw TypeError("Invalid UUID");let g;const p=new Uint8Array(16);p[0]=(g=parseInt(b.slice(0,8),16))>>>24;p[1]=g>>>16&255;p[2]=g>>>8&255;p[3]=g&255;p[4]=(g=parseInt(b.slice(9,13),16))>>>8;p[5]=g&255;p[6]=(g=parseInt(b.slice(14,18),16))>>>8;p[7]=g&255;p[8]=(g=parseInt(b.slice(19,23),16))>>>8;p[9]=g&255;p[10]=(g=parseInt(b.slice(24,36),16))/1099511627776&255;p[11]=g/4294967296&255;p[12]=
|
|||
|
g>>>24&255;p[13]=g>>>16&255;p[14]=g>>>8&255;p[15]=g&255;return!0}catch(g){return!1}}function ek(b,g=0,p){let G;return function(...Y){null==p?void 0:p(...Y);clearTimeout(G);G=setTimeout(()=>b.apply(Y),g)}}function Jk(){return/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)}function wh(){var b,g,p;return(null==(p=null==(g=null==(b=null==window?void 0:window.logseq)?void 0:b.api)?void 0:g.get_state_from_store)?void 0:p.call(g,"ui/developer-mode?"))||!1}function si(b){return!!b}function Mj(b=0){return new Promise(g=>
|
|||
|
setTimeout(g,b))}function tm(b="noid"){Wv[b]||(Wv[b]=Yy.createContext({}));return Wv[b]}function ui(b="noid"){return Yy.useContext(tm(b))}function Hj(b){const {callbacks:g}=ui(),p=az.useRef(-1);return az.useMemo(()=>{const G=Y=>{var la,pa;const {order:Ga=0}=Y;if(!Ga){var Qa=Y.target;Qa.removeEventListener("pointerup",G);Qa.releasePointerCapture(Y.pointerId);null==(la=g.onPointerUp)?void 0:la.call(g,{type:"selection",handle:b,order:Ga},Y);la=Date.now();Qa=la-p.current;300<Qa?p.current=la:300>=Qa&&
|
|||
|
(null==(pa=g.onDoubleClick)?void 0:pa.call(g,{type:"selection",handle:b,order:Ga},Y),p.current=-1);Y.order=Ga+1}};return{onPointerDown:Y=>{var la;const {order:pa=0}=Y;if(!pa){var Ga=Nj(Y.currentTarget);Ga.setPointerCapture(Y.pointerId);Ga.addEventListener("pointerup",G);null==(la=g.onPointerDown)?void 0:la.call(g,{type:"selection",handle:b,order:pa},Y);Y.order=pa+1}},onPointerMove:Y=>{var la;const {order:pa=0}=Y;pa||(null==(la=g.onPointerMove)?void 0:la.call(g,{type:"selection",handle:b,order:pa},
|
|||
|
Y),Y.order=pa+1)},onPointerEnter:Y=>{var la;const {order:pa=0}=Y;pa||(null==(la=g.onPointerEnter)?void 0:la.call(g,{type:"selection",handle:b,order:pa},Y),Y.order=pa+1)},onPointerLeave:Y=>{var la;const {order:pa=0}=Y;pa||(null==(la=g.onPointerLeave)?void 0:la.call(g,{type:"selection",handle:b,order:pa},Y),Y.order=pa+1)},onKeyDown:Y=>{var la;null==(la=g.onKeyDown)?void 0:la.call(g,{type:"selection",handle:b,order:-1},Y)},onKeyUp:Y=>{var la;null==(la=g.onKeyUp)?void 0:la.call(g,{type:"selection",handle:b,
|
|||
|
order:-1},Y)}}},[g])}function Nj(b){var g;if(null==(g=b.namespaceURI)?0:g.endsWith("svg")){if(b.parentElement)return Nj(b.parentElement);throw Error("Could not find a parent element of an HTML type!");}return b}function Bl(b,g,p){const G=dt.useRef(!1),Y=dt.useCallback(()=>{var la;if(G.current){const pa=null==(la=b.current)?void 0:la.getBoundingClientRect();pa&&(la={minX:pa.left,maxX:pa.left+pa.width,minY:pa.top,maxY:pa.top+pa.height,width:pa.width,height:pa.height},g.updateBounds(la),null==p?void 0:
|
|||
|
p(la))}else G.current=!0},[b,p]);dt.useEffect(()=>{const la=b.current?QD(b.current):document,pa=ek(Y,100);la.addEventListener("scroll",pa);window.addEventListener("resize",pa);return()=>{la.removeEventListener("scroll",pa);window.removeEventListener("resize",pa)}},[]);dt.useLayoutEffect(()=>{const la=new ResizeObserver(pa=>{pa[0].contentRect&&Y()});b.current&&la.observe(b.current);return()=>{la.disconnect()}},[b]);dt.useEffect(()=>{Y();setTimeout(()=>{var la,pa;null==(pa=null==(la=b.current)?void 0:
|
|||
|
la.querySelector(".tl-canvas"))?void 0:pa.focus()})},[b])}function pl(b,g){return Object.keys(g).reduce((p,G)=>{const Y=g[G];return Y?p+`${`--${b}-${G}`}: ${Y};
|
|||
|
`:p},"")}function Sl(b,g,p=".logseq-tldraw"){Uv.useLayoutEffect(()=>{const G=document.createElement("style"),Y=pl(b,g);G.setAttribute("id",`${b}-theme`);G.setAttribute("data-selector",p);G.innerHTML=`
|
|||
|
${p} {
|
|||
|
${Y}
|
|||
|
}
|
|||
|
`;document.head.appendChild(G);return()=>{G&&document.head.contains(G)&&document.head.removeChild(G)}},[b,g,p])}function gk(b,g){Uv.useLayoutEffect(()=>{if(Sv.get(b))return()=>{};const p=document.createElement("style");p.innerHTML=g;p.setAttribute("id",b);document.head.appendChild(p);Sv.set(b,p);return()=>{p&&document.head.contains(p)&&(document.head.removeChild(p),Sv.delete(b))}},[b,g])}function hk(b,g){const p=Uv.useMemo(()=>pe(pe({},PD),b),[b]);Sl("tl",p,g);gk("tl-canvas",OD)}function xk(b=
|
|||
|
"noid"){Rv[b]||(Rv[b]=Ty.createContext({}));return Rv[b]}function Ye(b="noid"){return Ty.useContext(xk(b))}function vg(){const b=Ye(),{callbacks:g}=ui(),p=Vy.useRef(-1);return Vy.useMemo(()=>({onPointerDown:G=>{var Y,la,pa;const {order:Ga=0}=G;Ga||(null==(Y=G.currentTarget)?void 0:Y.setPointerCapture(G.pointerId));G.isPrimary&&(null==(la=g.onPointerDown)?void 0:la.call(g,{type:"canvas",order:Ga},G),Y=Date.now(),la=Y-p.current,300<la?p.current=Y:300>=la&&(null==(pa=g.onDoubleClick)?void 0:pa.call(g,
|
|||
|
{type:"canvas",order:Ga},G),p.current=-1))},onPointerMove:G=>{var Y;const {order:la=0}=G;null==(Y=g.onPointerMove)?void 0:Y.call(g,{type:"canvas",order:la},G)},onPointerUp:G=>{var Y,la;const {order:pa=0}=G;pa||(null==(Y=G.currentTarget)?void 0:Y.releasePointerCapture(G.pointerId));null==(la=g.onPointerUp)?void 0:la.call(g,{type:"canvas",order:pa},G)},onPointerEnter:G=>{var Y;const {order:la=0}=G;null==(Y=g.onPointerEnter)?void 0:Y.call(g,{type:"canvas",order:la},G)},onPointerLeave:G=>{var Y;const {order:la=
|
|||
|
0}=G;null==(Y=g.onPointerLeave)?void 0:Y.call(g,{type:"canvas",order:la},G)},onDrop:G=>Zh(this,null,function*(){G.preventDefault();"clientX"in G&&b.drop(G.dataTransfer,[G.clientX,G.clientY])}),onDragOver:G=>{G.preventDefault()},onTouchEnd:G=>{let Y=b.selectedTool.id;"pencil"!==Y&&"highlighter"!==Y||G.preventDefault()}}),[g])}function qj(b,g,p){return 0===g||Infinity===Math.abs(g)?Math.pow(b,5*p):b*g*p/(g+p*b)}function Eh(b,g,p,G=.15){return 0===G?Math.max(g,Math.min(b,p)):b<g?-qj(g-b,p-g,G)+g:b>p?
|
|||
|
+qj(b-p,p-g,G)+p:b}function Gi(b,[g,p],[G,Y]){const [[la,pa],[Ga,Qa]]=b;return[Eh(g,la,pa,G),Eh(p,Ga,Qa,Y)]}function Nh(b,g,p){g in b?Object.defineProperty(b,g,{value:p,enumerable:!0,configurable:!0,writable:!0}):b[g]=p;return b}function di(b,g){var p=Object.keys(b);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(b);g&&(G=G.filter(function(Y){return Object.getOwnPropertyDescriptor(b,Y).enumerable}));p.push.apply(p,G)}return p}function Gg(b){for(var g=1;g<arguments.length;g++){var p=
|
|||
|
null!=arguments[g]?arguments[g]:{};g%2?di(Object(p),!0).forEach(function(G){Nh(b,G,p[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(p)):di(Object(p)).forEach(function(G){Object.defineProperty(b,G,Object.getOwnPropertyDescriptor(p,G))})}return b}function ik(b){return b?b[0].toUpperCase()+b.slice(1):""}function Kk(b=!1,g){return b&&!ND.includes(g)}function Oh(b,g="",p=!1){const G=Uy[b];g=G?G[g]||g:g;return"on"+ik(b)+ik(g)+(Kk(p,g)?"Capture":"")}function Li(b){b=
|
|||
|
b.substring(2).toLowerCase();const g=!!~b.indexOf("passive");g&&(b=b.replace("passive",""));var p=MD.includes(b)?"capturecapture":"capture";(p=!!~b.indexOf(p))&&(b=b.replace("capture",""));return{device:b,capture:p,passive:g}}function Th(b,g=""){const p=Uy[b];return b+(p?p[g]||g:g)}function bl(b){return"touches"in b?"touch":"pointerType"in b?b.pointerType:"mouse"}function yk(b){return Array.from(b.touches).filter(g=>{var p,G;return g.target===b.currentTarget||(null===(p=b.currentTarget)||void 0===
|
|||
|
p?void 0:null===(G=p.contains)||void 0===G?void 0:G.call(p,g.target))})}function Oj(b){return"touches"in b?("touchend"===b.type||"touchcancel"===b.type?b.changedTouches:b.targetTouches)[0]:b}function ql(b,g){const p=g.clientX-b.clientX,G=g.clientY-b.clientY;return{angle:-(180*Math.atan2(p,G))/Math.PI,distance:Math.hypot(p,G),origin:[(g.clientX+b.clientX)/2,(g.clientY+b.clientY)/2]}}function gn(b){return yk(b).map(g=>g.identifier)}function jk(b,g){const [p,G]=Array.from(b.touches).filter(Y=>g.includes(Y.identifier));
|
|||
|
return ql(p,G)}function Ci(b){const g=Oj(b);return"touches"in b?g.identifier:g.pointerId}function rj(b){b=Oj(b);return[b.clientX,b.clientY]}function Yh(b){let {deltaX:g,deltaY:p,deltaMode:G}=b;1===G?(g*=40,p*=40):2===G&&(g*=800,p*=800);return[g,p]}function Ti(b,...g){return"function"===typeof b?b(...g):b}function Ph(){}function gj(...b){return 0===b.length?Ph:1===b.length?b[0]:function(){let g;for(const p of b)g=p.apply(this,arguments)||g;return g}}function vi([b,g],p){b=Math.abs(b);g=Math.abs(g);
|
|||
|
if(b>g&&b>p)return"x";if(g>b&&g>p)return"y"}function cl(b){const [g,p]=b.overflow,[G,Y]=b._delta,[la,pa]=b._direction;if(0>g&&0<G&&0>la||0<g&&0>G&&0<la)b._movement[0]=b._movementBound[0];if(0>p&&0<Y&&0>pa||0<p&&0>Y&&0<pa)b._movement[1]=b._movementBound[1]}function dl(b){aw.set(b.key,b.engine);bw.set(b.key,b.resolver)}function Ui(b={},g){const p={};for(const [G,Y]of Object.entries(g))switch(typeof Y){case "function":p[G]=Y.call(p,b[G],G,b);break;case "object":p[G]=Ui(b[G],Y);break;case "boolean":Y&&
|
|||
|
(p[G]=b[G])}return p}function Pg(b,g,p={}){const {target:G,eventOptions:Y,window:la,enabled:pa,transform:Ga}=b;var Qa=iE;if(null==b)b={};else{if(null==b)var Za={};else{Za={};var fb=Object.keys(b),mb;for(mb=0;mb<fb.length;mb++){var Lb=fb[mb];0<=Qa.indexOf(Lb)||(Za[Lb]=b[Lb])}}if(Object.getOwnPropertySymbols)for(mb=Object.getOwnPropertySymbols(b),Lb=0;Lb<mb.length;Lb++)fb=mb[Lb],0<=Qa.indexOf(fb)||Object.prototype.propertyIsEnumerable.call(b,fb)&&(Za[fb]=b[fb]);b=Za}p.shared=Ui({target:G,eventOptions:Y,
|
|||
|
window:la,enabled:pa,transform:Ga},hE);if(g){var Tb=bw.get(g);p[g]=Ui(Gg({shared:p.shared},b),Tb)}else for(Tb in b)(g=bw.get(Tb))&&(p[Tb]=Ui(Gg({shared:p.shared},b[Tb]),g));return p}function Mi(b,g){b.gestures.add(g);b.gestureEventStores[g]=new dz(b,g);b.gestureTimeoutStores[g]=new dE}function Qh(b,g,p,G,Y,la){if(b.has(p)&&aw.has(G)){var pa=p+"Start",Ga=p+"End";Y[G]=Qa=>{let Za=void 0;if(Qa.first&&pa in g)g[pa](Qa);p in g&&(Za=g[p](Qa));if(Qa.last&&Ga in g)g[Ga](Qa);return Za};la[G]=la[G]||{}}}function Qj(b,
|
|||
|
g={},p,G){const Y=$v.default.useMemo(()=>new eE(b),[]);Y.applyHandlers(b,G);Y.applyConfig(g,p);$v.default.useEffect(Y.effect.bind(Y));$v.default.useEffect(()=>Y.clean.bind(Y),[]);if(void 0===g.target)return Y.bind.bind(Y)}function Hh(b){b.forEach(dl);return function(g,p){p=p||{};const G={},Y={},la=new Set;for(let Lb in g)fE.test(Lb)?(la.add(RegExp.lastMatch),Y[Lb]=g[Lb]):G[Lb]=g[Lb];const [pa,Ga,Qa]=[Y,G,la];g={};Qh(Qa,pa,"onDrag","drag",g,p);Qh(Qa,pa,"onWheel","wheel",g,p);Qh(Qa,pa,"onScroll","scroll",
|
|||
|
g,p);Qh(Qa,pa,"onPinch","pinch",g,p);Qh(Qa,pa,"onMove","move",g,p);Qh(Qa,pa,"onHover","hover",g,p);const {handlers:Za,nativeHandlers:fb,config:mb}={handlers:g,config:p,nativeHandlers:Ga};return Qj(Za,mb,void 0,fb)}}function Hi(b,g){return Hh([DE,lE,kE,gE,jE,EE])(b,g||{})}function Mk(b){const {viewport:g,inputs:p,callbacks:G}=ui(),Y=hu.useRef(void 0),la=hu.useRef([0,0]),pa=hu.useRef(0),Ga=hu.useMemo(()=>({onWheel:Qa=>{var Za;({event:Qa}=Qa);Qa.preventDefault();const {deltaY:fb,deltaX:mb}=Qa;var Lb=
|
|||
|
0;if(Qa.ctrlKey||Qa.metaKey){Lb=Math.sign(Qa.deltaY);let xc=fb;10<Math.abs(Qa.deltaY)&&(xc=10*Lb);Lb=xc}const [Tb,Pb,lc]=[mb,fb,Lb];"pinching"===p.state||pa.current>=Qa.timeStamp||(pa.current=Qa.timeStamp,(Qa.altKey||Qa.ctrlKey||Qa.metaKey)&&0===Qa.buttons?(Lb=g.bounds,Qa=null!=(Za=p.currentScreenPoint)?Za:[Lb.width/2,Lb.height/2],Za=g.camera.zoom,g.onZoom(Qa,Za-lc/100*Za)):(Za=ke.mul(Qa.shiftKey&&!Jk()?[Pb,0]:[Tb,Pb],.8),ke.isEqual(Za,[0,0])||g.panCamera(Za)))},onPinchStart:({event:Qa,delta:Za,offset:fb,
|
|||
|
origin:mb})=>{var Lb;const Tb=b.current;Qa instanceof WheelEvent||!(Qa.target===Tb||null!=Tb&&Tb.contains(Qa.target))||(null==(Lb=G.onPinchStart)?void 0:Lb.call(G,{type:"canvas",order:0,delta:[...Za,fb[0]],offset:fb,point:ke.sub(mb,p.containerOffset)},Qa),Y.current=mb,la.current=[0,0])},onPinchEnd:({event:Qa,offset:Za,origin:fb})=>{var mb;const Lb=b.current;Qa instanceof WheelEvent||!(Qa.target===Lb||null!=Lb&&Lb.contains(Qa.target))||"pinching"!==p.state||(null==(mb=G.onPinchEnd)?void 0:mb.call(G,
|
|||
|
{type:"canvas",order:0,delta:[0,0,Za[0]],offset:Za,point:ke.sub(fb,p.containerOffset)},Qa),la.current=[0,0])},onPinch:({event:Qa,offset:Za,origin:fb})=>{var mb,Lb=b.current;if(!(Qa instanceof WheelEvent)&&(Qa.target===Lb||null!=Lb&&Lb.contains(Qa.target))){Y.current||(Y.current=fb);Lb=ke.sub(Y.current,fb);var Tb=ke.sub(Lb,la.current);null==(mb=G.onPinch)?void 0:mb.call(G,{type:"canvas",order:0,delta:[...Tb,Za[0]],offset:Za,point:ke.sub(fb,p.containerOffset)},Qa);la.current=Lb}}}),[G]);Hi(Ga,{target:b,
|
|||
|
eventOptions:{passive:!1},pinch:{from:[g.camera.zoom,g.camera.zoom],scaleBounds:()=>({from:g.camera.zoom,max:Ro.maxZoom,min:Ro.minZoom})}})}function hj(b,g,p,G){Zv.useLayoutEffect(()=>{b.current.style.transform=`translate(
|
|||
|
calc(${g.minX}px - var(--tl-padding)),
|
|||
|
calc(${g.minY}px - var(--tl-padding)))
|
|||
|
scale(var(--tl-scale))`},[g.minX,g.minY,p,g.rotation]);Zv.useLayoutEffect(()=>{const Y=b.current;Y.style.width=`calc(${Math.floor(g.width)}px + (var(--tl-padding) * 2))`;Y.style.height=`calc(${Math.floor(g.height)}px + (var(--tl-padding) * 2))`},[g.width,g.height]);Zv.useLayoutEffect(()=>{const Y=b.current;void 0!==G&&(Y.style.zIndex=G.toString())},[G])}function xj(b,g){const {onPersist:p,onError:G,onMount:Y,onCreateAssets:la,onCreateShapes:pa,onDeleteAssets:Ga,onDeleteShapes:Qa,onDrop:Za,
|
|||
|
onPaste:fb,onCopy:mb,onCanvasDBClick:Lb}=g;fz.useLayoutEffect(()=>{const Tb=[];if(b)return window.tlapps=window.tlapps||{},window.tlapps[b.uuid]=b,Y&&Y(b,null),()=>{Tb.forEach(Pb=>Pb());window.tlapps&&delete window.tlapps[b.uuid]}},[b]);fz.useLayoutEffect(()=>{const Tb=[];p&&Tb.push(b.subscribe("persist",p));G&&Tb.push(b.subscribe("error",G));pa&&Tb.push(b.subscribe("create-shapes",pa));la&&Tb.push(b.subscribe("create-assets",la));Qa&&Tb.push(b.subscribe("delete-shapes",Qa));Ga&&Tb.push(b.subscribe("delete-assets",
|
|||
|
Ga));Za&&Tb.push(b.subscribe("drop",Za));fb&&Tb.push(b.subscribe("paste",fb));mb&&Tb.push(b.subscribe("copy",mb));Lb&&Tb.push(b.subscribe("canvas-dbclick",Lb));return()=>Tb.forEach(Pb=>Pb())},[b,p,G])}function vn(b){if("app"in b)return b.app;const [g]=oz.useState(()=>new RD(b.model,b.Shapes,b.Tools,b.readOnly));oz.useLayoutEffect(()=>()=>{g.dispose()},[g]);return g}function Nk(b,g){FE.useEffect(()=>{"model"in g&&g.model&&b.loadDocumentModel(g.model)},[g.model])}function Cl(b){const g=ui(),{viewport:{bounds:p}}=
|
|||
|
g;bE.useEffect(()=>{const G=pa=>{pa.preventDefault()},Y=pa=>{if(0!==pa.touches.length){var Ga=pa.touches[0].pageX,Qa=pa.touches[0].radiusX||0;(10>Ga-Qa||Ga+Qa>p.width-10)&&pa.preventDefault()}},la=b.current;if(!la)return()=>{};la.addEventListener("touchstart",G,{passive:!0});la.addEventListener("gestureend",G,{passive:!0});la.addEventListener("gesturechange",G,{passive:!0});la.addEventListener("gesturestart",G,{passive:!0});la.addEventListener("touchstart",Y,{passive:!0});return()=>{la&&(la.removeEventListener("touchstart",
|
|||
|
G),la.removeEventListener("gestureend",G),la.removeEventListener("gesturechange",G),la.removeEventListener("gesturestart",G),la.removeEventListener("touchstart",Y))}},[b,p.width])}function Jm(b,g){const {inputs:p,callbacks:G}=ui();return aE.useMemo(()=>({onPointerDown:Y=>{var la,pa;const {order:Ga=0}=Y;Ga||(null==(la=Y.currentTarget)?void 0:la.setPointerCapture(Y.pointerId));la=b.props.handles[g];null==(pa=G.onPointerDown)?void 0:pa.call(G,{type:"handle",shape:b,handle:la,id:g,order:Ga},Y);Y.order=
|
|||
|
Ga+1},onPointerMove:Y=>{var la;const {order:pa=0}=Y,Ga=b.props.handles[g];null==(la=G.onPointerMove)?void 0:la.call(G,{type:"handle",shape:b,handle:Ga,id:g,order:pa},Y);Y.order=pa+1},onPointerUp:Y=>{var la,pa;const {order:Ga=0}=Y;Ga||(null==(la=Y.currentTarget)?void 0:la.releasePointerCapture(Y.pointerId));la=b.props.handles[g];null==(pa=G.onPointerUp)?void 0:pa.call(G,{type:"handle",shape:b,handle:la,id:g,order:Ga},Y);Y.order=Ga+1},onPointerEnter:Y=>{var la;const {order:pa=0}=Y,Ga=b.props.handles[g];
|
|||
|
null==(la=G.onPointerEnter)?void 0:la.call(G,{type:"handle",shape:b,handle:Ga,id:g,order:pa},Y);Y.order=pa+1},onPointerLeave:Y=>{var la;const {order:pa=0}=Y,Ga=b.props.handles[g];null==(la=G.onPointerLeave)?void 0:la.call(G,{type:"handle",shape:b,handle:Ga,id:g,order:pa},Y);Y.order=pa+1},onKeyUp:Y=>{var la;const pa=b.props.handles[g];null==(la=G.onKeyUp)?void 0:la.call(G,{type:"handle",shape:b,handle:pa,id:g,order:-1},Y)},onKeyDown:Y=>{var la;const pa=b.props.handles[g];null==(la=G.onKeyDown)?void 0:
|
|||
|
la.call(G,{type:"handle",shape:b,handle:pa,id:g,order:-1},Y)}}),[b.id,p,G])}function ij(b,g,p=!1){return`url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 35 35' xmlns='http://www.w3.org/2000/svg'><g fill='none' style='transform-origin:center center' transform='rotate(${g})${p?" scale(-1,-1) translate(0, -32)":""}'>`+b.replaceAll('"',"'")+'\x3c/g\x3e\x3c/svg\x3e") 16 16, pointer'}function Km(b,g,p=0){GE.useEffect(()=>{const G=b.current;G&&(G.style.cursor=HE[g](qm.radiansToDegrees(p)))},
|
|||
|
[g,p])}function em(b){const {viewport:g}=ui(),p=Ye();IE.useLayoutEffect(()=>Ld(()=>{const G=ek(()=>{var Y;null==(Y=b.current)?void 0:Y.style.setProperty("--tl-zoom",g.camera.zoom.toString())},200);"pinching"!==p.inputs.state&&null!=g.camera.zoom&&G()}),[])}function Ak(b,g=0){const [p,G]=(0,pz.useState)(b);(0,pz.useEffect)(()=>{let Y=!1;const la=setTimeout(()=>{Y||G(b)},g);return()=>{Y=!0;clearTimeout(la)}},[b,g]);return p}function Yj(){const b=Ye();qz.useEffect(()=>{ue(()=>pe({},b.viewport.camera),
|
|||
|
()=>{window.sessionStorage.setItem("logseq.tldraw.camera:"+b.currentPageId,JSON.stringify(b.viewport.camera))})},[b.viewport.camera]);qz.useEffect(()=>{var g;const p=JSON.parse(null!=(g=window.sessionStorage.getItem("logseq.tldraw.camera:"+b.currentPageId))?g:"null");p?b.viewport.update(p):b.selectedIds.size?b.api.zoomToSelection():b.api.zoomToFit()},[b])}function fm(b){b()}function zk(b){return He(Eg(b,void 0))}function zg(b){return{reaction:b,mounted:!1,changedBeforeMount:!1,cleanAt:Date.now()+
|
|||
|
JE}}function um(b){var g=new Map,p=1,G=new b(function(Y){var la=g.get(Y);la&&(la.reaction.dispose(),g.delete(Y))});return{addReactionToTrack:function(Y,la,pa){var Ga=p++;G.register(pa,Ga,Y);Y.current=zg(la);Y.current.finalizationRegistryCleanupToken=Ga;g.set(Ga,Y.current);return Y.current},recordReactionAsCommitted:function(Y){G.unregister(Y);Y.current&&Y.current.finalizationRegistryCleanupToken&&g.delete(Y.current.finalizationRegistryCleanupToken)},forceCleanupTimerToRunNowForTests:function(){},
|
|||
|
resetCleanupScheduleForTests:function(){}}}function rh(){function b(){void 0===G&&(G=setTimeout(g,1E4))}function g(){G=void 0;var Y=Date.now();p.forEach(function(la){var pa=la.current;pa&&Y>=pa.cleanAt&&(pa.reaction.dispose(),la.current=null,p.delete(la))});0<p.size&&b()}var p=new Set,G;return{addReactionToTrack:function(Y,la,pa){Y.current=zg(la);p.add(Y);b();return Y.current},recordReactionAsCommitted:function(Y){p.delete(Y)},forceCleanupTimerToRunNowForTests:function(){G&&(clearTimeout(G),g())},
|
|||
|
resetCleanupScheduleForTests:function(){var Y;if(0<p.size){try{for(var la=KE(p),pa=la.next();!pa.done;pa=la.next()){var Ga=pa.value,Qa=Ga.current;Qa&&(Qa.reaction.dispose(),Ga.current=null)}}catch(fb){var Za={error:fb}}finally{try{pa&&!pa.done&&(Y=la.return)&&Y.call(la)}finally{if(Za)throw Za.error;}}p.clear()}G&&(clearTimeout(G),G=void 0)}}}function bj(){return new NE}function Ok(b,g){void 0===g&&(g="observed");var p=tz(gt.default.useState(bj),1)[0],G=tz(gt.default.useState(),2)[1],Y=gt.default.useRef(null);
|
|||
|
if(!Y.current)var la=new Pr("observer".concat(g),function(){pa.mounted?G([]):pa.changedBeforeMount=!0}),pa=LE(Y,la,p);p=Y.current.reaction;gt.default.useDebugValue(p,zk);gt.default.useEffect(function(){ME(Y);Y.current?(Y.current.mounted=!0,Y.current.changedBeforeMount&&(Y.current.changedBeforeMount=!1,G([]))):(Y.current={reaction:new Pr("observer".concat(g),function(){G([])}),mounted:!0,changedBeforeMount:!1,cleanAt:Infinity},G([]));return function(){Y.current.reaction.dispose();Y.current=null}},
|
|||
|
[]);var Ga,Qa;p.track(function(){try{Ga=b()}catch(Za){Qa=Za}});if(Qa)throw Qa;return Ga}function cf(b,g){var p;if(kz&&b.$$typeof===kz)throw Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");g=null!==(p=null===g||void 0===g?void 0:g.forwardRef)&&void 0!==p?p:!1;var G=b,Y=b.displayName||b.name;if(gz&&b.$$typeof===gz&&(g=!0,G=b.render,"function"!==typeof G))throw Error("[mobx-react-lite] `render` property of ForwardRef was not a function");
|
|||
|
p=function(la,pa){return Ok(function(){return G(la,pa)},Y)};""!==Y&&(p.displayName=Y);b.contextTypes&&(p.contextTypes=b.contextTypes);g&&(p=(0,Xr.forwardRef)(p));p=(0,Xr.memo)(p);jj(b,p);return p}function jj(b,g){Object.keys(b).forEach(function(p){qE[p]||Object.defineProperty(g,p,Object.getOwnPropertyDescriptor(b,p))})}function kk(b){var g=b.render;b=b.children||g;return"function"!==typeof b?null:Ok(b)}function Dk(b){const g=Ye(),{callbacks:p}=ui(),G=jz.useRef(!1);jz.useEffect(()=>{const Y=Qa=>{var Za,
|
|||
|
fb;if(null==(Za=b.current)?0:Za.contains(document.activeElement))null==(fb=p.onKeyDown)?void 0:fb.call(p,{type:"canvas",order:-1},Qa),G.current=Qa.shiftKey},la=Qa=>{var Za,fb;if(null==(Za=b.current)?0:Za.contains(document.activeElement))null==(fb=p.onKeyUp)?void 0:fb.call(p,{type:"canvas",order:-1},Qa),G.current=Qa.shiftKey},pa=Qa=>{var Za,fb,mb;!g.editingShape&&(null==(Za=b.current)?0:Za.contains(document.activeElement))&&!["INPUT","TEXTAREA"].includes(null!=(mb=null==(fb=document.activeElement)?
|
|||
|
void 0:fb.tagName)?mb:"")&&(Qa.preventDefault(),g.paste(Qa,G.current))},Ga=Qa=>{var Za,fb,mb;!g.editingShape&&0<g.selectedShapes.size&&(null==(Za=b.current)?0:Za.contains(document.activeElement))&&!["INPUT","TEXTAREA"].includes(null!=(mb=null==(fb=document.activeElement)?void 0:fb.tagName)?mb:"")&&(Qa.preventDefault(),g.copy())};window.addEventListener("keydown",Y);window.addEventListener("keyup",la);document.addEventListener("paste",pa);document.addEventListener("copy",Ga);return()=>{window.removeEventListener("keydown",
|
|||
|
Y);window.removeEventListener("keyup",la);document.removeEventListener("paste",pa);document.removeEventListener("copy",Ga)}},[])}function gm(b){const {inputs:g,callbacks:p}=ui(),G=wz.useRef(-1);return wz.useMemo(()=>({onPointerDown:Y=>{var la,pa;const {order:Ga=0}=Y;Ga||(null==(la=Y.currentTarget)?void 0:la.setPointerCapture(Y.pointerId));null==(pa=p.onPointerDown)?void 0:pa.call(p,{type:"shape",shape:b,order:Ga},Y);Y.order=Ga+1},onPointerMove:Y=>{var la;const {order:pa=0}=Y;null==(la=p.onPointerMove)?
|
|||
|
void 0:la.call(p,{type:"shape",shape:b,order:pa},Y);Y.order=pa+1},onPointerUp:Y=>{var la,pa,Ga;const {order:Qa=0}=Y;Qa||(null==(la=Y.currentTarget)?void 0:la.releasePointerCapture(Y.pointerId));null==(pa=p.onPointerUp)?void 0:pa.call(p,{type:"shape",shape:b,order:Qa},Y);la=Date.now();pa=la-G.current;300<pa?G.current=la:300>=pa&&(null==(Ga=p.onDoubleClick)?void 0:Ga.call(p,{type:"shape",shape:b,order:Qa},Y),G.current=-1);Y.order=Qa+1},onPointerEnter:Y=>{var la;const {order:pa=0}=Y;null==(la=p.onPointerEnter)?
|
|||
|
void 0:la.call(p,{type:"shape",shape:b,order:pa},Y);Y.order=pa+1},onPointerLeave:Y=>{var la;const {order:pa=0}=Y;null==(la=p.onPointerLeave)?void 0:la.call(p,{type:"shape",shape:b,order:pa},Y);Y.order=pa+1},onKeyUp:Y=>{var la;null==(la=p.onKeyUp)?void 0:la.call(p,{type:"shape",shape:b,order:-1},Y)},onKeyDown:Y=>{var la;null==(la=p.onKeyDown)?void 0:la.call(p,{type:"shape",shape:b,order:-1},Y)}}),[b.id,g,p])}function rg(b){var {viewport:g,inputs:p,callbacks:G,components:Y}=b;b=zf(b,["viewport","inputs",
|
|||
|
"callbacks","components"]);return(0,tb.jsx)(YE,{id:b.id,viewport:g,inputs:p,callbacks:G,components:Y,meta:b.meta,children:(0,tb.jsx)(WE,pe({},b))})}function df(){df=Object.assign?Object.assign.bind():function(b){for(var g=1;g<arguments.length;g++){var p=arguments[g],G;for(G in p)Object.prototype.hasOwnProperty.call(p,G)&&(b[G]=p[G])}return b};return df.apply(this,arguments)}function If(b,g,{checkForDefaultPrevented:p=!0}={}){return function(G){null===b||void 0===b||b(G);if(!1===p||!G.defaultPrevented)return null===
|
|||
|
g||void 0===g?void 0:g(G)}}function Ek(...b){return g=>b.forEach(p=>{"function"===typeof p?p(g):null!==p&&void 0!==p&&(p.current=g)})}function Df(...b){return(0,aF.useCallback)(Ek(...b),b)}function yj(b,g=[]){let p=[];const G=()=>{const Y=p.map(la=>(0,fr.createContext)(la));return function(la){const pa=(null===la||void 0===la?void 0:la[b])||Y;return(0,fr.useMemo)(()=>({[`__scope${b}`]:hf(pe({},la),{[b]:pa})}),[la,pa])}};G.scopeName=b;return[function(Y,la){function pa(Za){const {scope:fb,children:mb}=
|
|||
|
Za,Lb=zf(Za,["scope","children"]);Za=(null===fb||void 0===fb?void 0:fb[b][Qa])||Ga;const Tb=(0,fr.useMemo)(()=>Lb,Object.values(Lb));return(0,fr.createElement)(Za.Provider,{value:Tb},mb)}const Ga=(0,fr.createContext)(la),Qa=p.length;p=[...p,la];pa.displayName=Y+"Provider";return[pa,function(Za,fb){if(fb=(0,fr.useContext)((null===fb||void 0===fb?void 0:fb[b][Qa])||Ga))return fb;if(void 0!==la)return la;throw Error(`\`${Za}\` must be used within \`${Y}\``);}]},el(G,...g)]}function el(...b){const g=
|
|||
|
b[0];if(1===b.length)return g;const p=()=>{const G=b.map(Y=>({useScope:Y(),scopeName:Y.scopeName}));return function(Y){const la=G.reduce((pa,{useScope:Ga,scopeName:Qa})=>{Ga=Ga(Y)[`__scope${Qa}`];return pe(pe({},pa),Ga)},{});return(0,fr.useMemo)(()=>({[`__scope${g.scopeName}`]:la}),[la])}};p.scopeName=g.scopeName;return p}function sg(b){return(0,$m.isValidElement)(b)&&b.type===Hz}function kj(b,g){const p=pe({},g);for(const G in g){const Y=b[G],la=g[G];/^on[A-Z]/.test(G)?Y&&la?p[G]=(...pa)=>{la(...pa);
|
|||
|
Y(...pa)}:Y&&(p[G]=Y):"style"===G?p[G]=pe(pe({},Y),la):"className"===G&&(p[G]=[Y,la].filter(Boolean).join(" "))}return pe(pe({},b),p)}function sl(b,g){b&&(0,bF.flushSync)(()=>b.dispatchEvent(g))}function pf(b){const g=(0,fw.useRef)(b);(0,fw.useEffect)(()=>{g.current=b});return(0,fw.useMemo)(()=>(...p)=>{var G;return null===(G=g.current)||void 0===G?void 0:G.call(g,...p)},[])}function lk(b,g=null===globalThis||void 0===globalThis?void 0:globalThis.document){const p=pf(b);(0,cF.useEffect)(()=>{const G=
|
|||
|
Y=>{"Escape"===Y.key&&p(Y)};g.addEventListener("keydown",G);return()=>g.removeEventListener("keydown",G)},[p,g])}function Pj(b,g=null===globalThis||void 0===globalThis?void 0:globalThis.document){const p=pf(b),G=(0,Nn.useRef)(!1),Y=(0,Nn.useRef)(()=>{});(0,Nn.useEffect)(()=>{const la=Ga=>{if(Ga.target&&!G.current){let Qa=function(){Vm("dismissableLayer.pointerDownOutside",p,Za,{discrete:!0})};const Za={originalEvent:Ga};"touch"===Ga.pointerType?(g.removeEventListener("click",Y.current),Y.current=
|
|||
|
Qa,g.addEventListener("click",Y.current,{once:!0})):Qa()}G.current=!1},pa=window.setTimeout(()=>{g.addEventListener("pointerdown",la)},0);return()=>{window.clearTimeout(pa);g.removeEventListener("pointerdown",la);g.removeEventListener("click",Y.current)}},[g,p]);return{onPointerDownCapture:()=>G.current=!0}}function Tl(b,g=null===globalThis||void 0===globalThis?void 0:globalThis.document){const p=pf(b),G=(0,Nn.useRef)(!1);(0,Nn.useEffect)(()=>{const Y=la=>{la.target&&!G.current&&Vm("dismissableLayer.focusOutside",
|
|||
|
p,{originalEvent:la},{discrete:!1})};g.addEventListener("focusin",Y);return()=>g.removeEventListener("focusin",Y)},[g,p]);return{onFocusCapture:()=>G.current=!0,onBlurCapture:()=>G.current=!1}}function Lk(){const b=new CustomEvent("dismissableLayer.update");document.dispatchEvent(b)}function Vm(b,g,p,{discrete:G}){const Y=p.originalEvent.target;p=new CustomEvent(b,{bubbles:!1,cancelable:!0,detail:p});g&&Y.addEventListener(b,g,{once:!0});G?sl(Y,p):Y.dispatchEvent(p)}function xi(b){const [g,p]=Jz.useState(fF());
|
|||
|
Om(()=>{b||p(G=>null!==G&&void 0!==G?G:String(gF++))},[b]);return b||(g?`radix-${g}`:"")}function Vi(b){return b.split("-")[0]}function Ck(b){return["top","bottom"].includes(Vi(b))?"x":"y"}function mk(b){return"y"===b?"height":"width"}function ul(b,g,p){let {reference:G,floating:Y}=b;var la=G.x+G.width/2-Y.width/2;const pa=G.y+G.height/2-Y.height/2;b=Ck(g);var Ga=mk(b);Ga=G[Ga]/2-Y[Ga]/2;const Qa="x"===b;switch(Vi(g)){case "top":la={x:la,y:G.y-Y.height};break;case "bottom":la={x:la,y:G.y+G.height};
|
|||
|
break;case "right":la={x:G.x+G.width,y:pa};break;case "left":la={x:G.x-Y.width,y:pa};break;default:la={x:G.x,y:G.y}}switch(g.split("-")[1]){case "start":la[b]-=Ga*(p&&Qa?-1:1);break;case "end":la[b]+=Ga*(p&&Qa?-1:1)}return la}function hn(b){return"number"!=typeof b?pe({top:0,right:0,bottom:0,left:0},b):{top:b,right:b,bottom:b,left:b}}function Wm(b){return hf(pe({},b),{top:b.y,left:b.x,right:b.x+b.width,bottom:b.y+b.height})}function rl(b,g){return Zh(this,null,function*(){var p;void 0===g&&(g={});
|
|||
|
const {x:G,y:Y,platform:la,rects:pa,elements:Ga,strategy:Qa}=b,{boundary:Za="clippingAncestors",rootBoundary:fb="viewport",elementContext:mb="floating",altBoundary:Lb=!1,padding:Tb=0}=g,Pb=hn(Tb),lc=Ga[Lb?"floating"===mb?"reference":"floating":mb],xc=Wm(yield la.getClippingRect({element:null==(p=yield null==la.isElement?void 0:la.isElement(lc))||p?lc:lc.contextElement||(yield null==la.getDocumentElement?void 0:la.getDocumentElement(Ga.floating)),boundary:Za,rootBoundary:fb,strategy:Qa}));p=Wm(la.convertOffsetParentRelativeRectToViewportRelativeRect?
|
|||
|
yield la.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===mb?hf(pe({},pa.floating),{x:G,y:Y}):pa.reference,offsetParent:yield null==la.getOffsetParent?void 0:la.getOffsetParent(Ga.floating),strategy:Qa}):pa[mb]);return{top:xc.top-p.top+Pb.top,bottom:p.bottom-xc.bottom+Pb.bottom,left:xc.left-p.left+Pb.left,right:p.right-xc.right+Pb.right}})}function wm(b){return b.replace(/left|right|bottom|top/g,g=>Kz[g])}function tl(b,g,p){void 0===p&&(p=!1);const G=b.split("-")[1],Y=Ck(b);
|
|||
|
b=mk(Y);p="x"===Y?G===(p?"end":"start")?"right":"left":"start"===G?"bottom":"top";return g.reference[b]>g.floating[b]&&(p=wm(p)),{main:p,cross:wm(p)}}function Sj(b){return b.replace(/start|end/g,g=>iF[g])}function Pk(b,g){return{top:b.top-g.height,right:b.right-g.width,bottom:b.bottom-g.height,left:b.left-g.width}}function nk(b){return Lz.some(g=>0<=b[g])}function bk(b){return null==b?window:b&&b.document&&b.location&&b.alert&&b.setInterval?b:(b=b.ownerDocument)&&b.defaultView||window}function Rk(b){return bk(b).getComputedStyle(b)}
|
|||
|
function Aj(b){return b&&b.document&&b.location&&b.alert&&b.setInterval?"":b?(b.nodeName||"").toLowerCase():""}function Ul(){const b=navigator.userAgentData;return null!=b&&b.brands?b.brands.map(g=>g.brand+"/"+g.version).join(" "):navigator.userAgent}function Jj(b){return b instanceof bk(b).HTMLElement}function zj(b){return b instanceof bk(b).Element}function Rj(b){return"undefined"==typeof ShadowRoot?!1:b instanceof bk(b).ShadowRoot||b instanceof ShadowRoot}function hm(b){const {overflow:g,overflowX:p,
|
|||
|
overflowY:G}=Rk(b);return/auto|scroll|overlay|hidden/.test(g+G+p)}function jm(b){const g=/firefox/i.test(Ul());b=Rk(b);return"none"!==b.transform||"none"!==b.perspective||"paint"===b.contain||["transform","perspective"].includes(b.willChange)||g&&"filter"===b.willChange||g&&!!b.filter&&"none"!==b.filter}function fl(){return!/^((?!chrome|android).)*safari/i.test(Ul())}function sj(b,g,p){var G,Y,la,pa;void 0===g&&(g=!1);void 0===p&&(p=!1);var Ga=b.getBoundingClientRect();let Qa=1,Za=1;g&&Jj(b)&&(Qa=
|
|||
|
0<b.offsetWidth&&nu(Ga.width)/b.offsetWidth||1,Za=0<b.offsetHeight&&nu(Ga.height)/b.offsetHeight||1);b=zj(b)?bk(b):window;g=!fl()&&p;p=(Ga.left+(g&&null!=(G=null==(Y=b.visualViewport)?void 0:Y.offsetLeft)?G:0))/Qa;G=(Ga.top+(g&&null!=(la=null==(pa=b.visualViewport)?void 0:pa.offsetTop)?la:0))/Za;la=Ga.width/Qa;Ga=Ga.height/Za;return{width:la,height:Ga,top:G,right:p+la,bottom:G+Ga,left:p,x:p,y:G}}function wl(b){return(g=b,(g instanceof bk(g).Node?b.ownerDocument:b.document)||window.document).documentElement;
|
|||
|
var g}function ak(b){return zj(b)?{scrollLeft:b.scrollLeft,scrollTop:b.scrollTop}:{scrollLeft:b.pageXOffset,scrollTop:b.pageYOffset}}function ok(b){return sj(wl(b)).left+ak(b).scrollLeft}function Mh(b){return"html"===Aj(b)?b:b.assignedSlot||b.parentNode||(Rj(b)?b.host:null)||wl(b)}function wj(b){return Jj(b)&&"fixed"!==getComputedStyle(b).position?b.offsetParent:null}function pk(b){for(var g=bk(b),p=wj(b);p&&["table","td","th"].includes(Aj(p))&&"static"===getComputedStyle(p).position;)p=wj(p);if(!p||
|
|||
|
"html"!==Aj(p)&&("body"!==Aj(p)||"static"!==getComputedStyle(p).position||jm(p))){if(!p)a:{b=Mh(b);for(Rj(b)&&(b=b.host);Jj(b)&&!["html","body"].includes(Aj(b));){if(jm(b)){p=b;break a}b=b.parentNode}p=null}g=p||g}return g}function wk(b){if(Jj(b))return{width:b.offsetWidth,height:b.offsetHeight};b=sj(b);return{width:b.width,height:b.height}}function zh(b){const g=Mh(b);return["html","body","#document"].includes(Aj(g))?b.ownerDocument.body:Jj(g)&&hm(g)?g:zh(g)}function Zg(b,g){var p;void 0===g&&(g=
|
|||
|
[]);var G=zh(b);b=G===(null==(p=b.ownerDocument)?void 0:p.body);p=bk(G);G=b?[p].concat(p.visualViewport||[],hm(G)?G:[]):G;g=g.concat(G);return b?g:g.concat(Zg(G))}function Ig(b,g,p){return"viewport"===g?Wm(function(G,Y){var la=bk(G),pa=wl(G);la=la.visualViewport;G=pa.clientWidth;pa=pa.clientHeight;let Ga=0,Qa=0;if(la){G=la.width;pa=la.height;const Za=fl();(Za||!Za&&"fixed"===Y)&&(Ga=la.offsetLeft,Qa=la.offsetTop)}return{width:G,height:pa,x:Ga,y:Qa}}(b,p)):zj(g)?function(G,Y){var la=sj(G,!1,"fixed"===
|
|||
|
Y);Y=la.top+G.clientTop;la=la.left+G.clientLeft;return{top:Y,left:la,x:la,y:Y,right:la+G.clientWidth,bottom:Y+G.clientHeight,width:G.clientWidth,height:G.clientHeight}}(g,p):Wm(function(G){var Y;const la=wl(G);var pa=ak(G);const Ga=null==(Y=G.ownerDocument)?void 0:Y.body;Y=ht(la.scrollWidth,la.clientWidth,Ga?Ga.scrollWidth:0,Ga?Ga.clientWidth:0);const Qa=ht(la.scrollHeight,la.clientHeight,Ga?Ga.scrollHeight:0,Ga?Ga.clientHeight:0);G=-pa.scrollLeft+ok(G);pa=-pa.scrollTop;return"rtl"===Rk(Ga||la).direction&&
|
|||
|
(G+=ht(la.clientWidth,Ga?Ga.clientWidth:0)-Y),{width:Y,height:Qa,x:G,y:pa}}(wl(b)))}function fk(b){const g=Zg(b),p=["absolute","fixed"].includes(Rk(b).position)&&Jj(b)?pk(b):b;return zj(p)?g.filter(G=>{var Y;if(Y=zj(G))a:if(Y=null==p.getRootNode?void 0:p.getRootNode(),G.contains(p))Y=!0;else{if(Y&&Rj(Y)){Y=p;do{if(Y&&G===Y){Y=!0;break a}Y=Y.parentNode||Y.host}while(Y)}Y=!1}return Y&&"body"!==Aj(G)}):[]}function Lh(b,g,p,G){void 0===G&&(G={});const {ancestorScroll:Y=!0,ancestorResize:la=!0,elementResize:pa=
|
|||
|
!0,animationFrame:Ga=!1}=G,Qa=Y&&!Ga,Za=la&&!Ga,fb=Qa||Za?[...(zj(b)?Zg(b):[]),...Zg(g)]:[];fb.forEach(Pb=>{Qa&&Pb.addEventListener("scroll",p,{passive:!0});Za&&Pb.addEventListener("resize",p)});let mb,Lb=null;if(pa){let Pb=!0;Lb=new ResizeObserver(()=>{Pb||p();Pb=!1});zj(b)&&!Ga&&Lb.observe(b);Lb.observe(g)}let Tb=Ga?sj(b):null;return Ga&&function lc(){const xc=sj(b);!Tb||xc.x===Tb.x&&xc.y===Tb.y&&xc.width===Tb.width&&xc.height===Tb.height||p();Tb=xc;mb=requestAnimationFrame(lc)}(),p(),()=>{var lc;
|
|||
|
fb.forEach(xc=>{Qa&&xc.removeEventListener("scroll",p);Za&&xc.removeEventListener("resize",p)});null==(lc=Lb)||lc.disconnect();Lb=null;Ga&&cancelAnimationFrame(mb)}}function Wi(b,g){if(b===g)return!0;if(typeof b!==typeof g)return!1;if("function"===typeof b&&b.toString()===g.toString())return!0;let p,G;if(b&&g&&"object"==typeof b){if(Array.isArray(b)){var Y=b.length;if(Y!=g.length)return!1;for(p=Y;0!==p--;)if(!Wi(b[p],g[p]))return!1;return!0}G=Object.keys(b);Y=G.length;if(Y!==Object.keys(g).length)return!1;
|
|||
|
for(p=Y;0!==p--;)if(!Object.prototype.hasOwnProperty.call(g,G[p]))return!1;for(p=Y;0!==p--;)if(Y=G[p],!("_owner"===Y&&b.$$typeof||Wi(b[Y],g[Y])))return!1;return!0}return b!==b&&g!==g}function Cg(b){const g=go.useRef(b);jw(()=>{g.current=b});return g}function Xi(b){let {middleware:g,placement:p="bottom",strategy:G="absolute",whileElementsMounted:Y}=void 0===b?{}:b;const la=go.useRef(null),pa=go.useRef(null),Ga=Cg(Y),Qa=go.useRef(null),[Za,fb]=go.useState({x:null,y:null,strategy:G,placement:p,middlewareData:{}}),
|
|||
|
[mb,Lb]=go.useState(g);Wi(null==mb?void 0:mb.map(oc=>{({options:oc}=oc);return oc}),null==g?void 0:g.map(oc=>{({options:oc}=oc);return oc}))||Lb(g);const Tb=go.useCallback(()=>{la.current&&pa.current&&lF(la.current,pa.current,{middleware:mb,placement:p,strategy:G}).then(oc=>{Pb.current&&mF.flushSync(()=>{fb(oc)})})},[mb,p,G]);jw(()=>{Pb.current&&Tb()},[Tb]);const Pb=go.useRef(!1);jw(()=>{Pb.current=!0;return()=>{Pb.current=!1}},[]);const lc=go.useCallback(()=>{"function"===typeof Qa.current&&(Qa.current(),
|
|||
|
Qa.current=null);if(la.current&&pa.current)if(Ga.current){const oc=Ga.current(la.current,pa.current,Tb);Qa.current=oc}else Tb()},[Tb,Ga]),xc=go.useCallback(oc=>{la.current=oc;lc()},[lc]),$b=go.useCallback(oc=>{pa.current=oc;lc()},[lc]),sc=go.useMemo(()=>({reference:la,floating:pa}),[]);return go.useMemo(()=>hf(pe({},Za),{update:Tb,refs:sc,reference:xc,floating:$b}),[Za,Tb,sc,xc,$b])}function Wf(b){const [g,p]=(0,oF.useState)(void 0);Om(()=>{if(b){p({width:b.offsetWidth,height:b.offsetHeight});const G=
|
|||
|
new ResizeObserver(Y=>{if(Array.isArray(Y)&&Y.length){Y=Y[0];if("borderBoxSize"in Y){Y=Y.borderBoxSize;var la=Array.isArray(Y)?Y[0]:Y;Y=la.inlineSize;la=la.blockSize}else Y=b.offsetWidth,la=b.offsetHeight;p({width:Y,height:la})}});G.observe(b,{box:"border-box"});return()=>G.unobserve(b)}p(void 0)},[b]);return g}function Mg(b){return void 0!==b}function Bj(b){return null!==b}function mi(b){const [g,p="center"]=b.split("-");return[g,p]}function ph(b,g){return(0,Ep.useReducer)((p,G)=>{G=g[p][G];return null!==
|
|||
|
G&&void 0!==G?G:p},b)}function xg(b){const [g,p]=(0,Ep.useState)(),G=(0,Ep.useRef)({}),Y=(0,Ep.useRef)(b),la=(0,Ep.useRef)("none"),[pa,Ga]=ph(b?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});(0,Ep.useEffect)(()=>{const Qa=lh(G.current);la.current="mounted"===pa?Qa:"none"},[pa]);Om(()=>{const Qa=G.current,Za=Y.current;if(Za!==b){const fb=la.current,mb=lh(Qa);b?Ga("MOUNT"):
|
|||
|
"none"===mb||"none"===(null===Qa||void 0===Qa?void 0:Qa.display)?Ga("UNMOUNT"):Za&&fb!==mb?Ga("ANIMATION_OUT"):Ga("UNMOUNT");Y.current=b}},[b,Ga]);Om(()=>{if(g){const Qa=fb=>{const mb=lh(G.current).includes(fb.animationName);fb.target===g&&mb&&(0,yF.flushSync)(()=>Ga("ANIMATION_END"))},Za=fb=>{fb.target===g&&(la.current=lh(G.current))};g.addEventListener("animationstart",Za);g.addEventListener("animationcancel",Qa);g.addEventListener("animationend",Qa);return()=>{g.removeEventListener("animationstart",
|
|||
|
Za);g.removeEventListener("animationcancel",Qa);g.removeEventListener("animationend",Qa)}}Ga("ANIMATION_END")},[g,Ga]);return{isPresent:["mounted","unmountSuspended"].includes(pa),ref:(0,Ep.useCallback)(Qa=>{Qa&&(G.current=getComputedStyle(Qa));p(Qa)},[])}}function lh(b){return(null===b||void 0===b?void 0:b.animationName)||"none"}function Kj({prop:b,defaultProp:g,onChange:p=()=>{}}){const [G,Y]=Ii({defaultProp:g,onChange:p}),la=void 0!==b;g=la?b:G;const pa=pf(p);p=(0,ou.useCallback)(Ga=>{la?(Ga="function"===
|
|||
|
typeof Ga?Ga(b):Ga,Ga!==b&&pa(Ga)):Y(Ga)},[la,b,Y,pa]);return[g,p]}function Ii({defaultProp:b,onChange:g}){b=(0,ou.useState)(b);const [p]=b,G=(0,ou.useRef)(p),Y=pf(g);(0,ou.useEffect)(()=>{G.current!==p&&(Y(p),G.current=p)},[p,G,Y]);return b}function $i(b,g){const p=Math.abs(g.top-b.y),G=Math.abs(g.bottom-b.y),Y=Math.abs(g.right-b.x);b=Math.abs(g.left-b.x);switch(Math.min(p,G,Y,b)){case b:return"left";case Y:return"right";case p:return"top";case G:return"bottom";default:return null}}function Rb(b){b=
|
|||
|
b.slice();b.sort((g,p)=>g.x<p.x?-1:g.x>p.x?1:g.y<p.y?-1:g.y>p.y?1:0);return ec(b)}function ec(b){if(1>=b.length)return b.slice();const g=[];for(var p=0;p<b.length;p++){for(var G=b[p];2<=g.length;){var Y=g[g.length-1],la=g[g.length-2];if((Y.x-la.x)*(G.y-la.y)>=(Y.y-la.y)*(G.x-la.x))g.pop();else break}g.push(G)}g.pop();p=[];for(G=b.length-1;0<=G;G--){for(Y=b[G];2<=p.length;){la=p[p.length-1];const pa=p[p.length-2];if((la.x-pa.x)*(Y.y-pa.y)>=(la.y-pa.y)*(Y.x-pa.x))p.pop();else break}p.push(Y)}p.pop();
|
|||
|
return 1===g.length&&1===p.length&&g[0].x===p[0].x&&g[0].y===p[0].y?g:g.concat(p)}function dc(b){var {side:g,content:p,sideOffset:G=10}=b;b=zf(b,["side","content","sideOffset"]);return p?(0,tb.jsx)(KF,{delayDuration:300,children:(0,tb.jsxs)(LF,{children:[(0,tb.jsx)(MF,{asChild:!0,children:b.children}),(0,tb.jsx)(NF,{children:(0,tb.jsxs)(OF,hf(pe({className:"tl-tooltip-content",sideOffset:G,side:g},b),{children:[p,(0,tb.jsx)(PF,{className:"tl-tooltip-arrow"})]}))})]})}):(0,tb.jsx)(tb.Fragment,{children:b.children})}
|
|||
|
function ka(b){var {className:g,tooltip:p,tooltipSide:G}=b;b=zf(b,["className","tooltip","tooltipSide"]);return(0,tb.jsx)(dc,{content:p,side:G,children:(0,tb.jsx)("button",pe({className:"tl-button "+(null!=g?g:"")},b))})}function Eb(b){var g=b+"CollectionProvider";const [p,G]=yj(g),[Y,la]=p(g,{collectionRef:{current:null},itemMap:new Map}),pa=fb=>{const {scope:mb,children:Lb}=fb;fb=kp.default.useRef(null);const Tb=kp.default.useRef(new Map).current;return kp.default.createElement(Y,{scope:mb,itemMap:Tb,
|
|||
|
collectionRef:fb},Lb)};Object.assign(pa,{displayName:g});const Ga=b+"CollectionSlot";g=kp.default.forwardRef((fb,mb)=>{const {scope:Lb,children:Tb}=fb;fb=la(Ga,Lb);mb=Df(mb,fb.collectionRef);return kp.default.createElement(ip,{ref:mb},Tb)});Object.assign(g,{displayName:Ga});const Qa=b+"CollectionItemSlot",Za=kp.default.forwardRef((fb,mb)=>{const {scope:Lb,children:Tb}=fb,Pb=zf(fb,["scope","children"]),lc=kp.default.useRef(null);fb=Df(mb,lc);const xc=la(Qa,Lb);kp.default.useEffect(()=>{xc.itemMap.set(lc,
|
|||
|
pe({ref:lc},Pb));return()=>void xc.itemMap.delete(lc)});return kp.default.createElement(ip,{["data-radix-collection-item"]:"",ref:fb},Tb)});Object.assign(Za,{displayName:Qa});return[{Provider:pa,Slot:g,ItemSlot:Za},function(fb){const mb=la(b+"CollectionConsumer",fb);return kp.default.useCallback(()=>{const Lb=mb.collectionRef.current;if(!Lb)return[];const Tb=Array.from(Lb.querySelectorAll("[data-radix-collection-item]"));return Array.from(mb.itemMap.values()).sort((Pb,lc)=>Tb.indexOf(Pb.ref.current)-
|
|||
|
Tb.indexOf(lc.ref.current))},[mb.collectionRef,mb.itemMap])},G]}function Ub(b){const g=(0,Zz.useContext)(RF);return b||g||"ltr"}function vb(){(0,SF.useEffect)(()=>{var b,g;const p=document.querySelectorAll("[data-radix-focus-guard]");document.body.insertAdjacentElement("afterbegin",null!==(b=p[0])&&void 0!==b?b:yb());document.body.insertAdjacentElement("beforeend",null!==(g=p[1])&&void 0!==g?g:yb());qw++;return()=>{1===qw&&document.querySelectorAll("[data-radix-focus-guard]").forEach(G=>G.remove());
|
|||
|
qw--}},[])}function yb(){const b=document.createElement("span");b.setAttribute("data-radix-focus-guard","");b.tabIndex=0;b.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none";return b}function Qb(b,{select:g=!1}={}){const p=document.activeElement;for(const G of b)if(Bc(G,{select:g}),document.activeElement!==p)break}function sb(b){const g=[];for(b=document.createTreeWalker(b,NodeFilter.SHOW_ELEMENT,{acceptNode:p=>{const G="INPUT"===p.tagName&&"hidden"===p.type;return p.disabled||
|
|||
|
p.hidden||G?NodeFilter.FILTER_SKIP:0<=p.tabIndex?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});b.nextNode();)g.push(b.currentNode);return g}function Mb(b,g){for(const p of b)if(!ac(p,{upTo:g}))return p}function ac(b,{upTo:g}){if("hidden"===getComputedStyle(b).visibility)return!0;for(;b&&(void 0===g||b!==g);){if("none"===getComputedStyle(b).display)return!0;b=b.parentElement}return!1}function Bc(b,{select:g=!1}={}){if(b&&b.focus){const p=document.activeElement;b.focus({preventScroll:!0});b!==
|
|||
|
p&&b instanceof HTMLInputElement&&"select"in b&&g&&b.select()}}function Oc(b,g){b=[...b];g=b.indexOf(g);-1!==g&&b.splice(g,1);return b}function Sc(b){return b.filter(g=>"A"!==g.tagName)}function xd(b,g,p){b=b.key;p="rtl"!==p?b:"ArrowLeft"===b?"ArrowRight":"ArrowRight"===b?"ArrowLeft":b;if("vertical"!==g||!["ArrowLeft","ArrowRight"].includes(p))if("horizontal"!==g||!["ArrowUp","ArrowDown"].includes(p))return ZF[p]}function Rd(b){const g=document.activeElement;for(const p of b){if(p===g)break;p.focus();
|
|||
|
if(document.activeElement!==g)break}}function Ed(b,g){return b.map((p,G)=>b[(g+G)%b.length])}function Bd(b,g){var p=(0,cG.useState)(function(){return{value:b,callback:g,facade:{get current(){return p.value},set current(G){var Y=p.value;Y!==G&&(p.value=G,p.callback(G,Y))}}}})[0];p.callback=g;return p.facade}function Gd(b,g){return Bd(g||null,function(p){return b.forEach(function(G){"function"===typeof G?G(p):G&&(G.current=p);return G})})}function ze(b){return b}function Zf(b,g){void 0===g&&(g=ze);
|
|||
|
var p=[],G=!1;return{read:function(){if(G)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return p.length?p[p.length-1]:b},useMedium:function(Y){var la=g(Y,G);p.push(la);return function(){p=p.filter(function(pa){return pa!==la})}},assignSyncMedium:function(Y){for(G=!0;p.length;){var la=p;p=[];la.forEach(Y)}p={push:function(pa){return Y(pa)},filter:function(){return p}}},assignMedium:function(Y){G=!0;var la=[];if(p.length){var pa=p;p=
|
|||
|
[];pa.forEach(Y);la=p}var Ga=function(){var Qa=la;la=[];Qa.forEach(Y)};Promise.resolve().then(Ga);p={push:function(Qa){la.push(Qa);Promise.resolve().then(Ga)},filter:function(Qa){la=la.filter(Qa);return p}}}}}function xe(b){const g=document.activeElement;for(const p of b){if(p===g)break;p.focus();if(document.activeElement!==g)break}}function We(b,g){return b.map((p,G)=>b[(g+G)%b.length])}function Me(b,g,p){const G=1<g.length&&Array.from(g).every(la=>la===g[0])?g[0]:g,Y=p?b.indexOf(p):-1;b=We(b,Math.max(Y,
|
|||
|
0));1===G.length&&(b=b.filter(la=>la!==p));b=b.find(la=>la.toLowerCase().startsWith(G.toLowerCase()));return b!==p?b:void 0}function Oe(b){return g=>"mouse"===g.pointerType?b(g):void 0}function tg(b,[g,p]){return Math.min(p,Math.max(g,b))}function Vf(b){const g=(0,IA.useRef)({value:b,previous:b});return(0,IA.useMemo)(()=>{g.current.value!==b&&(g.current.previous=g.current.value,g.current.value=b);return g.current.previous},[b])}function cj(b=[],g,p){b=[...b];b[p]=g;return b.sort((G,Y)=>G-Y)}function Tf(b,
|
|||
|
g,p){return 100/(p-g)*(b-g)}function og(b,g){if(2<g)return`Value ${b+1} of ${g}`;if(2===g)return["Minimum","Maximum"][b]}function mh(b,g){if(1===b.length)return 0;b=b.map(G=>Math.abs(G-g));const p=Math.min(...b);return b.indexOf(p)}function Rg(b,g,p){b/=2;const G=bh([0,50],[0,b]);return(b-G(g)*p)*p}function Tg(b){return b.slice(0,-1).map((g,p)=>b[p+1]-g)}function bh(b,g){return p=>b[0]===b[1]||g[0]===g[1]?g[0]:g[0]+(g[1]-g[0])/(b[1]-b[0])*(p-b[0])}function Dg(b,g){g=Math.pow(10,g);return Math.round(b*
|
|||
|
g)/g}function pg(b){function g(Qa){return Qa?(0,tb.jsx)("div",{className:"tl-color-bg",style:{backgroundColor:Qa},children:(0,tb.jsx)("div",{className:`w-full h-full bg-${Qa}-500`})}):(0,tb.jsx)("div",{className:"tl-color-bg",children:(0,tb.jsx)(Bh,{name:"color-swatch"})})}var {color:p,opacity:G,popoverSide:Y,setColor:la,setOpacity:pa}=b;b=zf(b,["color","opacity","popoverSide","setColor","setOpacity"]);const Ga=aH.default.useMemo(()=>{let Qa="";return ek(Za=>{la(Qa)},100,Za=>{Qa=Za.target.value})},
|
|||
|
[]);return(0,tb.jsx)(QA,hf(pe({},b),{border:!0,arrow:!0,side:Y,label:(0,tb.jsx)(dc,{content:"Color",side:Y,sideOffset:14,children:g(p)}),children:(0,tb.jsxs)("div",{className:"p-1",children:[(0,tb.jsx)("div",{className:"tl-color-palette",children:Object.values(Mq).map(Qa=>(0,tb.jsx)("button",{className:`tl-color-drip m-1${Qa===p?" active":""}`,onClick:()=>la(Qa),children:g(Qa)},Qa))}),(0,tb.jsxs)("div",{className:"flex items-center tl-custom-color",children:[(0,tb.jsx)("div",{className:`tl-color-drip m-1 mr-3 ${jg(p)?
|
|||
|
"":"active"}`,children:(0,tb.jsx)("div",{className:"color-input-wrapper tl-color-bg",children:(0,tb.jsx)("input",pe({className:"color-input cursor-pointer",id:"tl-custom-color-input",type:"color",value:p,onChange:Ga,style:{opacity:jg(p)?0:1}},b))})}),(0,tb.jsx)("label",{for:"tl-custom-color-input",className:"cursor-pointer",children:"Select custom color"})]}),pa&&(0,tb.jsx)("div",{className:"mx-1 my-2",children:(0,tb.jsxs)(XG,{defaultValue:[null!=G?G:0],onValueCommit:Qa=>pa(Qa[0]),max:1,step:.1,"aria-label":"Opacity",
|
|||
|
className:"tl-slider-root",children:[(0,tb.jsx)(YG,{className:"tl-slider-track",children:(0,tb.jsx)(ZG,{className:"tl-slider-range"})}),(0,tb.jsx)($G,{className:"tl-slider-thumb"})]})})]})}))}function ch(b,g){b&&(0,cH.flushSync)(()=>b.dispatchEvent(g))}function Qf(b,g=null===globalThis||void 0===globalThis?void 0:globalThis.document){const p=pf(b),G=(0,On.useRef)(!1),Y=(0,On.useRef)(()=>{});(0,On.useEffect)(()=>{const la=Ga=>{if(Ga.target&&!G.current){let Qa=function(){ji("dismissableLayer.pointerDownOutside",
|
|||
|
p,Za,{discrete:!0})};const Za={originalEvent:Ga};"touch"===Ga.pointerType?(g.removeEventListener("click",Y.current),Y.current=Qa,g.addEventListener("click",Y.current,{once:!0})):Qa()}G.current=!1},pa=window.setTimeout(()=>{g.addEventListener("pointerdown",la)},0);return()=>{window.clearTimeout(pa);g.removeEventListener("pointerdown",la);g.removeEventListener("click",Y.current)}},[g,p]);return{onPointerDownCapture:()=>G.current=!0}}function aj(b,g=null===globalThis||void 0===globalThis?void 0:globalThis.document){const p=
|
|||
|
pf(b),G=(0,On.useRef)(!1);(0,On.useEffect)(()=>{const Y=la=>{la.target&&!G.current&&ji("dismissableLayer.focusOutside",p,{originalEvent:la},{discrete:!1})};g.addEventListener("focusin",Y);return()=>g.removeEventListener("focusin",Y)},[g,p]);return{onFocusCapture:()=>G.current=!0,onBlurCapture:()=>G.current=!1}}function th(){const b=new CustomEvent("dismissableLayer.update");document.dispatchEvent(b)}function ji(b,g,p,{discrete:G}){const Y=p.originalEvent.target;p=new CustomEvent(b,{bubbles:!1,cancelable:!0,
|
|||
|
detail:p});g&&Y.addEventListener(b,g,{once:!0});G?ch(Y,p):Y.dispatchEvent(p)}function ck(b,{select:g=!1}={}){const p=document.activeElement;for(const G of b)if(Yi(G,{select:g}),document.activeElement!==p)break}function zi(b){const g=[];for(b=document.createTreeWalker(b,NodeFilter.SHOW_ELEMENT,{acceptNode:p=>{const G="INPUT"===p.tagName&&"hidden"===p.type;return p.disabled||p.hidden||G?NodeFilter.FILTER_SKIP:0<=p.tabIndex?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});b.nextNode();)g.push(b.currentNode);
|
|||
|
return g}function tk(b,g){for(const p of b)if(!Ql(p,{upTo:g}))return p}function Ql(b,{upTo:g}){if("hidden"===getComputedStyle(b).visibility)return!0;for(;b&&(void 0===g||b!==g);){if("none"===getComputedStyle(b).display)return!0;b=b.parentElement}return!1}function Yi(b,{select:g=!1}={}){if(b&&b.focus){const p=document.activeElement;b.focus({preventScroll:!0});b!==p&&b instanceof HTMLInputElement&&"select"in b&&g&&b.select()}}function om(b,g){b=[...b];g=b.indexOf(g);-1!==g&&b.splice(g,1);return b}function Rm(b){return b.filter(g=>
|
|||
|
"A"!==g.tagName)}function ug(b){return void 0!==b}function dn(b){return null!==b}function cn(b){const [g,p="center"]=b.split("-");return[g,p]}function am(b){const g=pf(b),p=(0,yf.useRef)(""),G=(0,yf.useRef)(0);b=(0,yf.useCallback)(la=>{la=p.current+la;g(la);(function Qa(Ga){p.current=Ga;window.clearTimeout(G.current);""!==Ga&&(G.current=window.setTimeout(()=>Qa(""),1E3))})(la)},[g]);const Y=(0,yf.useCallback)(()=>{p.current="";window.clearTimeout(G.current)},[]);(0,yf.useEffect)(()=>()=>window.clearTimeout(G.current),
|
|||
|
[]);return[p,b,Y]}function Zk(b,g,p){const G=1<g.length&&Array.from(g).every(la=>la===g[0])?g[0]:g,Y=p?b.indexOf(p):-1;b=Wj(b,Math.max(Y,0));1===G.length&&(b=b.filter(la=>la!==p));b=b.find(la=>la.textValue.toLowerCase().startsWith(G.toLowerCase()));return b!==p?b:void 0}function Wj(b,g){return b.map((p,G)=>b[(g+G)%b.length])}function Ej(b){var {options:g,tooltip:p,popoverSide:G,chevron:Y=!0,value:la,onValueChange:pa}=b;b=zf(b,"options tooltip popoverSide chevron value onValueChange".split(" "));const [Ga,
|
|||
|
Qa]=bH.useState(!1);return(0,tb.jsx)("div",hf(pe({},b),{className:"tl-select-input",children:(0,tb.jsxs)(LH,{open:Ga,onOpenChange:Qa,value:la,onValueChange:pa,children:[(0,tb.jsx)(dc,{content:p,side:G,children:(0,tb.jsxs)(MH,{className:"tl-select-input-trigger",children:[(0,tb.jsx)("div",{className:"tl-select-input-trigger-value",children:(0,tb.jsx)(NH,{})}),Y&&(0,tb.jsx)(OH,{style:{lineHeight:1},className:"ml-1 md:ml-3",children:(0,tb.jsx)(Bh,{name:Ga?"chevron-up":"chevron-down"})})]})}),(0,tb.jsx)(PH,
|
|||
|
{className:"tl-select-input-portal",children:(0,tb.jsxs)(QH,{className:"tl-select-input-content",side:G,position:"popper",sideOffset:14,align:"center",onKeyDown:Za=>Za.stopPropagation(),children:[(0,tb.jsx)(UH,{}),(0,tb.jsx)(RH,{className:"tl-select-input-viewport",children:g.map(Za=>(0,tb.jsx)(SH,{className:"tl-select-input-select-item",value:Za.value,children:(0,tb.jsx)(TH,{children:Za.label})},Za.value))}),(0,tb.jsx)(VH,{})]})})]})}))}function Jh(b){var {scaleLevel:g,compact:p,popoverSide:G}=b;
|
|||
|
zf(b,["scaleLevel","compact","popoverSide"]);const Y=Ye();return(0,tb.jsx)(Ej,{tooltip:"Scale level",options:[{label:p?"XS":"Extra Small",value:"xs"},{label:p?"SM":"Small",value:"sm"},{label:p?"MD":"Medium",value:"md"},{label:p?"LG":"Large",value:"lg"},{label:p?"XL":"Extra Large",value:"xl"},{label:p?"XXL":"Huge",value:"xxl"}],value:g,popoverSide:G,chevron:!p,onValueChange:la=>{Y.api.setScaleLevel(la)}})}function oi(b,g){return function(p){return b(g(p))}}function pm(b,g){return g(b)}function rm(b,
|
|||
|
g){return function(p){return b(g,p)}}function Ri(b,g){return function(){return b(g)}}function $k(b,g){g(b);return b}function re(){for(var b=arguments.length,g=Array(b),p=0;p<b;p++)g[p]=arguments[p];return g}function Mf(b){b()}function Le(b){return function(){return b}}function ff(){for(var b=arguments.length,g=Array(b),p=0;p<b;p++)g[p]=arguments[p];return function(){g.map(Mf)}}function Ei(){}function dg(b,g){return b(1,g)}function fj(b,g){b(0,g)}function Fh(b){b(2)}function Gl(b){return b(4)}function $d(b,
|
|||
|
g){return dg(b,rm(g,0))}function Ke(b,g){var p=b(1,function(G){p();g(G)});return p}function Uf(){var b=[];return function(g,p){switch(g){case 2:b.splice(0,b.length);break;case 1:return b.push(p),function(){var G=b.indexOf(p);-1<G&&b.splice(G,1)};case 0:b.slice().forEach(function(G){G(p)});break;default:throw Error("unrecognized action "+g);}}}function Pd(b){var g=b,p=Uf();return function(G,Y){switch(G){case 1:Y(g);break;case 0:g=Y;break;case 4:return g}return p(G,Y)}}function Ol(b){var g,p;return function(G,
|
|||
|
Y){switch(G){case 1:if(Y){if(p===Y)break;g&&g();p=Y;return g=b(1,Y)}g&&g();return Ei;case 2:g&&g();p=null;break;default:throw Error("unrecognized action "+G);}}}function pj(b){return $k(Uf(),function(g){return $d(b,g)})}function Qi(b,g){return $k(Pd(g),function(p){return $d(b,p)})}function Ai(){for(var b=arguments.length,g=Array(b),p=0;p<b;p++)g[p]=arguments[p];return function(G){return g.reduceRight(pm,G)}}function Ge(b){for(var g=arguments.length,p=Array(1<g?g-1:0),G=1;G<g;G++)p[G-1]=arguments[G];
|
|||
|
var Y=Ai.apply(void 0,p);return function(la,pa){switch(la){case 1:return dg(b,Y(pa));case 2:b(2);break;default:throw Error("unrecognized action "+la);}}}function Kf(b,g){return b===g}function kg(b){void 0===b&&(b=Kf);var g;return function(p){return function(G){b(g,G)||(g=G,p(G))}}}function Ug(b){return function(g){return function(p){b(p)&&g(p)}}}function $f(b){return function(g){return oi(g,b)}}function Pf(b){return function(g){return function(){return g(b)}}}function ol(b,g){return function(p){return function(G){return p(g=
|
|||
|
b(g,G))}}}function Uk(b){return function(g){return function(p){0<b?b--:g(p)}}}function Jf(b){var g,p;return function(G){return function(Y){g=Y;p||=setTimeout(function(){p=void 0;G(g)},b)}}}function Hl(b){var g,p;return function(G){return function(Y){g=Y;p&&clearTimeout(p);p=setTimeout(function(){G(g)},b)}}}function eg(){for(var b=arguments.length,g=Array(b),p=0;p<b;p++)g[p]=arguments[p];var G=Array(g.length),Y=0,la=null,pa=Math.pow(2,g.length)-1;g.forEach(function(Ga,Qa){var Za=Math.pow(2,Qa);dg(Ga,
|
|||
|
function(fb){var mb=Y;Y|=Za;G[Qa]=fb;mb!==pa&&Y===pa&&la&&(la(),la=null)})});return function(Ga){return function(Qa){var Za=function(){return Ga([Qa].concat(G))};Y===pa?Za():la=Za}}}function pi(){for(var b=arguments.length,g=Array(b),p=0;p<b;p++)g[p]=arguments[p];return function(G,Y){switch(G){case 1:return ff.apply(void 0,g.map(function(la){return la(1,Y)}));case 2:break;default:throw Error("unrecognized action "+G);}}}function Ah(b,g){void 0===g&&(g=Kf);return Ge(b,kg(g))}function Ki(){for(var b=
|
|||
|
Uf(),g=arguments.length,p=Array(g),G=0;G<g;G++)p[G]=arguments[G];var Y=Array(p.length),la=0,pa=Math.pow(2,p.length)-1;p.forEach(function(Ga,Qa){var Za=Math.pow(2,Qa);dg(Ga,function(fb){Y[Qa]=fb;la|=Za;la===pa&&b(0,Y)})});return function(Ga,Qa){switch(Ga){case 1:return la===pa&&Qa(Y),b(1,Qa);case 2:b(2);break;default:throw Error("unrecognized action "+Ga);}}}function qh(b,g,p){void 0===g&&(g=[]);p=(void 0===p?{singleton:!0}:p).singleton;return{id:Symbol(),constructor:b,dependencies:g,singleton:p}}
|
|||
|
function bm(b){var g=new Map;return function Y(G){var la=G.id,pa=G.constructor,Ga=G.dependencies;if((G=G.singleton)&&g.has(la))return g.get(la);pa=pa(Ga.map(function(Qa){return Y(Qa)}));G&&g.set(la,pa);return pa}(b)}function xm(b,g){if(null==b)return{};var p={},G=Object.keys(b),Y;for(Y=0;Y<G.length;Y++){var la=G[Y];0<=g.indexOf(la)||(p[la]=b[la])}return p}function Lj(b,g){if(b){if("string"===typeof b)return ao(b,g);var p=Object.prototype.toString.call(b).slice(8,-1);"Object"===p&&b.constructor&&(p=
|
|||
|
b.constructor.name);if("Map"===p||"Set"===p)return Array.from(b);if("Arguments"===p||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return ao(b,g)}}function ao(b,g){if(null==g||g>b.length)g=b.length;for(var p=0,G=Array(g);p<g;p++)G[p]=b[p];return G}function yl(b,g){var p="undefined"!==typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(p)return(p=p.call(b)).next.bind(p);if(Array.isArray(b)||(p=Lj(b))||g&&b&&"number"===typeof b.length){p&&(b=p);var G=0;return function(){return G>=b.length?{done:!0}:
|
|||
|
{done:!1,value:b[G++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function ei(b,g){for(var p={},G={},Y=0,la=b.length;Y<la;)G[b[Y]]=1,Y+=1;for(var pa in g)G.hasOwnProperty(pa)||(p[pa]=g[pa]);return p}function Sm(b,g,p){function G(mb,Lb){mb.propsReady&&(0,mb.propsReady)(0,!1);for(var Tb=yl(pa),Pb;!(Pb=Tb()).done;)Pb=Pb.value,(0,mb[g.required[Pb]])(0,Lb[Pb]);for(Tb=yl(Ga);!(Pb=Tb()).done;)if(Pb=
|
|||
|
Pb.value,Pb in Lb)(0,mb[g.optional[Pb]])(0,Lb[Pb]);mb.propsReady&&(0,mb.propsReady)(0,!0)}function Y(mb){return Qa.reduce(function(Lb,Tb){Lb[Tb]=function(Pb){(0,mb[g.methods[Tb]])(0,Pb)};return Lb},{})}function la(mb){return Za.reduce(function(Lb,Tb){Lb[Tb]=Ol(mb[g.events[Tb]]);return Lb},{})}var pa=Object.keys(g.required||{}),Ga=Object.keys(g.optional||{}),Qa=Object.keys(g.methods||{}),Za=Object.keys(g.events||{}),fb=(0,Pn.createContext)({});return{Component:(0,Pn.forwardRef)(function(mb,Lb){var Tb=
|
|||
|
mb.children,Pb=xm(mb,aI),lc=(0,Pn.useState)(function(){return $k(bm(b),function($b){return G($b,Pb)})})[0],xc=(0,Pn.useState)(Ri(la,lc))[0];Iu(function(){for(var $b=yl(Za),sc;!(sc=$b()).done;)if(sc=sc.value,sc in Pb)(0,xc[sc])(1,Pb[sc]);return function(){Object.values(xc).map(Fh)}},[Pb,xc,lc]);Iu(function(){G(lc,Pb)});(0,Pn.useImperativeHandle)(Lb,Le(Y(lc)));return(0,Pn.createElement)(fb.Provider,{value:lc},p?(0,Pn.createElement)(p,ei([].concat(pa,Ga,Za),Pb),Tb):Tb)}),usePublisher:function(mb){return(0,Pn.useCallback)(rm(fj,
|
|||
|
(0,Pn.useContext)(fb)[mb]),[mb])},useEmitterValue:function(mb){var Lb=(0,Pn.useContext)(fb)[mb];mb=(0,Pn.useState)(Ri(Gl,Lb));var Tb=mb[0],Pb=mb[1];Iu(function(){return dg(Lb,function(lc){lc!==Tb&&Pb(Le(lc))})},[Lb,Tb]);return Tb},useEmitter:function(mb,Lb){var Tb=(0,Pn.useContext)(fb)[mb];Iu(function(){return Tb(1,Lb)},[Lb,Tb])}}}function mg(){return mg=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var p=arguments[g],G;for(G in p)Object.prototype.hasOwnProperty.call(p,G)&&(b[G]=
|
|||
|
p[G])}return b},mg.apply(this,arguments)}function yi(b,g){if(null==b)return{};var p,G,Y={},la=Object.keys(b);for(G=0;G<la.length;G++)0<=g.indexOf(p=la[G])||(Y[p]=b[p]);return Y}function tn(b,g){(null==g||g>b.length)&&(g=b.length);for(var p=0,G=Array(g);p<g;p++)G[p]=b[p];return G}function Wl(b,g){var p="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(p)return(p=p.call(b)).next.bind(p);if(Array.isArray(b)||(p=function(Y,la){if(Y){if("string"==typeof Y)return tn(Y,la);var pa=Object.prototype.toString.call(Y).slice(8,
|
|||
|
-1);return"Object"===pa&&Y.constructor&&(pa=Y.constructor.name),"Map"===pa||"Set"===pa?Array.from(Y):"Arguments"===pa||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pa)?tn(Y,la):void 0}}(b))||g&&b&&"number"==typeof b.length){p&&(b=p);var G=0;return function(){return G>=b.length?{done:!0}:{done:!1,value:b[G++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function Fj(b,g){void 0===g&&
|
|||
|
(g=!0);var p=(0,hi.useRef)(null),G=function(la){};if("undefined"!=typeof ResizeObserver){var Y=new ResizeObserver(function(la){la=la[0].target;null!==la.offsetParent&&b(la)});G=function(la){la&&g?(Y.observe(la),p.current=la):(p.current&&Y.unobserve(p.current),p.current=null)}}return{ref:p,callbackRef:G}}function Yf(b,g){return void 0===g&&(g=!0),Fj(b,g).callbackRef}function Si(b,g,p,G,Y,la,pa){return Fj(function(Ga){for(var Qa=function(mb,Lb,Tb,Pb){Tb=mb.length;if(0===Tb)return null;for(var lc=[],
|
|||
|
xc=0;xc<Tb;xc++){var $b=mb.item(xc);if($b&&void 0!==$b.dataset.index){var sc=parseInt($b.dataset.index),oc=parseFloat($b.dataset.knownSize),Mc=Lb($b,"offsetHeight");if(0===Mc&&Pb("Zero-sized element, this should not happen",{child:$b},Em.ERROR),Mc!==oc)$b=lc[lc.length-1],0===lc.length||$b.size!==Mc||$b.endIndex!==sc-1?lc.push({startIndex:sc,endIndex:sc,size:Mc}):lc[lc.length-1].endIndex++}}return lc}(Ga.children,g,0,Y),Za=Ga.parentElement;!Za.dataset.virtuosoScroller;)Za=Za.parentElement;var fb="window"===
|
|||
|
Za.firstElementChild.dataset.viewportType;G({scrollTop:Math.max(pa?pa.scrollTop:fb?window.pageYOffset||document.documentElement.scrollTop:Za.scrollTop,0),scrollHeight:pa?pa.scrollHeight:fb?document.documentElement.scrollHeight:Za.scrollHeight,viewportHeight:pa?pa.offsetHeight:fb?window.innerHeight:Za.offsetHeight});null==la||la(function(mb,Lb,Tb){return"normal"===Lb||null!=Lb&&Lb.endsWith("px")||Tb("row-gap was not resolved to pixel value correctly",Lb,Em.WARN),"normal"===Lb?0:parseInt(null!=Lb?Lb:
|
|||
|
"0",10)}(0,getComputedStyle(Ga).rowGap,Y));null!==Qa&&b(Qa)},p)}function gl(b,g){return Math.round(b.getBoundingClientRect()[g])}function Hm(b,g,p,G,Y){void 0===G&&(G=Ei);var la=(0,hi.useRef)(null),pa=(0,hi.useRef)(null),Ga=(0,hi.useRef)(null),Qa=(0,hi.useRef)(!1),Za=(0,hi.useCallback)(function(fb){fb=fb.target;var mb=fb===window||fb===document,Lb=mb?window.pageYOffset||document.documentElement.scrollTop:fb.scrollTop,Tb=mb?document.documentElement.scrollHeight:fb.scrollHeight,Pb=mb?window.innerHeight:
|
|||
|
fb.offsetHeight;fb=function(){b({scrollTop:Math.max(Lb,0),scrollHeight:Tb,viewportHeight:Pb})};Qa.current?(0,bI.flushSync)(fb):fb();Qa.current=!1;null!==pa.current&&(Lb===pa.current||0>=Lb||Lb===Tb-Pb)&&(pa.current=null,g(!0),Ga.current&&(clearTimeout(Ga.current),Ga.current=null))},[b,g]);return(0,hi.useEffect)(function(){var fb=Y||la.current;return G(Y||la.current),Za({target:fb}),fb.addEventListener("scroll",Za,{passive:!0}),function(){G(null);fb.removeEventListener("scroll",Za)}},[la,Za,p,G,Y]),
|
|||
|
{scrollerRef:la,scrollByCallback:function(fb){Qa.current=!0;la.current.scrollBy(fb)},scrollToCallback:function(fb){var mb=la.current;if(mb&&!("offsetHeight"in mb&&0===mb.offsetHeight)){var Lb,Tb,Pb,lc="smooth"===fb.behavior;if(mb===window?(Tb=Math.max(gl(document.documentElement,"height"),document.documentElement.scrollHeight),Lb=window.innerHeight,Pb=document.documentElement.scrollTop):(Tb=mb.scrollHeight,Lb=gl(mb,"height"),Pb=mb.scrollTop),fb.top=Math.ceil(Math.max(Math.min(Tb-Lb,fb.top),0)),1.01>
|
|||
|
Math.abs(Lb-Tb)||fb.top===Pb)return b({scrollTop:Pb,scrollHeight:Tb,viewportHeight:Lb}),void(lc&&g(!0));lc?(pa.current=fb.top,Ga.current&&clearTimeout(Ga.current),Ga.current=setTimeout(function(){Ga.current=null;pa.current=null;g(!0)},1E3)):pa.current=null;mb.scrollTo(fb)}}}}function y(b,g,p,G,Y){return void 0===G&&(G=Oi),void 0===Y&&(Y=Oi),{k:b,v:g,lvl:p,l:G,r:Y}}function V(b,g){if(b===Oi)return Oi;var p=b.k,G=b.l,Y=b.r;if(g===p){if(G===Oi)return Y;if(Y===Oi)return G;g=qb(G);return Dc(Xb(b,{k:g[0],
|
|||
|
v:g[1],l:ub(G)}))}return Dc(Xb(b,g<p?{l:V(G,g)}:{r:V(Y,g)}))}function xa(b,g,p){return(void 0===p&&(p="k"),b===Oi)?[-Infinity,void 0]:b[p]===g?[b.k,b.v]:b[p]<g?(g=xa(b.r,g,p),-Infinity===g[0]?[b.k,b.v]:g):xa(b.l,g,p)}function ua(b,g,p){return b===Oi?y(g,p,1):g===b.k?Xb(b,{k:g,v:p}):od(Ce(Xb(b,g<b.k?{l:ua(b.l,g,p)}:{r:ua(b.r,g,p)})))}function Fa(b,g,p){if(b===Oi)return[];var G=b.k,Y=b.v,la=b.r,pa=[];return G>g&&(pa=pa.concat(Fa(b.l,g,p))),G>=g&&G<=p&&pa.push({k:G,v:Y}),G<=p&&(pa=pa.concat(Fa(la,g,
|
|||
|
p))),pa}function $a(b){return b===Oi?[]:[].concat($a(b.l),[{k:b.k,v:b.v}],$a(b.r))}function qb(b){return b.r===Oi?[b.k,b.v]:qb(b.r)}function ub(b){return b.r===Oi?b.l:Dc(Xb(b,{r:ub(b.r)}))}function Xb(b,g){return y(void 0!==g.k?g.k:b.k,void 0!==g.v?g.v:b.v,void 0!==g.lvl?g.lvl:b.lvl,void 0!==g.l?g.l:b.l,void 0!==g.r?g.r:b.r)}function Cc(b){return b===Oi||b.lvl>b.r.lvl}function Dc(b){var g=b.l,p=b.r,G=b.lvl;if(p.lvl>=G-1&&g.lvl>=G-1)return b;if(G>p.lvl+1){if(Cc(g))return Ce(Xb(b,{lvl:G-1}));if(g===
|
|||
|
Oi||g.r===Oi)throw Error("Unexpected empty nodes");return Xb(g.r,{l:Xb(g,{r:g.r.l}),r:Xb(b,{l:g.r.r,lvl:G-1}),lvl:G})}if(Cc(b))return od(Xb(b,{lvl:G-1}));if(p===Oi||p.l===Oi)throw Error("Unexpected empty nodes");g=p.l;var Y=Cc(g)?p.lvl-1:p.lvl;return Xb(g,{l:Xb(b,{r:g.l,lvl:G-1}),r:od(Xb(p,{l:g.r,lvl:Y})),lvl:g.lvl+1})}function Fd(b,g,p){return b===Oi?[]:Md(Fa(b,xa(b,g)[0],p),function(G){return{index:G.k,value:G.v}})}function Md(b,g){var p=b.length;if(0===p)return[];var G=g(b[0]),Y=G.index;G=G.value;
|
|||
|
for(var la=[],pa=1;pa<p;pa++){var Ga=g(b[pa]),Qa=Ga.index;Ga=Ga.value;la.push({start:Y,end:Qa-1,value:G});Y=Qa;G=Ga}return la.push({start:Y,end:Infinity,value:G}),la}function od(b){var g=b.r,p=b.lvl;return g===Oi||g.r===Oi||g.lvl!==p||g.r.lvl!==p?b:Xb(g,{l:Xb(b,{r:g.l}),lvl:p+1})}function Ce(b){var g=b.l;return g===Oi||g.lvl!==b.lvl?b:Xb(g,{r:Xb(b,{l:g.r})})}function Cf(b,g,p,G){void 0===G&&(G=0);for(var Y=b.length-1;G<=Y;){var la=Math.floor((G+Y)/2),pa=p(b[la],g);if(0===pa)return la;if(-1===pa){if(2>
|
|||
|
Y-G)return la-1;Y=la-1}else{if(Y===G)return la;G=la+1}}throw Error("Failed binary finding record in array - "+b.join(",")+", searched for "+g);}function Ng(b){var g=b.size,p=b.startIndex,G=b.endIndex;return function(Y){return Y.start===p&&(Y.end===G||Infinity===Y.end)&&Y.value===g}}function tj(b,g){b=b.index;return g===b?0:g<b?-1:1}function yg(b,g){b=b.offset;return g===b?0:g<b?-1:1}function nh(b){return{index:b.index,value:b}}function ai(b,g,p,G){var Y=0,la=0,pa=0,Ga;0!==g?(pa=b[Ga=Cf(b,g-1,tj)].offset,
|
|||
|
la=xa(p,g-1),Y=la[0],la=la[1],b.length&&b[Ga].size===xa(p,g)[1]&&--Ga,b=b.slice(0,Ga+1)):b=[];for(g=Wl(Fd(p,g,Infinity));!(p=g()).done;)Ga=p.value,p=Ga.start,Ga=Ga.value,Y=p-Y,pa=Y*la+pa+Y*G,b.push({offset:pa,size:Ga,index:p}),Y=p,la=Ga;return{offsetTree:b,lastIndex:Y,lastOffset:pa,lastSize:la}}function Bi(b,g){var p=g[0],G=g[1],Y=g[3];0<p.length&&(0,g[2])("received item sizes",p,Em.DEBUG);var la=b.sizeTree;g=la;var pa=0;if(0<G.length&&la===Oi&&2===p.length){var Ga=p[0].size,Qa=p[1].size;g=G.reduce(function(fb,
|
|||
|
mb){return ua(ua(fb,mb,Ga),mb+1,Qa)},g)}else p=function(fb,mb){var Lb,Tb=fb===Oi?0:Infinity;for(mb=Wl(mb);!(Lb=mb()).done;){var Pb=Lb.value;Lb=Pb.size;var lc=Pb.startIndex,xc=Pb.endIndex;if(Tb=Math.min(Tb,lc),fb===Oi)fb=ua(fb,0,Lb);else{var $b=Fd(fb,lc-1,xc+1);if(!$b.some(Ng(Pb))){var sc,oc=Pb=!1;for($b=Wl($b);!(sc=$b()).done;){var Mc=sc.value;sc=Mc.start;var Tc=Mc.end;Mc=Mc.value;Pb?(xc>=sc||Lb===Mc)&&(fb=V(fb,sc)):(oc=Mc!==Lb,Pb=!0);Tc>xc&&xc>=sc&&Mc!==Lb&&(fb=ua(fb,xc+1,Mc))}oc&&(fb=ua(fb,lc,Lb))}}}return[fb,
|
|||
|
Tb]}(g,p),g=p[0],pa=p[1];if(g===la)return b;b=ai(b.offsetTree,pa,g,Y);var Za=b.offsetTree;return{sizeTree:g,offsetTree:Za,lastIndex:b.lastIndex,lastOffset:b.lastOffset,lastSize:b.lastSize,groupOffsetTree:G.reduce(function(fb,mb){return ua(fb,mb,Gh(mb,Za,Y))},Oi),groupIndices:G}}function Gh(b,g,p){if(0===g.length)return 0;g=g[Cf(g,b,tj)];b-=g.index;b=g.size*b+(b-1)*p+g.offset;return 0<b?b+p:b}function ig(b,g,p){if(void 0!==b.groupIndex)return g.groupIndices[b.groupIndex]+1;b=Rf("LAST"===b.index?p:
|
|||
|
b.index,g);return Math.max(0,b,Math.min(p,b))}function Rf(b,g){if(g.groupOffsetTree===Oi)return b;for(var p=0;g.groupIndices[p]<=b+p;)p++;return b+p}function Ch(b){b="number"==typeof b?{index:b}:b;return b.align||(b.align="start"),b.behavior&&fI||(b.behavior="auto"),b.offset||(b.offset=0),b}function ih(b){return!!b&&("smooth"===b?"smooth":"auto")}function Cj(b){return b.reduce(function(g,p){return g.groupIndices.push(g.totalCount),g.totalCount+=p+1,g},{totalCount:0,groupIndices:[]})}function li(b,
|
|||
|
g){return!(!b||b[0]!==g[0]||b[1]!==g[1])}function Xj(b,g){return!(!b||b.startIndex!==g.startIndex||b.endIndex!==g.endIndex)}function Pl(b,g,p){return"number"==typeof b?"up"===p&&"top"===g||"down"===p&&"bottom"===g?b:0:"up"===p?"top"===g?b.main:b.reverse:"bottom"===g?b.main:b.reverse}function Sk(b,g,p){if(0===b.length)return[];if(g.groupOffsetTree===Oi)return b.map(function(Qa){return mg({},Qa,{index:Qa.index+p,originalIndex:Qa.index})});var G,Y=[],la=Fd(g.groupOffsetTree,b[0].index,b[b.length-1].index),
|
|||
|
pa=void 0,Ga=0;for(b=Wl(b);!(G=b()).done;)G=G.value,(!pa||pa.end<G.index)&&(pa=la.shift(),Ga=g.groupIndices.indexOf(pa.start)),Y.push(mg({},G.index===pa.start?{type:"group",index:Ga}:{index:G.index-(Ga+1)+p,groupIndex:Ga},{size:G.size,offset:G.offset,originalIndex:G.index,data:G.data}));return Y}function im(b,g,p,G,Y,la){var pa=0,Ga=0;0<b.length&&(pa=b[0].offset,Ga=b[b.length-1],Ga=Ga.offset+Ga.size);var Qa=p-Y.lastIndex,Za=pa;G=Y.lastOffset+Qa*Y.lastSize+(Qa-1)*G-Ga;return{items:Sk(b,Y,la),topItems:Sk(g,
|
|||
|
Y,la),topListHeight:g.reduce(function(fb,mb){return mb.size+fb},0),offsetTop:pa,offsetBottom:G,top:Za,bottom:Ga,totalCount:p,firstItemIndex:la}}function ap(b){var g,p=!1;return function(){return p||(p=!0,g=b()),g}}function jn(b,g){var p=(0,hi.useRef)(null),G=(0,hi.useCallback)(function(Qa){if(null!==Qa&&Qa.offsetParent){var Za=Qa.getBoundingClientRect();Qa=Za.width;if(g){var fb=g.getBoundingClientRect();Za=Za.top-fb.top;fb=fb.height-Math.max(0,Za);Za+=g.scrollTop}else fb=window.innerHeight-Math.max(0,
|
|||
|
Za.top),Za=Za.top+window.pageYOffset;p.current={offsetTop:Za,visibleHeight:fb,visibleWidth:Qa};b(p.current)}},[b,g]),Y=Fj(G),la=Y.callbackRef,pa=Y.ref,Ga=(0,hi.useCallback)(function(){G(pa.current)},[G,pa]);return(0,hi.useEffect)(function(){if(g){g.addEventListener("scroll",Ga);var Qa=new ResizeObserver(Ga);return Qa.observe(g),function(){g.removeEventListener("scroll",Ga);Qa.unobserve(g)}}return window.addEventListener("scroll",Ga),window.addEventListener("resize",Ga),function(){window.removeEventListener("scroll",
|
|||
|
Ga);window.removeEventListener("resize",Ga)}},[Ga,g]),la}function $g(b){return b}function ym(b,g){var p=Uf();return dg(p,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+g,"color: red;","color: inherit;","color: blue;")}),$d(p,b),p}function bi(b,g){if("string"!=typeof b)return{context:g}}function Wn(b){var g=b.usePublisher,p=b.useEmitter,G=b.useEmitterValue;return gh.memo(function(Y){var la=Y.style,pa=Y.children;Y=yi(Y,tI);var Ga=g("scrollContainerState"),Qa=
|
|||
|
G("ScrollerComponent"),Za=g("smoothScrollTargetReached"),fb=G("scrollerRef"),mb=G("context");Ga=Hm(Ga,Za,Qa,fb);Za=Ga.scrollerRef;fb=Ga.scrollByCallback;return p("scrollTo",Ga.scrollToCallback),p("scrollBy",fb),(0,hi.createElement)(Qa,mg({ref:Za,style:mg({},AI,la),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},Y,bi(Qa,mb)),pa)})}function en(b){var g=b.usePublisher,p=b.useEmitter,G=b.useEmitterValue;return gh.memo(function(Y){var la=Y.style,pa=Y.children;Y=yi(Y,uI);var Ga=
|
|||
|
g("windowScrollContainerState"),Qa=G("ScrollerComponent"),Za=g("smoothScrollTargetReached"),fb=G("totalListHeight"),mb=G("deviation"),Lb=G("customScrollParent"),Tb=G("context");Za=Hm(Ga,Za,Qa,Ei,Lb);var Pb=Za.scrollerRef;Ga=Za.scrollByCallback;Za=Za.scrollToCallback;return cI(function(){return Pb.current=Lb||window,function(){Pb.current=null}},[Pb,Lb]),p("windowScrollTo",Za),p("scrollBy",Ga),(0,hi.createElement)(Qa,mg({style:mg({position:"relative"},la,0!==fb?{height:fb+mb}:{}),"data-virtuoso-scroller":!0},
|
|||
|
Y,bi(Qa,Tb)),pa)})}function Xn(b,g,p){return Array.from({length:g-b+1}).map(function(G,Y){return{index:Y+b,data:null==p?void 0:p[Y+b]}})}function Ao(b,g){return b&&b.column===g.column&&b.row===g.row}function sm(b,g,p,G){var Y=p.height;return void 0===Y||0===G.length?{top:0,bottom:0}:{top:Tm(b,g,p,G[0].index),bottom:Tm(b,g,p,G[G.length-1].index)+Y}}function Tm(b,g,p,G){var Y=g.column;b=fs(1,Lu((b.width+Y)/(p.width+Y)));G=Lu(G/b);p=G*p.height+fs(0,G-1)*g.row;return 0<p?p+g.row:p}function al(b,g,p){return"normal"===
|
|||
|
g||null!=g&&g.endsWith("px")||p(b+" was not resolved to pixel value correctly",g,Em.WARN),"normal"===g?0:parseInt(null!=g?g:"0",10)}function uk(b,g){uk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,G){p.__proto__=G;return p};return uk(b,g)}function un(b,g){b.prototype=Object.create(g.prototype);b.prototype.constructor=b;uk(b,g)}function xn(b){xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)};return xn(b)}function wn(){if("undefined"===
|
|||
|
typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(b){return!1}}function Do(b,g,p){Do=wn()?Reflect.construct.bind():function(G,Y,la){var pa=[null];pa.push.apply(pa,Y);G=new (Function.bind.apply(G,pa));la&&uk(G,la.prototype);return G};return Do.apply(null,arguments)}function Zn(b){var g="function"===typeof Map?new Map:void 0;Zn=function(p){function G(){return Do(p,
|
|||
|
arguments,xn(this).constructor)}if(null===p||-1===Function.toString.call(p).indexOf("[native code]"))return p;if("function"!==typeof p)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof g){if(g.has(p))return g.get(p);g.set(p,G)}G.prototype=Object.create(p.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}});return uk(G,p)};return Zn(b)}function $o(b,g,p){return Math.round(255*b)+","+Math.round(255*g)+","+Math.round(255*p)}function Qk(b,
|
|||
|
g,p,G){void 0===G&&(G=$o);if(0===g)return G(p,p,p);b=(b%360+360)%360/60;var Y=(1-Math.abs(2*p-1))*g,la=Y*(1-Math.abs(b%2-1)),pa=g=0,Ga=0;0<=b&&1>b?(g=Y,pa=la):1<=b&&2>b?(g=la,pa=Y):2<=b&&3>b?(pa=Y,Ga=la):3<=b&&4>b?(pa=la,Ga=Y):4<=b&&5>b?(g=la,Ga=Y):5<=b&&6>b&&(g=Y,Ga=la);p-=Y/2;return G(g+p,pa+p,Ga+p)}function wp(b){if("string"!==typeof b)throw new np(3);if("string"===typeof b){var g=b.toLowerCase();b=rB[g]?"#"+rB[g]:b}if(b.match(eJ))return{red:parseInt(""+b[1]+b[2],16),green:parseInt(""+b[3]+b[4],
|
|||
|
16),blue:parseInt(""+b[5]+b[6],16)};if(b.match(fJ))return g=parseFloat((parseInt(""+b[7]+b[8],16)/255).toFixed(2)),{red:parseInt(""+b[1]+b[2],16),green:parseInt(""+b[3]+b[4],16),blue:parseInt(""+b[5]+b[6],16),alpha:g};if(b.match(gJ))return{red:parseInt(""+b[1]+b[1],16),green:parseInt(""+b[2]+b[2],16),blue:parseInt(""+b[3]+b[3],16)};if(b.match(hJ))return g=parseFloat((parseInt(""+b[4]+b[4],16)/255).toFixed(2)),{red:parseInt(""+b[1]+b[1],16),green:parseInt(""+b[2]+b[2],16),blue:parseInt(""+b[3]+b[3],
|
|||
|
16),alpha:g};if(g=Ow.exec(b))return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};if(g=iJ.exec(b.substring(0,50)))return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10),alpha:1<parseFloat(""+g[4])?parseFloat(""+g[4])/100:parseFloat(""+g[4])};var p=jJ.exec(b);if(p){g=parseInt(""+p[1],10);var G=parseInt(""+p[2],10)/100;p=parseInt(""+p[3],10)/100;g="rgb("+Qk(g,G,p)+")";G=Ow.exec(g);if(!G)throw new np(4,b,g);return{red:parseInt(""+G[1],10),
|
|||
|
green:parseInt(""+G[2],10),blue:parseInt(""+G[3],10)}}if(g=kJ.exec(b.substring(0,50))){G=parseInt(""+g[1],10);p=parseInt(""+g[2],10)/100;var Y=parseInt(""+g[3],10)/100;G="rgb("+Qk(G,p,Y)+")";p=Ow.exec(G);if(!p)throw new np(4,b,G);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10),alpha:1<parseFloat(""+g[4])?parseFloat(""+g[4])/100:parseFloat(""+g[4])}}throw new np(5);}function Lm(b){b=b.toString(16);return 1===b.length?"0"+b:b}function fn(b,g,p){return Pw("#"+Lm(Math.round(255*
|
|||
|
b))+Lm(Math.round(255*g))+Lm(Math.round(255*p)))}function Yn(b,g,p){if("number"===typeof b&&"number"===typeof g&&"number"===typeof p)return Pw("#"+Lm(b)+Lm(g)+Lm(p));if("object"===typeof b&&void 0===g&&void 0===p)return Pw("#"+Lm(b.red)+Lm(b.green)+Lm(b.blue));throw new np(6);}function In(b){if("object"!==typeof b)throw new np(8);if("number"===typeof b.red&&"number"===typeof b.green&&"number"===typeof b.blue&&"number"===typeof b.alpha){if("object"===typeof b)b=1<=b.alpha?Yn(b.red,b.green,b.blue):
|
|||
|
"rgba("+b.red+","+b.green+","+b.blue+","+b.alpha+")";else throw new np(7);return b}if("number"===typeof b.red&&"number"===typeof b.green&&"number"===typeof b.blue&&("number"!==typeof b.alpha||"undefined"===typeof b.alpha))return Yn(b);if("number"===typeof b.hue&&"number"===typeof b.saturation&&"number"===typeof b.lightness&&"number"===typeof b.alpha){if("object"===typeof b)b=1<=b.alpha?Qk(b.hue,b.saturation,b.lightness,fn):"rgba("+Qk(b.hue,b.saturation,b.lightness)+","+b.alpha+")";else throw new np(2);
|
|||
|
return b}if("number"===typeof b.hue&&"number"===typeof b.saturation&&"number"===typeof b.lightness&&("number"!==typeof b.alpha||"undefined"===typeof b.alpha)){if("object"===typeof b)b=Qk(b.hue,b.saturation,b.lightness,fn);else throw new np(1);return b}throw new np(8);}function Bo(b,g,p){return function(){var G=p.concat(Array.prototype.slice.call(arguments));return G.length>=g?b.apply(this,G):Bo(b,g,G)}}function Co(b,g){if("transparent"===g)return g;g=wp(g);var p=g.red/255,G=g.green/255,Y=g.blue/255,
|
|||
|
la=Math.max(p,G,Y),pa=Math.min(p,G,Y),Ga=(la+pa)/2;if(la===pa)g=void 0!==g.alpha?{hue:0,saturation:0,lightness:Ga,alpha:g.alpha}:{hue:0,saturation:0,lightness:Ga};else{var Qa=la-pa;pa=.5<Ga?Qa/(2-la-pa):Qa/(la+pa);switch(la){case p:p=(G-Y)/Qa+(G<Y?6:0);break;case G:p=(Y-p)/Qa+2;break;default:p=(p-G)/Qa+4}p*=60;g=void 0!==g.alpha?{hue:p,saturation:pa,lightness:Ga,alpha:g.alpha}:{hue:p,saturation:pa,lightness:Ga}}Ga=df;b=g.lightness-parseFloat(b);return In(Ga({},g,{lightness:Math.max(0,Math.min(1,b))}))}
|
|||
|
function cm(b,g){var p;void 0!==g.strokeWidth&&(g.strokeWidth=Math.max(g.strokeWidth,1));void 0!==g.opacity&&(g.opacity=Math.min(1,Math.max(g.opacity,0)));let G=null!=(p=g.fill)?p:b.props.fill;void 0===G||jg(G)||"var(--ls-secondary-background-color)"===G||g.noFill||!KJ.includes(b.props.type)||(b=lJ(.3,G),g.stroke=b);return g}function no({strokeWidth:b,size:g,mode:p}){return"svg"===p?(0,tb.jsx)("rect",{className:"tl-binding-indicator",x:b,y:b,rx:2,ry:2,width:Math.max(0,g[0]-2*b),height:Math.max(0,
|
|||
|
g[1]-2*b),strokeWidth:4*b}):(0,tb.jsx)("div",{className:"tl-binding-indicator",style:{position:"absolute",left:0,top:0,right:0,bottom:0,boxShadow:"0 0 0 4px var(--tl-binding)",borderRadius:4}})}function Vl(){const b=Ye();return"panning"===b.inputs.state||"pinching"===b.inputs.state}function Um({left:b,middle:g,right:p,stroke:G,strokeWidth:Y}){return(0,tb.jsxs)("g",{children:[(0,tb.jsx)("path",{className:"tl-stroke-hitarea",d:`M ${b} L ${g} ${p}`}),(0,tb.jsx)("path",{d:`M ${b} L ${g} ${p}`,fill:"none",
|
|||
|
stroke:G,strokeWidth:Y,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"})]})}function $n(b,g,p){g=K(b,g,b,p).points;if(!g)return console.warn("Could not find an intersection for the arrow head."),{left:b,right:b};g=(p=g[0])?ke.rotWith(p,b,Math.PI/6):b;b=p?ke.rotWith(p,b,-Math.PI/6):b;return{left:g,right:b}}function Eo(b,g,p){const {left:G,right:Y}=$n(b,g,p);return`M ${G} L ${b} ${Y}`}function Lo(b,g,p,G,Y){b=b.strokeWidth;var la=ke.dist(g,p);b=Math.min(la/3,16*b);la=[];la.push(`M ${g} L ${p}`);
|
|||
|
G&&la.push(Eo(g,p,b));Y&&la.push(Eo(p,g,b));return la.join(" ")}function Dl({id:b,bounds:g,labelSize:p,offset:G,scale:Y=1}){return(0,tb.jsx)("defs",{children:(0,tb.jsxs)("mask",{id:b+"_clip",children:[(0,tb.jsx)("rect",{x:-100,y:-100,width:g.width+200,height:g.height+200,fill:"white"}),(0,tb.jsx)("rect",{x:g.width/2-p[0]/2*Y+((null==G?void 0:G[0])||0),y:g.height/2-p[1]/2*Y+((null==G?void 0:G[1])||0),width:p[0]*Y,height:p[1]*Y,rx:4*Y,ry:4*Y,fill:"black"})]})})}function Jo(b,g,p,G=Y=>Y){return b*G(.5-
|
|||
|
g*(.5-p))}function Fo(b){return[-b[0],-b[1]]}function zl(b,g){return[b[0]+g[0],b[1]+g[1]]}function vk(b,g){return[b[0]-g[0],b[1]-g[1]]}function Al(b,g){return[b[0]*g,b[1]*g]}function dm(b){return[b[1],-b[0]]}function Rp(b,g){return b[0]===g[0]&&b[1]===g[1]}function Go(b){return b[0]*b[0]+b[1]*b[1]}function Ho(b){var g=Math.hypot(b[0],b[1]);return[b[0]/g,b[1]/g]}function La(b,g){return Math.hypot(b[1]-g[1],b[0]-g[0])}function Ya(b,g,p){let G=Math.sin(p);p=Math.cos(p);let Y=b[0]-g[0];b=b[1]-g[1];return[Y*
|
|||
|
p-b*G+g[0],Y*G+b*p+g[1]]}function Ka(b,g,p){return zl(b,Al(vk(g,b),p))}function hb(b,g,p){return zl(b,Al(g,p))}function Jb(b,g={}){let {size:p=16,smoothing:G=.5,thinning:Y=.5,simulatePressure:la=!0,easing:pa=sd=>sd,start:Ga={},end:Qa={},last:Za=!1}=g,{cap:fb=!0,easing:mb=sd=>sd*(2-sd)}=Ga,{cap:Lb=!0,easing:Tb=sd=>--sd*sd*sd+1}=Qa;if(0===b.length||0>=p)return[];var Pb=b[b.length-1].runningLength;let lc=!1===Ga.taper?0:!0===Ga.taper?Math.max(p,Pb):Ga.taper,xc=!1===Qa.taper?0:!0===Qa.taper?Math.max(p,
|
|||
|
Pb):Qa.taper;var $b=Math.pow(p*G,2);g=[];let sc=[];var oc=b.slice(0,10).reduce((sd,ud)=>{var ie=ud.pressure;la&&(ud=js(1,ud.distance/p),ie=js(1,1-ud),ie=js(1,sd+.275*(ie-sd)*ud));return(sd+ie)/2},b[0].pressure),Mc=Jo(p,Y,b[b.length-1].pressure,pa),Tc;let vd=b[0].vector;var de=b[0].point;let ne=de;var De=de;let $e=ne;var mf=!1;for(var Te=0;Te<b.length;Te++){var {pressure:rf}=b[Te];let {point:sd,vector:ud,distance:ie,runningLength:jf}=b[Te];if(Te<b.length-1&&3>Pb-jf)continue;Y?(la&&(Mc=js(1,ie/p),rf=
|
|||
|
js(1,1-Mc),rf=js(1,oc+.275*(rf-oc)*Mc)),Mc=Jo(p,Y,rf,pa)):Mc=p/2;void 0===Tc&&(Tc=Mc);var Vd=jf<lc?mb(jf/lc):1,rd=Pb-jf<xc?Tb((Pb-jf)/xc):1;Mc=Math.max(.01,Mc*Math.min(Vd,rd));rd=(Te<b.length-1?b[Te+1]:b[Te]).vector;let tf=Te<b.length-1?ud[0]*rd[0]+ud[1]*rd[1]:1;Vd=null!==tf&&0>tf;if(0>ud[0]*vd[0]+ud[1]*vd[1]&&!mf||Vd){de=Al(dm(vd),Mc);for(let gg=1/13,Bf=0;1>=Bf;Bf+=gg)De=Ya(vk(sd,de),sd,rt*Bf),g.push(De),$e=Ya(zl(sd,de),sd,rt*-Bf),sc.push($e);de=De;ne=$e;Vd&&(mf=!0)}else(mf=!1,Te===b.length-1)?(rf=
|
|||
|
Al(dm(ud),Mc),g.push(vk(sd,rf)),sc.push(zl(sd,rf))):(oc=Al(dm(Ka(rd,ud,tf)),Mc),De=vk(sd,oc),(1>=Te||Go(vk(de,De))>$b)&&(g.push(De),de=De),$e=zl(sd,oc),(1>=Te||Go(vk(ne,$e))>$b)&&(sc.push($e),ne=$e),oc=rf,vd=ud)}Pb=b[0].point.slice(0,2);$b=1<b.length?b[b.length-1].point.slice(0,2):zl(b[0].point,[1,1]);De=[];mf=[];if(1===b.length){if(!lc&&!xc||Za){b=hb(Pb,Ho(dm(vk(Pb,$b))),-(Tc||Mc));g=[];for(let sd=1/13,ud=sd;1>=ud;ud+=sd)g.push(Ya(b,Pb,2*rt*ud));return g}}else{if(!(lc||xc&&1===b.length))if(fb)for(let sd=
|
|||
|
1/13,ud=sd;1>=ud;ud+=sd)Tc=Ya(sc[0],Pb,rt*ud),De.push(Tc);else Te=vk(g[0],sc[0]),Tc=Al(Te,.5),Te=Al(Te,.51),De.push(vk(Pb,Tc),vk(Pb,Te),zl(Pb,Te),zl(Pb,Tc));Tc=dm(Fo(b[b.length-1].vector));if(xc||lc&&1===b.length)mf.push($b);else if(Lb){b=hb($b,Tc,Mc);for(let sd=1/29,ud=sd;1>ud;ud+=sd)mf.push(Ya(b,$b,3*rt*ud))}else mf.push(zl($b,Al(Tc,Mc)),zl($b,Al(Tc,.99*Mc)),vk($b,Al(Tc,.99*Mc)),vk($b,Al(Tc,Mc)))}return g.concat(mf,sc.reverse(),De)}function tc(b,g={}){var p;let {streamline:G=.5,size:Y=16,last:la=
|
|||
|
!1}=g;if(0===b.length)return[];g=.15+.85*(1-G);b=Array.isArray(b[0])?b:b.map(({x:mb,y:Lb,pressure:Tb=.5})=>[mb,Lb,Tb]);if(2===b.length){var pa=b[1];b=b.slice(0,-1);for(var Ga=1;5>Ga;Ga++)b.push(Ka(b[0],pa,Ga/4))}1===b.length&&(b=[...b,[...zl(b[0],[1,1]),...b[0].slice(2)]]);pa=[{point:[b[0][0],b[0][1]],pressure:0<=b[0][2]?b[0][2]:.25,vector:[1,1],distance:0,runningLength:0}];Ga=!1;let Qa=0,Za=pa[0],fb=b.length-1;for(let mb=1;mb<b.length;mb++){let Lb=la&&mb===fb?b[mb].slice(0,2):Ka(Za.point,b[mb],g);
|
|||
|
if(Rp(Za.point,Lb))continue;let Tb=La(Lb,Za.point);if(Qa+=Tb,mb<fb&&!Ga){if(Qa<Y)continue;Ga=!0}Za={point:Lb,pressure:0<=b[mb][2]?b[mb][2]:.5,vector:Ho(vk(Za.point,Lb)),distance:Tb,runningLength:Qa};pa.push(Za)}return pa[0].vector=(null==(p=pa[1])?void 0:p.vector)||[0,0],pa}function Zc(b,g=4/3){return(new ax(b)).exportAsSVG(g)}function Nd(b,g=4/3){return(new ax(b)).generatePreviewJsx(void 0,g)}function je({id:b,type:g,onRemove:p,showContent:G}){const Y=Ye(),{handlers:la}=ZH.default.useContext(an);
|
|||
|
return(0,tb.jsxs)("div",{className:"tl-shape-links-panel-item color-level relative",children:[(0,tb.jsx)("div",{className:"whitespace-pre break-all overflow-hidden text-ellipsis inline-flex",children:(0,tb.jsx)(dB,{id:b,showReferenceContent:G})}),(0,tb.jsx)("div",{className:"flex-1"}),la.getBlockPageName(b)!==Y.currentPage.name&&(0,tb.jsx)(ka,{tooltip:"Open Page",type:"button",onClick:()=>null==la?void 0:la.redirectToPage(b),children:(0,tb.jsx)(Bh,{name:"open-as-page"})}),(0,tb.jsx)(ka,{tooltip:"Open Page in Right Sidebar",
|
|||
|
type:"button",onClick:()=>null==la?void 0:la.sidebarAddBlock(b,"B"===g?"block":"page"),children:(0,tb.jsx)(Bh,{name:"move-to-sidebar-right"})}),p&&(0,tb.jsx)(ka,{className:"tl-shape-links-panel-item-remove-button",tooltip:"Remove link",type:"button",onClick:p,children:(0,tb.jsx)(Bh,{name:"x",className:"!translate-y-0"})})]})}function Ee({options:b,value:g,onValueChange:p}){return(0,tb.jsx)(VB,{className:"tl-toggle-group-input",type:"single",value:g,onValueChange:p,children:b.map(G=>(0,tb.jsx)(dc,
|
|||
|
{content:G.tooltip,children:(0,tb.jsx)("div",{className:"inline-block",children:(0,tb.jsx)(WB,{className:"tl-toggle-group-input-button",value:G.value,disabled:G.value===g,children:(0,tb.jsx)(Bh,{name:G.icon})})})},G.value))})}function fa({options:b,value:g,onValueChange:p}){return(0,tb.jsx)(VB,{className:"tl-toggle-group-input",type:"multiple",value:g,onValueChange:p,children:b.map(G=>(0,tb.jsx)(WB,{className:"tl-toggle-group-input-button",value:G.value,children:(0,tb.jsx)(Bh,{name:G.icon})},G.value))})}
|
|||
|
function va(b){var {toggle:g=!0,pressed:p,onPressedChange:G,className:Y,tooltip:la}=b;b=zf(b,["toggle","pressed","onPressedChange","className","tooltip"]);return(0,tb.jsx)(dc,{content:la,children:(0,tb.jsx)("div",{className:"inline-block",children:(0,tb.jsx)(CJ,hf(pe({},b),{"data-toggle":g,className:"tl-toggle-input"+(Y?" "+Y:""),pressed:p,onPressedChange:G}))})})}function Wa(b){return Ye().selectedShapesArray.filter(g=>!g.props.isLocked).filter(g=>{var p;return null==(p=bx[g.props.type])?void 0:
|
|||
|
p.includes(b)})}function xb(b){return g=>"mouse"!==g.pointerType?b(g):void 0}function bc(b){b=b.match(/\.[0-9a-z]+$/i);if(!b)return"unknown";b=b[0].toLowerCase();return hK.includes(b)?"image":iK.includes(b)?"video":"unknown"}function wc(...b){return(...g)=>Zh(this,null,function*(){for(const p of b){const G=yield p(...g);if(G&&0<G.length)return G}return null})}function Wc(b,g){return Zh(this,null,function*(){return b.types.includes(g)?b instanceof DataTransfer?b.getData(g):yield(yield b.getType(g)).text():
|
|||
|
null})}function md(){const {handlers:b}=aC.useContext(an);return aC.useCallback((g,p)=>Zh(this,null,function*(){if(p.shiftKey&&1===g.selectedShapesArray.length){var G=yield navigator.clipboard.read();let Y;0<G.length&&(G=(yield(yield G[0].getType("text/plain")).text()).trim())&&(/^\(\(.*\)\)$/.test(G)&&40===G.length?(G=G.slice(2,-2),dk(G)&&(Y=G)):/^\[\[.*\]\]$/.test(G)&&(Y=G.slice(2,-2)));if(Y){g.selectedShapesArray[0].update({refs:[Y]});g.persist();return}}jK(g,p,b)}),[])}function Ad(){const b=md();
|
|||
|
return gK.useCallback((g,p)=>Zh(this,[g,p],function*(G,{dataTransfer:Y,point:la}){b(G,{point:la,shiftKey:!1,dataTransfer:Y,fromDrop:!0})}),[])}function Ud(){const {handlers:b}=bC.useContext(an);return bC.useCallback((g,{text:p,html:G})=>{b.copyToClipboard(p,G)},[])}function Ae(){return kK.default.useCallback(b=>Zh(this,null,function*(){setTimeout(()=>{b.transition("logseq-portal").selectedTool.transition("creating")},100)}),[])}var Xe=Object.create,qf=Object.defineProperty,Fg=Object.defineProperties,
|
|||
|
Hg=Object.getOwnPropertyDescriptor,wi=Object.getOwnPropertyDescriptors,Bk=Object.getOwnPropertyNames,Zj=Object.getOwnPropertySymbols,Uh=Object.getPrototypeOf,Ij=Object.prototype.hasOwnProperty,vl=Object.prototype.propertyIsEnumerable,yn=(b,g,p)=>g in b?qf(b,g,{enumerable:!0,configurable:!0,writable:!0,value:p}):b[g]=p,pe=(b,g)=>{for(var p in g||={})Ij.call(g,p)&&yn(b,p,g[p]);if(Zj)for(p of Zj(g))vl.call(g,p)&&yn(b,p,g[p]);return b},hf=(b,g)=>Fg(b,wi(g)),zf=(b,g)=>{var p={},G;for(G in b)Ij.call(b,
|
|||
|
G)&&0>g.indexOf(G)&&(p[G]=b[G]);if(null!=b&&Zj)for(G of Zj(b))0>g.indexOf(G)&&vl.call(b,G)&&(p[G]=b[G]);return p},oh=(b,g)=>function(){return g||(0,b[Bk(b)[0]])((g={exports:{}}).exports,g),g.exports},Im=(b,g,p,G)=>{if(g&&"object"===typeof g||"function"===typeof g)for(let Y of Bk(g))Ij.call(b,Y)||Y===p||qf(b,Y,{get:()=>g[Y],enumerable:!(G=Hg(g,Y))||G.enumerable});return b},sf=(b,g,p)=>(p=null!=b?Xe(Uh(b)):{},Im(!g&&b&&b.__esModule?p:qf(p,"default",{value:b,enumerable:!0}),b)),ce=(b,g,p,G)=>{for(var Y=
|
|||
|
1<G?void 0:G?Hg(g,p):g,la=b.length-1,pa;0<=la;la--)if(pa=b[la])Y=(G?pa(g,p,Y):pa(Y))||Y;G&&Y&&qf(g,p,Y);return Y},ib=(b,g,p)=>{yn(b,"symbol"!==typeof g?g+"":g,p);return p},Zh=(b,g,p)=>new Promise((G,Y)=>{var la=Qa=>{try{Ga(p.next(Qa))}catch(Za){Y(Za)}},pa=Qa=>{try{Ga(p.throw(Qa))}catch(Za){Y(Za)}},Ga=Qa=>Qa.done?G(Qa.value):Promise.resolve(Qa.value).then(la,pa);Ga((p=p.apply(b,g)).next())}),vm=oh({["../../node_modules/rbush/rbush.min.js"](b,g){!function(p,G){"object"==typeof b&&"undefined"!=typeof g?
|
|||
|
g.exports=G():"function"==typeof define&&define.amd?define(G):(p=p||self).RBush=G()}(b,function(){function p($b,sc,oc,Mc,Tc){!function Te(de,ne,De,$e,mf){for(;$e>De;){if(600<$e-De){var rf=$e-De+1,Vd=ne-De+1,rd=Math.log(rf),sd=.5*Math.exp(2*rd/3);rd=.5*Math.sqrt(rd*sd*(rf-sd)/rf)*(0>Vd-rf/2?-1:1);Te(de,ne,Math.max(De,Math.floor(ne-Vd*sd/rf+rd)),Math.min($e,Math.floor(ne+(rf-Vd)*sd/rf+rd)),mf)}rf=de[ne];Vd=De;sd=$e;G(de,De,ne);for(0<mf(de[$e],rf)&&G(de,De,$e);Vd<sd;){G(de,Vd,sd);Vd++;for(sd--;0>mf(de[Vd],
|
|||
|
rf);)Vd++;for(;0<mf(de[sd],rf);)sd--}0===mf(de[De],rf)?G(de,De,sd):G(de,++sd,$e);sd<=ne&&(De=sd+1);ne<=sd&&($e=sd-1)}}($b,sc,oc||0,Mc||$b.length-1,Tc||Y)}function G($b,sc,oc){var Mc=$b[sc];$b[sc]=$b[oc];$b[oc]=Mc}function Y($b,sc){return $b<sc?-1:$b>sc?1:0}function la($b,sc){pa($b,0,$b.children.length,sc,$b)}function pa($b,sc,oc,Mc,Tc){Tc||=Pb(null);Tc.minX=1/0;Tc.minY=1/0;Tc.maxX=-1/0;for(Tc.maxY=-1/0;sc<oc;sc++){var vd=$b.children[sc];Ga(Tc,$b.leaf?Mc(vd):vd)}return Tc}function Ga($b,sc){return $b.minX=
|
|||
|
Math.min($b.minX,sc.minX),$b.minY=Math.min($b.minY,sc.minY),$b.maxX=Math.max($b.maxX,sc.maxX),$b.maxY=Math.max($b.maxY,sc.maxY),$b}function Qa($b,sc){return $b.minX-sc.minX}function Za($b,sc){return $b.minY-sc.minY}function fb($b){return($b.maxX-$b.minX)*($b.maxY-$b.minY)}function mb($b){return $b.maxX-$b.minX+($b.maxY-$b.minY)}function Lb($b,sc){return $b.minX<=sc.minX&&$b.minY<=sc.minY&&sc.maxX<=$b.maxX&&sc.maxY<=$b.maxY}function Tb($b,sc){return sc.minX<=$b.maxX&&sc.minY<=$b.maxY&&sc.maxX>=$b.minX&&
|
|||
|
sc.maxY>=$b.minY}function Pb($b){return{children:$b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function lc($b,sc,oc,Mc,Tc){for(var vd=[sc,oc];vd.length;)if(!((oc=vd.pop())-(sc=vd.pop())<=Mc)){var de=sc+Math.ceil((oc-sc)/Mc/2)*Mc;p($b,de,sc,oc,Tc);vd.push(sc,de,de,oc)}}var xc=function($b){void 0===$b&&($b=9);this._maxEntries=Math.max(4,$b);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));this.clear()};return xc.prototype.all=function(){return this._all(this.data,[])},xc.prototype.search=
|
|||
|
function($b){var sc=this.data,oc=[];if(!Tb($b,sc))return oc;for(var Mc=this.toBBox,Tc=[];sc;){for(var vd=0;vd<sc.children.length;vd++){var de=sc.children[vd],ne=sc.leaf?Mc(de):de;Tb($b,ne)&&(sc.leaf?oc.push(de):Lb($b,ne)?this._all(de,oc):Tc.push(de))}sc=Tc.pop()}return oc},xc.prototype.collides=function($b){var sc=this.data;if(!Tb($b,sc))return!1;for(var oc=[];sc;){for(var Mc=0;Mc<sc.children.length;Mc++){var Tc=sc.children[Mc],vd=sc.leaf?this.toBBox(Tc):Tc;if(Tb($b,vd)){if(sc.leaf||Lb($b,vd))return!0;
|
|||
|
oc.push(Tc)}}sc=oc.pop()}return!1},xc.prototype.load=function($b){if(!$b||!$b.length)return this;if($b.length<this._minEntries){for(var sc=0;sc<$b.length;sc++)this.insert($b[sc]);return this}$b=this._build($b.slice(),0,$b.length-1,0);this.data.children.length?this.data.height===$b.height?this._splitRoot(this.data,$b):(this.data.height<$b.height&&(sc=this.data,this.data=$b,$b=sc),this._insert($b,this.data.height-$b.height-1,!0)):this.data=$b;return this},xc.prototype.insert=function($b){return $b&&
|
|||
|
this._insert($b,this.data.height-1),this},xc.prototype.clear=function(){return this.data=Pb([]),this},xc.prototype.remove=function($b,sc){if(!$b)return this;for(var oc,Mc,Tc,vd=this.data,de=this.toBBox($b),ne=[],De=[];vd||ne.length;){if(vd||(vd=ne.pop(),Mc=ne[ne.length-1],oc=De.pop(),Tc=!0),vd.leaf){a:{var $e=$b;var mf=vd.children,Te=sc;if(Te){for(var rf=0;rf<mf.length;rf++)if(Te($e,mf[rf])){$e=rf;break a}$e=-1}else $e=mf.indexOf($e)}if(-1!==$e)return vd.children.splice($e,1),ne.push(vd),this._condense(ne),
|
|||
|
this}Tc||vd.leaf||!Lb(vd,de)?Mc?(oc++,vd=Mc.children[oc],Tc=!1):vd=null:(ne.push(vd),De.push(oc),oc=0,Mc=vd,vd=vd.children[0])}return this},xc.prototype.toBBox=function($b){return $b},xc.prototype.compareMinX=function($b,sc){return $b.minX-sc.minX},xc.prototype.compareMinY=function($b,sc){return $b.minY-sc.minY},xc.prototype.toJSON=function(){return this.data},xc.prototype.fromJSON=function($b){return this.data=$b,this},xc.prototype._all=function($b,sc){for(var oc=[];$b;)$b.leaf?sc.push.apply(sc,
|
|||
|
$b.children):oc.push.apply(oc,$b.children),$b=oc.pop();return sc},xc.prototype._build=function($b,sc,oc,Mc){var Tc,vd=oc-sc+1,de=this._maxEntries;if(vd<=de)return la(Tc=Pb($b.slice(sc,oc+1)),this.toBBox),Tc;Mc||(Mc=Math.ceil(Math.log(vd)/Math.log(de)),de=Math.ceil(vd/Math.pow(de,Mc-1)));(Tc=Pb([])).leaf=!1;Tc.height=Mc;vd=Math.ceil(vd/de);de=vd*Math.ceil(Math.sqrt(de));for(lc($b,sc,oc,de,this.compareMinX);sc<=oc;sc+=de){var ne=Math.min(sc+de-1,oc);lc($b,sc,ne,vd,this.compareMinY);for(var De=sc;De<=
|
|||
|
ne;De+=vd)Tc.children.push(this._build($b,De,Math.min(De+vd-1,ne),Mc-1))}return la(Tc,this.toBBox),Tc},xc.prototype._chooseSubtree=function($b,sc,oc,Mc){for(;Mc.push(sc),!sc.leaf&&Mc.length-1!==oc;){for(var Tc=1/0,vd=1/0,de=void 0,ne=0;ne<sc.children.length;ne++){var De=sc.children[ne],$e=fb(De),mf=(Te=$b,rf=De,(Math.max(rf.maxX,Te.maxX)-Math.min(rf.minX,Te.minX))*(Math.max(rf.maxY,Te.maxY)-Math.min(rf.minY,Te.minY))-$e);mf<vd?(vd=mf,Tc=$e<Tc?$e:Tc,de=De):mf===vd&&$e<Tc&&(Tc=$e,de=De)}sc=de||sc.children[0]}var Te,
|
|||
|
rf;return sc},xc.prototype._insert=function($b,sc,oc){oc=oc?$b:this.toBBox($b);var Mc=[],Tc=this._chooseSubtree(oc,this.data,sc,Mc);Tc.children.push($b);for(Ga(Tc,oc);0<=sc&&Mc[sc].children.length>this._maxEntries;)this._split(Mc,sc),sc--;this._adjustParentBBoxes(oc,Mc,sc)},xc.prototype._split=function($b,sc){var oc=$b[sc],Mc=oc.children.length,Tc=this._minEntries;this._chooseSplitAxis(oc,Tc,Mc);Mc=this._chooseSplitIndex(oc,Tc,Mc);Mc=Pb(oc.children.splice(Mc,oc.children.length-Mc));Mc.height=oc.height;
|
|||
|
Mc.leaf=oc.leaf;la(oc,this.toBBox);la(Mc,this.toBBox);sc?$b[sc-1].children.push(Mc):this._splitRoot(oc,Mc)},xc.prototype._splitRoot=function($b,sc){this.data=Pb([$b,sc]);this.data.height=$b.height+1;this.data.leaf=!1;la(this.data,this.toBBox)},xc.prototype._chooseSplitIndex=function($b,sc,oc){for(var Mc,Tc,vd,de,ne,De,$e,mf=1/0,Te=1/0,rf=sc;rf<=oc-sc;rf++){var Vd=pa($b,0,rf,this.toBBox),rd=pa($b,rf,oc,this.toBBox),sd=(Tc=Vd,vd=rd,de=void 0,ne=void 0,De=void 0,$e=void 0,de=Math.max(Tc.minX,vd.minX),
|
|||
|
ne=Math.max(Tc.minY,vd.minY),De=Math.min(Tc.maxX,vd.maxX),$e=Math.min(Tc.maxY,vd.maxY),Math.max(0,De-de)*Math.max(0,$e-ne));Vd=fb(Vd)+fb(rd);sd<mf?(mf=sd,Mc=rf,Te=Vd<Te?Vd:Te):sd===mf&&Vd<Te&&(Te=Vd,Mc=rf)}return Mc||oc-sc},xc.prototype._chooseSplitAxis=function($b,sc,oc){var Mc=$b.leaf?this.compareMinX:Qa,Tc=$b.leaf?this.compareMinY:Za;this._allDistMargin($b,sc,oc,Mc)<this._allDistMargin($b,sc,oc,Tc)&&$b.children.sort(Mc)},xc.prototype._allDistMargin=function($b,sc,oc,Mc){$b.children.sort(Mc);Mc=
|
|||
|
this.toBBox;for(var Tc=pa($b,0,sc,Mc),vd=pa($b,oc-sc,oc,Mc),de=mb(Tc)+mb(vd),ne=sc;ne<oc-sc;ne++){var De=$b.children[ne];Ga(Tc,$b.leaf?Mc(De):De);de+=mb(Tc)}for(oc=oc-sc-1;oc>=sc;oc--)Tc=$b.children[oc],Ga(vd,$b.leaf?Mc(Tc):Tc),de+=mb(vd);return de},xc.prototype._adjustParentBBoxes=function($b,sc,oc){for(;0<=oc;oc--)Ga(sc[oc],$b)},xc.prototype._condense=function($b){for(var sc=$b.length-1,oc=void 0;0<=sc;sc--)0===$b[sc].children.length?0<sc?(oc=$b[sc-1].children).splice(oc.indexOf($b[sc]),1):this.clear():
|
|||
|
la($b[sc],this.toBBox)},xc})}}),yr=oh({["../../node_modules/fast-deep-equal/index.js"](b,g){g.exports=function la(G,Y){if(G===Y)return!0;if(G&&Y&&"object"==typeof G&&"object"==typeof Y){if(G.constructor!==Y.constructor)return!1;var pa;if(Array.isArray(G)){var Ga=G.length;if(Ga!=Y.length)return!1;for(pa=Ga;0!==pa--;)if(!la(G[pa],Y[pa]))return!1;return!0}if(G.constructor===RegExp)return G.source===Y.source&&G.flags===Y.flags;if(G.valueOf!==Object.prototype.valueOf)return G.valueOf()===Y.valueOf();if(G.toString!==
|
|||
|
Object.prototype.toString)return G.toString()===Y.toString();var Qa=Object.keys(G);Ga=Qa.length;if(Ga!==Object.keys(Y).length)return!1;for(pa=Ga;0!==pa--;)if(!Object.prototype.hasOwnProperty.call(Y,Qa[pa]))return!1;for(pa=Ga;0!==pa--;)if(Ga=Qa[pa],!la(G[Ga],Y[Ga]))return!1;return!0}return G!==G&&Y!==Y}}}),Tp=oh({["../../../node_modules/deepmerge/dist/cjs.js"](b,g){function p(mb,Lb){return!1!==Lb.clone&&Lb.isMergeableObject(mb)?Qa(Array.isArray(mb)?[]:{},mb,Lb):mb}function G(mb,Lb,Tb){return mb.concat(Lb).map(function(Pb){return p(Pb,
|
|||
|
Tb)})}function Y(mb){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(mb).filter(function(Lb){return mb.propertyIsEnumerable(Lb)}):[]}function la(mb){return Object.keys(mb).concat(Y(mb))}function pa(mb,Lb){try{return Lb in mb}catch(Tb){return!1}}function Ga(mb,Lb,Tb){var Pb={};Tb.isMergeableObject(mb)&&la(mb).forEach(function(lc){Pb[lc]=p(mb[lc],Tb)});la(Lb).forEach(function(lc){if(!pa(mb,lc)||Object.hasOwnProperty.call(mb,lc)&&Object.propertyIsEnumerable.call(mb,lc))if(pa(mb,lc)&&
|
|||
|
Tb.isMergeableObject(Lb[lc])){if(Tb.customMerge){var xc=Tb.customMerge(lc);xc="function"===typeof xc?xc:Qa}else xc=Qa;Pb[lc]=xc(mb[lc],Lb[lc],Tb)}else Pb[lc]=p(Lb[lc],Tb)});return Pb}function Qa(mb,Lb,Tb){Tb=Tb||{};Tb.arrayMerge=Tb.arrayMerge||G;Tb.isMergeableObject=Tb.isMergeableObject||Za;Tb.cloneUnlessOtherwiseSpecified=p;var Pb=Array.isArray(Lb),lc=Array.isArray(mb);return Pb!==lc?p(Lb,Tb):Pb?Tb.arrayMerge(mb,Lb,Tb):Ga(mb,Lb,Tb)}var Za=function(mb){var Lb;if(Lb=!!mb&&"object"===typeof mb)Lb=Object.prototype.toString.call(mb),
|
|||
|
Lb=!("[object RegExp]"===Lb||"[object Date]"===Lb||mb.$$typeof===fb);return Lb},fb="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;Qa.all=function(mb,Lb){if(!Array.isArray(mb))throw Error("first argument should be an array");return mb.reduce(function(Tb,Pb){return Qa(Tb,Pb,Lb)},{})};g.exports=Qa}}),Lq=oh({["../../node_modules/tslib/tslib.js"](b,g){var p,G,Y,la,pa,Ga,Qa,Za,fb,mb,Lb,Tb,Pb,lc,xc,$b,sc,oc,Mc,Tc,vd,de,ne,De,$e;(function(mf){function Te(Vd,rd){Vd!==rf&&("function"===
|
|||
|
typeof Object.create?Object.defineProperty(Vd,"__esModule",{value:!0}):Vd.__esModule=!0);return function(sd,ud){return Vd[sd]=rd?rd(sd,ud):ud}}var rf="object"===typeof wa?wa:"object"===typeof self?self:"object"===typeof this?this:{};"function"===typeof define&&define.amd?define("tslib",["exports"],function(Vd){mf(Te(rf,Te(Vd)))}):"object"===typeof g&&"object"===typeof g.exports?mf(Te(rf,Te(g.exports))):mf(Te(rf))})(function(mf){var Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Vd,
|
|||
|
rd){Vd.__proto__=rd}||function(Vd,rd){for(var sd in rd)Object.prototype.hasOwnProperty.call(rd,sd)&&(Vd[sd]=rd[sd])};p=function(Vd,rd){function sd(){this.constructor=Vd}if("function"!==typeof rd&&null!==rd)throw new TypeError("Class extends value "+String(rd)+" is not a constructor or null");Te(Vd,rd);Vd.prototype=null===rd?Object.create(rd):(sd.prototype=rd.prototype,new sd)};G=Object.assign||function(Vd){for(var rd,sd=1,ud=arguments.length;sd<ud;sd++){rd=arguments[sd];for(var ie in rd)Object.prototype.hasOwnProperty.call(rd,
|
|||
|
ie)&&(Vd[ie]=rd[ie])}return Vd};Y=function(Vd,rd){var sd={},ud;for(ud in Vd)Object.prototype.hasOwnProperty.call(Vd,ud)&&0>rd.indexOf(ud)&&(sd[ud]=Vd[ud]);if(null!=Vd&&"function"===typeof Object.getOwnPropertySymbols){var ie=0;for(ud=Object.getOwnPropertySymbols(Vd);ie<ud.length;ie++)0>rd.indexOf(ud[ie])&&Object.prototype.propertyIsEnumerable.call(Vd,ud[ie])&&(sd[ud[ie]]=Vd[ud[ie]])}return sd};la=function(Vd,rd,sd,ud){var ie=arguments.length,jf=3>ie?rd:null===ud?ud=Object.getOwnPropertyDescriptor(rd,
|
|||
|
sd):ud,tf;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)jf=Reflect.decorate(Vd,rd,sd,ud);else for(var gg=Vd.length-1;0<=gg;gg--)if(tf=Vd[gg])jf=(3>ie?tf(jf):3<ie?tf(rd,sd,jf):tf(rd,sd))||jf;return 3<ie&&jf&&Object.defineProperty(rd,sd,jf),jf};pa=function(Vd,rd){return function(sd,ud){rd(sd,ud,Vd)}};Ga=function(Vd,rd){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(Vd,rd)};Qa=function(Vd,rd,sd,ud){function ie(jf){return jf instanceof sd?
|
|||
|
jf:new sd(function(tf){tf(jf)})}return new (sd||=Promise)(function(jf,tf){function gg(hh){try{Sf(ud.next(hh))}catch(Ff){tf(Ff)}}function Bf(hh){try{Sf(ud["throw"](hh))}catch(Ff){tf(Ff)}}function Sf(hh){hh.done?jf(hh.value):ie(hh.value).then(gg,Bf)}Sf((ud=ud.apply(Vd,rd||[])).next())})};Za=function(Vd,rd){function sd(Sf){return function(hh){return ud([Sf,hh])}}function ud(Sf){if(jf)throw new TypeError("Generator is already executing.");for(;ie;)try{if(jf=1,tf&&(gg=Sf[0]&2?tf["return"]:Sf[0]?tf["throw"]||
|
|||
|
((gg=tf["return"])&&gg.call(tf),0):tf.next)&&!(gg=gg.call(tf,Sf[1])).done)return gg;if(tf=0,gg)Sf=[Sf[0]&2,gg.value];switch(Sf[0]){case 0:case 1:gg=Sf;break;case 4:return ie.label++,{value:Sf[1],done:!1};case 5:ie.label++;tf=Sf[1];Sf=[0];continue;case 7:Sf=ie.ops.pop();ie.trys.pop();continue;default:if(!(gg=ie.trys,gg=0<gg.length&&gg[gg.length-1])&&(6===Sf[0]||2===Sf[0])){ie=0;continue}if(3===Sf[0]&&(!gg||Sf[1]>gg[0]&&Sf[1]<gg[3]))ie.label=Sf[1];else if(6===Sf[0]&&ie.label<gg[1])ie.label=gg[1],gg=
|
|||
|
Sf;else if(gg&&ie.label<gg[2])ie.label=gg[2],ie.ops.push(Sf);else{gg[2]&&ie.ops.pop();ie.trys.pop();continue}}Sf=rd.call(Vd,ie)}catch(hh){Sf=[6,hh],tf=0}finally{jf=gg=0}if(Sf[0]&5)throw Sf[1];return{value:Sf[0]?Sf[1]:void 0,done:!0}}var ie={label:0,sent:function(){if(gg[0]&1)throw gg[1];return gg[1]},trys:[],ops:[]},jf,tf,gg,Bf;return Bf={next:sd(0),"throw":sd(1),"return":sd(2)},"function"===typeof Symbol&&(Bf[Symbol.iterator]=function(){return this}),Bf};fb=function(Vd,rd){for(var sd in Vd)"default"===
|
|||
|
sd||Object.prototype.hasOwnProperty.call(rd,sd)||$e(rd,Vd,sd)};$e=Object.create?function(Vd,rd,sd,ud){void 0===ud&&(ud=sd);var ie=Object.getOwnPropertyDescriptor(rd,sd);if(!ie||("get"in ie?!rd.__esModule:ie.writable||ie.configurable))ie={enumerable:!0,get:function(){return rd[sd]}};Object.defineProperty(Vd,ud,ie)}:function(Vd,rd,sd,ud){void 0===ud&&(ud=sd);Vd[ud]=rd[sd]};mb=function(Vd){var rd="function"===typeof Symbol&&Symbol.iterator,sd=rd&&Vd[rd],ud=0;if(sd)return sd.call(Vd);if(Vd&&"number"===
|
|||
|
typeof Vd.length)return{next:function(){Vd&&ud>=Vd.length&&(Vd=void 0);return{value:Vd&&Vd[ud++],done:!Vd}}};throw new TypeError(rd?"Object is not iterable.":"Symbol.iterator is not defined.");};Lb=function(Vd,rd){var sd="function"===typeof Symbol&&Vd[Symbol.iterator];if(!sd)return Vd;Vd=sd.call(Vd);var ud,ie=[];try{for(;(void 0===rd||0<rd--)&&!(ud=Vd.next()).done;)ie.push(ud.value)}catch(tf){var jf={error:tf}}finally{try{ud&&!ud.done&&(sd=Vd["return"])&&sd.call(Vd)}finally{if(jf)throw jf.error;}}return ie};
|
|||
|
Tb=function(){for(var Vd=[],rd=0;rd<arguments.length;rd++)Vd=Vd.concat(Lb(arguments[rd]));return Vd};Pb=function(){for(var Vd=0,rd=0,sd=arguments.length;rd<sd;rd++)Vd+=arguments[rd].length;Vd=Array(Vd);var ud=0;for(rd=0;rd<sd;rd++)for(var ie=arguments[rd],jf=0,tf=ie.length;jf<tf;jf++,ud++)Vd[ud]=ie[jf];return Vd};lc=function(Vd,rd,sd){if(sd||2===arguments.length)for(var ud=0,ie=rd.length,jf;ud<ie;ud++)!jf&&ud in rd||(jf||=Array.prototype.slice.call(rd,0,ud),jf[ud]=rd[ud]);return Vd.concat(jf||Array.prototype.slice.call(rd))};
|
|||
|
xc=function(Vd){return this instanceof xc?(this.v=Vd,this):new xc(Vd)};$b=function(Vd,rd,sd){function ud(Ff){Bf[Ff]&&(Sf[Ff]=function(jh){return new Promise(function(sh,oj){1<hh.push([Ff,jh,sh,oj])||ie(Ff,jh)})})}function ie(Ff,jh){try{var sh=Bf[Ff](jh);sh.value instanceof xc?Promise.resolve(sh.value.v).then(jf,tf):gg(hh[0][2],sh)}catch(oj){gg(hh[0][3],oj)}}function jf(Ff){ie("next",Ff)}function tf(Ff){ie("throw",Ff)}function gg(Ff,jh){(Ff(jh),hh.shift(),hh.length)&&ie(hh[0][0],hh[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");
|
|||
|
var Bf=sd.apply(Vd,rd||[]),Sf,hh=[];return Sf={},ud("next"),ud("throw"),ud("return"),Sf[Symbol.asyncIterator]=function(){return this},Sf};sc=function(Vd){function rd(ie,jf){sd[ie]=Vd[ie]?function(tf){return(ud=!ud)?{value:xc(Vd[ie](tf)),done:"return"===ie}:jf?jf(tf):tf}:jf}var sd,ud;return sd={},rd("next"),rd("throw",function(ie){throw ie;}),rd("return"),sd[Symbol.iterator]=function(){return this},sd};oc=function(Vd){function rd(jf){ie[jf]=Vd[jf]&&function(tf){return new Promise(function(gg,Bf){tf=
|
|||
|
Vd[jf](tf);sd(gg,Bf,tf.done,tf.value)})}}function sd(jf,tf,gg,Bf){Promise.resolve(Bf).then(function(Sf){jf({value:Sf,done:gg})},tf)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var ud=Vd[Symbol.asyncIterator],ie;return ud?ud.call(Vd):(Vd="function"===typeof mb?mb(Vd):Vd[Symbol.iterator](),ie={},rd("next"),rd("throw"),rd("return"),ie[Symbol.asyncIterator]=function(){return this},ie)};Mc=function(Vd,rd){Object.defineProperty?Object.defineProperty(Vd,"raw",{value:rd}):
|
|||
|
Vd.raw=rd;return Vd};var rf=Object.create?function(Vd,rd){Object.defineProperty(Vd,"default",{enumerable:!0,value:rd})}:function(Vd,rd){Vd["default"]=rd};Tc=function(Vd){if(Vd&&Vd.__esModule)return Vd;var rd={};if(null!=Vd)for(var sd in Vd)"default"!==sd&&Object.prototype.hasOwnProperty.call(Vd,sd)&&$e(rd,Vd,sd);rf(rd,Vd);return rd};vd=function(Vd){return Vd&&Vd.__esModule?Vd:{"default":Vd}};de=function(Vd,rd,sd,ud){if("a"===sd&&!ud)throw new TypeError("Private accessor was defined without a getter");
|
|||
|
if("function"===typeof rd?Vd!==rd||!ud:!rd.has(Vd))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===sd?ud:"a"===sd?ud.call(Vd):ud?ud.value:rd.get(Vd)};ne=function(Vd,rd,sd,ud,ie){if("m"===ud)throw new TypeError("Private method is not writable");if("a"===ud&&!ie)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof rd?Vd!==rd||!ie:!rd.has(Vd))throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|||
|
return"a"===ud?ie.call(Vd,sd):ie?ie.value=sd:rd.set(Vd,sd),sd};De=function(Vd,rd){if(null===rd||"object"!==typeof rd&&"function"!==typeof rd)throw new TypeError("Cannot use 'in' operator on non-object");return"function"===typeof Vd?rd===Vd:Vd.has(rd)};mf("__extends",p);mf("__assign",G);mf("__rest",Y);mf("__decorate",la);mf("__param",pa);mf("__metadata",Ga);mf("__awaiter",Qa);mf("__generator",Za);mf("__exportStar",fb);mf("__createBinding",$e);mf("__values",mb);mf("__read",Lb);mf("__spread",Tb);mf("__spreadArrays",
|
|||
|
Pb);mf("__spreadArray",lc);mf("__await",xc);mf("__asyncGenerator",$b);mf("__asyncDelegator",sc);mf("__asyncValues",oc);mf("__makeTemplateObject",Mc);mf("__importStar",Tc);mf("__importDefault",vd);mf("__classPrivateFieldGet",de);mf("__classPrivateFieldSet",ne);mf("__classPrivateFieldIn",De)})}}),tp={};((b,g)=>{for(var p in g)qf(b,p,{get:g[p],enumerable:!0})})(tp,{App:()=>pK,PreviewManager:()=>ax,generateJSXFromModel:()=>Nd,generateSVGFromModel:()=>Zc});Ta.exports=(b=>Im(qf({},"__esModule",{value:!0}),
|
|||
|
b))(tp);var Mq=(b=>{b.Yellow="yellow";b.Red="red";b.Pink="pink";b.Green="green";b.Blue="blue";b.Purple="purple";b.Gray="gray";b.Default="";return b})(Mq||{}),Up=(b=>{b.Box="box";b.Ellipse="ellipse";b.Polygon="polygon";return b})(Up||{}),Sp,Ls=new Uint8Array(16),wg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,El=[];for(let b=0;256>b;++b)El.push((b+256).toString(16).slice(1));var xr,Jn,oo=0,up=0,Gk=function(b,g,p){p=g&&p||0;const G=
|
|||
|
g||Array(16);b=b||{};let Y=b.node||xr;var la=void 0!==b.clockseq?b.clockseq:Jn;if(null==Y||null==la){var pa=b.random||(b.rng||q)();null==Y&&(Y=xr=[pa[0]|1,pa[1],pa[2],pa[3],pa[4],pa[5]]);null==la&&(la=Jn=(pa[6]<<8|pa[7])&16383)}pa=void 0!==b.msecs?b.msecs:Date.now();let Ga=void 0!==b.nsecs?b.nsecs:up+1;const Qa=pa-oo+(Ga-up)/1E4;0>Qa&&void 0===b.clockseq&&(la=la+1&16383);(0>Qa||pa>oo)&&void 0===b.nsecs&&(Ga=0);if(1E4<=Ga)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");oo=pa;up=Ga;Jn=
|
|||
|
la;pa+=122192928E5;b=(1E4*(pa&268435455)+Ga)%4294967296;G[p++]=b>>>24&255;G[p++]=b>>>16&255;G[p++]=b>>>8&255;G[p++]=b&255;b=pa/4294967296*1E4&268435455;G[p++]=b>>>8&255;G[p++]=b&255;G[p++]=b>>>24&15|16;G[p++]=b>>>16&255;G[p++]=la>>>8|128;G[p++]=la&255;for(la=0;6>la;++la)G[p+la]=Y[la];return g||R(G)},kh=class{static clamp(b,g,p){return Math.max(g,"undefined"!==typeof p?Math.min(b,p):b)}static clampV(b,g,p){return b.map(G=>p?kh.clamp(G,g,p):kh.clamp(G,g))}static cross(b,g,p){return(g[0]-b[0])*(p[1]-
|
|||
|
b[1])-(p[0]-b[0])*(g[1]-b[1])}static snap(b,g=1){return[Math.round(b[0]/g)*g,Math.round(b[1]/g)*g]}},Id=kh;Id.neg=b=>[-b[0],-b[1]];Id.add=(b,g)=>[b[0]+g[0],b[1]+g[1]];Id.addScalar=(b,g)=>[b[0]+g,b[1]+g];Id.sub=(b,g)=>[b[0]-g[0],b[1]-g[1]];Id.subScalar=(b,g)=>[b[0]-g,b[1]-g];Id.vec=(b,g)=>[g[0]-b[0],g[1]-b[1]];Id.mul=(b,g)=>[b[0]*g,b[1]*g];Id.mulV=(b,g)=>[b[0]*g[0],b[1]*g[1]];Id.div=(b,g)=>[b[0]/g,b[1]/g];Id.divV=(b,g)=>[b[0]/g[0],b[1]/g[1]];Id.per=b=>[b[1],-b[0]];Id.dpr=(b,g)=>b[0]*g[0]+b[1]*g[1];
|
|||
|
Id.cpr=(b,g)=>b[0]*g[1]-g[0]*b[1];Id.len2=b=>b[0]*b[0]+b[1]*b[1];Id.len=b=>Math.hypot(b[0],b[1]);Id.pry=(b,g)=>kh.dpr(b,g)/kh.len(g);Id.uni=b=>kh.div(b,kh.len(b));Id.normalize=b=>kh.uni(b);Id.tangent=(b,g)=>kh.uni(kh.sub(b,g));Id.dist2=(b,g)=>kh.len2(kh.sub(b,g));Id.dist=(b,g)=>Math.hypot(b[1]-g[1],b[0]-g[0]);Id.fastDist=(b,g)=>{b=[g[0]-b[0],g[1]-b[1]];g=[Math.abs(b[0]),Math.abs(b[1])];let p=1/Math.max(g[0],g[1]);p*=1.29289-(g[0]+g[1])*p*.29289;return[b[0]*p,b[1]*p]};Id.ang=(b,g)=>Math.atan2(kh.cpr(b,
|
|||
|
g),kh.dpr(b,g));Id.angle=(b,g)=>Math.atan2(g[1]-b[1],g[0]-b[0]);Id.med=(b,g)=>kh.mul(kh.add(b,g),.5);Id.rot=(b,g=0)=>[b[0]*Math.cos(g)-b[1]*Math.sin(g),b[0]*Math.sin(g)+b[1]*Math.cos(g)];Id.rotWith=(b,g,p=0)=>{if(0===p)return b;const G=Math.sin(p);p=Math.cos(p);const Y=b[0]-g[0];b=b[1]-g[1];return[Y*p-b*G+g[0],Y*G+b*p+g[1]]};Id.isEqual=(b,g)=>b[0]===g[0]&&b[1]===g[1];Id.lrp=(b,g,p)=>kh.add(b,kh.mul(kh.sub(g,b),p));Id.int=(b,g,p,G,Y=1)=>{p=(kh.clamp(p,G)-p)/(G-p);return kh.add(kh.mul(b,1-p),kh.mul(g,
|
|||
|
Y))};Id.ang3=(b,g,p)=>{b=kh.vec(g,b);g=kh.vec(g,p);return kh.ang(b,g)};Id.abs=b=>[Math.abs(b[0]),Math.abs(b[1])];Id.rescale=(b,g)=>{const p=kh.len(b);return[g*b[0]/p,g*b[1]/p]};Id.isLeft=(b,g,p)=>(g[0]-b[0])*(p[1]-b[1])-(p[0]-b[0])*(g[1]-b[1]);Id.clockwise=(b,g,p)=>0<kh.isLeft(b,g,p);Id.toFixed=b=>b.map(g=>Math.round(100*g)/100);Id.nearestPointOnLineThroughPoint=(b,g,p)=>kh.add(b,kh.mul(g,kh.pry(kh.sub(p,b),g)));Id.distanceToLineThroughPoint=(b,g,p)=>kh.dist(p,kh.nearestPointOnLineThroughPoint(b,
|
|||
|
g,p));Id.nearestPointOnLineSegment=(b,g,p,G=!0)=>{const Y=kh.uni(kh.sub(g,b));p=kh.add(b,kh.mul(Y,kh.pry(kh.sub(p,b),Y)));if(G){if(p[0]<Math.min(b[0],g[0]))return b[0]<g[0]?b:g;if(p[0]>Math.max(b[0],g[0]))return b[0]>g[0]?b:g;if(p[1]<Math.min(b[1],g[1]))return b[1]<g[1]?b:g;if(p[1]>Math.max(b[1],g[1]))return b[1]>g[1]?b:g}return p};Id.distanceToLineSegment=(b,g,p,G=!0)=>kh.dist(p,kh.nearestPointOnLineSegment(b,g,p,G));Id.nudge=(b,g,p)=>kh.isEqual(b,g)?b:kh.add(b,kh.mul(kh.uni(kh.sub(g,b)),p));Id.nudgeAtAngle=
|
|||
|
(b,g,p)=>[Math.cos(g)*p+b[0],Math.sin(g)*p+b[1]];Id.toPrecision=(b,g=4)=>[+b[0].toPrecision(g),+b[1].toPrecision(g)];Id.pointsBetween=(b,g,p=6)=>Array.from(Array(p)).map((G,Y)=>{G=Y/(p-1);Y=Math.min(1,.5+Math.abs(.5-G));return[...kh.lrp(b,g,G),Y]});Id.slope=(b,g)=>b[0]===g[0]?NaN:(b[1]-g[1])/(b[0]-g[0]);Id.toAngle=b=>{b=Math.atan2(b[1],b[0]);return 0>b?b+2*Math.PI:b};Id.max=(...b)=>[Math.max(...b.map(g=>g[0])),Math.max(...b.map(g=>g[1]))];Id.min=(...b)=>[Math.min(...b.map(g=>g[0])),Math.min(...b.map(g=>
|
|||
|
g[1]))];var ke=Id,vf=class{static getRectangleSides(b,g,p=0){const G=[b[0]+g[0]/2,b[1]+g[1]/2],Y=Id.rotWith(b,G,p),la=Id.rotWith(Id.add(b,[g[0],0]),G,p),pa=Id.rotWith(Id.add(b,g),G,p);b=Id.rotWith(Id.add(b,[0,g[1]]),G,p);return[["top",[Y,la]],["right",[la,pa]],["bottom",[pa,b]],["left",[b,Y]]]}static getBoundsSides(b){return vf.getRectangleSides([b.minX,b.minY],[b.width,b.height])}static expandBounds(b,g){return{minX:b.minX-g,minY:b.minY-g,maxX:b.maxX+g,maxY:b.maxY+g,width:b.width+2*g,height:b.height+
|
|||
|
2*g}}static boundsCollide(b,g){return!(b.maxX<g.minX||b.minX>g.maxX||b.maxY<g.minY||b.minY>g.maxY)}static boundsContain(b,g){return Array.isArray(g)?b.minX<g[0]&&b.minY<g[1]&&b.maxY>g[1]&&b.maxX>g[0]:b.minX<g.minX&&b.minY<g.minY&&b.maxY>g.maxY&&b.maxX>g.maxX}static boundsContained(b,g){return vf.boundsContain(g,b)}static boundsAreEqual(b,g){return!(g.maxX!==b.maxX||g.minX!==b.minX||g.maxY!==b.maxY||g.minY!==b.minY)}static getBoundsFromPoints(b,g=0){let p=Infinity,G=Infinity,Y=-Infinity,la=-Infinity;
|
|||
|
if(2>b.length)G=p=0,la=Y=1;else for(const pa of b)p=Math.min(pa[0],p),G=Math.min(pa[1],G),Y=Math.max(pa[0],Y),la=Math.max(pa[1],la);return 0!==g?vf.getBoundsFromPoints(b.map(pa=>Id.rotWith(pa,[(p+Y)/2,(G+la)/2],g))):{minX:p,minY:G,maxX:Y,maxY:la,width:Math.max(1,Y-p),height:Math.max(1,la-G)}}static centerBounds(b,g){const p=vf.getBoundsCenter(b);return vf.translateBounds(b,[g[0]-p[0],g[1]-p[1]])}static snapBoundsToGrid(b,g){const p=Math.round(b.minX/g)*g,G=Math.round(b.minY/g)*g,Y=Math.round(b.maxX/
|
|||
|
g)*g;b=Math.round(b.maxY/g)*g;return{minX:p,minY:G,maxX:Y,maxY:b,width:Math.max(1,Y-p),height:Math.max(1,b-G)}}static translateBounds(b,g){return{minX:b.minX+g[0],minY:b.minY+g[1],maxX:b.maxX+g[0],maxY:b.maxY+g[1],width:b.width,height:b.height}}static multiplyBounds(b,g){const p=vf.getBoundsCenter(b);return vf.centerBounds({minX:b.minX*g,minY:b.minY*g,maxX:b.maxX*g,maxY:b.maxY*g,width:b.width*g,height:b.height*g},[p[0]*g,p[1]*g])}static divideBounds(b,g){const p=vf.getBoundsCenter(b);return vf.centerBounds({minX:b.minX/
|
|||
|
g,minY:b.minY/g,maxX:b.maxX/g,maxY:b.maxY/g,width:b.width/g,height:b.height/g},[p[0]/g,p[1]/g])}static getRotatedBounds(b,g=0){b=vf.getRotatedCorners(b,g);let p=g=Infinity,G=-Infinity,Y=-Infinity;for(const la of b)g=Math.min(la[0],g),p=Math.min(la[1],p),G=Math.max(la[0],G),Y=Math.max(la[1],Y);return{minX:g,minY:p,maxX:G,maxY:Y,width:Math.max(1,G-g),height:Math.max(1,Y-p),rotation:0}}static getRotatedEllipseBounds(b,g,p,G,Y=0){var la=Math.cos(Y);const pa=Math.sin(Y);Y=Math.hypot(p*la,G*pa);la=Math.hypot(p*
|
|||
|
pa,G*la);return{minX:b+p-Y,minY:g+G-la,maxX:b+p+Y,maxY:g+G+la,width:2*Y,height:2*la}}static getExpandedBounds(b,g){const p=Math.min(b.minX,g.minX),G=Math.min(b.minY,g.minY),Y=Math.max(b.maxX,g.maxX);b=Math.max(b.maxY,g.maxY);return{minX:p,minY:G,maxX:Y,maxY:b,width:Math.abs(Y-p),height:Math.abs(b-G)}}static getCommonBounds(b){if(2>b.length)return b[0];let g=b[0];for(let p=1;p<b.length;p++)g=vf.getExpandedBounds(g,b[p]);return g}static getRotatedCorners(b,g=0){const p=[b.minX+b.width/2,b.minY+b.height/
|
|||
|
2];b=[[b.minX,b.minY],[b.maxX,b.minY],[b.maxX,b.maxY],[b.minX,b.maxY]];return g?b.map(G=>Id.rotWith(G,p,g)):b}static getTransformedBoundingBox(b,g,p,G=0,Y=!1){const [la,pa]=[b.minX,b.minY],[Ga,Qa]=[b.maxX,b.maxY];let [Za,fb]=[b.minX,b.minY],[mb,Lb]=[b.maxX,b.maxY];if("center"===g)return{minX:Za+p[0],minY:fb+p[1],maxX:mb+p[0],maxY:Lb+p[1],width:mb-Za,height:Lb-fb,scaleX:1,scaleY:1};const [Tb,Pb]=Id.rot(p,-G);switch(g){case "top_edge":case "top_left_corner":case "top_right_corner":fb+=Pb;break;case "bottom_edge":case "bottom_left_corner":case "bottom_right_corner":Lb+=
|
|||
|
Pb}switch(g){case "left_edge":case "top_left_corner":case "bottom_left_corner":Za+=Tb;break;case "right_edge":case "top_right_corner":case "bottom_right_corner":mb+=Tb}var lc=Ga-la;const xc=Qa-pa;var $b=(mb-Za)/lc,sc=(Lb-fb)/xc;b=0>$b;p=0>sc;var oc=Math.abs(mb-Za),Mc=Math.abs(Lb-fb);if(Y)switch(Y=lc/xc,lc=Y<oc/Mc,sc=1/Y*(0>sc?1:-1)*oc,$b=Mc*(0>$b?1:-1)*Y,g){case "top_left_corner":lc?fb=Lb+sc:Za=mb+$b;break;case "top_right_corner":lc?fb=Lb+sc:mb=Za-$b;break;case "bottom_right_corner":lc?Lb=fb-sc:mb=
|
|||
|
Za-$b;break;case "bottom_left_corner":lc?Lb=fb-sc:Za=mb+$b;break;case "bottom_edge":case "top_edge":oc=(Za+mb)/2;Mc*=Y;Za=oc-Mc/2;mb=oc+Mc/2;break;case "left_edge":case "right_edge":Mc=(fb+Lb)/2,oc/=Y,fb=Mc-oc/2,Lb=Mc+oc/2}if(0!==G%(2*Math.PI)){oc=[0,0];Mc=Id.med([la,pa],[Ga,Qa]);$b=Id.med([Za,fb],[mb,Lb]);switch(g){case "top_left_corner":oc=Id.sub(Id.rotWith([mb,Lb],$b,G),Id.rotWith([Ga,Qa],Mc,G));break;case "top_right_corner":oc=Id.sub(Id.rotWith([Za,Lb],$b,G),Id.rotWith([la,Qa],Mc,G));break;case "bottom_right_corner":oc=
|
|||
|
Id.sub(Id.rotWith([Za,fb],$b,G),Id.rotWith([la,pa],Mc,G));break;case "bottom_left_corner":oc=Id.sub(Id.rotWith([mb,fb],$b,G),Id.rotWith([Ga,pa],Mc,G));break;case "top_edge":oc=Id.sub(Id.rotWith(Id.med([Za,Lb],[mb,Lb]),$b,G),Id.rotWith(Id.med([la,Qa],[Ga,Qa]),Mc,G));break;case "left_edge":oc=Id.sub(Id.rotWith(Id.med([mb,fb],[mb,Lb]),$b,G),Id.rotWith(Id.med([Ga,pa],[Ga,Qa]),Mc,G));break;case "bottom_edge":oc=Id.sub(Id.rotWith(Id.med([Za,fb],[mb,fb]),$b,G),Id.rotWith(Id.med([la,pa],[Ga,pa]),Mc,G));break;
|
|||
|
case "right_edge":oc=Id.sub(Id.rotWith(Id.med([Za,fb],[Za,Lb]),$b,G),Id.rotWith(Id.med([la,pa],[la,Qa]),Mc,G))}[Za,fb]=Id.sub([Za,fb],oc);[mb,Lb]=Id.sub([mb,Lb],oc)}mb<Za&&([mb,Za]=[Za,mb]);Lb<fb&&([Lb,fb]=[fb,Lb]);return{minX:Za,minY:fb,maxX:mb,maxY:Lb,width:mb-Za,height:Lb-fb,scaleX:(mb-Za)/(Ga-la||1)*(b?-1:1),scaleY:(Lb-fb)/(Qa-pa||1)*(p?-1:1)}}static getTransformAnchor(b,g,p){let G=b;switch(b){case "top_left_corner":G=g&&p?"bottom_right_corner":g?"top_right_corner":p?"bottom_left_corner":"bottom_right_corner";
|
|||
|
break;case "top_right_corner":G=g&&p?"bottom_left_corner":g?"top_left_corner":p?"bottom_right_corner":"bottom_left_corner";break;case "bottom_right_corner":G=g&&p?"top_left_corner":g?"bottom_left_corner":p?"top_right_corner":"top_left_corner";break;case "bottom_left_corner":G=g&&p?"top_right_corner":g?"bottom_right_corner":p?"top_left_corner":"top_right_corner"}return G}static getRelativeTransformedBoundingBox(b,g,p,G,Y){G=b.minX+(G?g.maxX-p.maxX:p.minX-g.minX)/g.width*b.width;Y=b.minY+(Y?g.maxY-
|
|||
|
p.maxY:p.minY-g.minY)/g.height*b.height;const la=p.width/g.width*b.width;b=p.height/g.height*b.height;return{minX:G,minY:Y,maxX:G+la,maxY:Y+b,width:la,height:b}}static getRotatedSize(b,g){const p=Id.div(b,2);b=[[0,0],[b[0],0],b,[0,b[1]]].map(G=>Id.rotWith(G,p,g));b=vf.getBoundsFromPoints(b);return[b.width,b.height]}static getBoundsCenter(b){return[b.minX+b.width/2,b.minY+b.height/2]}static getBoundsWithCenter(b){const g=vf.getBoundsCenter(b);return hf(pe({},b),{midX:g[0],midY:g[1]})}static getCommonTopLeft(b){const g=
|
|||
|
[Infinity,Infinity];b.forEach(p=>{g[0]=Math.min(g[0],p[0]);g[1]=Math.min(g[1],p[1])});return g}static getTLSnapPoints(b,g,p){const G=pe({},b);b=[0,0];const Y=[],la={minX:{id:"minX",isSnapped:!1},midX:{id:"midX",isSnapped:!1},maxX:{id:"maxX",isSnapped:!1},minY:{id:"minY",isSnapped:!1},midY:{id:"midY",isSnapped:!1},maxY:{id:"maxY",isSnapped:!1}},pa=["midX","minX","maxX"],Ga=["midY","minY","maxY"];g=g.map(Lb=>{const Tb=pa.flatMap((lc,xc)=>pa.map(($b,sc)=>{const oc=G[lc]-Lb[$b];return{f:lc,t:$b,gap:oc,
|
|||
|
distance:Math.abs(oc),isCareful:0===xc||3===xc+sc}})),Pb=Ga.flatMap((lc,xc)=>Ga.map(($b,sc)=>{const oc=G[lc]-Lb[$b];return{f:lc,t:$b,gap:oc,distance:Math.abs(oc),isCareful:0===xc||3===xc+sc}}));return[Lb,Tb,Pb]});let Qa=Infinity,Za=Infinity,fb=Infinity,mb=Infinity;g.forEach(([,Lb,Tb])=>{Lb.forEach(Pb=>{Pb.distance<p&&Pb.distance<fb&&(fb=Pb.distance,Qa=Pb.gap)});Tb.forEach(Pb=>{Pb.distance<p&&Pb.distance<mb&&(mb=Pb.distance,Za=Pb.gap)})});g.forEach(([Lb,Tb,Pb])=>{Infinity!==Qa&&Tb.forEach(lc=>{2>Math.abs(lc.gap-
|
|||
|
Qa)&&(la[lc.f]=hf(pe({},la[lc.f]),{isSnapped:!0,to:Lb[lc.t],B:Lb,distance:lc.distance}))});Infinity!==Za&&Pb.forEach(lc=>{2>Math.abs(lc.gap-Za)&&(la[lc.f]=hf(pe({},la[lc.f]),{isSnapped:!0,to:Lb[lc.t],B:Lb,distance:lc.distance}))})});b[0]=Infinity===Qa?0:Qa;b[1]=Infinity===Za?0:Za;G.minX-=b[0];G.midX-=b[0];G.maxX-=b[0];G.minY-=b[1];G.midY-=b[1];G.maxY-=b[1];pa.forEach(Lb=>{Lb=la[Lb];if(Lb.isSnapped){var {id:Tb,B:Pb}=Lb;Lb=G[Tb];Y.push("minX"===Tb?[[Lb,G.midY],[Lb,Pb.minY],[Lb,Pb.maxY]]:[[Lb,G.minY],
|
|||
|
[Lb,G.maxY],[Lb,Pb.minY],[Lb,Pb.maxY]])}});Ga.forEach(Lb=>{Lb=la[Lb];if(Lb.isSnapped){var {id:Tb,B:Pb}=Lb;Lb=G[Tb];Y.push("midY"===Tb?[[G.midX,Lb],[Pb.minX,Lb],[Pb.maxX,Lb]]:[[G.minX,Lb],[G.maxX,Lb],[Pb.minX,Lb],[Pb.maxX,Lb]])}});return{offset:b,snapLines:Y}}static ensureRatio(b,g){const {width:p,height:G}=b,Y=pe({},b);p/G<g?(Y.width=G*g,Y.maxX+=p-b.width):(Y.height=p/g,Y.maxY+=G-b.height);return Y}static getDistributions(b,g){var p=b.map(la=>{const pa=la.getBounds();return{id:la.id,point:[pa.minX,
|
|||
|
pa.minY],bounds:pa,center:la.getCenter()}});b=p.length;var G=vf.getCommonBounds(p.map(({bounds:la})=>la));const Y=[];switch(g){case "horizontal":g=p.reduce((la,pa)=>la+pa.bounds.width,0);if(g>G.width){const la=p.sort((Za,fb)=>Za.bounds.minX-fb.bounds.minX)[0],pa=p.sort((Za,fb)=>fb.bounds.maxX-Za.bounds.maxX)[0];G=p.filter(Za=>Za!==la&&Za!==pa).sort((Za,fb)=>Za.center[0]-fb.center[0]);const Ga=(pa.center[0]-la.center[0])/(b-1),Qa=la.center[0]+Ga;G.forEach(({id:Za,point:fb,bounds:mb},Lb)=>{Y.push({id:Za,
|
|||
|
prev:fb,next:[Qa+Ga*Lb-mb.width/2,mb.minY]})})}else{p=p.sort((Ga,Qa)=>Ga.center[0]-Qa.center[0]);let la=G.minX;const pa=(G.width-g)/(b-1);p.forEach(({id:Ga,point:Qa,bounds:Za})=>{Y.push({id:Ga,prev:Qa,next:[la,Za.minY]});la+=Za.width+pa})}break;case "vertical":if(g=p.reduce((la,pa)=>la+pa.bounds.height,0),g>G.height){const la=p.sort((Za,fb)=>Za.bounds.minY-fb.bounds.minY)[0],pa=p.sort((Za,fb)=>fb.bounds.maxY-Za.bounds.maxY)[0];G=p.filter(Za=>Za!==la&&Za!==pa).sort((Za,fb)=>Za.center[1]-fb.center[1]);
|
|||
|
const Ga=(pa.center[1]-la.center[1])/(b-1),Qa=la.center[1]+Ga;G.forEach(({id:Za,point:fb,bounds:mb},Lb)=>{Y.push({id:Za,prev:fb,next:[mb.minX,Qa+Ga*Lb-mb.height/2]})})}else{p=p.sort((Ga,Qa)=>Ga.center[1]-Qa.center[1]);let la=G.minY;const pa=(G.height-g)/(b-1);p.forEach(({id:Ga,point:Qa,bounds:Za})=>{Y.push({id:Ga,prev:Qa,next:[Za.minX,la]});la+=Za.height+pa})}}return Y}static getPackedDistributions(b){const g=vf.getCommonBounds(b.map(({bounds:Y})=>Y)),p=[g.minX,g.minY],G=Object.fromEntries(b.map(Y=>
|
|||
|
[Y.id,[Y.bounds.minX,Y.bounds.minY]]));b=b.filter(Y=>{var la,pa,Ga,Qa;return!((null==(pa=null==(la=Y.props.handles)?void 0:la.start)?0:pa.bindingId)||(null==(Qa=null==(Ga=Y.props.handles)?void 0:Ga.end)?0:Qa.bindingId))}).map(Y=>{const la=Y.getBounds();return{id:Y.id,w:la.width+16,h:la.height+16,x:la.minX,y:la.minY}});A(b);return b.map(({id:Y,x:la,y:pa})=>({id:Y,prev:G[Y],next:[la+p[0],pa+p[1]]}))}},Ko=class{static pointInCircle(b,g,p){return Id.dist(b,g)<=p}static pointInEllipse(b,g,p,G,Y=0){Y=Y||
|
|||
|
0;var la=Math.cos(Y);Y=Math.sin(Y);g=Id.sub(b,g);b=la*g[0]+Y*g[1];la=Y*g[0]-la*g[1];return 1>=b*b/(p*p)+la*la/(G*G)}static pointInRect(b,g){return!(b[0]<g[0]||b[0]>b[0]+g[0]||b[1]<g[1]||b[1]>b[1]+g[1])}static pointInPolygon(b,g){let p=0;g.forEach((G,Y)=>{Y=g[(Y+1)%g.length];G[1]<=b[1]?Y[1]>b[1]&&0<Id.cross(G,Y,b)&&(p+=1):Y[1]<=b[1]&&0>Id.cross(G,Y,b)&&--p});return 0!==p}static pointInBounds(b,g){return!(b[0]<g.minX||b[0]>g.maxX||b[1]<g.minY||b[1]>g.maxY)}static pointInPolyline(b,g,p=3){for(let G=
|
|||
|
1;G<g.length;G++)if(Id.distanceToLineSegment(g[G-1],g[G],b)<p)return!0;return!1}static _getSqSegDist(b,g,p){let G=g[0];g=g[1];let Y=p[0]-G,la=p[1]-g;if(0!==Y||0!==la){const pa=((b[0]-G)*Y+(b[1]-g)*la)/(Y*Y+la*la);1<pa?(G=p[0],g=p[1]):0<pa&&(G+=Y*pa,g+=la*pa)}Y=b[0]-G;la=b[1]-g;return Y*Y+la*la}static _simplifyStep(b,g,p,G,Y){let la=G,pa=-1;for(let Ga=g+1;Ga<p;Ga++){const Qa=Ko._getSqSegDist(b[Ga],b[g],b[p]);Qa>la&&(pa=Ga,la=Qa)}-1<pa&&la>G&&(1<pa-g&&Ko._simplifyStep(b,g,pa,G,Y),Y.push(b[pa]),1<p-
|
|||
|
pa&&Ko._simplifyStep(b,pa,p,G,Y))}static simplify2(b,g=1){if(2>=b.length)return b;g*=g;var p=b[0],G=b[1];const Y=[p];for(let la=1,pa=b.length;la<pa;la++)G=b[la],(G[0]-p[0])*(G[0]-p[0])+(G[1]-p[1])*(G[1]-p[1])>g&&(Y.push(G),p=G);p!==G&&Y.push(G);p=Y.length-1;G=[Y[0]];Ko._simplifyStep(Y,0,p,g,G);G.push(Y[p],b[b.length-1]);return G}static pointNearToPolyline(b,g,p=8){const G=g.length;for(let Y=1;Y<G;Y++)if(Id.distanceToLineSegment(g[Y-1],g[Y],b)<p)return!0;return!1}},Fk=Ko;ib(Fk,"simplify",(b,g=1)=>
|
|||
|
{var p=b.length;const G=b[0],Y=b[p-1],[la,pa]=G,[Ga,Qa]=Y;if(2<p){let Za=0,fb=0;const mb=Id.len2([Qa-pa,Ga-la]);for(let Lb=1;Lb<p-1;Lb++){const [Tb,Pb]=b[Lb],lc=Math.pow(Tb*(Qa-pa)+la*(Pb-Qa)+Ga*(pa-Pb),2)/mb;Za>lc||(Za=lc,fb=Lb)}if(Za>g)return p=Ko.simplify(b.slice(0,fb+1),g),b=Ko.simplify(b.slice(fb+1),g),p.concat(b.slice(1))}return[G,Y]});var Fl=Math.PI,zn=Fl/2,Tk=2*Fl,vp={},zr={bottom_edge:"ns-resize",top_edge:"ns-resize",left_edge:"ew-resize",right_edge:"ew-resize",bottom_left_corner:"nesw-resize",
|
|||
|
bottom_right_corner:"nwse-resize",top_left_corner:"nwse-resize",top_right_corner:"nesw-resize",bottom_left_resize_corner:"swne-rotate",bottom_right_resize_corner:"senw-rotate",top_left_resize_corner:"nwse-rotate",top_right_resize_corner:"nesw-rotate",rotate:"rotate",center:"grab",background:"grab"},qm=class{static circleFromThreePoints(b,g,p){const [G,Y]=b,[la,pa]=g,[Ga,Qa]=p;g=G*(pa-Qa)-Y*(la-Ga)+la*Qa-Ga*pa;b=-((G*G+Y*Y)*(Qa-pa)+(la*la+pa*pa)*(Y-Qa)+(Ga*Ga+Qa*Qa)*(pa-Y))/(2*g);g=-((G*G+Y*Y)*(la-
|
|||
|
Ga)+(la*la+pa*pa)*(Ga-G)+(Ga*Ga+Qa*Qa)*(G-la))/(2*g);return[b,g,Math.hypot(b-G,g-Y)]}static perimeterOfEllipse(b,g){const p=Math.pow(b-g,2)/Math.pow(b+g,2);return Fl*(b+g)*(1+3*p/(10+Math.sqrt(4-3*p)))}static shortAngleDist(b,g){b=(g-b)%Tk;return 2*b%Tk-b}static longAngleDist(b,g){return Tk-qm.shortAngleDist(b,g)}static lerpAngles(b,g,p){return b+qm.shortAngleDist(b,g)*p}static angleDelta(b,g){return qm.shortAngleDist(b,g)}static getSweep(b,g,p){return qm.angleDelta(ke.angle(b,g),ke.angle(b,p))}static clampRadians(b){return(Tk+
|
|||
|
b)%Tk}static snapAngleToSegments(b,g){g=Tk/g;b=Math.floor((qm.clampRadians(b)+g/2)/g)*g%Tk;b<Fl&&(b+=Tk);b>Fl&&(b-=Tk);return b}static isAngleBetween(b,g,p){if(p===b||p===g)return!0;g=(g-b+zn)%zn;return g<=Fl!==(p-b+zn)%zn>g}static degreesToRadians(b){return b*Fl/180}static radiansToDegrees(b){return 180*b/Fl}static getArcLength(b,g,p,G){b=qm.getSweep(b,p,G);return b/Tk*Tk*g}static getSweepFlag(b,g,p){p=ke.angle(b,p);return 0<(ke.angle(b,g)-p+3*Fl)%Tk-Fl?0:1}static getLargeArcFlag(b,g,p){b=ke.angle(p,
|
|||
|
b);g=(ke.angle(p,g)-b+3*Fl)%Tk-Fl;return Math.abs(g)>zn?0:1}static getArcDashOffset(b,g,p,G,Y){const la=qm.getSweepFlag(b,p,G);g=qm.getArcLength(b,g,p,G);return-(0>la?g:Tk*b[2]-g)/2+Y}static getEllipseDashOffset(b,g){return-(Tk*b[2])/2+-g}static radiansToCardinalDirection(b){return b<.25*Math.PI?"north":b<.75*Math.PI?"east":b<1.25*Math.PI?"south":b<1.75*Math.PI?"west":"north"}},nl=class{static getPolygonCentroid(b){var g=b.map(p=>p[0]);b=b.map(p=>p[1]);g=Math.min(...g)+Math.max(...g);b=Math.min(...b)+
|
|||
|
Math.max(...b);return[g?g/2:0,b?b/2:0]}};ib(nl,"getEdges",b=>{const g=b.length;return b.map((p,G)=>[p,b[(G+1)%g]])});ib(nl,"getEdgeOutwardNormal",(b,g)=>ke.per(ke.uni(ke.sub(g,b))));ib(nl,"getEdgeInwardNormal",(b,g)=>ke.neg(nl.getEdgeOutwardNormal(b,g)));ib(nl,"getOffsetEdge",(b,g,p)=>{p=ke.mul(ke.per(ke.uni(ke.sub(g,b))),p);return[ke.add(b,p),ke.add(g,p)]});ib(nl,"getOffsetEdges",(b,g)=>b.map(([p,G])=>nl.getOffsetEdge(p,G,g)));ib(nl,"getOffsetPolygon",(b,g)=>{if(1>b.length)throw Error("Expected at least one point.");
|
|||
|
if(1===b.length)return b=b[0],[ke.add(b,[-g,-g]),ke.add(b,[g,-g]),ke.add(b,[g,g]),ke.add(b,[-g,g])];if(2===b.length){const [p,G]=b;return[...nl.getOffsetEdge(p,G,g),...nl.getOffsetEdge(G,p,g)]}return nl.getOffsetEdges(nl.getEdges(b),g).flatMap((p,G,Y)=>{{G=Y[(G+1)%Y.length];const la=Id.slope(p[0],p[1]);Y=Id.slope(G[0],G[1]);la!==Y?Number.isNaN(la)&&!Number.isNaN(Y)?p=[p[0][0],(p[0][0]-G[0][0])*Y+G[0][1]]:Number.isNaN(Y)&&!Number.isNaN(la)?p=[G[0][0],(G[0][0]-p[0][0])*la+p[0][1]]:(p=(la*p[0][0]-Y*
|
|||
|
G[0][0]+G[0][1]-p[0][1])/(la-Y),p=[p,Y*(p-G[0][0])+G[0][1]]):p=void 0}if(void 0===p)throw Error("Expected an intersection");return p})});ib(nl,"getPolygonVertices",(b,g,p=0,G=1)=>{b=ke.div(b,2);const [Y,la]=[Math.max(1,b[0]-p),Math.max(1,b[1]-p)];p=[];for(let Za=0,fb=Tk/g;Za<g;Za++){var pa=(-zn+Za*fb)%Tk,Ga=(-zn+(Za+1)*fb)%Tk;pa=ke.add(b,[Y*Math.cos(pa),la*Math.sin(pa)]);Ga=ke.add(b,[Y*Math.cos(Ga),la*Math.sin(Ga)]);var Qa=ke.med(pa,Ga);Qa=ke.nudge(Qa,b,ke.dist(b,Qa)*(1-G));p.push(pa,Qa,Ga)}return p});
|
|||
|
ib(nl,"getTriangleVertices",(b,g=0,p=1)=>{const [G,Y]=b;var la=1-p;b=[G/2,g/2];p=[G-g,Y-g];g=[g/2,Y-g];const pa=nl.getPolygonCentroid([b,p,g]),Ga=ke.med(b,p),Qa=ke.med(p,g),Za=ke.med(g,b),fb=ke.dist(Ga,pa)*la,mb=ke.dist(Qa,pa)*la;la*=ke.dist(Za,pa);return[b,fb?ke.nudge(Ga,pa,fb):Ga,p,mb?ke.nudge(Qa,pa,mb):Qa,g,la?ke.nudge(Za,pa,la):Za]});ib(nl,"getStarVertices",(b,g,p,G=1)=>{const Y=ke.div(g,2),la=ke.mul(Y,G/2),pa=Tk/p/2;return Array.from(Array(2*p)).map((Ga,Qa)=>{Ga=-zn+Qa*pa;const [Za,fb]=Qa%2?
|
|||
|
la:Y;return ke.add(b,[Za*Math.cos(Ga),fb*Math.sin(Ga)])})});var Ks=class{static getCurvedPathForPolygon(b){if(3>b.length)return"M -4, 0\n a 4,4 0 1,0 8,0\n a 4,4 0 1,0 -8,0";const g=["M",...b[0].slice(0,2),"Q"],p=b.length;for(let G=1;G<p;G++){const [Y,la]=b[G],[pa,Ga]=b[(G+1)%p];g.push(Y,la,(Y+pa)/2,(la+Ga)/2)}g.push("Z");return g.join(" ")}static getCurvedPathForPoints(b){if(3>b.length)return"M -4, 0\n a 4,4 0 1,0 8,0\n a 4,4 0 1,0 -8,0";const g=["M",...b[0].slice(0,2),"Q"],p=
|
|||
|
b.length;for(let G=1;G<p-1;G++){const [Y,la]=b[G],[pa,Ga]=b[G+1];g.push(Y,la,(Y+pa)/2,(la+Ga)/2)}return g.join(" ")}static getSvgPathFromStroke(b,g=!0){const p=b.length;if(4>p)return"";let G=b[0],Y=b[1];var la=b[2];la=`M${G[0].toFixed(2)},${G[1].toFixed(2)} Q${Y[0].toFixed(2)},${Y[1].toFixed(2)} ${((Y[0]+la[0])/2).toFixed(2)},${((Y[1]+la[1])/2).toFixed(2)} T`;for(let pa=2,Ga=p-1;pa<Ga;pa++)G=b[pa],Y=b[pa+1],la+=`${((G[0]+Y[0])/2).toFixed(2)},${((G[1]+Y[1])/2).toFixed(2)} `;g&&(la+="Z");return la}static getSvgPathFromStrokePoints(b,
|
|||
|
g=!1){const p=b.length;if(4>p)return"";let G=b[0].point,Y=b[1].point;var la=b[2].point;la=`M${G[0].toFixed(2)},${G[1].toFixed(2)} Q${Y[0].toFixed(2)},${Y[1].toFixed(2)} ${((Y[0]+la[0])/2).toFixed(2)},${((Y[1]+la[1])/2).toFixed(2)} T`;for(let pa=2,Ga=p-1;pa<Ga;pa++)G=b[pa].point,Y=b[pa+1].point,la+=`${((G[0]+Y[0])/2).toFixed(2)},${((G[1]+Y[1])/2).toFixed(2)} `;g&&(la+="Z");return la}};ib(Ks,"TRIM_NUMBERS",/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g);var Cv={},Dv=Object.assign,bp=Object.getOwnPropertyDescriptor,
|
|||
|
Mo=Object.defineProperty,cp=Object.prototype,U=[];Object.freeze(U);var ma={};Object.freeze(ma);var Da="undefined"!==typeof Proxy,gb=Object.toString(),Gb=function(){},rc="undefined"!==typeof Object.getOwnPropertySymbols,Ic="undefined"!==typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:rc?function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:Object.getOwnPropertyNames,fd=Object.getOwnPropertyDescriptors||function(b){var g={};Ic(b).forEach(function(p){g[p]=bp(b,p)});
|
|||
|
return g},Od=Symbol("mobx-stored-annotations"),ae=Symbol("mobx administration"),hg=function(){function b(p){void 0===p&&(p="Atom");this.name_=void 0;this.isBeingObserved_=this.isPendingUnobservation_=!1;this.observers_=new Set;this.lastAccessedBy_=this.diffValue_=0;this.lowestObserverState_=Dj.NOT_TRACKING_;this.onBUOL=this.onBOL=void 0;this.name_=p}var g=b.prototype;g.onBO=function(){this.onBOL&&this.onBOL.forEach(function(p){return p()})};g.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(p){return p()})};
|
|||
|
g.reportObserved=function(){return Nb(this)};g.reportChanged=function(){ld();fc(this);Sd()};g.toString=function(){return this.name_};return b}(),uh=D("Atom",hg),ef={identity:function(b,g){return b===g},structural:function(b,g){return ta(b,g)},"default":function(b,g){return Object.is?Object.is(b,g):b===g?0!==b||1/b===1/g:b!==b&&g!==g},shallow:function(b,g){return ta(b,g,1)}},Lg="override",yh=ob(),Yg={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Yg);var se=Wb("observable"),Wd=
|
|||
|
Wb("observable.ref",{enhancer:eb}),qe=Wb("observable.shallow",{enhancer:function(b,g,p){if(void 0===b||null===b||Xd(b)||kb(b)||Xp(b)||Nq(b))return b;if(Array.isArray(b))return Qe.array(b,{name:p,deep:!1});if(E(b))return Qe.object(b,void 0,{name:p,deep:!1});if(O(b))return Qe.map(b,{name:p,deep:!1});if(P(b))return Qe.set(b,{name:p,deep:!1})}}),Ze=Wb("observable.struct",{enhancer:function(b,g){return ta(b,g)?g:b}}),kf=Ua(se);Object.assign(ad,kf);var Kh={box:function(b,g){g=g||Yg;return new Oq(b,Jc(g),
|
|||
|
g.name,!0,g.equals)},array:function(b,g){g=g||Yg;return(!1===Ef.useProxies||!1===g.proxy?gf:ab)(b,Jc(g),g.name)},map:function(b,g){g=g||Yg;return new yy(b,Jc(g),g.name)},set:function(b,g){g=g||Yg;return new ky(b,Jc(g),g.name)},object:function(b,g,p){if(!1===Ef.useProxies||!1===(null==p?void 0:p.proxy))p=Cd({},p);else{var G={},Y,la;X();G=Cd(G,p);p=null!=(la=(Y=G[ae]).proxy_)?la:Y.proxy_=new Proxy(G,kD)}return qc(p,b,g)},ref:Ua(Wd),shallow:Ua(qe),deep:kf,struct:Ua(Ze)},Qe=Dv(ad,Kh),Dh=Ab("computed"),
|
|||
|
qi=Ab("computed.struct",{equals:ef.structural}),wf=function(b,g){if(T(g))return Ea(b,g,Dh);if(E(b))return Ua(Ab("computed",b));g=E(g)?g:{};g.get=b;g.name||(g.name=b.name||"");return new Rs(g)};Object.assign(wf,Dh);wf.struct=Ua(qi);var Io,Tt,$t=0,sD=1,qD=null!=(Io=null==(Tt=bp(function(){},"name"))?void 0:Tt.configurable)?Io:!1,Ay={value:"action",configurable:!0,writable:!1,enumerable:!1};var rD=Symbol.toPrimitive;var Oq=function(b){function g(G,Y,la,pa,Ga){void 0===la&&(la="ObservableValue");void 0===
|
|||
|
Ga&&(Ga=ef["default"]);pa=b.call(this,la)||this;pa.enhancer=void 0;pa.hasUnreportedChange_=!1;pa.interceptors_=void 0;pa.changeListeners_=void 0;pa.value_=void 0;pa.dehancer=void 0;pa.enhancer=Y;pa.name_=la;pa.equals=Ga;pa.value_=Y(G,void 0,la);return pa}ia(g,b);var p=g.prototype;p.dehanceValue=function(G){return void 0!==this.dehancer?this.dehancer(G):G};p.set=function(G){G=this.prepareNewValue_(G);G!==Ef.UNCHANGED&&this.setNewValue_(G)};p.prepareNewValue_=function(G){if(ee(this)){G=mc(this,{object:this,
|
|||
|
type:dp,newValue:G});if(!G)return Ef.UNCHANGED;G=G.newValue}G=this.enhancer(G,this.value_,this.name_);return this.equals(this.value_,G)?Ef.UNCHANGED:G};p.setNewValue_=function(G){var Y=this.value_;this.value_=G;this.reportChanged();Je(this)&&af(this,{type:dp,object:this,newValue:G,oldValue:Y})};p.get=function(){this.reportObserved();return this.dehanceValue(this.value_)};p.intercept_=function(G){return pd(this,G)};p.observe_=function(G,Y){Y&&G({observableKind:"value",debugObjectName:this.name_,object:this,
|
|||
|
type:dp,newValue:this.value_,oldValue:void 0});return cg(this,G)};p.raw=function(){return this.value_};p.toJSON=function(){return this.get()};p.toString=function(){return this.name_+"["+this.value_+"]"};p.valueOf=function(){return ba(this.get())};p[rD]=function(){return this.valueOf()};return g}(hg),oD=D("ObservableValue",Oq);var pD=Symbol.toPrimitive;var Rs=function(){function b(p){this.dependenciesState_=Dj.NOT_TRACKING_;this.observing_=[];this.newObserving_=null;this.isPendingUnobservation_=this.isBeingObserved_=
|
|||
|
!1;this.observers_=new Set;this.lastAccessedBy_=this.runId_=this.diffValue_=0;this.lowestObserverState_=Dj.UP_TO_DATE_;this.unboundDepsCount_=0;this.value_=new cr(null);this.triggeredBy_=this.name_=void 0;this.isRunningSetter_=this.isComputing_=!1;this.setter_=this.derivation=void 0;this.isTracing_=Mr.NONE;this.onBUOL=this.onBOL=this.keepAlive_=this.requiresReaction_=this.equals_=this.scope_=void 0;p.get||l(31);this.derivation=p.get;this.name_=p.name||"ComputedValue";p.set&&(this.setter_=Pc("ComputedValue-setter",
|
|||
|
p.set));this.equals_=p.equals||(p.compareStructural||p.struct?ef.structural:ef["default"]);this.scope_=p.context;this.requiresReaction_=p.requiresReaction;this.keepAlive_=!!p.keepAlive}var g=b.prototype;g.onBecomeStale_=function(){rb(this)};g.onBO=function(){this.onBOL&&this.onBOL.forEach(function(p){return p()})};g.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(p){return p()})};g.get=function(){this.isComputing_&&l(32,this.name_,this.derivation);if(0!==Ef.inBatch||0!==this.observers_.size||
|
|||
|
this.keepAlive_){if(Nb(this),Vc(this)){var p=Ef.trackingContext;this.keepAlive_&&!p&&(Ef.trackingContext=this);this.trackAndCompute()&&Yb(this);Ef.trackingContext=p}}else Vc(this)&&(this.warnAboutUntrackedRead_(),ld(),this.value_=this.computeValue_(!1),Sd());p=this.value_;if(p instanceof cr)throw p.cause;return p};g.set=function(p){if(this.setter_){this.isRunningSetter_&&l(33,this.name_);this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,p)}finally{this.isRunningSetter_=!1}}else l(34,this.name_)};
|
|||
|
g.trackAndCompute=function(){var p=this.value_,G=this.dependenciesState_===Dj.NOT_TRACKING_,Y=this.computeValue_(!0);if(p=G||p instanceof cr||Y instanceof cr||!this.equals_(p,Y))this.value_=Y;return p};g.computeValue_=function(p){this.isComputing_=!0;var G=yc(!1);if(p)var Y=hd(this,this.derivation,this.scope_);else if(!0===Ef.disableErrorBoundaries)Y=this.derivation.call(this.scope_);else try{Y=this.derivation.call(this.scope_)}catch(la){Y=new cr(la)}Ef.allowStateChanges=G;this.isComputing_=!1;return Y};
|
|||
|
g.suspend_=function(){this.keepAlive_||(Kd(this),this.value_=void 0)};g.observe_=function(p,G){var Y=this,la=!0,pa=void 0;return Ld(function(){var Ga=Y.get();if(!la||G){var Qa=pc();p({observableKind:"computed",debugObjectName:Y.name_,type:dp,object:Y,newValue:Ga,oldValue:pa});Ef.trackingDerivation=Qa}la=!1;pa=Ga})};g.warnAboutUntrackedRead_=function(){};g.toString=function(){return this.name_+"["+this.derivation.toString()+"]"};g.valueOf=function(){return ba(this.get())};g[pD]=function(){return this.valueOf()};
|
|||
|
return b}(),$s=D("ComputedValue",Rs),Dj;(function(b){b[b.NOT_TRACKING_=-1]="NOT_TRACKING_";b[b.UP_TO_DATE_=0]="UP_TO_DATE_";b[b.POSSIBLY_STALE_=1]="POSSIBLY_STALE_";b[b.STALE_=2]="STALE_"})(Dj||={});var Mr;(function(b){b[b.NONE=0]="NONE";b[b.LOG=1]="LOG";b[b.BREAK=2]="BREAK"})(Mr||={});var cr=function(b){this.cause=void 0;this.cause=b},cu=function(){this.version=6;this.UNCHANGED={};this.trackingContext=this.trackingDerivation=null;this.inBatch=this.mobxGuid=this.runId=0;this.pendingUnobservations=
|
|||
|
[];this.pendingReactions=[];this.allowStateChanges=this.isRunningReactions=!1;this.enforceActions=this.allowStateReads=!0;this.spyListeners=[];this.globalReactionErrorHandlers=[];this.suppressReactionErrors=this.disableErrorBoundaries=this.observableRequiresReaction=this.reactionRequiresObservable=this.computedRequiresReaction=!1;this.useProxies=!0;this.verifyProxies=!1;this.safeDescriptors=!0},du=!0,Cy=!1,Ef=function(){var b=J();0<b.__mobxInstanceCount&&!b.__mobxGlobals&&(du=!1);b.__mobxGlobals&&
|
|||
|
b.__mobxGlobals.version!==(new cu).version&&(du=!1);if(du){if(b.__mobxGlobals)return b.__mobxInstanceCount+=1,b.__mobxGlobals.UNCHANGED||(b.__mobxGlobals.UNCHANGED={}),b.__mobxGlobals;b.__mobxInstanceCount=1;return b.__mobxGlobals=new cu}setTimeout(function(){Cy||l(35)},1);return new cu}(),Pr=function(){function b(p,G,Y,la){void 0===p&&(p="Reaction");this.requiresObservable_=this.errorHandler_=this.onInvalidate_=this.name_=void 0;this.observing_=[];this.newObserving_=[];this.dependenciesState_=Dj.NOT_TRACKING_;
|
|||
|
this.unboundDepsCount_=this.runId_=this.diffValue_=0;this.isRunning_=this.isTrackPending_=this.isScheduled_=this.isDisposed_=!1;this.isTracing_=Mr.NONE;this.name_=p;this.onInvalidate_=G;this.errorHandler_=Y;this.requiresObservable_=la}var g=b.prototype;g.onBecomeStale_=function(){this.schedule_()};g.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Ef.pendingReactions.push(this),0<Ef.inBatch||Ef.isRunningReactions||fu(nb))};g.isScheduled=function(){return this.isScheduled_};g.runReaction_=
|
|||
|
function(){if(!this.isDisposed_){ld();this.isScheduled_=!1;var p=Ef.trackingContext;Ef.trackingContext=this;if(Vc(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(G){this.reportExceptionInDerivation_(G)}}Ef.trackingContext=p;Sd()}};g.track=function(p){if(!this.isDisposed_){ld();this.isRunning_=!0;var G=Ef.trackingContext;Ef.trackingContext=this;p=hd(this,p,void 0);Ef.trackingContext=G;this.isTrackPending_=this.isRunning_=!1;this.isDisposed_&&Kd(this);p instanceof cr&&this.reportExceptionInDerivation_(p.cause);
|
|||
|
Sd()}};g.reportExceptionInDerivation_=function(p){var G=this;if(this.errorHandler_)this.errorHandler_(p,this);else{if(Ef.disableErrorBoundaries)throw p;Ef.suppressReactionErrors||console.error("[mobx] uncaught error in '"+this+"'",p);Ef.globalReactionErrorHandlers.forEach(function(Y){return Y(p,G)})}};g.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(ld(),Kd(this),Sd()))};g.getDisposer_=function(){var p=this.dispose.bind(this);p[ae]=this;return p};g.toString=function(){return"Reaction["+
|
|||
|
this.name_+"]"};g.trace=function(p){void 0===p&&(p=!1);Bb(this,p)};return b}(),wD=100,fu=function(b){return b()},gu=D("Reaction",Pr),Dy="action",Ey=db(Dy),xD=db("action.bound",{bound:!0}),By=db("autoAction",{autoAction:!0}),iD=db("autoAction.bound",{autoAction:!0,bound:!0}),qg=Uc(!1);Object.assign(qg,Ey);var Os=Uc(!0);Object.assign(Os,By);qg.bound=Ua(xD);Os.bound=Ua(iD);var lD=function(b){return b()},mD="onBO",nD="onBUO",uD=0;Sb.prototype=Object.create(Error.prototype);var zy=sa("flow"),jD=sa("flow.bound",
|
|||
|
{bound:!0}),Ps=Object.assign(function(b,g){if(T(g))return Ea(b,g,zy);var p=b.name||"\x3cunnamed flow\x3e";g=function(){var G=arguments,Y=++uD,la=qg(p+" - runid: "+Y+" - init",b).apply(this,G),pa,Ga=void 0;G=new Promise(function(Qa,Za){function fb(Pb){Ga=void 0;try{var lc=qg(p+" - runid: "+Y+" - yield "+Tb++,la.next).call(la,Pb)}catch(xc){return Za(xc)}Lb(lc)}function mb(Pb){Ga=void 0;try{var lc=qg(p+" - runid: "+Y+" - yield "+Tb++,la["throw"]).call(la,Pb)}catch(xc){return Za(xc)}Lb(lc)}function Lb(Pb){if(ha(null==
|
|||
|
Pb?void 0:Pb.then))Pb.then(Lb,Za);else{if(Pb.done)return Qa(Pb.value);Ga=Promise.resolve(Pb.value);return Ga.then(fb,mb)}}var Tb=0;pa=Za;fb(void 0)});G.cancel=qg(p+" - runid: "+Y+" - cancel",function(){try{if(Ga){var Qa=Ga;ha(Qa.cancel)&&Qa.cancel()}var Za=la["return"](void 0),fb=Promise.resolve(Za.value);fb.then(Gb,Gb);ha(fb.cancel)&&fb.cancel();pa(new Sb)}catch(mb){pa(mb)}});return G};g.isMobXFlow=!0;return g},zy);Ps.bound=Ua(jD);var kD={has:function(b,g){return b[ae].has_(g)},get:function(b,g){return b[ae].get_(g)},
|
|||
|
set:function(b,g,p){var G;return T(g)?null!=(G=b[ae].set_(g,p,!0))?G:!0:!1},deleteProperty:function(b,g){var p;return T(g)?null!=(p=b[ae].delete_(g,!0))?p:!0:!1},defineProperty:function(b,g,p){var G;return null!=(G=b[ae].defineProperty_(g,p))?G:!0},ownKeys:function(b){return b[ae].ownKeys_()},preventExtensions:function(b){l(13)}},dp="update",vD={get:function(b,g){var p=b[ae];return g===ae?p:"length"===g?p.getArrayLength_():"string"!==typeof g||isNaN(g)?H(Zt,g)?Zt[g]:b[g]:p.get_(parseInt(g))},set:function(b,
|
|||
|
g,p){var G=b[ae];"length"===g&&G.setArrayLength_(p);"symbol"===typeof g||isNaN(g)?b[g]=p:G.set_(parseInt(g),p);return!0},preventExtensions:function(){l(15)}},Mv=function(){function b(p,G,Y,la){void 0===p&&(p="ObservableArray");this.atom_=this.legacyMode_=this.owned_=void 0;this.values_=[];this.proxy_=this.dehancer=this.enhancer_=this.changeListeners_=this.interceptors_=void 0;this.lastKnownLength_=0;this.owned_=Y;this.legacyMode_=la;this.atom_=new hg(p);this.enhancer_=function(pa,Ga){return G(pa,
|
|||
|
Ga,"ObservableArray[..]")}}var g=b.prototype;g.dehanceValue_=function(p){return void 0!==this.dehancer?this.dehancer(p):p};g.dehanceValues_=function(p){return void 0!==this.dehancer&&0<p.length?p.map(this.dehancer):p};g.intercept_=function(p){return pd(this,p)};g.observe_=function(p,G){void 0===G&&(G=!1);G&&p({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0});return cg(this,
|
|||
|
p)};g.getArrayLength_=function(){this.atom_.reportObserved();return this.values_.length};g.setArrayLength_=function(p){("number"!==typeof p||isNaN(p)||0>p)&&l("Out of range: "+p);var G=this.values_.length;if(p!==G)if(p>G){for(var Y=Array(p-G),la=0;la<p-G;la++)Y[la]=void 0;this.spliceWithArray_(G,0,Y)}else this.spliceWithArray_(p,G-p)};g.updateArrayLength_=function(p,G){p!==this.lastKnownLength_&&l(16);this.lastKnownLength_+=G;this.legacyMode_&&0<G&&we(p+G+1)};g.spliceWithArray_=function(p,G,Y){var la=
|
|||
|
this,pa=this.values_.length;void 0===p?p=0:p>pa?p=pa:0>p&&(p=Math.max(0,pa+p));G=1===arguments.length?pa-p:void 0===G||null===G?0:Math.max(0,Math.min(G,pa-p));void 0===Y&&(Y=U);if(ee(this)){var Ga=mc(this,{object:this.proxy_,type:"splice",index:p,removedCount:G,added:Y});if(!Ga)return U;G=Ga.removedCount;Y=Ga.added}Y=0===Y.length?Y:Y.map(function(Qa){return la.enhancer_(Qa,void 0)});this.legacyMode_&&this.updateArrayLength_(pa,Y.length-G);pa=this.spliceItemsIntoValues_(p,G,Y);0===G&&0===Y.length||
|
|||
|
this.notifyArraySplice_(p,Y,pa);return this.dehanceValues_(pa)};g.spliceItemsIntoValues_=function(p,G,Y){if(1E4>Y.length){var la;return(la=this.values_).splice.apply(la,[p,G].concat(Y))}la=this.values_.slice(p,p+G);var pa=this.values_.slice(p+G);this.values_.length+=Y.length-G;for(G=0;G<Y.length;G++)this.values_[p+G]=Y[G];for(G=0;G<pa.length;G++)this.values_[p+Y.length+G]=pa[G];return la};g.notifyArrayChildUpdate_=function(p,G,Y){var la=!this.owned_&&!1,pa=Je(this);p=pa||la?{observableKind:"array",
|
|||
|
object:this.proxy_,type:dp,debugObjectName:this.atom_.name_,index:p,newValue:G,oldValue:Y}:null;this.atom_.reportChanged();pa&&af(this,p)};g.notifyArraySplice_=function(p,G,Y){var la=!this.owned_&&!1,pa=Je(this);p=pa||la?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:p,removed:Y,added:G,removedCount:Y.length,addedCount:G.length}:null;this.atom_.reportChanged();pa&&af(this,p)};g.get_=function(p){if(this.legacyMode_&&p>=this.values_.length)console.warn("[mobx] Out of bounds read: "+
|
|||
|
p);else return this.atom_.reportObserved(),this.dehanceValue_(this.values_[p])};g.set_=function(p,G){var Y=this.values_;this.legacyMode_&&p>Y.length&&l(17,p,Y.length);if(p<Y.length){var la=Y[p];if(ee(this)){G=mc(this,{type:dp,object:this.proxy_,index:p,newValue:G});if(!G)return;G=G.newValue}G=this.enhancer_(G,la);G!==la&&(Y[p]=G,this.notifyArrayChildUpdate_(p,G,la))}else{p=Array(p+1-Y.length);for(la=0;la<p.length-1;la++)p[la]=void 0;p[p.length-1]=G;this.spliceWithArray_(Y.length,0,p)}};return b}(),
|
|||
|
Zt={clear:function(){return this.splice(0)},replace:function(b){var g=this[ae];return g.spliceWithArray_(0,g.values_.length,b)},toJSON:function(){return this.slice()},splice:function(b,g){for(var p=arguments.length,G=Array(2<p?p-2:0),Y=2;Y<p;Y++)G[Y-2]=arguments[Y];p=this[ae];switch(arguments.length){case 0:return[];case 1:return p.spliceWithArray_(b);case 2:return p.spliceWithArray_(b,g)}return p.spliceWithArray_(b,g,G)},spliceWithArray:function(b,g,p){return this[ae].spliceWithArray_(b,g,p)},push:function(){for(var b=
|
|||
|
this[ae],g=arguments.length,p=Array(g),G=0;G<g;G++)p[G]=arguments[G];b.spliceWithArray_(b.values_.length,0,p);return b.values_.length},pop:function(){return this.splice(Math.max(this[ae].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var b=this[ae],g=arguments.length,p=Array(g),G=0;G<g;G++)p[G]=arguments[G];b.spliceWithArray_(0,0,p);return b.values_.length},reverse:function(){Ef.trackingDerivation&&l(37,"reverse");this.replace(this.slice().reverse());
|
|||
|
return this},sort:function(){Ef.trackingDerivation&&l(37,"sort");var b=this.slice();b.sort.apply(b,arguments);this.replace(b);return this},remove:function(b){var g=this[ae];b=g.dehanceValues_(g.values_).indexOf(b);return-1<b?(this.splice(b,1),!0):!1}};Cb("concat",cb);Cb("flat",cb);Cb("includes",cb);Cb("indexOf",cb);Cb("join",cb);Cb("lastIndexOf",cb);Cb("slice",cb);Cb("toString",cb);Cb("toLocaleString",cb);Cb("every",Db);Cb("filter",Db);Cb("find",Db);Cb("findIndex",Db);Cb("flatMap",Db);Cb("forEach",
|
|||
|
Db);Cb("map",Db);Cb("some",Db);Cb("reduce",gc);Cb("reduceRight",gc);var hD=D("ObservableArrayAdministration",Mv),gD={};var tD=Symbol.iterator;var fD=Symbol.toStringTag;var yy=function(){function b(p,G,Y){var la=this;void 0===G&&(G=Ma);void 0===Y&&(Y="ObservableMap");this.name_=this.enhancer_=void 0;this[ae]=gD;this.dehancer=this.changeListeners_=this.interceptors_=this.keysAtom_=this.hasMap_=this.data_=void 0;this.enhancer_=G;this.name_=Y;ha(Map)||l(18);this.keysAtom_=Xa("ObservableMap.keys()");this.data_=
|
|||
|
new Map;this.hasMap_=new Map;Fb(!0,function(){la.merge(p)})}var g=b.prototype;g.has_=function(p){return this.data_.has(p)};g.has=function(p){var G=this;if(!Ef.trackingDerivation)return this.has_(p);var Y=this.hasMap_.get(p);if(!Y){var la=Y=new Oq(this.has_(p),eb,"ObservableMap.key?",!1);this.hasMap_.set(p,la);vc(la,function(){return G.hasMap_["delete"](p)})}return Y.get()};g.set=function(p,G){var Y=this.has_(p);if(ee(this)){G=mc(this,{type:Y?dp:"add",object:this,newValue:G,name:p});if(!G)return this;
|
|||
|
G=G.newValue}Y?this.updateValue_(p,G):this.addValue_(p,G);return this};g["delete"]=function(p){var G=this;if(ee(this)&&!mc(this,{type:"delete",object:this,name:p}))return!1;if(this.has_(p)){var Y=Je(this),la=Y?{observableKind:"map",debugObjectName:this.name_,type:"delete",object:this,oldValue:this.data_.get(p).value_,name:p}:null;Hd(function(){var pa;G.keysAtom_.reportChanged();null==(pa=G.hasMap_.get(p))?void 0:pa.setNewValue_(!1);G.data_.get(p).setNewValue_(void 0);G.data_["delete"](p)});Y&&af(this,
|
|||
|
la);return!0}return!1};g.updateValue_=function(p,G){var Y=this.data_.get(p);G=Y.prepareNewValue_(G);if(G!==Ef.UNCHANGED){var la=Je(this);p=la?{observableKind:"map",debugObjectName:this.name_,type:dp,object:this,oldValue:Y.value_,name:p,newValue:G}:null;Y.setNewValue_(G);la&&af(this,p)}};g.addValue_=function(p,G){var Y=this;Hd(function(){var Ga,Qa=new Oq(G,Y.enhancer_,"ObservableMap.key",!1);Y.data_.set(p,Qa);G=Qa.value_;null==(Ga=Y.hasMap_.get(p))?void 0:Ga.setNewValue_(!0);Y.keysAtom_.reportChanged()});
|
|||
|
var la=Je(this),pa=la?{observableKind:"map",debugObjectName:this.name_,type:"add",object:this,name:p,newValue:G}:null;la&&af(this,pa)};g.get=function(p){return this.has(p)?this.dehanceValue_(this.data_.get(p).get()):this.dehanceValue_(void 0)};g.dehanceValue_=function(p){return void 0!==this.dehancer?this.dehancer(p):p};g.keys=function(){this.keysAtom_.reportObserved();return this.data_.keys()};g.values=function(){var p=this,G=this.keys();return bb({next:function(){var Y=G.next(),la=Y.done;Y=Y.value;
|
|||
|
return{done:la,value:la?void 0:p.get(Y)}}})};g.entries=function(){var p=this,G=this.keys();return bb({next:function(){var Y=G.next(),la=Y.done;Y=Y.value;return{done:la,value:la?void 0:[Y,p.get(Y)]}}})};g[tD]=function(){return this.entries()};g.forEach=function(p,G){for(var Y=Ha(this),la;!(la=Y()).done;)la=la.value,p.call(G,la[1],la[0],this)};g.merge=function(p){var G=this;Xp(p)&&(p=new Map(p));Hd(function(){E(p)?da(p).forEach(function(Y){return G.set(Y,p[Y])}):Array.isArray(p)?p.forEach(function(Y){return G.set(Y[0],
|
|||
|
Y[1])}):O(p)?(p.constructor!==Map&&l(19,p),p.forEach(function(Y,la){return G.set(la,Y)})):null!==p&&void 0!==p&&l(20,p)});return this};g.clear=function(){var p=this;Hd(function(){Jd(function(){for(var G=Ha(p.keys()),Y;!(Y=G()).done;)p["delete"](Y.value)})})};g.replace=function(p){var G=this;Hd(function(){for(var Y=gd(p),la=new Map,pa=!1,Ga=Ha(G.data_.keys()),Qa;!(Qa=Ga()).done;)if(Qa=Qa.value,!Y.has(Qa))if(G["delete"](Qa))pa=!0;else{var Za=G.data_.get(Qa);la.set(Qa,Za)}for(Y=Ha(Y.entries());!(Ga=
|
|||
|
Y()).done;)Qa=Ga.value,Ga=Qa[0],Za=Qa[1],Qa=G.data_.has(Ga),G.set(Ga,Za),G.data_.has(Ga)&&(Za=G.data_.get(Ga),la.set(Ga,Za),Qa||(pa=!0));if(!pa)if(G.data_.size!==la.size)G.keysAtom_.reportChanged();else for(pa=G.data_.keys(),Y=la.keys(),Ga=pa.next(),Qa=Y.next();!Ga.done;){if(Ga.value!==Qa.value){G.keysAtom_.reportChanged();break}Ga=pa.next();Qa=Y.next()}G.data_=la});return this};g.toString=function(){return"[object ObservableMap]"};g.toJSON=function(){return Array.from(this)};g.observe_=function(p,
|
|||
|
G){return cg(this,p)};g.intercept_=function(p){return pd(this,p)};N(b,[{key:"size",get:function(){this.keysAtom_.reportObserved();return this.data_.size}},{key:fD,get:function(){return"Map"}}]);return b}(),Xp=D("ObservableMap",yy),cD={};var dD=Symbol.iterator;var eD=Symbol.toStringTag;var ky=function(){function b(p,G,Y){void 0===G&&(G=Ma);void 0===Y&&(Y="ObservableSet");this.name_=void 0;this[ae]=cD;this.data_=new Set;this.enhancer_=this.dehancer=this.interceptors_=this.changeListeners_=this.atom_=
|
|||
|
void 0;this.name_=Y;ha(Set)||l(22);this.atom_=Xa(this.name_);this.enhancer_=function(la,pa){return G(la,pa,Y)};p&&this.replace(p)}var g=b.prototype;g.dehanceValue_=function(p){return void 0!==this.dehancer?this.dehancer(p):p};g.clear=function(){var p=this;Hd(function(){Jd(function(){for(var G=Ha(p.data_.values()),Y;!(Y=G()).done;)p["delete"](Y.value)})})};g.forEach=function(p,G){for(var Y=Ha(this),la;!(la=Y()).done;)la=la.value,p.call(G,la,la,this)};g.add=function(p){var G=this;if(ee(this)&&!mc(this,
|
|||
|
{type:"add",object:this,newValue:p}))return this;if(!this.has(p)){Hd(function(){G.data_.add(G.enhancer_(p,void 0));G.atom_.reportChanged()});var Y=Je(this),la=Y?{observableKind:"set",debugObjectName:this.name_,type:"add",object:this,newValue:p}:null;Y&&af(this,la)}return this};g["delete"]=function(p){var G=this;if(ee(this)&&!mc(this,{type:"delete",object:this,oldValue:p}))return!1;if(this.has(p)){var Y=Je(this),la=Y?{observableKind:"set",debugObjectName:this.name_,type:"delete",object:this,oldValue:p}:
|
|||
|
null;Hd(function(){G.atom_.reportChanged();G.data_["delete"](p)});Y&&af(this,la);return!0}return!1};g.has=function(p){this.atom_.reportObserved();return this.data_.has(this.dehanceValue_(p))};g.entries=function(){var p=0,G=Array.from(this.keys()),Y=Array.from(this.values());return bb({next:function(){var la=p;p+=1;return la<Y.length?{value:[G[la],Y[la]],done:!1}:{done:!0}}})};g.keys=function(){return this.values()};g.values=function(){this.atom_.reportObserved();var p=this,G=0,Y=Array.from(this.data_.values());
|
|||
|
return bb({next:function(){return G<Y.length?{value:p.dehanceValue_(Y[G++]),done:!1}:{done:!0}}})};g.replace=function(p){var G=this;Nq(p)&&(p=new Set(p));Hd(function(){Array.isArray(p)?(G.clear(),p.forEach(function(Y){return G.add(Y)})):P(p)?(G.clear(),p.forEach(function(Y){return G.add(Y)})):null!==p&&void 0!==p&&l("Cannot initialize set from "+p)});return this};g.observe_=function(p,G){return cg(this,p)};g.intercept_=function(p){return pd(this,p)};g.toJSON=function(){return Array.from(this)};g.toString=
|
|||
|
function(){return"[object ObservableSet]"};g[dD]=function(){return this.values()};N(b,[{key:"size",get:function(){this.atom_.reportObserved();return this.data_.size}},{key:eD,get:function(){return"Set"}}]);return b}(),Nq=D("ObservableSet",ky),ly=Object.create(null),my=function(){function b(p,G,Y,la){void 0===G&&(G=new Map);void 0===la&&(la=yh);this.pendingKeys_=this.appliedAnnotations_=this.isPlainObject_=this.proxy_=this.interceptors_=this.changeListeners_=this.keysAtom_=this.defaultAnnotation_=
|
|||
|
this.values_=this.target_=void 0;this.target_=p;this.values_=G;this.name_=Y;this.defaultAnnotation_=la;this.keysAtom_=new hg("ObservableObject.keys");this.isPlainObject_=E(this.target_)}var g=b.prototype;g.getObservablePropValue_=function(p){return this.values_.get(p).get()};g.setObservablePropValue_=function(p,G){var Y=this.values_.get(p);if(Y instanceof Rs)return Y.set(G),!0;if(ee(this)){G=mc(this,{type:dp,object:this.proxy_||this.target_,name:p,newValue:G});if(!G)return null;G=G.newValue}G=Y.prepareNewValue_(G);
|
|||
|
if(G!==Ef.UNCHANGED){var la=Je(this);p=la?{type:dp,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:Y.value_,name:p,newValue:G}:null;Y.setNewValue_(G);la&&af(this,p)}return!0};g.get_=function(p){Ef.trackingDerivation&&!H(this.target_,p)&&this.has_(p);return this.target_[p]};g.set_=function(p,G,Y){void 0===Y&&(Y=!1);if(H(this.target_,p)){if(this.values_.has(p))return this.setObservablePropValue_(p,G);if(Y)return Reflect.set(this.target_,p,G);this.target_[p]=
|
|||
|
G;return!0}return this.extend_(p,{value:G,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,Y)};g.has_=function(p){if(!Ef.trackingDerivation)return p in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var G=this.pendingKeys_.get(p);G||(G=new Oq(p in this.target_,eb,"ObservableObject.key?",!1),this.pendingKeys_.set(p,G));return G.get()};g.make_=function(p,G){!0===G&&(G=this.defaultAnnotation_);if(!1!==G){if(!(p in this.target_)){var Y;if(null!=(Y=this.target_[Od])&&Y[p])return;
|
|||
|
l(1,G.annotationType_,this.name_+"."+p.toString())}for(Y=this.target_;Y&&Y!==cp;){var la=bp(Y,p);if(la){la=G.make_(this,p,la,Y);if(0===la)return;if(1===la)break}Y=Object.getPrototypeOf(Y)}var pa;null==(pa=this.target_[Od])?!0:delete pa[p]}};g.extend_=function(p,G,Y,la){void 0===la&&(la=!1);!0===Y&&(Y=this.defaultAnnotation_);if(!1===Y)return this.defineProperty_(p,G,la);if(G=Y.extend_(this,p,G,la)){var pa;null==(pa=this.target_[Od])?!0:delete pa[p]}return G};g.defineProperty_=function(p,G,Y){void 0===
|
|||
|
Y&&(Y=!1);try{ld();var la=this.delete_(p);if(!la)return la;if(ee(this)){var pa=mc(this,{object:this.proxy_||this.target_,name:p,type:"add",newValue:G.value});if(!pa)return null;var Ga=pa.newValue;G.value!==Ga&&(G=ca({},G,{value:Ga}))}if(Y){if(!Reflect.defineProperty(this.target_,p,G))return!1}else Mo(this.target_,p,G);this.notifyPropertyAddition_(p,G.value)}finally{Sd()}return!0};g.defineObservableProperty_=function(p,G,Y,la){void 0===la&&(la=!1);try{ld();var pa=this.delete_(p);if(!pa)return pa;if(ee(this)){var Ga=
|
|||
|
mc(this,{object:this.proxy_||this.target_,name:p,type:"add",newValue:G});if(!Ga)return null;G=Ga.newValue}var Qa=me(p),Za={configurable:Ef.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:Qa.get,set:Qa.set};if(la){if(!Reflect.defineProperty(this.target_,p,Za))return!1}else Mo(this.target_,p,Za);var fb=new Oq(G,Y,"ObservableObject.key",!1);this.values_.set(p,fb);this.notifyPropertyAddition_(p,fb.value_)}finally{Sd()}return!0};g.defineComputedProperty_=function(p,G,Y){void 0===Y&&(Y=!1);try{ld();
|
|||
|
var la=this.delete_(p);if(!la)return la;if(ee(this)&&!mc(this,{object:this.proxy_||this.target_,name:p,type:"add",newValue:void 0}))return null;G.name||(G.name="ObservableObject.key");G.context=this.proxy_||this.target_;var pa=me(p),Ga={configurable:Ef.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:pa.get,set:pa.set};if(Y){if(!Reflect.defineProperty(this.target_,p,Ga))return!1}else Mo(this.target_,p,Ga);this.values_.set(p,new Rs(G));this.notifyPropertyAddition_(p,void 0)}finally{Sd()}return!0};
|
|||
|
g.delete_=function(p,G){void 0===G&&(G=!1);if(!H(this.target_,p))return!0;if(ee(this)&&!mc(this,{object:this.proxy_||this.target_,name:p,type:"remove"}))return null;try{var Y,la;ld();var pa=Je(this),Ga=this.values_.get(p),Qa=void 0;if(!Ga&&pa){var Za;Qa=null==(Za=bp(this.target_,p))?void 0:Za.value}if(G){if(!Reflect.deleteProperty(this.target_,p))return!1}else delete this.target_[p];Ga&&(this.values_["delete"](p),Ga instanceof Oq&&(Qa=Ga.value_),fc(Ga));this.keysAtom_.reportChanged();null==(Y=this.pendingKeys_)?
|
|||
|
void 0:null==(la=Y.get(p))?void 0:la.set(p in this.target_);if(pa){var fb={type:"remove",observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:Qa,name:p};pa&&af(this,fb)}}finally{Sd()}return!0};g.observe_=function(p,G){return cg(this,p)};g.intercept_=function(p){return pd(this,p)};g.notifyPropertyAddition_=function(p,G){var Y,la,pa=Je(this);pa&&(G=pa?{type:"add",observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:p,newValue:G}:
|
|||
|
null,pa&&af(this,G));null==(Y=this.pendingKeys_)?void 0:null==(la=Y.get(p))?void 0:la.set(!0);this.keysAtom_.reportChanged()};g.ownKeys_=function(){this.keysAtom_.reportObserved();return Ic(this.target_)};g.keys_=function(){this.keysAtom_.reportObserved();return Object.keys(this.target_)};return b}(),aD=D("ObservableObjectAdministration",my),bD=Ue(0),Kv=0,ny=function(){};(function(b,g){Object.setPrototypeOf?Object.setPrototypeOf(b.prototype,g):void 0!==b.prototype.__proto__?b.prototype.__proto__=
|
|||
|
g:b.prototype=g})(ny,Array.prototype);var Lv=function(b,g,p){function G(la,pa,Ga,Qa){void 0===Ga&&(Ga="ObservableArray");void 0===Qa&&(Qa=!1);var Za=b.call(this)||this;pa=new Mv(Ga,pa,Qa,!0);pa.proxy_=qa(Za);S(qa(Za),ae,pa);la&&la.length&&(pa=yc(!0),Za.spliceWithArray(0,0,la),Ef.allowStateChanges=pa);Object.defineProperty(qa(Za),"0",bD);return Za}ia(G,b);var Y=G.prototype;Y.concat=function(){this[ae].atom_.reportObserved();for(var la=arguments.length,pa=Array(la),Ga=0;Ga<la;Ga++)pa[Ga]=arguments[Ga];
|
|||
|
return Array.prototype.concat.apply(this.slice(),pa.map(function(Qa){return kb(Qa)?Qa.slice():Qa}))};Y[p]=function(){var la=this,pa=0;return bb({next:function(){return pa<la.length?{value:la[pa++],done:!1}:{done:!0,value:void 0}}})};N(G,[{key:"length",get:function(){return this[ae].getArrayLength_()},set:function(la){this[ae].setArrayLength_(la)}},{key:g,get:function(){return"Array"}}]);return G}(ny,Symbol.toStringTag,Symbol.iterator);Object.entries(Zt).forEach(function(b){var g=b[0];b=b[1];"concat"!==
|
|||
|
g&&M(Lv.prototype,g,b)});we(1E3);var oy=cp.toString;["Symbol","Map","Set"].forEach(function(b){"undefined"===typeof J()[b]&&l("MobX requires global '"+b+"' to be available or polyfilled")});"object"===typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:uc,extras:{getDebugName:zb},$mobx:ae});var tb=W(588),zm=class{constructor(b){ib(this,"props");ib(this,"aspectRatio");ib(this,"type");ib(this,"hideCloneHandles",!1);ib(this,"hideResizeHandles",!1);ib(this,"hideRotateHandle",
|
|||
|
!1);ib(this,"hideContextBar",!1);ib(this,"hideSelectionDetail",!1);ib(this,"hideSelection",!1);ib(this,"canChangeAspectRatio",!0);ib(this,"canUnmount",!0);ib(this,"canResize",[!0,!0]);ib(this,"canScale",!0);ib(this,"canFlip",!0);ib(this,"canEdit",!1);ib(this,"canBind",!1);ib(this,"nonce");ib(this,"bindingDistance",4);ib(this,"isDirty",!1);ib(this,"lastSerialized");ib(this,"getCenter",()=>vf.getBoundsCenter(this.bounds));ib(this,"getRotatedBounds",()=>{const {bounds:la,props:{rotation:pa}}=this;return pa?
|
|||
|
vf.getBoundsFromPoints(vf.getRotatedCorners(la,pa)):la});ib(this,"hitTestPoint",la=>{var pa=this.rotatedBounds;if(!this.props.rotation)return Fk.pointInBounds(la,pa);pa=vf.getRotatedCorners(pa,this.props.rotation);return Fk.pointInPolygon(la,pa)});ib(this,"hitTestLineSegment",(la,pa)=>{const Ga=vf.getBoundsFromPoints([la,pa]),{rotatedBounds:Qa,props:{rotation:Za=0}}=this;return vf.boundsContain(Qa,Ga)||Za?h(la,pa,vf.getRotatedCorners(this.bounds)).didIntersect:0<m(Qa,la,pa).length});ib(this,"hitTestBounds",
|
|||
|
la=>{const {rotatedBounds:pa,props:{rotation:Ga=0}}=this,Qa=vf.getRotatedCorners(this.bounds,Ga);return vf.boundsContain(la,pa)||0<z([la.minX,la.minY],[la.width,la.height],Qa).length});ib(this,"getExpandedBounds",()=>vf.expandBounds(this.getBounds(),this.bindingDistance));ib(this,"getBindingPoint",(la,pa,Ga,Qa)=>{var Za=this.getBounds(),fb=this.getExpandedBounds();if(Fk.pointInBounds(la,fb)){var mb=C(pa,Ga,fb).filter(Lb=>Lb.didIntersect).map(Lb=>Lb.points[0]);if(mb.length)return Ga=this.getCenter(),
|
|||
|
mb=mb.sort((Lb,Tb)=>ke.dist(Tb,pa)-ke.dist(Lb,pa))[0],mb=ke.med(la,mb),Qa?(Qa=2>ke.dist(la,Ga)?Ga:la,Za=0):(Qa=2>ke.distanceToLineSegment(la,mb,Ga)?Ga:mb,Za=Fk.pointInBounds(la,Za)?this.bindingDistance:Math.max(this.bindingDistance,vf.getBoundsSides(Za).map(Lb=>ke.distanceToLineSegment(Lb[1][0],Lb[1][1],la)).sort((Lb,Tb)=>Lb-Tb)[0])),fb=ke.divV(ke.sub(Qa,[fb.minX,fb.minY]),[fb.width,fb.height]),{point:ke.clampV(fb,0,1),distance:Za}}});ib(this,"getSerialized",()=>Ec(hf(pe({},this.props),{type:this.type,
|
|||
|
nonce:this.nonce})));ib(this,"getCachedSerialized",()=>{!this.isDirty&&this.lastSerialized||Hd(()=>{this.setIsDirty(!1);this.setLastSerialized(this.getSerialized())});if(this.lastSerialized)return this.lastSerialized;throw Error("Should not get here for getCachedSerialized");});ib(this,"validateProps",la=>la);ib(this,"update",(la,pa=!1,Ga=!1)=>{pa||this.isDirty||this.setIsDirty(!0);pa||Ga||this.incNonce();Object.assign(this.props,this.validateProps(la));return this});ib(this,"clone",()=>new this.constructor(this.serialized));
|
|||
|
ib(this,"onResetBounds",la=>this);ib(this,"scale",[1,1]);ib(this,"onResizeStart",la=>{var pa;this.scale=[...(null!=(pa=this.props.scale)?pa:[1,1])];return this});ib(this,"onResize",(la,pa)=>{const {bounds:Ga,rotation:Qa,scale:[Za,fb]}=pa;la=[...this.scale];0>Za&&(la[0]*=-1);0>fb&&(la[1]*=-1);this.update({point:[Ga.minX,Ga.minY],scale:la,rotation:Qa});return this});ib(this,"onHandleChange",(la,{id:pa,delta:Ga})=>{if(void 0!==la.handles){var Qa=er(la.handles);Qa[pa]=hf(pe({},Qa[pa]),{point:ke.add(Ga,
|
|||
|
la.handles[pa].point)});var Za=vf.getCommonTopLeft(Object.values(Qa).map(fb=>fb.point));Object.values(Qa).forEach(fb=>{fb.point=ke.sub(fb.point,Za)});this.update({point:ke.add(la.point,Za),handles:Qa})}});var g,p;const G=this.constructor.id,Y=null!=(g=this.constructor.defaultProps)?g:{};this.type=G;this.props=pe(pe({scale:[1,1]},Y),b);this.nonce=null!=(p=b.nonce)?p:Date.now();Ag(this)}get id(){return this.props.id}setNonce(b){this.nonce=b}incNonce(){this.nonce++}setIsDirty(b){this.isDirty=b}setLastSerialized(b){this.lastSerialized=
|
|||
|
b}get center(){return this.getCenter()}get bounds(){return this.getBounds()}get rotatedBounds(){return this.getRotatedBounds()}get serialized(){return this.getCachedSerialized()}getShapeSVGJsx(b){b=this.getBounds();const {stroke:g,strokeWidth:p,strokeType:G,opacity:Y,fill:la,noFill:pa,borderRadius:Ga}=this.props;return(0,tb.jsx)("rect",{fill:pa?"none":Xg(la,"background"),stroke:Xg(g,"stroke"),strokeWidth:null!=p?p:2,strokeDasharray:"dashed"===G?"8 2":void 0,fillOpacity:null!=Y?Y:.2,width:b.width,
|
|||
|
height:b.height,rx:Ga,ry:Ga})}};ib(zm,"type");ce([Qe],zm.prototype,"props",2);ce([Qe],zm.prototype,"canResize",2);ce([Qe],zm.prototype,"nonce",2);ce([Qe],zm.prototype,"isDirty",2);ce([Qe],zm.prototype,"lastSerialized",2);ce([wf],zm.prototype,"id",1);ce([qg],zm.prototype,"setNonce",1);ce([qg],zm.prototype,"incNonce",1);ce([qg],zm.prototype,"setIsDirty",1);ce([qg],zm.prototype,"setLastSerialized",1);ce([wf],zm.prototype,"center",1);ce([wf],zm.prototype,"bounds",1);ce([wf],zm.prototype,"rotatedBounds",
|
|||
|
1);ce([wf],zm.prototype,"serialized",1);ce([qg],zm.prototype,"update",2);var An=class extends zm{constructor(b={}){super(b);ib(this,"canBind",!0);ib(this,"getBounds",()=>{const [g,p]=this.props.point,[G,Y]=this.props.size;return{minX:g,minY:p,maxX:g+G,maxY:p+Y,width:G,height:Y}});ib(this,"getRotatedBounds",()=>vf.getBoundsFromPoints(vf.getRotatedCorners(this.bounds,this.props.rotation)));ib(this,"onResize",(g,p)=>{const {bounds:G,rotation:Y,scale:[la,pa]}=p;g=[...this.scale];0>la&&(g[0]*=-1);0>pa&&
|
|||
|
(g[1]*=-1);this.update({point:[G.minX,G.minY],scale:g,rotation:Y});return this.update({rotation:Y,point:[G.minX,G.minY],size:[Math.max(1,G.width),Math.max(1,G.height)],scale:g})});ib(this,"validateProps",g=>{void 0!==g.size&&(g.size[0]=Math.max(g.size[0],1),g.size[1]=Math.max(g.size[1],1));return g});Ag(this)}};ib(An,"id","box");ib(An,"defaultProps",{id:"box",type:"box",parentId:"page",point:[0,0],size:[100,100]});var Ar=class extends zm{constructor(b={}){super(b);ib(this,"getBounds",()=>{const {pointBounds:g,
|
|||
|
props:{point:p}}=this;return vf.translateBounds(g,p)});ib(this,"getRotatedBounds",()=>{const {props:{rotation:g,point:p},bounds:G,rotatedPoints:Y}=this;return g?vf.translateBounds(vf.getBoundsFromPoints(Y),p):G});ib(this,"normalizedPoints",[]);ib(this,"isResizeFlippedX",!1);ib(this,"isResizeFlippedY",!1);ib(this,"onResizeStart",()=>{var g;const {bounds:p,props:{points:G}}=this;this.scale=[...(null!=(g=this.props.scale)?g:[1,1])];const Y=[p.width,p.height];this.normalizedPoints=G.map(la=>Id.divV(la,
|
|||
|
Y));return this});ib(this,"onResize",(g,p)=>{const {bounds:G,scale:[Y,la]}=p,pa=[G.width,G.height];g=[...this.scale];0>Y&&(g[0]*=-1);0>la&&(g[1]*=-1);return this.update(Y||la?{point:[G.minX,G.minY],points:this.normalizedPoints.map(Ga=>Id.mulV(Ga,pa).concat(Ga[2])),scale:g}:{point:[G.minX,G.minY],points:this.normalizedPoints.map(Ga=>Id.mulV(Ga,pa).concat(Ga[2]))})});ib(this,"hitTestPoint",g=>{const {props:{points:p,point:G}}=this;return Fk.pointNearToPolyline(Id.sub(g,G),p)});ib(this,"hitTestLineSegment",
|
|||
|
(g,p)=>{const {bounds:G,props:{points:Y,point:la}}=this;if(Fk.pointInBounds(g,G)||Fk.pointInBounds(p,G)||0<m(G,g,p).length){const pa=Id.sub(g,la),Ga=Id.sub(p,la);return h(pa,Ga,Y).didIntersect||!!Y.find(Qa=>5>Id.dist(pa,Qa)||5>Id.dist(Ga,Qa))}return!1});ib(this,"hitTestBounds",g=>{const {rotatedBounds:p,props:{points:G,point:Y}}=this,la=vf.translateBounds(g,Id.neg(Y));return vf.boundsContain(g,p)||G.every(pa=>Fk.pointInBounds(pa,la))||vf.boundsCollide(g,p)&&0<L([la.minX,la.minY],[la.width,la.height],
|
|||
|
G).length});Ag(this)}get pointBounds(){const {props:{points:b}}=this;return vf.getBoundsFromPoints(b)}get rotatedPoints(){const {props:{point:b,points:g,rotation:p},center:G}=this;if(!p)return g;const Y=Id.sub(G,b);return g.map(la=>Id.rotWith(la,Y,p))}};ib(Ar,"id","draw");ib(Ar,"defaultProps",{id:"draw",type:"draw",parentId:"page",point:[0,0],points:[],isComplete:!1});ce([wf],Ar.prototype,"pointBounds",1);ce([wf],Ar.prototype,"rotatedPoints",1);var Gv=class extends An{constructor(b={}){super(b);ib(this,
|
|||
|
"getBounds",()=>{const {props:{point:[g,p],size:[G,Y]}}=this;return vf.getRotatedEllipseBounds(g,p,G/2,Y/2,0)});ib(this,"getRotatedBounds",()=>{const {props:{point:[g,p],size:[G,Y],rotation:la}}=this;return vf.getRotatedEllipseBounds(g,p,G/2,Y/2,la)});ib(this,"hitTestPoint",g=>{const {props:{size:p,rotation:G},center:Y}=this;return Fk.pointInEllipse(g,Y,p[0],p[1],G||0)});ib(this,"hitTestLineSegment",(g,p)=>{const {props:{size:[G,Y],rotation:la=0},center:pa}=this;return r(g,p,pa,G,Y,la).didIntersect});
|
|||
|
ib(this,"hitTestBounds",g=>{const {props:{size:[p,G],rotation:Y=0},rotatedBounds:la}=this;var pa;if(!(pa=vf.boundsContain(g,la))){const {minX:Ga,minY:Qa,width:Za,height:fb}=g;pa=0<u(this.center,p/2,G/2,Y,[Ga,Qa],[Za,fb]).length}return pa});Ag(this)}};ib(Gv,"id","ellipse");ib(Gv,"defaultProps",{id:"ellipse",type:"ellipse",parentId:"page",point:[0,0],size:[100,100]});var Hv=class extends An{constructor(b={}){super(b);ib(this,"onResetBounds",g=>{const {clipping:p,size:G,point:Y}=this.props;if(p){const [la,
|
|||
|
pa,Ga,Qa]=Array.isArray(p)?p:[p,p,p,p];return this.update({clipping:0,point:[Y[0]-Qa,Y[1]-la],size:[G[0]+(Qa-pa),G[1]+(la-Ga)]})}if(g.asset){const {size:[la,pa]}=g.asset;this.update({clipping:0,point:[Y[0]+G[0]/2-la/2,Y[1]+G[1]/2-pa/2],size:[la,pa]})}return this});ib(this,"onResize",(g,p)=>{const {bounds:G,clip:Y,scale:la}=p;({clipping:p}=this.props);const {clipping:pa}=g;if(Y){const {point:[Ga,Qa],size:[Za,fb]}=g,[mb,Lb,Tb,Pb]=pa?Array.isArray(pa)?pa:[pa,pa,pa,pa]:[0,0,0,0];p=[mb+(G.minY-Qa),Lb+
|
|||
|
(G.maxX-(Ga+Za)),Tb+(G.maxY-(Qa+fb)),Pb+(G.minX-Ga)]}else void 0!==pa&&(p=Array.isArray(pa)?pa:[pa,pa,pa,pa],p=[p[0]*la[1],p[1]*la[0],p[2]*la[1],p[3]*la[0]]);if(p&&Array.isArray(p)){const Ga=p;Ga.every((Qa,Za)=>0===Za||Qa===Ga[Za-1])&&(p=Ga[0])}return this.update({point:[G.minX,G.minY],size:[Math.max(1,G.width),Math.max(1,G.height)],clipping:p})});Ag(this)}};ib(Hv,"id","ellipse");ib(Hv,"defaultProps",{id:"ellipse",type:"ellipse",parentId:"page",point:[0,0],size:[100,100],clipping:0,objectFit:"none",
|
|||
|
assetId:""});var iy=class extends zm{constructor(b={}){super(b);ib(this,"getBounds",()=>{const {points:g,props:{point:p}}=this;return vf.translateBounds(vf.getBoundsFromPoints(g),p)});ib(this,"getRotatedBounds",()=>{const {rotatedPoints:g,props:{point:p}}=this;return vf.translateBounds(vf.getBoundsFromPoints(g),p)});ib(this,"normalizedHandles",[]);ib(this,"onResizeStart",()=>{var g;const {props:{handles:p},bounds:G}=this;this.scale=[...(null!=(g=this.props.scale)?g:[1,1])];const Y=[G.width,G.height];
|
|||
|
this.normalizedHandles=Object.values(p).map(la=>Id.divV(la.point,Y));return this});ib(this,"onResize",(g,p)=>{const {bounds:G,scale:[Y,la]}=p,{props:{handles:pa},normalizedHandles:Ga}=this,Qa=[G.width,G.height];g=[...this.scale];0>Y&&(g[0]*=-1);0>la&&(g[1]*=-1);return this.update({point:[G.minX,G.minY],handles:Object.values(pa).map((Za,fb)=>hf(pe({},Za),{point:Id.mulV(Ga[fb],Qa)})),scale:g})});ib(this,"hitTestPoint",g=>{const {points:p}=this;return Fk.pointNearToPolyline(Id.sub(g,this.props.point),
|
|||
|
p)});ib(this,"hitTestLineSegment",(g,p)=>{const {bounds:G,points:Y,props:{point:la}}=this;if(Fk.pointInBounds(g,G)||Fk.pointInBounds(p,G)||0<m(G,g,p).length){const pa=Id.sub(g,la),Ga=Id.sub(p,la);return h(pa,Ga,Y).didIntersect||!!Y.find(Qa=>5>Id.dist(pa,Qa)||5>Id.dist(Ga,Qa))}return!1});ib(this,"hitTestBounds",g=>{const {rotatedBounds:p,points:G,props:{point:Y}}=this,la=vf.translateBounds(g,Id.neg(Y));return vf.boundsContain(g,p)||G.every(pa=>Fk.pointInBounds(pa,la))||vf.boundsCollide(g,p)&&0<L([la.minX,
|
|||
|
la.minY],[la.width,la.height],G).length});ib(this,"validateProps",g=>{g.point&&(g.point=[0,0]);void 0!==g.handles&&1>Object.values(g.handles).length&&(g.handles=iy.defaultProps.handles);return g});Ag(this)}get points(){return Object.values(this.props.handles).map(b=>b.point)}get centroid(){const {points:b}=this;return nl.getPolygonCentroid(b)}get rotatedPoints(){const {centroid:b,props:{handles:g,rotation:p}}=this;return p?Object.values(g).map(G=>Id.rotWith(G.point,b,p)):this.points}},Br=iy;ib(Br,
|
|||
|
"id","polyline");ib(Br,"defaultProps",{id:"polyline",type:"polyline",parentId:"page",point:[0,0],handles:{}});ce([wf],Br.prototype,"points",1);ce([wf],Br.prototype,"centroid",1);ce([wf],Br.prototype,"rotatedPoints",1);var jy=class extends Br{constructor(b={}){super(b);ib(this,"hideResizeHandles",!0);ib(this,"hideRotateHandle",!0);ib(this,"validateProps",g=>{g.point&&(g.point=[0,0]);void 0!==g.handles&&1>Object.values(g.handles).length&&(g.handles=jy.defaultProps.handles);return g});ib(this,"getHandlesChange",
|
|||
|
(g,p)=>{var G=Fi(g.handles,p);G=Fi(G,{start:{point:ke.toFixed(G.start.point)},end:{point:ke.toFixed(G.end.point)}});if(!ke.isEqual(G.start.point,G.end.point)){p={point:g.point,handles:er(G)};g=g.point;G=vf.translateBounds(vf.getBoundsFromPoints(Object.values(G).map(la=>la.point)),p.point);var Y=ke.sub([G.minX,G.minY],g);ke.isEqual(Y,[0,0])||(Object.values(p.handles).forEach(la=>{la.point=ke.toFixed(ke.sub(la.point,Y))}),p.point=ke.toFixed(ke.add(p.point,Y)));return p}});Ag(this)}},Ms=jy;ib(Ms,"id",
|
|||
|
"line");ib(Ms,"defaultProps",{id:"line",type:"line",parentId:"page",point:[0,0],handles:{start:{id:"start",canBind:!0,point:[0,0]},end:{id:"end",canBind:!0,point:[1,1]}}});var Vp=class extends An{constructor(b={}){super(b);ib(this,"getRotatedBounds",()=>{const {rotatedVertices:g,props:{point:p},offset:G}=this;return vf.translateBounds(vf.getBoundsFromPoints(g),Id.add(p,G))});ib(this,"hitTestPoint",g=>{const {vertices:p}=this;return Fk.pointInPolygon(Id.add(g,this.props.point),p)});ib(this,"hitTestLineSegment",
|
|||
|
(g,p)=>{const {vertices:G,props:{point:Y}}=this;return h(Id.sub(g,Y),Id.sub(p,Y),G).didIntersect});ib(this,"hitTestBounds",g=>{const {rotatedBounds:p,offset:G,rotatedVertices:Y,props:{point:la}}=this,pa=vf.translateBounds(g,Id.neg(Id.add(la,G)));return vf.boundsContain(g,p)||Y.every(Ga=>Fk.pointInBounds(Ga,pa))||0<z([pa.minX,pa.minY],[pa.width,pa.height],Y).length});ib(this,"validateProps",g=>{g.point&&(g.point=[0,0]);void 0!==g.sides&&3>g.sides&&(g.sides=3);return g});Ag(this)}get vertices(){return this.getVertices()}get pageVertices(){const {props:{point:b},
|
|||
|
vertices:g}=this;return g.map(p=>Id.add(p,b))}get centroid(){const {vertices:b}=this;return nl.getPolygonCentroid(b)}get rotatedVertices(){const {vertices:b,centroid:g,props:{rotation:p}}=this;return p?b.map(G=>Id.rotWith(G,g,p)):b}get offset(){const {props:{size:[b,g]}}=this,p=vf.getBoundsCenter(vf.getBoundsFromPoints(this.vertices));return Id.sub(Id.div([b,g],2),p)}getVertices(b=0){const {ratio:g,sides:p,size:G}=this.props;return 3===p?nl.getTriangleVertices(G,b,g):nl.getPolygonVertices(G,p,b,g)}};
|
|||
|
ib(Vp,"id","polygon");ib(Vp,"defaultProps",{id:"polygon",type:"polygon",parentId:"page",point:[0,0],size:[100,100],sides:5,ratio:1,isFlippedY:!1});ce([wf],Vp.prototype,"vertices",1);ce([wf],Vp.prototype,"pageVertices",1);ce([wf],Vp.prototype,"centroid",1);ce([wf],Vp.prototype,"rotatedVertices",1);ce([wf],Vp.prototype,"offset",1);var Iv=class extends An{constructor(b={}){super(b);ib(this,"canEdit",!0);ib(this,"canFlip",!1);Ag(this)}};ib(Iv,"id","text");ib(Iv,"defaultProps",{id:"text",type:"text",parentId:"page",
|
|||
|
isSizeLocked:!0,point:[0,0],size:[16,32],text:""});var Xt=class extends An{constructor(b={}){super(b);ib(this,"canEdit",!1);ib(this,"canFlip",!1);ib(this,"getBounds",()=>vf.getCommonBounds(this.shapes.map(g=>g.getBounds())));Ag(this);this.canResize=[!1,!1]}getShapes(){throw Error("will be implemented other places");}get shapes(){return this.getShapes()}};ib(Xt,"id","group");ib(Xt,"defaultProps",{id:"group",type:"group",parentId:"page",point:[0,0],size:[0,0],children:[]});ce([wf],Xt.prototype,"shapes",
|
|||
|
1);var Cr=class{constructor(){ib(this,"_id");ib(this,"_initial");ib(this,"_states");ib(this,"_isActive",!1);ib(this,"cursor");ib(this,"_disposables",[]);ib(this,"children",new Map([]));ib(this,"registerStates",p=>{p.forEach(G=>this.children.set(G.id,new G(this,this)));return this});ib(this,"deregisterStates",p=>{p.forEach(G=>{var Y;null==(Y=this.children.get(G.id))?void 0:Y.dispose();this.children.delete(G.id)});return this});ib(this,"currentState",{});ib(this,"transition",(p,G={})=>{if(0===this.children.size)throw Error(`Tool ${this.id} has no states, cannot transition to ${p}.`);
|
|||
|
const Y=this.children.get(p),la=this.currentState;if(!Y)throw Error(`Could not find a state named ${p}.`);Hd(()=>{this.currentState?(la._events.onExit(hf(pe({},G),{toId:p})),la.dispose(),this.setCurrentState(Y),this._events.onTransition(hf(pe({},G),{fromId:la.id,toId:p})),Y._events.onEnter(hf(pe({},G),{fromId:la.id}))):(this.currentState=Y,Y._events.onEnter(hf(pe({},G),{fromId:""})))});return this});ib(this,"isIn",p=>{p=p.split(".").reverse();let G=this;for(;0<p.length;){const Y=p.pop();if(!Y)return!0;
|
|||
|
if(G.currentState.id===Y){if(0===p.length)return!0;G=G.currentState}else break}return!1});ib(this,"isInAny",(...p)=>p.some(this.isIn));ib(this,"forwardEvent",(p,...G)=>{var Y,la;(null==(la=null==(Y=this.currentState)?void 0:Y._events)?0:la[p])&&Hd(()=>{var pa;return null==(pa=this.currentState._events)?void 0:pa[p](...G)})});ib(this,"_events",{onTransition:p=>{var G;null==(G=this.onTransition)?void 0:G.call(this,p)},onEnter:p=>{var G;this._isActive=!0;this.initial&&this.transition(this.initial,p);
|
|||
|
null==(G=this.onEnter)?void 0:G.call(this,p)},onExit:p=>{var G,Y,la;this._isActive=!1;null==(Y=null==(G=this.currentState)?void 0:G.onExit)?void 0:Y.call(G,{toId:"parent"});null==(la=this.onExit)?void 0:la.call(this,p)},onPointerDown:(p,G)=>{var Y;null==(Y=this.onPointerDown)?void 0:Y.call(this,p,G);this.forwardEvent("onPointerDown",p,G)},onPointerUp:(p,G)=>{var Y;null==(Y=this.onPointerUp)?void 0:Y.call(this,p,G);this.forwardEvent("onPointerUp",p,G)},onPointerMove:(p,G)=>{var Y;null==(Y=this.onPointerMove)?
|
|||
|
void 0:Y.call(this,p,G);this.forwardEvent("onPointerMove",p,G)},onPointerEnter:(p,G)=>{var Y;null==(Y=this.onPointerEnter)?void 0:Y.call(this,p,G);this.forwardEvent("onPointerEnter",p,G)},onPointerLeave:(p,G)=>{var Y;null==(Y=this.onPointerLeave)?void 0:Y.call(this,p,G);this.forwardEvent("onPointerLeave",p,G)},onDoubleClick:(p,G)=>{var Y;null==(Y=this.onDoubleClick)?void 0:Y.call(this,p,G);this.forwardEvent("onDoubleClick",p,G)},onKeyDown:(p,G)=>{var Y;this._events.onModifierKey(p,G);null==(Y=this.onKeyDown)?
|
|||
|
void 0:Y.call(this,p,G);this.forwardEvent("onKeyDown",p,G)},onKeyUp:(p,G)=>{var Y;this._events.onModifierKey(p,G);null==(Y=this.onKeyUp)?void 0:Y.call(this,p,G);this.forwardEvent("onKeyUp",p,G)},onPinchStart:(p,G)=>{var Y;null==(Y=this.onPinchStart)?void 0:Y.call(this,p,G);this.forwardEvent("onPinchStart",p,G)},onPinch:(p,G)=>{var Y;null==(Y=this.onPinch)?void 0:Y.call(this,p,G);this.forwardEvent("onPinch",p,G)},onPinchEnd:(p,G)=>{var Y;null==(Y=this.onPinchEnd)?void 0:Y.call(this,p,G);this.forwardEvent("onPinchEnd",
|
|||
|
p,G)},onModifierKey:(p,G)=>{switch(G.key){case "Shift":case "Alt":case "Ctrl":case "Meta":this._events.onPointerMove(p,G)}}});ib(this,"onEnter");ib(this,"onExit");ib(this,"onTransition");ib(this,"onPointerDown");ib(this,"onPointerUp");ib(this,"onPointerMove");ib(this,"onPointerEnter");ib(this,"onPointerLeave");ib(this,"onDoubleClick");ib(this,"onKeyDown");ib(this,"onKeyUp");ib(this,"onPinchStart");ib(this,"onPinch");ib(this,"onPinchEnd");const b=this.constructor.initial,g=this.constructor.states;
|
|||
|
this._id=this.constructor.id;this._initial=b;this._states=g}dispose(){this._disposables.forEach(b=>b());this._disposables=[];return this}get initial(){return this._initial}get states(){return this._states}get id(){return this._id}get isActive(){return this._isActive}get ascendants(){return[this]}get descendants(){return Array.from(this.children.values()).flatMap(b=>[b,...b.descendants])}setCurrentState(b){this.currentState=b}};ib(Cr,"id");ib(Cr,"shortcuts");ce([Qe],Cr.prototype,"currentState",2);
|
|||
|
ce([qg],Cr.prototype,"setCurrentState",1);var Jv=class extends Cr{constructor(b,g){var p,G;super();ib(this,"_root");ib(this,"_parent");ib(this,"children",new Map([]));ib(this,"registerStates",Y=>{Y.forEach(la=>this.children.set(la.id,new la(this,this._root)));return this});ib(this,"deregisterStates",Y=>{Y.forEach(la=>{var pa;null==(pa=this.children.get(la.id))?void 0:pa.dispose();this.children.delete(la.id)});return this});this._parent=b;this._root=g;this.states&&0<this.states.length&&(this.registerStates(this.states),
|
|||
|
b=null!=(p=this.initial)?p:this.states[0].id,p=this.children.get(b))&&(this.setCurrentState(p),null==(G=this.currentState)?void 0:G._events.onEnter({fromId:"initial"}));Ag(this)}get root(){return this._root}get parent(){return this._parent}get ascendants(){return this.parent?"ascendants"in this.parent?[...this.parent.ascendants,this]:[this.parent,this]:[this]}};ib(Jv,"cursor");var Wp=class extends Jv{constructor(){super(...arguments);ib(this,"isLocked",!1);ib(this,"previous");ib(this,"onEnter",({fromId:b})=>
|
|||
|
{this.previous=b;this.cursor&&this.app.cursors.setCursor(this.cursor)});ib(this,"onTransition",b=>{({toId:b}=b);b=this.children.get(b);this.app.cursors.reset();b.cursor?this.app.cursors.setCursor(b.cursor):this.cursor&&this.app.cursors.setCursor(this.cursor)})}get app(){return this.root}},Di=class extends Jv{get app(){return this.root}get tool(){return this.parent}},py=class extends Di{constructor(){super(...arguments);ib(this,"cursor","crosshair");ib(this,"creatingShape");ib(this,"aspectRatio");
|
|||
|
ib(this,"initialBounds",{});ib(this,"onEnter",()=>{const {currentPage:b,inputs:{originPoint:g,currentPoint:p}}=this.app;var {Shape:G}=this.tool;G=new G({id:Gk(),type:G.id,parentId:b.id,point:[...g],fill:this.app.settings.color,stroke:this.app.settings.color,size:ke.abs(ke.sub(p,g))});this.initialBounds={minX:g[0],minY:g[1],maxX:g[0]+1,maxY:g[1]+1,width:1,height:1};G.canChangeAspectRatio||(G.aspectRatio?(this.aspectRatio=G.aspectRatio,this.initialBounds.height=this.aspectRatio):(this.aspectRatio=1,
|
|||
|
this.initialBounds.height=1),this.initialBounds.width=1,this.initialBounds.maxY=this.initialBounds.minY+this.initialBounds.height);this.creatingShape=G;this.creatingShape.setScaleLevel(this.app.settings.scaleLevel);this.app.currentPage.addShapes(G);this.app.setSelectedShapes([G])});ib(this,"onPointerMove",b=>{if(!b.order){if(!this.creatingShape)throw Error("Expected a creating shape.");({initialBounds:b}=this);var {currentPoint:g,originPoint:p,shiftKey:G}=this.app.inputs;b=vf.getTransformedBoundingBox(b,
|
|||
|
"bottom_right_corner",ke.sub(g,p),0,G||this.creatingShape.props.isAspectRatioLocked||!this.creatingShape.canChangeAspectRatio);this.creatingShape.update({point:[b.minX,b.minY],size:[b.width,b.height]})}});ib(this,"onPointerUp",()=>{this.tool.transition("idle");this.creatingShape?(this.app.setSelectedShapes([this.creatingShape]),this.app.api.editShape(this.creatingShape)):this.app.transition("select");this.app.persist()});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":if(!this.creatingShape)throw Error("Expected a creating shape.");
|
|||
|
this.app.deleteShapes([this.creatingShape]);this.tool.transition("idle")}})}};ib(py,"id","creating");var qy=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",(b,g)=>{b.order||this.tool.transition("pointing")});ib(this,"onPinchStart",(...b)=>{var g,p;this.app.transition("select",{returnTo:this.app.currentState.id});null==(p=(g=this.app._events).onPinchStart)?void 0:p.call(g,...b)});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}})}};ib(qy,
|
|||
|
"id","idle");var ry=class extends Di{constructor(){super(...arguments);ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&(this.tool.transition("creating"),this.app.setSelectedShapes(this.app.currentPage.shapes))});ib(this,"onPointerUp",()=>{this.tool.transition("idle")})}};ib(ry,"id","pointing");var xp=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","crosshair")}};ib(xp,"id","box");ib(xp,"states",[qy,ry,py]);ib(xp,
|
|||
|
"initial","idle");var sy=class extends Di{constructor(){super(...arguments);ib(this,"shape",{});ib(this,"points",[[0,0,.5]]);ib(this,"persistDebounced",ek(this.app.persist,200));ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})});ib(this,"onEnter",()=>{var b;const {Shape:g,previousShape:p}=this.tool;var {originPoint:G}=this.app.inputs;this.app.history.pause();if(this.app.inputs.shiftKey&&p){this.shape=p;var {shape:Y}=this;var la=Y.props.points[Y.props.points.length-
|
|||
|
1];const Ga=Id.sub(G,Y.props.point).concat(null!=(b=G[2])?b:.5);this.points=[...Y.props.points,la,la];const Qa=Math.ceil(Id.dist(la,G)/16);for(let Za=0,fb=Za/(Qa-1);Za<Qa;Za++){b=this.points;G=b.push;Y=Id.lrp(la,Ga,fb);var pa=la[2];G.call(b,Y.concat.call(Y,pa+(Ga[2]-pa)*fb))}this.addNextPoint(Ga)}else this.tool.previousShape=void 0,this.points=[[0,0,null!=(la=G[2])?la:.5]],this.shape=new g({id:Gk(),type:g.id,parentId:this.app.currentPage.id,point:G.slice(0,2),points:this.points,isComplete:!1,fill:this.app.settings.color,
|
|||
|
stroke:this.app.settings.color}),this.shape.setScaleLevel(this.app.settings.scaleLevel),this.app.currentPage.addShapes(this.shape)});ib(this,"onPointerMove",()=>{const {shape:b}=this,{currentPoint:g,previousPoint:p}=this.app.inputs;Id.isEqual(p,g)||this.addNextPoint(Id.sub(g,b.props.point).concat(g[2]))});ib(this,"onPointerUp",()=>{if(!this.shape)throw Error("Expected a creating shape.");this.app.history.resume();this.shape.update({isComplete:!0,points:this.tool.simplify?Fk.simplify2(this.points,
|
|||
|
this.tool.simplifyTolerance):this.shape.props.points});this.tool.previousShape=this.shape;this.tool.transition("idle");let b=this.app.selectedTool.id;"pencil"===b||"highlighter"===b?this.persistDebounced():this.app.persist()});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":if(!this.shape)throw Error("Expected a creating shape.");this.app.deleteShapes([this.shape]);this.tool.transition("idle")}})}addNextPoint(b){const {shape:g}=this,p=Id.min(b,[0,0]);this.points.push(b);0>p[0]||0>p[1]?(this.points=
|
|||
|
this.points.map(G=>Id.sub(G,p).concat(G[2])),g.update({point:Id.add(g.props.point,p),points:this.points})):g.update({points:this.points})}};ib(sy,"id","creating");var ty=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",(b,g)=>{b.order||this.app.readOnly||this.tool.transition("creating")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}})}};ib(ty,"id",
|
|||
|
"idle");var uy=class extends Di{constructor(){super(...arguments);ib(this,"origin",[0,0]);ib(this,"prevDelta",[0,0]);ib(this,"onEnter",b=>{this.prevDelta=b.info.delta;this.origin=b.info.point});ib(this,"onPinch",b=>{this.app.viewport.pinchZoom(b.point,b.delta,b.delta[2])});ib(this,"onPinchEnd",()=>{this.tool.transition("idle")})}};ib(uy,"id","pinching");var Ns=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","crosshair");ib(this,"simplify",!0);ib(this,"simplifyTolerance",1);ib(this,
|
|||
|
"previousShape");ib(this,"onPinchStart",(b,g)=>{this.transition("pinching",{info:b,event:g})})}};ib(Ns,"id","draw");ib(Ns,"states",[ty,sy,uy]);ib(Ns,"initial","idle");var vy=class extends Di{constructor(){super(...arguments);ib(this,"points",[[0,0,.5]]);ib(this,"hitShapes",new Set);ib(this,"onEnter",()=>{const {originPoint:b}=this.app.inputs;this.points=[b];this.hitShapes.clear()});ib(this,"onPointerMove",()=>{const {currentPoint:b,previousPoint:g}=this.app.inputs;Id.isEqual(g,b)||(this.points.push(b),
|
|||
|
this.app.shapesInViewport.filter(p=>p.hitTestLineSegment(g,b)).forEach(p=>this.hitShapes.add(p)),this.app.setErasingShapes(Array.from(this.hitShapes.values())))});ib(this,"onPointerUp",()=>{this.app.deleteShapes(Array.from(this.hitShapes.values()));this.tool.transition("idle")});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.setErasingShapes([]),this.tool.transition("idle")}})}};ib(vy,"id","erasing");var wy=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",
|
|||
|
(b,g)=>{b.order||this.tool.transition("pointing")});ib(this,"onPinchStart",(...b)=>{var g,p;this.app.transition("select",{returnTo:this.app.currentState.id});null==(p=(g=this.app._events).onPinchStart)?void 0:p.call(g,...b)});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}})}};ib(wy,"id","idle");var xy=class extends Di{constructor(){super(...arguments);ib(this,"onEnter",()=>{const {currentPoint:b}=this.app.inputs;this.app.setErasingShapes(this.app.shapesInViewport.filter(g=>
|
|||
|
g.hitTestPoint(b)))});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&(this.tool.transition("erasing"),this.app.setSelectedShapes([]))});ib(this,"onPointerUp",()=>{const b=[...this.app.erasingShapes];this.app.setErasingShapes([]);this.app.deleteShapes(b);this.tool.transition("idle")})}};ib(xy,"id","pointing");var Yt=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","crosshair")}};ib(Yt,"id","erase");ib(Yt,"states",[wy,xy,vy]);ib(Yt,
|
|||
|
"initial","idle");var Fv=class extends Di{constructor(){super(...arguments);ib(this,"handle",{});ib(this,"handleId","end");ib(this,"currentShape",{});ib(this,"initialShape",{});ib(this,"bindableShapeIds",[]);ib(this,"startBindingShapeId");ib(this,"newStartBindingId","");ib(this,"draggedBindingId","");ib(this,"onPointerMove",()=>{const {inputs:{shiftKey:b,previousPoint:g,originPoint:p,currentPoint:G,modKey:Y,altKey:la}}=this.app;var pa=this.app.getShapeById(this.initialShape.id),{handles:Ga}=this.initialShape,
|
|||
|
Qa=this.handleId,Za="start"===this.handleId?"end":"start";if(!ke.isEqual(g,G)){var fb=ke.sub(G,p);if(b){var mb=Ga[Za].point,Lb=ke.add(Ga[Qa].point,fb),Tb=ke.angle(mb,Lb);mb=ke.rotWith(Lb,mb,qm.snapAngleToSegments(Tb,24)-Tb);fb=ke.add(fb,ke.sub(mb,Lb))}fb=ke.add(Ga[Qa].point,fb);Ga={[Qa]:hf(pe({},Ga[Qa]),{point:ke.toFixed(fb),bindingId:void 0})};var Pb=this.currentShape.getHandlesChange(this.initialShape,Ga);if(Pb){Ga=Fi(pa.props,Pb);var lc={},xc;Qa=Ga.handles[Qa];Za=Ga.handles[Za];if(this.startBindingShapeId){var $b;
|
|||
|
if(fb=this.app.getShapeById(this.startBindingShapeId)){Lb=fb.getCenter();mb=Ga.handles.end;var sc=ke.add(Ga.handles.start.point,Ga.point);ke.isEqual(sc,Lb)&&sc[1]++;Tb=fb.hitTestPoint(G);sc=ke.uni(ke.sub(sc,Lb));const oc=void 0!==this.app.currentPage.bindings[this.newStartBindingId];Y||fb.hitTestPoint(ke.add(Ga.point,mb.point))||($b=Rc(pa.props,fb,"start",this.newStartBindingId,Lb,Lb,sc,Tb));$b&&!oc?(lc[this.newStartBindingId]=$b,Ga.handles.start.bindingId=$b.id):!$b&&oc&&(console.log("removing start binding"),
|
|||
|
delete lc[this.newStartBindingId],Ga.handles.start.bindingId=void 0)}}if(!Y){$b=ke.add(Za.point,Ga.point);Za=ke.add(Qa.point,Ga.point);Qa=ke.uni(ke.sub(Za,$b));const oc=ke.add(Ga.point,Ga.handles.start.point),Mc=ke.add(Ga.point,Ga.handles.end.point);fb=this.bindableShapeIds.map(Tc=>this.app.getShapeById(Tc)).sort((Tc,vd)=>vd.nonce-Tc.nonce).filter(Tc=>![oc,Mc].every(vd=>Tc.hitTestPoint(vd)));for(const Tc of fb)if(xc=Rc(pa.props,Tc,this.handleId,this.draggedBindingId,Za,$b,Qa,la))break}xc?(lc[this.draggedBindingId]=
|
|||
|
xc,Ga=Fi(Ga,{handles:{[this.handleId]:{bindingId:this.draggedBindingId}}})):(pa=pa.props.handles[this.handleId].bindingId,void 0!==pa&&(delete lc[pa],Ga=Fi(Ga,{handles:{[this.handleId]:{bindingId:void 0}}})));Pb=this.currentShape.getHandlesChange(Ga,Ga.handles);Hd(()=>{var oc;if(Pb){this.currentShape.update(Pb);this.app.currentPage.updateBindings(lc);const Mc=Object.values(null!=(oc=Pb.handles)?oc:{}).map(Tc=>Tc.bindingId).map(Tc=>this.app.currentPage.bindings[Tc]).filter(Boolean).flatMap(Tc=>[Tc.toId,
|
|||
|
Tc.fromId].filter(Boolean));this.app.setBindingShapes(Mc)}})}}});ib(this,"onPointerUp",()=>{this.tool.transition("idle");this.currentShape&&this.app.setSelectedShapes([this.currentShape]);this.app.transition("select");this.app.persist()});ib(this,"onExit",()=>{this.app.clearBindingShape();this.app.history.resume();this.app.persist()});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.deleteShapes([this.currentShape]),this.tool.transition("idle")}})}};ib(Fv,"id","creating");var ay=class extends Fv{constructor(){super(...arguments);
|
|||
|
ib(this,"onEnter",()=>{var b;this.app.history.pause();this.newStartBindingId=Gk();this.draggedBindingId=Gk();this.bindableShapeIds=this.app.currentPage.getBindableShapes();var {Shape:g}=this.tool;const {originPoint:p}=this.app.inputs;g=new g(hf(pe({},g.defaultProps),{id:Gk(),type:g.id,parentId:this.app.currentPage.id,point:p,fill:this.app.settings.color,stroke:this.app.settings.color,scaleLevel:this.app.settings.scaleLevel}));this.initialShape=Ec(g.props);this.currentShape=g;this.app.currentPage.addShapes(g);
|
|||
|
this.app.setSelectedShapes([g]);if(this.startBindingShapeId=null==(b=this.bindableShapeIds.map(G=>this.app.getShapeById(G)).filter(G=>Fk.pointInBounds(p,G.bounds))[0])?void 0:b.id)this.bindableShapeIds.splice(this.bindableShapeIds.indexOf(this.startBindingShapeId),1),this.app.setBindingShapes([this.startBindingShapeId])})}};ib(ay,"id","creating");var by=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",(b,g)=>{b.order||this.tool.transition("pointing")});ib(this,"onPinchStart",
|
|||
|
(...b)=>{var g,p;this.app.transition("select",{returnTo:this.app.currentState.id});null==(p=(g=this.app._events).onPinchStart)?void 0:p.call(g,...b)});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}});ib(this,"onPointerEnter",b=>{if(!b.order)switch(b.type){case "shape":this.app.setHoveredShape(b.shape.id);break;case "selection":"background"!==b.handle&&"center"!==b.handle&&this.tool.transition("hoveringSelectionHandle",b)}});ib(this,"onPointerLeave",b=>{b.order||
|
|||
|
"shape"===b.type&&this.app.hoveredId&&this.app.setHoveredShape(void 0)})}};ib(by,"id","idle");var cy=class extends Di{constructor(){super(...arguments);ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&(this.tool.transition("creating"),this.app.setSelectedShapes(this.app.currentPage.shapes))})}};ib(cy,"id","pointing");var Vt=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","crosshair")}};ib(Vt,"id","line");ib(Vt,
|
|||
|
"states",[by,cy,ay]);ib(Vt,"initial","idle");var dy=class extends Di{constructor(){super(...arguments);ib(this,"cursor","crosshair");ib(this,"creatingShape");ib(this,"aspectRatio");ib(this,"initialBounds",{});ib(this,"onEnter",()=>{const {currentPage:b,inputs:{originPoint:g}}=this.app,{Shape:p}=this.tool,G=new p({id:Gk(),type:p.id,parentId:b.id,point:[...g],text:"",size:[16,32],isSizeLocked:!0,fill:this.app.settings.color,stroke:this.app.settings.color});this.creatingShape=G;this.creatingShape.setScaleLevel(this.app.settings.scaleLevel);
|
|||
|
Hd(()=>{this.app.currentPage.addShapes(G);const {bounds:Y}=G;G.update({point:ke.sub(g,[Y.width/2,Y.height/2])});this.app.transition("select");this.app.setSelectedShapes([G]);this.app.currentState.transition("editingShape",{type:"shape",shape:this.creatingShape,order:0})})})}};ib(dy,"id","creating");var ey=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",(b,g)=>{b.order||this.app.readOnly||this.tool.transition("creating")});ib(this,"onPinchStart",(...b)=>{var g,p;this.app.transition("select",
|
|||
|
{returnTo:this.app.currentState.id});null==(p=(g=this.app._events).onPinchStart)?void 0:p.call(g,...b)});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}})}};ib(ey,"id","idle");var Wt=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","crosshair")}};ib(Wt,"id","box");ib(Wt,"states",[ey,dy]);ib(Wt,"initial","idle");var ZC=sf(vm()),$C=class extends ZC.default{constructor(){super(...arguments);ib(this,"toBBox",b=>b.rotatedBounds)}},fy=class extends Di{constructor(){super(...arguments);
|
|||
|
ib(this,"initialSelectedIds",[]);ib(this,"initialSelectedShapes",[]);ib(this,"tree",new $C);ib(this,"onEnter",()=>{const {selectedShapes:b,currentPage:g,selectedIds:p}=this.app;this.initialSelectedIds=Array.from(p.values());this.initialSelectedShapes=Array.from(b.values());this.tree.load(g.shapes)});ib(this,"onExit",()=>{this.initialSelectedIds=[];this.tree.clear();this.app.setBrush(void 0)});ib(this,"onPointerMove",()=>{const {inputs:{shiftKey:b,ctrlKey:g,originPoint:p,currentPoint:G}}=this.app,
|
|||
|
Y=vf.getBoundsFromPoints([G,p],0);this.app.setBrush(Y);const la=[...(new Set(this.tree.search(Y).filter(pa=>g?vf.boundsContain(Y,pa.rotatedBounds):pa.hitTestBounds(Y)).filter(pa=>"group"!==pa.type).map(pa=>{var Ga;return null!=(Ga=this.app.getParentGroup(pa))?Ga:pa})))];b?la.every(pa=>this.initialSelectedShapes.includes(pa))?this.app.setSelectedShapes(this.initialSelectedShapes.filter(pa=>!la.includes(pa))):this.app.setSelectedShapes([...(new Set([...this.initialSelectedShapes,...la]))]):this.app.setSelectedShapes(la);
|
|||
|
this.app.viewport.panToPointWhenOutOfBounds(G)});ib(this,"onPointerUp",()=>{this.app.setBrush(void 0);this.tool.transition("idle")});ib(this,"handleModifierKey",(b,g)=>{switch(g.key){case "Escape":this.app.setBrush(void 0),this.app.setSelectedShapes(this.initialSelectedIds),this.tool.transition("idle")}})}};ib(fy,"id","brushing");var gy=class extends Di{constructor(){super(...arguments);ib(this,"onEnter",b=>{var g;const {selectedIds:p,inputs:{shiftKey:G}}=this.app;if("shape"===b.type&&!p.has(b.shape.id)){const Y=
|
|||
|
null!=(g=this.app.getParentGroup(b.shape))?g:b.shape;G?this.app.setSelectedShapes([...Array.from(p.values()),Y.id]):this.app.setSelectedShapes([Y])}});ib(this,"onPointerDown",()=>{this.tool.transition("idle")})}};ib(gy,"id","contextMenu");var hy=class extends Di{constructor(){super(...arguments);ib(this,"onEnter",b=>{"pinching"===b.fromId&&this.parent.returnTo&&this.app.transition(this.parent.returnTo)});ib(this,"onExit",()=>{});ib(this,"onPointerEnter",b=>{if(!b.order)switch(b.type){case "shape":this.app.setHoveredShape(b.shape.id);
|
|||
|
break;case "selection":"background"!==b.handle&&"center"!==b.handle&&this.tool.transition("hoveringSelectionHandle",b);break;case "canvas":this.app.setHoveredShape(void 0)}});ib(this,"onPointerDown",(b,g)=>{const {selectedShapes:p,inputs:{ctrlKey:G}}=this.app;if(2===g.button)this.tool.transition("contextMenu",b);else if(G)this.tool.transition("pointingCanvas");else switch(b.type){case "selection":switch(b.handle){case "center":break;case "background":this.tool.transition("pointingBoundsBackground");
|
|||
|
break;case "rotate":this.tool.transition("pointingRotateHandle");break;default:this.tool.transition("pointingResizeHandle",b)}break;case "shape":if(p.has(b.shape))this.tool.transition("pointingSelectedShape",b);else{const {selectionBounds:Y,inputs:la}=this.app;Y&&Fk.pointInBounds(la.currentPoint,Y)?this.tool.transition("pointingShapeBehindBounds",b):this.tool.transition("pointingShape",b)}break;case "handle":this.tool.transition("pointingHandle",b);break;case "canvas":this.tool.transition("pointingCanvas");
|
|||
|
break;case "minimap":this.tool.transition("pointingMinimap",pe(pe({},g),b))}});ib(this,"onPointerLeave",b=>{b.order||"shape"===b.type&&this.app.hoveredId&&this.app.setHoveredShape(void 0)});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})});ib(this,"onDoubleClick",b=>{if(!b.order&&1===this.app.selectedShapesArray.length&&!this.app.readOnly){var g=this.app.selectedShapesArray[0];if(g.canEdit&&!g.props.isLocked)switch(b.type){case "shape":this.tool.transition("editingShape",
|
|||
|
b);break;case "selection":1===this.app.selectedShapesArray.length&&this.tool.transition("editingShape",{type:"shape",target:g})}}});ib(this,"onKeyDown",(b,g)=>{({selectedShapesArray:b}=this.app);switch(g.key){case "Enter":1===b.length&&b[0].canEdit&&!this.app.readOnly&&this.tool.transition("editingShape",{type:"shape",shape:b[0],order:0});break;case "Escape":b.length&&this.app.setSelectedShapes([])}})}};ib(hy,"id","idle");var Ux=class extends Di{constructor(){super(...arguments);ib(this,"onEnter",
|
|||
|
b=>{var g;const {selectedIds:p,inputs:{shiftKey:G}}=this.app,Y=null!=(g=this.app.getParentGroup(b.shape))?g:b.shape;G?this.app.setSelectedShapes([...Array.from(p.values()),Y.id]):this.app.setSelectedShapes([Y])});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&this.tool.transition("translating")});ib(this,"onPointerUp",()=>{this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}};
|
|||
|
ib(Ux,"id","pointingShape");var Vx=class extends Di{constructor(){super(...arguments);ib(this,"cursor","move");ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&this.tool.transition("translating")});ib(this,"onPointerUp",()=>{this.app.setSelectedShapes([]);this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}};ib(Vx,"id","pointingBoundsBackground");var Wx=class extends Di{constructor(){super(...arguments);
|
|||
|
ib(this,"onEnter",()=>{var b;const {shiftKey:g}=this.app.inputs;g||(this.app.setSelectedShapes([]),this.app.setEditingShape(),null==(b=window.getSelection())?void 0:b.removeAllRanges())});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&this.tool.transition("brushing")});ib(this,"onPointerUp",()=>{this.app.inputs.shiftKey||this.app.setSelectedShapes([]);this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,
|
|||
|
event:g})});ib(this,"onDoubleClick",()=>{this.app.notify("canvas-dbclick",{point:this.app.inputs.originPoint})})}};ib(Wx,"id","pointingCanvas");var Xx=class extends Di{constructor(){super(...arguments);ib(this,"cursor","move");ib(this,"isCloning",!1);ib(this,"didClone",!1);ib(this,"initialPoints",{});ib(this,"initialShapePoints",{});ib(this,"initialClonePoints",{});ib(this,"clones",[]);ib(this,"onEnter",()=>{var b;this.app.history.pause();const {allSelectedShapesArray:g,inputs:p}=this.app;this.initialPoints=
|
|||
|
this.initialShapePoints=Object.fromEntries(g.map(({id:G,props:{point:Y}})=>[G,Y.slice()]));document.querySelectorAll("input,textarea").forEach(G=>G.blur());null==(b=document.getSelection())?void 0:b.empty();p.altKey?this.startCloning():this.moveSelectedShapesToPointer()});ib(this,"onExit",()=>{this.app.history.resume();this.isCloning=this.didClone=!1;this.clones=[];this.initialPoints={};this.initialShapePoints={};this.initialClonePoints={}});ib(this,"onPointerMove",()=>{const {inputs:{currentPoint:b}}=
|
|||
|
this.app;this.moveSelectedShapesToPointer();this.app.viewport.panToPointWhenOutOfBounds(b)});ib(this,"onPointerDown",()=>{this.app.history.resume();this.app.persist();this.tool.transition("idle")});ib(this,"onPointerUp",()=>{this.app.history.resume();this.app.persist();this.tool.transition("idle")});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Alt":this.startCloning();break;case "Escape":this.app.allSelectedShapes.forEach(p=>{p.update({point:this.initialPoints[p.id]})}),this.tool.transition("idle")}});
|
|||
|
ib(this,"onKeyUp",(b,g)=>{switch(g.key){case "Alt":if(!this.isCloning)throw Error("Expected to be cloning.");const {currentPage:p,allSelectedShapes:G}=this.app;p.removeShapes(...G);this.initialPoints=this.initialShapePoints;this.app.setSelectedShapes(Object.keys(this.initialPoints));this.moveSelectedShapesToPointer();this.isCloning=!1}})}moveSelectedShapesToPointer(){const {inputs:{shiftKey:b,originPoint:g,currentPoint:p}}=this.app,{initialPoints:G}=this,Y=Id.sub(p,g);b&&(Math.abs(Y[0])<Math.abs(Y[1])?
|
|||
|
Y[0]=0:Y[1]=0);Hd(()=>{this.app.allSelectedShapesArray.forEach(la=>{la.props.isLocked||la.update({point:Id.add(G[la.id],Y)})})})}startCloning(){this.didClone||(this.clones=this.app.allSelectedShapesArray.map(b=>{const g=this.app.getShapeClass(b.type);if(!g)throw Error("Could not find that shape class.");return new g(hf(pe({},b.serialized),{id:Gk(),type:b.type,point:this.initialPoints[b.id],rotation:b.props.rotation,isLocked:!1}))}),this.initialClonePoints=Object.fromEntries(this.clones.map(({id:b,
|
|||
|
props:{point:g}})=>[b,g.slice()])),this.didClone=!0);this.app.allSelectedShapes.forEach(b=>{b.update({point:this.initialPoints[b.id]})});this.initialPoints=this.initialClonePoints;this.app.currentPage.addShapes(...this.clones);this.app.setSelectedShapes(Object.keys(this.initialClonePoints));this.moveSelectedShapesToPointer();this.isCloning=!0}};ib(Xx,"id","translating");var Yx=class extends Di{constructor(){super(...arguments);ib(this,"pointedSelectedShape");ib(this,"onEnter",b=>{this.pointedSelectedShape=
|
|||
|
b.shape});ib(this,"onExit",()=>{this.pointedSelectedShape=void 0});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&this.tool.transition("translating")});ib(this,"onPointerUp",()=>{const {shiftKey:b,currentPoint:g}=this.app.inputs;var {selectedShapesArray:p}=this.app;if(!this.pointedSelectedShape)throw Error("Expected a pointed selected shape");if(b)({selectedIds:p}=this.app),p=Array.from(p.values()),p.splice(p.indexOf(this.pointedSelectedShape.id),
|
|||
|
1),this.app.setSelectedShapes(p);else{if(1===p.length&&this.pointedSelectedShape.canEdit&&!this.app.readOnly&&!this.pointedSelectedShape.props.isLocked&&this.pointedSelectedShape instanceof An&&Fk.pointInBounds(g,this.pointedSelectedShape.bounds)){this.tool.transition("editingShape",{shape:this.pointedSelectedShape,order:0,type:"shape"});return}this.app.setSelectedShapes([this.pointedSelectedShape.id])}this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,
|
|||
|
event:g})})}};ib(Yx,"id","pointingSelectedShape");var Zx=class extends Di{constructor(){super(...arguments);ib(this,"info",{});ib(this,"onEnter",b=>{this.info=b;this.updateCursor()});ib(this,"onExit",()=>{this.app.cursors.reset()});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&this.tool.transition("resizing",this.info)});ib(this,"onPointerUp",()=>{this.tool.transition("hoveringSelectionHandle",this.info)});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",
|
|||
|
{info:b,event:g})})}updateCursor(){this.app.cursors.setCursor(zr[this.info.handle],this.app.selectionBounds.rotation)}};ib(Zx,"id","pointingResizeHandle");var $x=class extends Di{constructor(){super(...arguments);ib(this,"isSingle",!1);ib(this,"handle","bottom_right_corner");ib(this,"snapshots",{});ib(this,"initialCommonBounds",{});ib(this,"selectionRotation",0);ib(this,"resizeType","corner");ib(this,"onEnter",b=>{var g,p;const {history:G,selectedShapesArray:Y,selectionBounds:la}=this.app;if(!la)throw Error("Expected a selected bounds.");
|
|||
|
this.handle=b.handle;this.resizeType="left_edge"===b.handle||"right_edge"===b.handle?"horizontal-edge":"top_edge"===b.handle||"bottom_edge"===b.handle?"vertical-edge":"corner";this.app.cursors.setCursor($x.CURSORS[b.handle],null==(g=this.app.selectionBounds)?void 0:g.rotation);G.pause();const pa=vf.getBoundsFromPoints(Y.map(Ga=>vf.getBoundsCenter(Ga.bounds)));this.selectionRotation=(this.isSingle=1===Y.length)?null!=(p=Y[0].props.rotation)?p:0:0;this.initialCommonBounds=pe({},la);this.snapshots=Object.fromEntries(Y.map(Ga=>
|
|||
|
{const Qa=pe({},Ga.bounds),[Za,fb]=vf.getBoundsCenter(Qa);return[Ga.id,{props:Ga.serialized,bounds:Qa,transformOrigin:[(Za-this.initialCommonBounds.minX)/this.initialCommonBounds.width,(fb-this.initialCommonBounds.minY)/this.initialCommonBounds.height],innerTransformOrigin:[(Za-pa.minX)/pa.width,(fb-pa.minY)/pa.height],isAspectRatioLocked:Ga.props.isAspectRatioLocked||!(Ga.canChangeAspectRatio&&!Ga.props.rotation)}]}));Y.forEach(Ga=>{var Qa;null==(Qa=Ga.onResizeStart)?void 0:Qa.call(Ga,{isSingle:this.isSingle})})});
|
|||
|
ib(this,"onExit",()=>{this.app.cursors.reset();this.snapshots={};this.initialCommonBounds={};this.selectionRotation=0;this.app.history.resume()});ib(this,"onPointerMove",()=>{const {inputs:{altKey:b,shiftKey:g,ctrlKey:p,originPoint:G,currentPoint:Y}}=this.app,{handle:la,snapshots:pa,initialCommonBounds:Ga}=this;let Qa=Id.sub(Y,G);b&&(Qa=Id.mul(Qa,2));const Za=this.app.selectedShapes.values().next().value;let fb=vf.getTransformedBoundingBox(Ga,la,Qa,this.selectionRotation,g||this.isSingle&&(p?!("clipping"in
|
|||
|
Za.props):!Za.canChangeAspectRatio||Za.props.isAspectRatioLocked));b&&(fb=pe(pe({},fb),vf.centerBounds(fb,vf.getBoundsCenter(Ga))));const {scaleX:mb,scaleY:Lb}=fb;this.app.selectedShapes.forEach(Tb=>{var Pb,lc;const {props:xc,bounds:$b,transformOrigin:sc}=pa[Tb.id];let oc=vf.getRelativeTransformedBoundingBox(fb,Ga,$b,0>mb,0>Lb);if(Tb.canResize.some(vd=>vd)||Tb.props.isSizeLocked||!this.isSingle){var Mc=[mb,Lb],Tc=null!=(Pb=xc.rotation)?Pb:0;Pb=vf.getBoundsCenter(oc);Tb.canFlip||(Mc=Id.abs(Mc));Tb.canScale||
|
|||
|
(Mc=null!=(lc=xc.scale)?lc:[1,1]);if(Tc&&0>mb&&0<=Lb||0>Lb&&0<=mb)Tc*=-1;Tb.onResize(xc,{center:Pb,rotation:Tc,scale:Mc,bounds:oc,type:la,clip:p,transformOrigin:sc})}});this.updateCursor(mb,Lb);this.app.viewport.panToPointWhenOutOfBounds(Y)});ib(this,"onPointerUp",()=>{this.app.history.resume();this.app.persist();this.tool.transition("idle")});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.selectedShapes.forEach(p=>{p.update(pe({},this.snapshots[p.id].props))}),this.tool.transition("idle")}})}updateCursor(b,
|
|||
|
g){var p,G,Y,la;const pa=0>b&&0<=g;b=0>g&&0<=b;switch(this.handle){case "top_left_corner":case "bottom_right_corner":pa||b?"nwse-resize"===this.app.cursors.cursor&&this.app.cursors.setCursor("nesw-resize",null==(p=this.app.selectionBounds)?void 0:p.rotation):"nesw-resize"===this.app.cursors.cursor&&this.app.cursors.setCursor("nwse-resize",null==(G=this.app.selectionBounds)?void 0:G.rotation);break;case "top_right_corner":case "bottom_left_corner":pa||b?"nesw-resize"===this.app.cursors.cursor&&this.app.cursors.setCursor("nwse-resize",
|
|||
|
null==(Y=this.app.selectionBounds)?void 0:Y.rotation):"nwse-resize"===this.app.cursors.cursor&&this.app.cursors.setCursor("nesw-resize",null==(la=this.app.selectionBounds)?void 0:la.rotation)}}},Ev=$x;ib(Ev,"id","resizing");ib(Ev,"CURSORS",{bottom_edge:"ns-resize",top_edge:"ns-resize",left_edge:"ew-resize",right_edge:"ew-resize",bottom_left_corner:"nesw-resize",bottom_right_corner:"nwse-resize",top_left_corner:"nwse-resize",top_right_corner:"nesw-resize"});var Tx=class extends Di{constructor(){super(...arguments);
|
|||
|
ib(this,"cursor","rotate");ib(this,"handle","");ib(this,"onEnter",b=>{this.app.history.pause();this.handle=b.handle;this.updateCursor()});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&this.tool.transition("rotating",{handle:this.handle})});ib(this,"onPointerUp",()=>{this.app.history.resume();this.app.persist();this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}updateCursor(){this.app.cursors.setCursor(zr[this.handle],
|
|||
|
this.app.selectionRotation)}};ib(Tx,"id","pointingRotateHandle");var lz=class extends Di{constructor(){super(...arguments);ib(this,"info",{});ib(this,"onEnter",b=>{this.info=b});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&!this.app.readOnly&&this.tool.transition("translating")});ib(this,"onPointerUp",()=>{const {selectedIds:b,inputs:{shiftKey:g}}=this.app;g?this.app.setSelectedShapes([...Array.from(b.values()),this.info.shape.id]):this.app.setSelectedShapes([this.info.shape.id]);
|
|||
|
this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}};ib(lz,"id","pointingShapeBehindBounds");var Nv=class extends Di{constructor(){super(...arguments);ib(this,"cursor","rotate");ib(this,"snapshot",{});ib(this,"initialCommonCenter",[0,0]);ib(this,"initialCommonBounds",{});ib(this,"initialAngle",0);ib(this,"initialSelectionRotation",0);ib(this,"handle","");ib(this,"onEnter",b=>{const {history:g,selectedShapesArray:p,selectionBounds:G}=this.app;
|
|||
|
if(!G)throw Error("Expected selected bounds.");g.pause();this.handle=b.handle;this.initialSelectionRotation=this.app.selectionRotation;this.initialCommonBounds=pe({},G);this.initialCommonCenter=vf.getBoundsCenter(G);this.initialAngle=Id.angle(this.initialCommonCenter,this.app.inputs.currentPoint);this.snapshot=Object.fromEntries(p.map(Y=>[Y.id,{point:[...Y.props.point],center:[...Y.center],rotation:Y.props.rotation,handles:"handles"in Y?er(Y.handles):void 0}]));this.updateCursor()});ib(this,"onExit",
|
|||
|
()=>{this.app.history.resume();this.snapshot={}});ib(this,"onPointerMove",()=>{const {selectedShapes:b,inputs:{shiftKey:g,currentPoint:p}}=this.app,{snapshot:G,initialCommonCenter:Y,initialAngle:la,initialSelectionRotation:pa}=this;let Ga=Id.angle(Y,p)-la;g&&(Ga=qm.snapAngleToSegments(Ga,24));b.forEach(Za=>{var fb=G[Za.id];let mb=0;if(g){var {rotation:Lb=0}=fb;mb=qm.snapAngleToSegments(Lb,24)-Lb}const Tb=Id.sub(fb.center,fb.point);Lb=Id.rotWith(fb.center,Y,Ga);if("handles"in Za){fb=fb.handles;const Pb=
|
|||
|
fb.map(xc=>Id.rotWith(xc.point,Tb,Ga)),lc=vf.getCommonTopLeft(Pb);Za.update({point:Id.add(lc,Id.sub(Lb,Tb)),handles:fb.map((xc,$b)=>hf(pe({},xc),{point:Id.sub(Pb[$b],lc)}))})}else Za.update({point:Id.sub(Lb,Tb),rotation:qm.clampRadians((fb.rotation||0)+Ga+mb)})});const Qa=qm.clampRadians(pa+Ga);this.app.setSelectionRotation(g?qm.snapAngleToSegments(Qa,24):Qa);this.updateCursor()});ib(this,"onPointerUp",()=>{this.app.history.resume();this.app.persist();this.tool.transition("idle")});ib(this,"onKeyDown",
|
|||
|
(b,g)=>{switch(g.key){case "Escape":this.app.selectedShapes.forEach(p=>{p.update(this.snapshot[p.id])}),this.tool.transition("idle")}})}updateCursor(){this.app.cursors.setCursor(zr[this.handle],this.app.selectionRotation)}};ib(Nv,"id","rotating");var Gy=class extends Di{constructor(){super(...arguments);ib(this,"onPinch",(b,g)=>{this.app.viewport.pinchZoom(b.point,b.delta,b.delta[2])});ib(this,"onPinchEnd",()=>{this.tool.transition("idle")});ib(this,"onPointerDown",()=>{this.tool.transition("idle")})}};
|
|||
|
ib(Gy,"id","pinching");var Hy=class extends Fv{constructor(){super(...arguments);ib(this,"cursor","grabbing");ib(this,"onEnter",b=>{this.app.history.pause();this.newStartBindingId=Gk();this.draggedBindingId=Gk();this.bindableShapeIds=this.app.currentPage.getBindableShapes();this.handleId=b.id;this.currentShape=b.shape;this.initialShape=Ec(this.currentShape.props);this.app.setSelectedShapes([this.currentShape])})}};ib(Hy,"id","translatingHandle");var Iy=class extends Di{constructor(){super(...arguments);
|
|||
|
ib(this,"cursor","grabbing");ib(this,"info",{});ib(this,"onEnter",b=>{this.info=b});ib(this,"onPointerMove",()=>{const {currentPoint:b,originPoint:g}=this.app.inputs;5<Id.dist(b,g)&&this.tool.transition("translatingHandle",this.info)});ib(this,"onPointerUp",()=>{this.tool.transition("idle")});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}};ib(Iy,"id","pointingHandle");var Jy=class extends Di{constructor(){super(...arguments);ib(this,"handle");ib(this,"onEnter",
|
|||
|
b=>{var g;this.app.cursors.setCursor(zr[b.handle],null!=(g=this.app.selectionBounds.rotation)?g:0);this.handle=b.handle});ib(this,"onExit",()=>{this.app.cursors.reset()});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})});ib(this,"onPointerDown",b=>{switch(b.type){case "selection":switch(b.handle){case "center":break;case "background":break;case "top_left_resize_corner":case "top_right_resize_corner":case "bottom_right_resize_corner":case "bottom_left_resize_corner":this.tool.transition("pointingRotateHandle",
|
|||
|
b);break;default:this.tool.transition("pointingResizeHandle",b)}}});ib(this,"onPointerLeave",()=>{this.tool.transition("idle")});ib(this,"onDoubleClick",b=>{var g;if(!b.order&&1===this.app.selectedShapes.size){var p=this.app.selectedShapes.values().next().value;if(!p.canEdit||this.app.readOnly||p.props.isLocked)p.onResetBounds({asset:p.props.assetId?this.app.assets[p.props.assetId]:void 0,zoom:this.app.viewport.camera.zoom}),this.tool.transition("idle");else switch(b.type){case "shape":this.tool.transition("editingShape",
|
|||
|
b);break;case "selection":null==(g=p.onResetBounds)?void 0:g.call(p,{zoom:this.app.viewport.camera.zoom}),1===this.app.selectedShapesArray.length&&this.tool.transition("editingShape",{type:"shape",target:p})}}})}};ib(Jy,"id","hoveringSelectionHandle");var Ky=class extends Di{constructor(){super(...arguments);ib(this,"editingShape",{});ib(this,"onEnter",b=>{this.editingShape=b.shape;this.app.setEditingShape(b.shape)});ib(this,"onExit",()=>{var b;if(this.editingShape&&"text"in this.editingShape.props){const g=
|
|||
|
this.editingShape.props.text.trim();""===g&&"text"===this.editingShape.props.type?this.app.deleteShapes([this.editingShape]):(this.editingShape.onResetBounds(),this.editingShape.update({text:g}))}this.app.persist();this.app.setEditingShape();null==(b=document.querySelector(".tl-canvas"))?void 0:b.focus()});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})});ib(this,"onPointerDown",b=>{switch(b.type){case "shape":if(b.shape===this.editingShape)break;this.tool.transition("idle",
|
|||
|
b);break;case "canvas":b.order||this.tool.transition("idle",b)}});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":Hd(()=>{g.stopPropagation();this.app.setSelectedShapes([this.editingShape]);this.tool.transition("idle")})}})}};ib(Ky,"id","editingShape");var Ly=class extends Di{constructor(){super(...arguments);ib(this,"minimapZoom",1);ib(this,"minimapRect",{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0});ib(this,"getCameraPoint",b=>{const g=document.querySelector(".tl-preview-minimap svg");
|
|||
|
var p=document.querySelector(".tl-preview-minimap #minimap-camera-rect");if(g&&p){const G=g.getBoundingClientRect();this.minimapRect.height=G.height;this.minimapRect.width=G.width;this.minimapRect.minX=G.left;this.minimapRect.minY=G.top;this.minimapRect.maxX=G.right;this.minimapRect.maxY=G.bottom;this.minimapZoom=+g.dataset.commonBoundWidth/this.minimapRect.width;b=Id.sub(b,[this.minimapRect.minX,this.minimapRect.minY]);p=p.getBoundingClientRect();p=Id.mul(Id.sub(b,[p.left+p.width/2,p.top+p.height/
|
|||
|
2]),this.minimapZoom);return Id.sub(this.app.viewport.camera.point,p)}});ib(this,"onEnter",b=>{(b=this.getCameraPoint([b.clientX,b.clientY]))?this.app.viewport.update({point:b}):this.tool.transition("idle")});ib(this,"onPointerMove",(b,g)=>{"clientX"in g&&(b=this.getCameraPoint([g.clientX,g.clientY]))&&this.app.viewport.update({point:b})});ib(this,"onPointerUp",()=>{this.tool.transition("idle")})}};ib(Ly,"id","pointingMinimap");var Rr=class extends Wp{constructor(){super(...arguments);ib(this,"returnTo",
|
|||
|
"");ib(this,"onEnter",b=>{this.returnTo=null==b?void 0:b.returnTo})}};ib(Rr,"id","select");ib(Rr,"initial","idle");ib(Rr,"shortcut","whiteboard/select");ib(Rr,"states",[hy,fy,gy,Wx,Ux,lz,Yx,Vx,Jy,Zx,Tx,Ly,Iy,Hy,Xx,Ev,Nv,Nv,Gy,Ky]);var My=class extends Di{constructor(){super(...arguments);ib(this,"cursor","grabbing");ib(this,"originalScreenPoint",[]);ib(this,"originalCameraPoint",[]);ib(this,"prevState","idle");ib(this,"onEnter",b=>{this.prevState=null==b?void 0:b.prevState;this.originalScreenPoint=
|
|||
|
this.app.inputs.currentScreenPoint;this.originalCameraPoint=this.app.viewport.camera.point});ib(this,"onPointerMove",(b,g)=>{b=ke.sub(this.originalScreenPoint,this.app.inputs.currentScreenPoint);this.app.viewport.update({point:ke.sub(this.originalCameraPoint,ke.div(b,this.app.viewport.camera.zoom))})});ib(this,"onPointerUp",()=>{var b;this.tool.transition(null!=(b=this.prevState)?b:"idle")})}};ib(My,"id","panning");var Ny=class extends Di{constructor(){super(...arguments);ib(this,"onEnter",b=>{this.parent.prevTool&&
|
|||
|
b.exit&&(this.app.setCurrentState(this.parent.prevTool),setTimeout(()=>{this.app.cursors.reset();this.app.cursors.setCursor(this.parent.prevTool.cursor)}))});ib(this,"onPointerDown",(b,g)=>{b.order||this.tool.transition("panning")})}};ib(Ny,"id","idle");var Oy=class extends Di{constructor(){super(...arguments);ib(this,"onPointerDown",(b,g)=>{b.order||this.tool.transition("panning",{prevState:"idleHold"})});ib(this,"onPinchStart",(b,g)=>{this.tool.transition("pinching",{info:b,event:g})})}};ib(Oy,
|
|||
|
"id","idleHold");var Fy=class extends Di{constructor(){super(...arguments);ib(this,"origin",[0,0]);ib(this,"prevDelta",[0,0]);ib(this,"onEnter",b=>{this.prevDelta=b.info.delta;this.origin=b.info.point});ib(this,"onPinch",b=>{this.app.viewport.pinchZoom(b.point,b.delta,b.delta[2])});ib(this,"onPinchEnd",()=>{this.tool.transition("idle")})}};ib(Fy,"id","pinching");var Qr=class extends Wp{constructor(){super(...arguments);ib(this,"cursor","grab");ib(this,"prevTool",null);ib(this,"onEnter",b=>{this.prevTool=
|
|||
|
null==b?void 0:b.prevTool});ib(this,"onKeyDown",(b,g)=>{switch(g.key){case "Escape":this.app.transition("select")}});ib(this,"onPinchStart",(b,g)=>{this.transition("pinching",{info:b,event:g})})}};ib(Qr,"id","move");ib(Qr,"shortcut","whiteboard/pan");ib(Qr,"states",[Ny,Oy,My,Fy]);ib(Qr,"initial","idle");var Cm=class{constructor(b,g={}){ib(this,"lastShapesNounces",null);ib(this,"app");ib(this,"id");ib(this,"name");ib(this,"shapes",[]);ib(this,"bindings",{});ib(this,"nonce",0);ib(this,"bringForward",
|
|||
|
Ga=>{const Qa=this.parseShapesArg(Ga);Qa.sort((Za,fb)=>this.shapes.indexOf(fb)-this.shapes.indexOf(Za)).map(Za=>this.shapes.indexOf(Za)).forEach(Za=>{if(Za!==this.shapes.length-1&&!Qa.includes(this.shapes[Za+1])){var fb=this.shapes[Za];this.shapes[Za]=this.shapes[Za+1];this.shapes[Za+1]=fb}});this.app.persist();return this});ib(this,"sendBackward",Ga=>{const Qa=this.parseShapesArg(Ga);Qa.sort((Za,fb)=>this.shapes.indexOf(Za)-this.shapes.indexOf(fb)).map(Za=>this.shapes.indexOf(Za)).forEach(Za=>{if(0!==
|
|||
|
Za&&!Qa.includes(this.shapes[Za-1])){var fb=this.shapes[Za];this.shapes[Za]=this.shapes[Za-1];this.shapes[Za-1]=fb}});this.app.persist();return this});ib(this,"bringToFront",Ga=>{const Qa=this.parseShapesArg(Ga);this.shapes=this.shapes.filter(Za=>!Qa.includes(Za)).concat(Qa);this.app.persist();return this});ib(this,"sendToBack",Ga=>{const Qa=this.parseShapesArg(Ga);this.shapes=Qa.concat(this.shapes.filter(Za=>!Qa.includes(Za)));this.app.persist();return this});ib(this,"flip",(Ga,Qa)=>{Ga=this.parseShapesArg(Ga);
|
|||
|
const Za=vf.getCommonBounds(Ga.map(fb=>fb.bounds));Ga.forEach(fb=>{var mb;const Lb=vf.getRelativeTransformedBoundingBox(Za,Za,fb.bounds,"horizontal"===Qa,"vertical"===Qa);if(fb.serialized)fb.onResize(fb.serialized,{bounds:Lb,center:vf.getBoundsCenter(Lb),rotation:null!=(mb=fb.props.rotation)?mb:-0,type:"top_left_corner",scale:fb.canFlip&&fb.props.scale?"horizontal"===Qa?[-fb.props.scale[0],1]:[1,-fb.props.scale[1]]:[1,1],clip:!1,transformOrigin:[.5,.5]})});this.app.persist();return this});ib(this,
|
|||
|
"getShapeById",Ga=>this.shapes.find(Qa=>Qa.id===Ga));ib(this,"cleanup",Ga=>{Ga=kc(this.bindings,Ga);const Qa=new Set;let Za=!1,fb=!1;const mb=er(this.bindings);Ga.forEach(Lb=>{var Tb;if(this.bindings[Lb.id]){var Pb=this.getShapeById(Lb.toId),lc=this.getShapeById(Lb.fromId);Pb&&lc?Qa.has(lc.id)||(Lb=this.updateArrowBindings(lc),Qa.add(lc.id),Lb&&(lc=pe(pe({},lc.props),Lb),Za=!0,null==(Tb=this.getShapeById(lc.id))?void 0:Tb.update(lc,!1,!0))):(delete mb[Lb.id],fb=!0)}});Object.keys(mb).forEach(Lb=>
|
|||
|
{const Tb=this.bindings[Lb];0===this.shapes.filter(Pb=>Pb.id===Tb.fromId||Pb.id===Tb.toId).length&&(delete mb[Lb],fb=!0)});fb&&this.update({bindings:mb});(Za||fb)&&this.app.persist(!0)});ib(this,"updateArrowBindings",Ga=>{var Qa,Za,fb,mb={start:er(Ga.props.handles.start),end:er(Ga.props.handles.end)},Lb={isBound:!1,handle:Ga.props.handles.start,point:ke.add(Ga.props.handles.start.point,Ga.props.point)},Tb={isBound:!1,handle:Ga.props.handles.end,point:ke.add(Ga.props.handles.end.point,Ga.props.point)};
|
|||
|
if(Ga.props.handles.start.bindingId){var Pb=void 0!==(null==(Qa=Ga.props.decorations)?void 0:Qa.start);Qa=Ga.props.handles.start;var lc=this.bindings[Ga.props.handles.start.bindingId],xc=this.getShapeById(null==lc?void 0:lc.toId);if(xc){Lb=xc.getBounds();var $b=xc.getExpandedBounds(),sc=vf.expandBounds(Lb,Pb?lc.distance:1);const {minX:oc,minY:Mc,width:Tc,height:vd}=$b,de=ke.add([oc,Mc],ke.mulV([Tc,vd],ke.rotWith(lc.point,[.5,.5],xc.props.rotation||0)));Lb={isBound:!0,hasDecoration:Pb,binding:lc,handle:Qa,
|
|||
|
point:de,target:xc,bounds:Lb,expandedBounds:$b,intersectBounds:sc,center:xc.getCenter()}}}if(Ga.props.handles.end.bindingId&&(Pb=void 0!==(null==(Za=Ga.props.decorations)?void 0:Za.end),Za=Ga.props.handles.end,Qa=this.bindings[Ga.props.handles.end.bindingId],lc=this.getShapeById(null==Qa?void 0:Qa.toId))){Tb=lc.getBounds();xc=lc.getExpandedBounds();$b=Pb?vf.expandBounds(Tb,Qa.distance):Tb;const {minX:oc,minY:Mc,width:Tc,height:vd}=xc;sc=ke.add([oc,Mc],ke.mulV([Tc,vd],ke.rotWith(Qa.point,[.5,.5],lc.props.rotation||
|
|||
|
0)));Tb={isBound:!0,hasDecoration:Pb,binding:Qa,handle:Za,point:sc,target:lc,bounds:Tb,expandedBounds:xc,intersectBounds:$b,center:lc.getCenter()}}for(const oc of["end","start"]){Za="start"===oc?Lb:Tb;const Mc="start"===oc?Tb:Lb;if(Za.isBound)if(Za.binding.distance){if(Pb=ke.uni(ke.sub(Za.point,Mc.point)),Qa=C(Mc.point,Pb,Za.intersectBounds,Za.target.props.rotation).filter(Tc=>Tc.didIntersect).map(Tc=>Tc.points[0]).sort((Tc,vd)=>ke.dist(Tc,Mc.point)-ke.dist(vd,Mc.point)),Qa[0])if(lc=void 0,Mc.isBound&&
|
|||
|
(lc=C(Mc.point,Pb,Mc.intersectBounds,Mc.target.props.rotation).filter(Tc=>Tc.didIntersect).map(Tc=>Tc.points[0]).sort((Tc,vd)=>ke.dist(Tc,Mc.point)-ke.dist(vd,Mc.point))[0]),Mc.isBound&&(2>Qa.length||lc&&Qa[0]&&10>Math.ceil(ke.dist(Qa[0],lc))||vf.boundsContain(Za.expandedBounds,Mc.expandedBounds)||vf.boundsCollide(Za.expandedBounds,Mc.expandedBounds)))Pb=ke.uni(ke.sub(Mc.point,Za.point)),Qa=C(Za.point,Pb,Za.bounds,Za.target.props.rotation).filter(Tc=>Tc.didIntersect).map(Tc=>Tc.points[0]),Qa[0]&&
|
|||
|
(mb[oc].point=ke.toFixed(ke.sub(Qa[0],Ga.props.point)),mb["start"===oc?"end":"start"].point=ke.toFixed(ke.add(ke.sub(Qa[0],Ga.props.point),ke.mul(Pb,Math.min(ke.dist(Qa[0],Mc.point),10*(vf.boundsContain(Mc.bounds,Za.intersectBounds)?-1:1))))));else{if(!Mc.isBound&&(Qa[0]&&10>ke.dist(Qa[0],Mc.point)||Fk.pointInBounds(Mc.point,Za.intersectBounds)))return mb=ke.uni(ke.sub(Za.center,Mc.point)),null==(fb=Ga.getHandlesChange)?void 0:fb.call(Ga,Ga.props,{[oc]:hf(pe({},Ga.props.handles[oc]),{point:ke.toFixed(ke.add(ke.sub(Mc.point,
|
|||
|
Ga.props.point),ke.mul(mb,10)))})});Qa[0]&&(mb[oc].point=ke.toFixed(ke.sub(Qa[0],Ga.props.point)))}}else mb[oc].point=ke.sub(Za.point,Ga.props.point)}return Ga.getHandlesChange(Ga.props,mb)});const {id:p,name:G,shapes:Y=[],bindings:la={},nonce:pa}=g;this.id=p;this.name=G;this.bindings=Object.assign({},la);this.app=b;this.nonce=pa||0;this.addShapes(...Y);Ag(this);Ld(()=>{const Ga=0<this.shapes.length?Object.fromEntries(this.shapes.map(Qa=>[Qa.id,Qa.nonce])):null;if(this.lastShapesNounces&&Ga){const Qa=
|
|||
|
this.lastShapesNounces,Za=[...(new Set([...Object.keys(Ga),...Object.keys(Qa)]))].filter(fb=>Qa[fb]!==Ga[fb]);requestAnimationFrame(()=>{this.cleanup(Za)})}Ga&&(this.lastShapesNounces=Ga)})}get serialized(){return{id:this.id,name:this.name,shapes:this.shapes.map(b=>b.serialized).filter(b=>!!b).map(b=>Ec(b)),bindings:er(this.bindings),nonce:this.nonce}}get shapesById(){return Object.fromEntries(this.shapes.map(b=>[b.id,b]))}update(b){Object.assign(this,b);return this}updateBindings(b){Object.assign(this.bindings,
|
|||
|
b);return this}updateShapesIndex(b){this.shapes.sort((g,p)=>b.indexOf(g.id)-b.indexOf(p.id));return this}addShapes(...b){if(0!==b.length)return b="getBounds"in b[0]?b:b.map(g=>new (this.app.getShapeClass(g.type))(g)),this.shapes.push(...b),b}parseShapesArg(b){return"string"===typeof b[0]?this.shapes.filter(g=>b.includes(g.id)):b}removeShapes(...b){const g=this.parseShapesArg(b);this.shapes=this.shapes.filter(p=>!g.includes(p));return g}getBindableShapes(){return this.shapes.filter(b=>b.canBind).sort((b,
|
|||
|
g)=>g.nonce-b.nonce).map(b=>b.id)}};ce([Qe],Cm.prototype,"id",2);ce([Qe],Cm.prototype,"name",2);ce([Qe],Cm.prototype,"shapes",2);ce([Qe],Cm.prototype,"bindings",2);ce([wf],Cm.prototype,"serialized",1);ce([wf],Cm.prototype,"shapesById",1);ce([Qe],Cm.prototype,"nonce",2);ce([qg],Cm.prototype,"update",1);ce([qg],Cm.prototype,"updateBindings",1);ce([qg],Cm.prototype,"updateShapesIndex",1);ce([qg],Cm.prototype,"addShapes",1);ce([qg],Cm.prototype,"removeShapes",1);ce([qg],Cm.prototype,"bringForward",2);
|
|||
|
ce([qg],Cm.prototype,"sendBackward",2);ce([qg],Cm.prototype,"bringToFront",2);ce([qg],Cm.prototype,"sendToBack",2);ce([qg],Cm.prototype,"cleanup",2);var Yk=class{constructor(){ib(this,"shiftKey",!1);ib(this,"ctrlKey",!1);ib(this,"modKey",!1);ib(this,"altKey",!1);ib(this,"spaceKey",!1);ib(this,"isPinching",!1);ib(this,"currentScreenPoint",[0,0]);ib(this,"currentPoint",[0,0]);ib(this,"previousScreenPoint",[0,0]);ib(this,"previousPoint",[0,0]);ib(this,"originScreenPoint",[0,0]);ib(this,"originPoint",
|
|||
|
[0,0]);ib(this,"pointerIds",new Set);ib(this,"state","idle");ib(this,"containerOffset",[0,0]);ib(this,"onPointerDown",(b,g)=>{this.pointerIds.add(g.pointerId);this.updateModifiers(g);this.originScreenPoint=this.currentScreenPoint;this.originPoint=b;this.state="pointing"});ib(this,"onPointerMove",(b,g)=>{"pinching"!==this.state&&("panning"===this.state&&(this.state="idle"),this.updateModifiers(g),this.previousPoint=this.currentPoint,this.currentPoint=b)});ib(this,"onPointerUp",(b,g)=>{this.pointerIds.clear();
|
|||
|
this.updateModifiers(g);this.state="idle"});ib(this,"onKeyDown",b=>{this.updateModifiers(b);switch(b.key){case " ":this.spaceKey=!0}});ib(this,"onKeyUp",b=>{this.updateModifiers(b);switch(b.key){case " ":this.spaceKey=!1}});ib(this,"onPinchStart",(b,g)=>{this.updateModifiers(g);this.state="pinching"});ib(this,"onPinch",(b,g)=>{"pinching"===this.state&&this.updateModifiers(g)});ib(this,"onPinchEnd",(b,g)=>{"pinching"===this.state&&(this.updateModifiers(g),this.state="idle")});Ag(this)}updateContainerOffset(b){Object.assign(this.containerOffset,
|
|||
|
b)}updateModifiers(b){b.isPrimary&&("clientX"in b&&(this.previousScreenPoint=this.currentScreenPoint,this.currentScreenPoint=ke.sub([b.clientX,b.clientY],this.containerOffset)),"shiftKey"in b&&(this.shiftKey=b.shiftKey,this.ctrlKey=b.ctrlKey,this.altKey=b.altKey,this.modKey=Jk()?b.metaKey:b.ctrlKey))}};ce([Qe],Yk.prototype,"shiftKey",2);ce([Qe],Yk.prototype,"ctrlKey",2);ce([Qe],Yk.prototype,"modKey",2);ce([Qe],Yk.prototype,"altKey",2);ce([Qe],Yk.prototype,"spaceKey",2);ce([Qe],Yk.prototype,"isPinching",
|
|||
|
2);ce([Qe],Yk.prototype,"currentScreenPoint",2);ce([Qe],Yk.prototype,"currentPoint",2);ce([Qe],Yk.prototype,"previousScreenPoint",2);ce([Qe],Yk.prototype,"previousPoint",2);ce([Qe],Yk.prototype,"originScreenPoint",2);ce([Qe],Yk.prototype,"originPoint",2);ce([Qe],Yk.prototype,"state",2);ce([Qe],Yk.prototype,"containerOffset",2);ce([qg],Yk.prototype,"updateContainerOffset",1);ce([qg],Yk.prototype,"updateModifiers",1);ce([qg],Yk.prototype,"onPointerDown",2);ce([qg],Yk.prototype,"onPointerMove",2);ce([qg],
|
|||
|
Yk.prototype,"onPointerUp",2);ce([qg],Yk.prototype,"onKeyDown",2);ce([qg],Yk.prototype,"onKeyUp",2);ce([qg],Yk.prototype,"onPinchStart",2);ce([qg],Yk.prototype,"onPinch",2);ce([qg],Yk.prototype,"onPinchEnd",2);var zD=(b,g=100)=>-(Math.cos(Math.PI*Id.clamp(b/g,0,1))-1)/2,bt=class{constructor(){ib(this,"bounds",{minX:0,minY:0,maxX:1080,maxY:720,width:1080,height:720});ib(this,"camera",{point:[0,0],zoom:1});ib(this,"updateBounds",b=>{this.bounds=b;return this});ib(this,"panCamera",b=>this.update({point:Id.sub(this.camera.point,
|
|||
|
Id.div(b,this.camera.zoom))}));ib(this,"panToPointWhenOutOfBounds",b=>{const g=Id.sub([this.currentView.maxX,this.currentView.maxY],b);b=Id.sub([this.currentView.minX,this.currentView.minY],b);this.panCamera(Id.mul([0>g[0]?g[0]:0<b[0]?b[0]:0,0>g[1]?g[1]:0<b[1]?b[1]:0],-bt.panMultiplier))});ib(this,"update",({point:b,zoom:g})=>{void 0===b||isNaN(b[0])||isNaN(b[1])||(this.camera.point=b);void 0===g||isNaN(g)||(this.camera.zoom=Math.min(4,Math.max(.1,g)));return this});ib(this,"getPagePoint",b=>{const {camera:g,
|
|||
|
bounds:p}=this;return Id.sub(Id.div(Id.sub(b,[p.minX,p.minY]),g.zoom),g.point)});ib(this,"getScreenPoint",b=>{const {camera:g}=this;return Id.mul(Id.add(b,g.point),g.zoom)});ib(this,"onZoom",(b,g,p=!1)=>this.pinchZoom(b,[0,0],g,p));ib(this,"pinchZoom",(b,g,p,G=!1)=>{var {camera:Y}=this;g=Id.sub(Y.point,Id.div(g,Y.zoom));p=Id.clamp(p,bt.minZoom,bt.maxZoom);Y=Id.div(b,Y.zoom);b=Id.div(b,p);b=Id.toFixed(Id.add(g,Id.sub(b,Y)));G?this.animateCamera({point:b,zoom:p}):this.update({point:b,zoom:p});return this});
|
|||
|
ib(this,"setZoom",(b,g=!1)=>{const {bounds:p}=this;this.onZoom([p.width/2,p.height/2],b,g)});ib(this,"zoomIn",()=>{const {camera:b}=this;this.setZoom(b.zoom/.8,!0)});ib(this,"zoomOut",()=>{const {camera:b}=this;this.setZoom(.8*b.zoom,!0)});ib(this,"resetZoom",()=>{this.setZoom(1,!0);return this});ib(this,"animateCamera",({point:b,zoom:g})=>this.animateToViewport({minX:-b[0],minY:-b[1],maxX:this.bounds.width/g-b[0],maxY:this.bounds.height/g-b[1],width:this.bounds.width/g,height:this.bounds.height/
|
|||
|
g}));ib(this,"animateToViewport",b=>{const g=performance.now(),p=pe({},this.currentView),G=()=>{var Y=performance.now()-g;Y=zD(Y);var la=p.minX+(b.minX-p.minX)*Y;this.update({point:[-la,-(p.minY+(b.minY-p.minY)*Y)],zoom:this.bounds.width/(p.maxX+(b.maxX-p.maxX)*Y-la)});1>Y&&requestAnimationFrame(G)};G()});ib(this,"zoomToBounds",({width:b,height:g,minX:p,minY:G})=>{const {bounds:Y,camera:la}=this;let pa=Math.min((Y.width-100)/b,(Y.height-100)/g);pa=Math.min(1,Math.max(bt.minZoom,la.zoom===pa||1>la.zoom?
|
|||
|
Math.min(1,pa):pa));b=Id.add([-p,-G],[(Y.width-b*pa)/2/pa,(Y.height-g*pa)/2/pa]);this.animateCamera({point:b,zoom:pa})});Ag(this)}get currentView(){const {bounds:b,camera:{point:g,zoom:p}}=this,G=b.width/p,Y=b.height/p;return{minX:-g[0],minY:-g[1],maxX:G-g[0],maxY:Y-g[1],width:G,height:Y}}},Ro=bt;ib(Ro,"minZoom",.1);ib(Ro,"maxZoom",4);ib(Ro,"panMultiplier",.05);ce([Qe],Ro.prototype,"bounds",2);ce([Qe],Ro.prototype,"camera",2);ce([qg],Ro.prototype,"updateBounds",2);ce([qg],Ro.prototype,"update",2);
|
|||
|
ce([wf],Ro.prototype,"currentView",1);var sE=class{constructor(b){ib(this,"app");ib(this,"editShape",g=>{(null==g?0:g.props.isLocked)||this.app.transition("select").selectedTool.transition("editingShape",{shape:g});return this});ib(this,"hoverShape",g=>{this.app.setHoveredShape(g);return this});ib(this,"createShapes",(...g)=>{this.app.createShapes(g);return this});ib(this,"updateShapes",(...g)=>{this.app.updateShapes(g);return this});ib(this,"deleteShapes",(...g)=>{this.app.deleteShapes(g.length?
|
|||
|
g:this.app.selectedShapesArray);return this});ib(this,"selectShapes",(...g)=>{this.app.setSelectedShapes(g);return this});ib(this,"deselectShapes",(...g)=>{const p="string"===typeof g[0]?g:g.map(G=>G.id);this.app.setSelectedShapes(this.app.selectedShapesArray.filter(G=>!p.includes(G.id)));return this});ib(this,"flipHorizontal",(...g)=>{this.app.flipHorizontal(g);return this});ib(this,"flipVertical",(...g)=>{this.app.flipVertical(g);return this});ib(this,"selectAll",()=>{this.app.setSelectedShapes(this.app.currentPage.shapes.filter(g=>
|
|||
|
!this.app.shapesInGroups().includes(g)));return this});ib(this,"deselectAll",()=>{this.app.setSelectedShapes([]);return this});ib(this,"zoomIn",()=>{this.app.viewport.zoomIn();return this});ib(this,"zoomOut",()=>{this.app.viewport.zoomOut();return this});ib(this,"resetZoom",()=>{this.app.viewport.resetZoom();return this});ib(this,"zoomToFit",()=>{var {shapes:g}=this.app.currentPage;if(0===g.length)return this;g=vf.getCommonBounds(g.map(p=>p.bounds));this.app.viewport.zoomToBounds(g);return this});
|
|||
|
ib(this,"cameraToCenter",()=>{var {shapes:g}=this.app.currentPage;if(0===g.length)return this;g=vf.getCommonBounds(g.map(p=>p.bounds));this.app.viewport.update({point:ke.add(ke.neg(vf.getBoundsCenter(g)),[this.app.viewport.currentView.width/2,this.app.viewport.currentView.height/2])});return this});ib(this,"zoomToSelection",()=>{const {selectionBounds:g}=this.app;if(!g)return this;this.app.viewport.zoomToBounds(g);return this});ib(this,"resetZoomToCursor",()=>{this.app.viewport.animateCamera({zoom:1,
|
|||
|
point:ke.sub(this.app.inputs.originScreenPoint,this.app.inputs.originPoint)});return this});ib(this,"toggleGrid",()=>{const {settings:g}=this.app;g.update({showGrid:!g.showGrid});return this});ib(this,"setColor",g=>{const {settings:p}=this.app;p.update({color:g});this.app.selectedShapesArray.forEach(G=>{G.props.isLocked||G.update({fill:g,stroke:g})});this.app.persist();return this});ib(this,"setScaleLevel",g=>{const {settings:p}=this.app;p.update({scaleLevel:g});this.app.selectedShapes.forEach(G=>
|
|||
|
{G.props.isLocked||G.setScaleLevel(g)});this.app.persist();return this});ib(this,"undo",()=>{this.app.undo();return this});ib(this,"redo",()=>{this.app.redo();return this});ib(this,"persist",()=>{this.app.persist();return this});ib(this,"createNewLineBinding",(g,p)=>this.app.createNewLineBinding(g,p));ib(this,"cloneShapes",({shapes:g,assets:p,bindings:G,point:Y=[0,0]})=>{const la=vf.getCommonBounds(g.filter(Qa=>"group"!==Qa.type).map(Qa=>{var Za,fb,mb,Lb,Tb,Pb,lc,xc,$b,sc,oc,Mc,Tc,vd,de,ne;return{minX:null!=
|
|||
|
(fb=null==(Za=Qa.point)?void 0:Za[0])?fb:Y[0],minY:null!=(Lb=null==(mb=Qa.point)?void 0:mb[1])?Lb:Y[1],width:null!=(Pb=null==(Tb=Qa.size)?void 0:Tb[0])?Pb:4,height:null!=(xc=null==(lc=Qa.size)?void 0:lc[1])?xc:4,maxX:(null!=(sc=null==($b=Qa.point)?void 0:$b[0])?sc:Y[0])+(null!=(Mc=null==(oc=Qa.size)?void 0:oc[0])?Mc:4),maxY:(null!=(vd=null==(Tc=Qa.point)?void 0:Tc[1])?vd:Y[1])+(null!=(ne=null==(de=Qa.size)?void 0:de[1])?ne:4)}})),pa=g.map(Qa=>hf(pe({},Qa),{id:Gk(),point:[Y[0]+Qa.point[0]-la.minX,
|
|||
|
Y[1]+Qa.point[1]-la.minY]}));pa.forEach(Qa=>{var Za;Qa.children&&0<(null==(Za=Qa.children)?void 0:Za.length)&&(Qa.children=Qa.children.map(fb=>{var mb;return null==(mb=pa[g.findIndex(Lb=>Lb.id===fb)])?void 0:mb.id}).filter(si))});const Ga=[];pa.flatMap(Qa=>{var Za;return Object.values(null!=(Za=Qa.handles)?Za:{})}).forEach(Qa=>{if(Qa.bindingId){var Za=G[Qa.bindingId];if(Za){var fb=g.findIndex(Lb=>Lb.id===Za.fromId);const mb=g.findIndex(Lb=>Lb.id===Za.toId);Za&&-1!==fb&&-1!==mb?(fb=hf(pe({},Za),{id:Gk(),
|
|||
|
fromId:pa[fb].id,toId:pa[mb].id}),Ga.push(fb),Qa.bindingId=fb.id):Qa.bindingId=void 0}else console.warn("binding not found",Qa.bindingId)}});p=p.filter(Qa=>pa.some(Za=>Za.assetId===Qa.id));return{shapes:pa,assets:p,bindings:Ga}});ib(this,"getClonedShapesFromTldrString",(g,p)=>{try{{var G;const Za=null==(G=g.match(/<whiteboard-tldr>(.*)<\/whiteboard-tldr>/))?void 0:G[1];if(Za){try{var Y=JSON.parse(Za)}catch(fb){Y=null}var la=Y}else la=void 0}g=la;if(!g)return null;const {shapes:pa,bindings:Ga,assets:Qa}=
|
|||
|
g;return this.cloneShapes({shapes:pa,bindings:Ga,assets:Qa,point:p})}catch(pa){console.log(pa)}return null});ib(this,"cloneShapesIntoCurrentPage",g=>{(g=this.cloneShapes(g))&&this.addClonedShapes(g);return this});ib(this,"addClonedShapes",g=>{const {shapes:p,assets:G,bindings:Y}=g;0<G.length&&this.app.createAssets(G);0<p.length&&this.app.createShapes(p);this.app.currentPage.updateBindings(Object.fromEntries(Y.map(la=>[la.id,la])));this.app.selectedTool.transition("idle");return this});ib(this,"addClonedShapesFromTldrString",
|
|||
|
(g,p)=>{(g=this.getClonedShapesFromTldrString(g,p))&&this.addClonedShapes(g);return this});ib(this,"doGroup",(g=this.app.allSelectedShapesArray)=>{if(!this.app.readOnly){var p=[...g.filter(G=>"group"===G.type),...g.map(G=>this.app.getParentGroup(G))].filter(si);this.app.currentPage.removeShapes(...p);g=g.filter(G=>"group"!==G.type);1<g.length&&(p=this.app.getShapeClass("group"),p=new p({id:Gk(),type:p.id,parentId:this.app.currentPage.id,children:g.map(G=>G.id)}),this.app.currentPage.addShapes(p),
|
|||
|
this.app.setSelectedShapes([p]),this.app.bringForward(g));this.app.persist()}});ib(this,"unGroup",(g=this.app.allSelectedShapesArray)=>{if(!this.app.readOnly){g=[...g.filter(G=>"group"===G.type),...g.map(G=>this.app.getParentGroup(G))].filter(si);var p=this.app.shapesInGroups(g);0<g.length&&(this.app.currentPage.removeShapes(...g),this.app.persist(),this.app.setSelectedShapes(p))}});ib(this,"convertShapes",(g,p=this.app.allSelectedShapesArray)=>{const G=this.app.getShapeClass(g);this.app.currentPage.removeShapes(...p);
|
|||
|
p=p.map(Y=>new G(hf(pe({},Y.serialized),{type:g,nonce:Date.now()})));this.app.currentPage.addShapes(...p);this.app.persist();this.app.setSelectedShapes(p)});ib(this,"setCollapsed",(g,p=this.app.allSelectedShapesArray)=>{p.forEach(G=>{"logseq-portal"===G.props.type&&G.setCollapsed(g)});this.app.persist()});this.app=b}},Vr=class{constructor(){ib(this,"cursor","default");ib(this,"rotation",0);ib(this,"reset",()=>{this.cursor="default"});ib(this,"setCursor",(b,g=0)=>{if(b!==this.cursor||g!==this.rotation)this.cursor=
|
|||
|
b,this.rotation=g});ib(this,"setRotation",b=>{b!==this.rotation&&(this.rotation=b)});Ag(this)}};ce([Qe],Vr.prototype,"cursor",2);ce([Qe],Vr.prototype,"rotation",2);ce([qg],Vr.prototype,"reset",2);ce([qg],Vr.prototype,"setCursor",2);ce([qg],Vr.prototype,"setRotation",2);var Wr=class{constructor(b){ib(this,"app");ib(this,"stack",[]);ib(this,"isPaused",!0);ib(this,"pause",()=>{this.isPaused||(this.isPaused=!0)});ib(this,"resume",()=>{this.isPaused&&(this.isPaused=!1)});ib(this,"persist",(g=!1)=>{this.isPaused||
|
|||
|
this.creating||this.app.notify("persist",{replace:g})});ib(this,"undo",()=>{this.isPaused||"idle"===this.app.selectedTool.currentState.id&&this.app.appUndo&&this.app.appUndo()});ib(this,"redo",()=>{this.isPaused||"idle"===this.app.selectedTool.currentState.id&&this.app.appRedo&&this.app.appRedo()});ib(this,"instantiateShape",g=>new (this.app.getShapeClass(g.type))(g));ib(this,"deserialize",g=>{Hd(()=>{var p,{pages:G}=g;const Y=this.isPaused;this.pause();const la=[...this.app.selectedIds];try{const pa=
|
|||
|
new Map(this.app.pages),Ga=[];for(const Qa of G){const Za=pa.get(Qa.id);if(void 0!==Za){const fb=new Map(Za.shapes.map(mb=>[mb.props.id,mb]));G=[];for(const mb of Qa.shapes){const Lb=fb.get(mb.id);void 0!==Lb?(Lb.nonce!==mb.nonce&&(Lb.update(mb,!0),Lb.nonce=mb.nonce,Lb.setLastSerialized(mb)),fb.delete(mb.id)):G.push(this.instantiateShape(mb))}0<fb.size&&!this.app.selectedTool.isInAny("creating","editingShape")&&Za.removeShapes(...fb.values());0<G.length&&Za.addShapes(...G);pa.delete(Qa.id);Za.updateBindings(Qa.bindings);
|
|||
|
Za.nonce=null!=(p=Qa.nonce)?p:0}else{const {id:fb,name:mb,shapes:Lb,bindings:Tb,nonce:Pb}=Qa;Ga.push(new Cm(this.app,{id:fb,name:mb,nonce:Pb,bindings:Tb,shapes:Lb.map(lc=>this.instantiateShape(lc))}))}}0<Ga.length&&this.app.addPages(Ga);0<pa.size&&this.app.removePages(Array.from(pa.values()));this.app.setSelectedShapes(la).setErasingShapes([])}catch(pa){console.warn(pa)}Y||this.resume()})});this.app=b;Ag(this)}get creating(){return"creating"===this.app.selectedTool.currentState.id}};ce([Qe],Wr.prototype,
|
|||
|
"stack",2);ce([qg],Wr.prototype,"persist",2);ce([qg],Wr.prototype,"undo",2);ce([qg],Wr.prototype,"redo",2);ce([qg],Wr.prototype,"deserialize",2);var Sr=class{constructor(){ib(this,"mode","light");ib(this,"showGrid",!0);ib(this,"scaleLevel","md");ib(this,"color","");Ag(this)}update(b){Object.assign(this,b)}};ce([Qe],Sr.prototype,"mode",2);ce([Qe],Sr.prototype,"showGrid",2);ce([Qe],Sr.prototype,"scaleLevel",2);ce([Qe],Sr.prototype,"color",2);ce([qg],Sr.prototype,"update",1);var eh=class extends Cr{constructor(b,
|
|||
|
g,p,G){var Y,la;super();ib(this,"uuid",Gk());ib(this,"readOnly");ib(this,"api");ib(this,"inputs",new Yk);ib(this,"cursors",new Vr);ib(this,"viewport",new Ro);ib(this,"settings",new Sr);ib(this,"Tools",[]);ib(this,"history",new Wr(this));ib(this,"persist",this.history.persist);ib(this,"undo",this.history.undo);ib(this,"redo",this.history.redo);ib(this,"saving",!1);ib(this,"saveState",()=>{this.history.isPaused||(this.saving=!0,requestAnimationFrame(()=>{this.saving&&(this.persist(),this.saving=!1)}))});
|
|||
|
ib(this,"load",()=>{this.notify("load",null);return this});ib(this,"save",()=>{this.notify("save",null);return this});ib(this,"pages",new Map([["page",new Cm(this,{id:"page",name:"page",shapes:[],bindings:{}})]]));ib(this,"getPageById",pa=>{const Ga=this.pages.get(pa);if(!Ga)throw Error(`Could not find a page named ${pa}.`);return Ga});ib(this,"getShapeById",(pa,Ga=this.currentPage.id)=>{var Qa;return null==(Qa=this.getPageById(Ga))?void 0:Qa.shapesById[pa]});ib(this,"createShapes",pa=>{if(this.readOnly)return this;
|
|||
|
(pa=this.currentPage.addShapes(...pa))&&this.notify("create-shapes",pa);this.persist();return this});ib(this,"updateShapes",pa=>{if(this.readOnly)return this;pa.forEach(Ga=>{const Qa=this.getShapeById(Ga.id);null==Qa?void 0:Qa.update(Ga);Ga.type!==(null==Qa?void 0:Qa.type)&&this.api.convertShapes(Ga.type,[Qa])});this.persist();return this});ib(this,"deleteShapes",pa=>{if(0===pa.length||this.readOnly)return this;pa=pa.map(fb=>"string"===typeof fb?this.getShapeById(fb):fb).filter(si).filter(fb=>!fb.props.isLocked);
|
|||
|
const Ga=this.shapesInGroups(pa);pa.forEach(fb=>{this.getParentGroup(fb)&&Ga.push(fb)});let Qa=new Set([...pa,...Ga].map(fb=>fb.id));Ga.forEach(fb=>{var mb;const Lb=this.getParentGroup(fb);if(Lb){const Tb=null==(mb=Lb.props.children)?void 0:mb.filter(Pb=>Pb!==fb.id);!Tb||1>=(null==Tb?void 0:Tb.length)?Qa.add(Lb.id):Lb.update({children:Tb})}});const Za=(fb,mb)=>{var Lb;[...Qa].includes(fb)&&"line"===(null==(Lb=this.getShapeById(mb))?void 0:Lb.type)&&Qa.add(mb)};this.currentPage.shapes.filter(fb=>!fb.props.isLocked).flatMap(fb=>
|
|||
|
{var mb;return Object.values(null!=(mb=fb.props.handles)?mb:{})}).flatMap(fb=>fb.bindingId).filter(si).map(fb=>{var mb,Lb;const Tb=null==(mb=this.currentPage.bindings[fb])?void 0:mb.toId;fb=null==(Lb=this.currentPage.bindings[fb])?void 0:Lb.fromId;Tb&&fb&&(Za(Tb,fb),Za(fb,Tb))});pa=[...Qa].map(fb=>this.getShapeById(fb));this.setSelectedShapes(this.selectedShapesArray.filter(fb=>!Qa.has(fb.id)));(pa=this.currentPage.removeShapes(...pa))&&this.notify("delete-shapes",pa);this.persist();return this});
|
|||
|
ib(this,"bringForward",(pa=this.selectedShapesArray)=>{0<pa.length&&!this.readOnly&&this.currentPage.bringForward(pa);return this});ib(this,"sendBackward",(pa=this.selectedShapesArray)=>{0<pa.length&&!this.readOnly&&this.currentPage.sendBackward(pa);return this});ib(this,"sendToBack",(pa=this.selectedShapesArray)=>{0<pa.length&&!this.readOnly&&this.currentPage.sendToBack(pa);return this});ib(this,"bringToFront",(pa=this.selectedShapesArray)=>{0<pa.length&&!this.readOnly&&this.currentPage.bringToFront(pa);
|
|||
|
return this});ib(this,"flipHorizontal",(pa=this.selectedShapesArray)=>{this.currentPage.flip(pa,"horizontal");return this});ib(this,"flipVertical",(pa=this.selectedShapesArray)=>{this.currentPage.flip(pa,"vertical");return this});ib(this,"align",(pa,Ga=this.selectedShapesArray)=>{if(2>Ga.length||this.readOnly)return this;const Qa=Ga.map(Tb=>{const Pb=Tb.getBounds();return{id:Tb.id,point:[Pb.minX,Pb.minY],bounds:Pb}}),Za=vf.getCommonBounds(Qa.map(({bounds:Tb})=>Tb)),fb=Za.minX+Za.width/2,mb=Za.minY+
|
|||
|
Za.height/2,Lb=Object.fromEntries(Qa.map(({id:Tb,point:Pb,bounds:lc})=>[Tb,{prev:Pb,next:{top:[Pb[0],Za.minY],centerVertical:[Pb[0],mb-lc.height/2],bottom:[Pb[0],Za.maxY-lc.height],left:[Za.minX,Pb[1]],centerHorizontal:[fb-lc.width/2,Pb[1]],right:[Za.maxX-lc.width,Pb[1]]}[pa]}]));Ga.forEach(Tb=>{Lb[Tb.id]&&Tb.update({point:Lb[Tb.id].next})});this.persist();return this});ib(this,"distribute",(pa,Ga=this.selectedShapesArray)=>{if(2>Ga.length||this.readOnly)return this;const Qa=Object.fromEntries(vf.getDistributions(Ga,
|
|||
|
pa).map(Za=>[Za.id,Za]));Ga.forEach(Za=>{Qa[Za.id]&&Za.update({point:Qa[Za.id].next})});this.persist();return this});ib(this,"packIntoRectangle",(pa=this.selectedShapesArray)=>{if(2>pa.length||this.readOnly)return this;const Ga=Object.fromEntries(vf.getPackedDistributions(pa).map(Qa=>[Qa.id,Qa]));pa.forEach(Qa=>{Ga[Qa.id]&&Qa.update({point:Ga[Qa.id].next})});this.persist();return this});ib(this,"setLocked",pa=>{if(0===this.selectedShapesArray.length||this.readOnly)return this;this.selectedShapesArray.forEach(Ga=>
|
|||
|
{Ga.update({isLocked:pa})});this.persist();return this});ib(this,"assets",{});ib(this,"removeUnusedAssets",()=>{const pa=this.getCleanUpAssets();Object.keys(this.assets).forEach(Ga=>{pa.some(Qa=>Qa.id===Ga)||delete this.assets[Ga]});this.persist();return this});ib(this,"copy",()=>{if(0<this.selectedShapesArray.length&&!this.editingShape){const Ga=this.allSelectedShapesArray;var pa=JSON.stringify({shapes:Ga.map(Za=>Za.serialized),assets:this.getCleanUpAssets().filter(Za=>Ga.some(fb=>fb.props.assetId===
|
|||
|
Za.id)),bindings:Ec(this.currentPage.bindings)});pa=encodeURIComponent(`<whiteboard-tldr>${pa}</whiteboard-tldr>`);const Qa=this.selectedShapesArray.map(Za=>`((${Za.props.id}))`).join(" ");this.notify("copy",{text:Qa,html:pa})}});ib(this,"paste",(pa,Ga)=>{var Qa;this.editingShape||this.readOnly||this.notify("paste",{point:this.inputs.currentPoint,shiftKey:!!Ga,dataTransfer:null!=(Qa=null==pa?void 0:pa.clipboardData)?Qa:void 0})});ib(this,"cut",()=>{this.copy();this.api.deleteShapes()});ib(this,"drop",
|
|||
|
(pa,Ga)=>{this.notify("drop",{dataTransfer:pa,point:Ga?this.viewport.getPagePoint(Ga):vf.getBoundsCenter(this.viewport.currentView)})});ib(this,"selectTool",(pa,Ga={})=>{this.readOnly&&!["select","move"].includes(pa)||this.transition(pa,Ga)});ib(this,"editingId");ib(this,"setEditingShape",pa=>{this.editingId="string"===typeof pa?pa:null==pa?void 0:pa.id;return this});ib(this,"clearEditingState",()=>{this.selectedTool.transition("idle");return this.setEditingShape()});ib(this,"hoveredId");ib(this,
|
|||
|
"setHoveredShape",pa=>{this.hoveredId="string"===typeof pa?pa:null==pa?void 0:pa.id;return this});ib(this,"selectedIds",new Set);ib(this,"selectedShapes",new Set);ib(this,"selectionRotation",0);ib(this,"setSelectedShapes",pa=>{var Ga;const {selectedIds:Qa,selectedShapes:Za}=this;Qa.clear();Za.clear();pa[0]&&"string"===typeof pa[0]?pa.forEach(mb=>Qa.add(mb)):pa.forEach(mb=>Qa.add(mb.id));const fb=this.currentPage.shapes.filter(mb=>Qa.has(mb.id));fb.forEach(mb=>Za.add(mb));this.selectionRotation=1===
|
|||
|
fb.length?null!=(Ga=fb[0].props.rotation)?Ga:0:0;0===pa.length&&this.setEditingShape();return this});ib(this,"erasingIds",new Set);ib(this,"erasingShapes",new Set);ib(this,"setErasingShapes",pa=>{const {erasingIds:Ga,erasingShapes:Qa}=this;Ga.clear();Qa.clear();pa[0]&&"string"===typeof pa[0]?pa.forEach(Za=>Ga.add(Za)):pa.forEach(Za=>Ga.add(Za.id));this.currentPage.shapes.filter(Za=>Ga.has(Za.id)).forEach(Za=>Qa.add(Za));return this});ib(this,"bindingIds");ib(this,"setBindingShapes",pa=>{this.bindingIds=
|
|||
|
pa;return this});ib(this,"clearBindingShape",()=>this.setBindingShapes());ib(this,"createNewLineBinding",(pa,Ga)=>{pa="string"===typeof pa?this.getShapeById(pa):pa;Ga="string"===typeof Ga?this.getShapeById(Ga):Ga;if((null==pa?0:pa.canBind)&&(null==Ga?0:Ga.canBind)&&(Ga=kd(pa,Ga))){const [Qa,Za]=Ga;this.createShapes([Qa]);this.currentPage.updateBindings(Object.fromEntries(Za.map(fb=>[fb.id,fb])));this.persist();return!0}return!1});ib(this,"brush");ib(this,"setBrush",pa=>{this.brush=pa;return this});
|
|||
|
ib(this,"setCamera",(pa,Ga)=>{this.viewport.update({point:pa,zoom:Ga});return this});ib(this,"getPagePoint",pa=>{const {camera:Ga}=this.viewport;return Id.sub(Id.div(pa,Ga.zoom),Ga.point)});ib(this,"getScreenPoint",pa=>{const {camera:Ga}=this.viewport;return Id.mul(Id.add(pa,Ga.point),Ga.zoom)});ib(this,"Shapes",new Map);ib(this,"registerShapes",pa=>{pa.forEach(Ga=>{if("group"===Ga.id){const Qa=this;Ga.prototype.getShapes=function(){var Za,fb;return null!=(fb=null==(Za=this.props.children)?void 0:
|
|||
|
Za.map(mb=>Qa.getShapeById(mb)).filter(Boolean))?fb:[]}}return this.Shapes.set(Ga.id,Ga)})});ib(this,"deregisterShapes",pa=>{pa.forEach(Ga=>this.Shapes.delete(Ga.id))});ib(this,"getShapeClass",pa=>{if(!pa)throw Error("No shape type provided.");const Ga=this.Shapes.get(pa);if(!Ga)throw Error(`Could not find shape class for ${pa}`);return Ga});ib(this,"wrapUpdate",pa=>{Hd(()=>{const Ga=!this.history.isPaused;Ga&&this.history.pause();pa();Ga&&(this.history.resume(),this.persist())})});ib(this,"subscriptions",
|
|||
|
new Set([]));ib(this,"subscribe",(pa,Ga)=>{if(void 0===Ga)throw Error("Callback is required.");const Qa={event:pa,callback:Ga};this.subscriptions.add(Qa);return()=>this.unsubscribe(Qa)});ib(this,"unsubscribe",pa=>{this.subscriptions.delete(pa);return this});ib(this,"notify",(pa,Ga)=>{this.subscriptions.forEach(Qa=>{Qa.event===pa&&Qa.callback(this,Ga)});return this});ib(this,"onTransition",()=>{});ib(this,"onPointerDown",(pa,Ga)=>{if(!this.editingShape&&1===Ga.button&&!this.isIn("move"))this.temporaryTransitionToMove(Ga);
|
|||
|
else if(2===Ga.button&&!this.editingShape)Ga.preventDefault(),this.transition("select");else if("clientX"in Ga)this.inputs.onPointerDown([...this.viewport.getPagePoint([Ga.clientX,Ga.clientY]),.5],Ga)});ib(this,"onPointerUp",(pa,Ga)=>{if(!this.editingShape&&1===Ga.button&&this.isIn("move"))this.selectedTool.transition("idle",{exit:!0}),Ga.stopPropagation(),Ga.preventDefault();else if("clientX"in Ga)this.inputs.onPointerUp([...this.viewport.getPagePoint([Ga.clientX,Ga.clientY]),.5],Ga)});ib(this,"onPointerMove",
|
|||
|
(pa,Ga)=>{if("clientX"in Ga)this.inputs.onPointerMove([...this.viewport.getPagePoint([Ga.clientX,Ga.clientY]),.5],Ga)});ib(this,"onKeyDown",(pa,Ga)=>{if(this.editingShape||" "!==Ga.key||this.isIn("move"))this.inputs.onKeyDown(Ga);else this.temporaryTransitionToMove(Ga)});ib(this,"onKeyUp",(pa,Ga)=>{if(!this.editingShape&&" "===Ga.key&&this.isIn("move"))this.selectedTool.transition("idle",{exit:!0}),Ga.stopPropagation(),Ga.preventDefault();else this.inputs.onKeyUp(Ga)});ib(this,"onPinchStart",(pa,
|
|||
|
Ga)=>{this.inputs.onPinchStart([...this.viewport.getPagePoint(pa.point),.5],Ga)});ib(this,"onPinch",(pa,Ga)=>{this.inputs.onPinch([...this.viewport.getPagePoint(pa.point),.5],Ga)});ib(this,"onPinchEnd",(pa,Ga)=>{this.inputs.onPinchEnd([...this.viewport.getPagePoint(pa.point),.5],Ga)});this._states=[Rr,Qr];this.readOnly=G;this.history.pause();this.states&&0<this.states.length&&(this.registerStates(this.states),G=null!=(Y=this.initial)?Y:this.states[0].id,Y=this.children.get(G))&&(this.currentState=
|
|||
|
Y,null==(la=this.currentState)?void 0:la._events.onEnter({fromId:"initial"}));g&&this.registerShapes(g);p&&this.registerTools(p);this.history.resume();b&&this.history.deserialize(b);this.api=new sE(this);Ag(this);this.notify("mount",null)}loadDocumentModel(b){this.history.deserialize(b);b.assets&&0<b.assets.length&&this.addAssets(b.assets);return this}get serialized(){return{}}get currentPageId(){return this.pages.keys().next().value}get currentPage(){return this.getPageById(this.currentPageId)}addPages(b){b.forEach(g=>
|
|||
|
this.pages.set(g.id,g));this.persist();return this}removePages(b){b.forEach(g=>this.pages.delete(g.id));this.persist();return this}shapesInGroups(b=this.shapes){return b.flatMap(g=>g.props.children).filter(si).map(g=>this.getShapeById(g)).filter(si)}getParentGroup(b){return this.shapes.find(g=>{var p;return null==(p=g.props.children)?void 0:p.includes(b.id)})}addAssets(b){b.forEach(g=>this.assets[g.id]=g);this.persist();return this}removeAssets(b){"string"===typeof b[0]?b.forEach(g=>delete this.assets[g]):
|
|||
|
b.forEach(g=>delete this.assets[g.id]);this.persist();return this}getCleanUpAssets(){const b=new Set;this.pages.forEach(g=>g.shapes.forEach(p=>{p.props.assetId&&this.assets[p.props.assetId]&&b.add(this.assets[p.props.assetId])}));return Array.from(b)}createAssets(b){this.addAssets(b);this.notify("create-assets",{assets:b});this.persist();return this}get selectedTool(){return this.currentState}registerTools(b){this.Tools=b;return this.registerStates(b)}get editingShape(){const {editingId:b,currentPage:g}=
|
|||
|
this;return b?g.shapes.find(p=>p.id===b):void 0}get hoveredShape(){const {hoveredId:b,currentPage:g}=this;return b?g.shapes.find(p=>p.id===b):void 0}get hoveredGroup(){const {hoveredShape:b}=this;return b?this.shapes.find(g=>{var p;return"group"===g.type&&(null==(p=g.props.children)?void 0:p.includes(b.id))}):void 0}get selectedShapesArray(){const {selectedShapes:b,selectedTool:g}=this;return"select"!==g.id?[]:Array.from(b.values())}get allSelectedShapes(){return new Set(this.allSelectedShapesArray)}get allSelectedShapesArray(){const {selectedShapesArray:b}=
|
|||
|
this;return[...(new Set([...b,...this.shapesInGroups(b)]))]}setSelectionRotation(b){this.selectionRotation=b}get erasingShapesArray(){return Array.from(this.erasingShapes.values())}get bindingShapes(){var b;const g=1===this.selectedShapesArray.length?this.selectedShapesArray.flatMap(G=>{var Y;return Object.values(null!=(Y=G.props.handles)?Y:{})}).flatMap(G=>G.bindingId).filter(si).flatMap(G=>{var Y,la;return[null==(Y=this.currentPage.bindings[G])?void 0:Y.fromId,null==(la=this.currentPage.bindings[G])?
|
|||
|
void 0:la.toId]}).filter(si):[],p=[...(null!=(b=this.bindingIds)?b:[]),...g];return p?this.currentPage.shapes.filter(G=>null==p?void 0:p.includes(G.id)):void 0}get currentGrid(){const {zoom:b}=this.viewport.camera;return.15>b?128:1>b?32:8}get shapes(){const {currentPage:{shapes:b}}=this;return Array.from(b.values())}get shapesInViewport(){const {selectedShapes:b,currentPage:g,viewport:{currentView:p}}=this;return g.shapes.filter(G=>!G.canUnmount||b.has(G)||vf.boundsContain(p,G.rotatedBounds)||vf.boundsCollide(p,
|
|||
|
G.rotatedBounds))}get selectionDirectionHint(){const {selectionBounds:b,viewport:{currentView:g}}=this;if(b&&!vf.boundsContain(g,b)&&!vf.boundsCollide(g,b)){var p=vf.getBoundsCenter(b);return Id.clampV([(p[0]-g.minX-g.width/2)/g.width,(p[1]-g.minY-g.height/2)/g.height],-1,1)}}get selectionBounds(){const {selectedShapesArray:b}=this;if(0!==b.length)return 1===b.length?hf(pe({},b[0].bounds),{rotation:b[0].props.rotation}):vf.getCommonBounds(this.selectedShapesArray.map(g=>g.rotatedBounds))}get showSelection(){var b;
|
|||
|
const {selectedShapesArray:g}=this;return this.isIn("select")&&!this.isInAny("select.translating","select.pinching","select.rotating")&&(1===g.length&&!(null==(b=g[0])?0:b.hideSelection)||1<g.length)}get showSelectionDetail(){return this.isIn("select")&&!this.isInAny("select.translating","select.pinching")&&0<this.selectedShapes.size&&!this.selectedShapesArray.every(b=>b.hideSelectionDetail)&&!1}get showSelectionRotation(){return this.showSelectionDetail&&this.isInAny("select.rotating","select.pointingRotateHandle")}get showContextBar(){const {selectedShapesArray:b}=
|
|||
|
this;return this.isInAny("select.idle","select.hoveringSelectionHandle")&&!this.isIn("select.contextMenu")&&0<b.length&&!this.readOnly&&!b.every(g=>g.hideContextBar)}get showRotateHandles(){const {selectedShapesArray:b}=this;return this.isInAny("select.idle","select.hoveringSelectionHandle","select.pointingRotateHandle","select.pointingResizeHandle")&&0<b.length&&!this.readOnly&&!b.some(g=>g.hideRotateHandle)}get showResizeHandles(){const {selectedShapesArray:b}=this;return this.isInAny("select.idle",
|
|||
|
"select.hoveringSelectionHandle","select.pointingShape","select.pointingSelectedShape","select.pointingRotateHandle","select.pointingResizeHandle")&&1===b.length&&!this.readOnly&&!b.every(g=>g.hideResizeHandles)}temporaryTransitionToMove(b){b.stopPropagation();b.preventDefault();this.transition("move",{prevTool:this.selectedTool});this.selectedTool.transition("idleHold")}};ib(eh,"id","app");ib(eh,"initial","select");ce([wf],eh.prototype,"serialized",1);ce([Qe],eh.prototype,"pages",2);ce([wf],eh.prototype,
|
|||
|
"currentPageId",1);ce([wf],eh.prototype,"currentPage",1);ce([qg],eh.prototype,"addPages",1);ce([qg],eh.prototype,"removePages",1);ce([qg],eh.prototype,"createShapes",2);ce([qg],eh.prototype,"updateShapes",2);ce([qg],eh.prototype,"deleteShapes",2);ce([Qe],eh.prototype,"assets",2);ce([qg],eh.prototype,"addAssets",1);ce([qg],eh.prototype,"removeAssets",1);ce([qg],eh.prototype,"removeUnusedAssets",2);ce([wf],eh.prototype,"selectedTool",1);ce([Qe],eh.prototype,"editingId",2);ce([wf],eh.prototype,"editingShape",
|
|||
|
1);ce([qg],eh.prototype,"setEditingShape",2);ce([Qe],eh.prototype,"hoveredId",2);ce([wf],eh.prototype,"hoveredShape",1);ce([wf],eh.prototype,"hoveredGroup",1);ce([qg],eh.prototype,"setHoveredShape",2);ce([Qe],eh.prototype,"selectedIds",2);ce([Qe],eh.prototype,"selectedShapes",2);ce([Qe],eh.prototype,"selectionRotation",2);ce([wf],eh.prototype,"selectedShapesArray",1);ce([wf],eh.prototype,"allSelectedShapes",1);ce([wf],eh.prototype,"allSelectedShapesArray",1);ce([qg],eh.prototype,"setSelectedShapes",
|
|||
|
2);ce([qg],eh.prototype,"setSelectionRotation",1);ce([Qe],eh.prototype,"erasingIds",2);ce([Qe],eh.prototype,"erasingShapes",2);ce([wf],eh.prototype,"erasingShapesArray",1);ce([qg],eh.prototype,"setErasingShapes",2);ce([Qe],eh.prototype,"bindingIds",2);ce([wf],eh.prototype,"bindingShapes",1);ce([qg],eh.prototype,"setBindingShapes",2);ce([qg],eh.prototype,"createNewLineBinding",2);ce([Qe],eh.prototype,"brush",2);ce([qg],eh.prototype,"setBrush",2);ce([qg],eh.prototype,"setCamera",2);ce([wf],eh.prototype,
|
|||
|
"currentGrid",1);ce([wf],eh.prototype,"shapes",1);ce([wf],eh.prototype,"shapesInViewport",1);ce([wf],eh.prototype,"selectionDirectionHint",1);ce([wf],eh.prototype,"selectionBounds",1);ce([wf],eh.prototype,"showSelection",1);ce([wf],eh.prototype,"showSelectionDetail",1);ce([wf],eh.prototype,"showSelectionRotation",1);ce([wf],eh.prototype,"showContextBar",1);ce([wf],eh.prototype,"showRotateHandles",1);ce([wf],eh.prototype,"showResizeHandles",1);var GD=Function.prototype.toString,Qv=Object.create,HD=
|
|||
|
Object.prototype.toString,ED=function(){function b(){this._keys=[];this._values=[]}b.prototype.has=function(g){return!!~this._keys.indexOf(g)};b.prototype.get=function(g){return this._values[this._keys.indexOf(g)]};b.prototype.set=function(g,p){this._keys.push(g);this._values.push(p)};return b}(),DD="undefined"!==typeof WeakMap?Se:ye,FD="g"===/test/g.flags?Lf:lg,ID="undefined"!==typeof Symbol?Xf:Af,CD=Object.defineProperty,BD=Object.getOwnPropertyDescriptor,Qy=Object.getOwnPropertyNames,Pv=Object.getOwnPropertySymbols,
|
|||
|
Ry=Object.prototype,Ov=Ry.hasOwnProperty,AD=Ry.propertyIsEnumerable,mz="function"===typeof Pv,TD=mz?Sg:Qy,SD=Array.isArray,Xv=Object.assign,VD=Object.getPrototypeOf,Zy={array:function(b,g){var p=new g.Constructor;g.cache.set(b,p);for(var G=0,Y=b.length;G<Y;++G)p[G]=g.copier(b[G],g);return p},arrayBuffer:function(b,g){return b.slice(0)},blob:function(b,g){return b.slice(0,b.size,b.type)},dataView:function(b,g){return new g.Constructor(b.buffer.slice(0))},date:function(b,g){return new g.Constructor(b.getTime())},
|
|||
|
error:Rh,map:vh,object:mz?ci:ri,regExp:function(b,g){g=new g.Constructor(b.source,FD(b));g.lastIndex=b.lastIndex;return g},set:bf},WD=Xv({},Zy,{array:function(b,g){var p=new g.Constructor;g.cache.set(b,p);return ki(b,p,g)},map:function(b,g){return ki(b,vh(b,g),g)},object:function(b,g){var p=Nf(g.prototype);g.cache.set(b,p);return ki(b,p,g)},set:function(b,g){return ki(b,bf(b,g),g)}});Sh(Xv({},WD,{}));var XD=Sh({});sf(yr());var YD=sf(Tp()),er=XD,fo=class{static insertTextFirefox(b,g){b.setRangeText(g,
|
|||
|
b.selectionStart||0,b.selectionEnd||0,"end");b.dispatchEvent(new InputEvent("input",{data:g,inputType:"insertText",isComposing:!1}))}static insert(b,g){const p=b.ownerDocument,G=p.activeElement;G!==b&&b.focus();p.execCommand("insertText",!1,g)||fo.insertTextFirefox(b,g);G===p.body?b.blur():G instanceof HTMLElement&&G!==b&&G.focus()}static set(b,g){b.select();fo.insert(b,g)}static getSelection(b){const {selectionStart:g,selectionEnd:p}=b;return b.value.slice(g?g:void 0,p?p:void 0)}static wrapSelection(b,
|
|||
|
g,p){const {selectionStart:G,selectionEnd:Y}=b,la=fo.getSelection(b);fo.insert(b,g+la+(null!=p?p:g));b.selectionStart=(G||0)+g.length;b.selectionEnd=(Y||0)+g.length}static replace(b,g,p){let G=0;b.value.replace(g,(...Y)=>{const la=G+Y[Y.length-2],pa=Y[0].length;b.selectionStart=la;b.selectionEnd=la+pa;Y="string"===typeof p?p:p(...Y);fo.insert(b,Y);b.selectionStart=la;G+=Y.length-pa;return Y})}static findLineEnd(b,g){const p=b.lastIndexOf("\n",g-1)+1;return"\t"!==b.charAt(p)?g:p+1}static indent(b){var g;
|
|||
|
const {selectionStart:p,selectionEnd:G,value:Y}=b;var la=Y.slice(p,G);if((la=null==(g=/\n/g.exec(la))?void 0:g.length)&&0<la){g=Y.lastIndexOf("\n",p-1)+1;var pa=b.value.slice(g,G-1);la=pa.replace(/^|\n/g,`$&${fo.INDENT}`);pa=la.length-pa.length;b.setSelectionRange(g,G-1);fo.insert(b,la);b.setSelectionRange(p+1,G+pa)}else fo.insert(b,fo.INDENT)}static unindent(b){const {selectionStart:g,selectionEnd:p,value:G}=b;var Y=G.lastIndexOf("\n",g-1)+1;const la=fo.findLineEnd(G,p);var pa=b.value.slice(Y,la);
|
|||
|
const Ga=pa.replace(/(^|\n)(\t| {1,2})/g,"$1");pa=pa.length-Ga.length;b.setSelectionRange(Y,la);fo.insert(b,Ga);Y=(Y=/\t| {1,2}/.exec(G.slice(Y,g)))?Y[0].length:0;b.setSelectionRange(g-Y,Math.max(g-Y,p-pa))}static normalizeText(b){return b.replace(fo.fixNewLines,"\n")}},Ur=fo;ib(Ur,"fixNewLines",/\r?\n|\r/g);ib(Ur,"INDENT"," ");var gq;"undefined"!==typeof window&&(gq=Ik());var Yv=new Map,$y=Jk()?"⌘":"ctrl",RD=class extends eh{},az=sf(W(22)),UD=()=>{};/^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|||
|
var Yy=sf(W(22)),Wv={},dt=sf(W(22)),QD=b=>{for(b=b.parentElement;b&&b!==document.body;){const {overflowY:g}=window.getComputedStyle(b);if(b.scrollHeight>b.clientHeight&&("auto"===g||"scroll"===g||"overlay"===g))return b;b=b.parentElement}return document},Uv=sf(W(22)),Sv=new Map,PD={accent:"rgb(255, 0, 0)",brushFill:"var(--ls-scrollbar-background-color, rgba(0, 0, 0, .05))",brushStroke:"var(--ls-scrollbar-thumb-hover-color, rgba(0, 0, 0, .05))",selectStroke:"var(--color-selectedFill)",selectFill:"rgba(65, 132, 244, 0.05)",
|
|||
|
binding:"rgba(65, 132, 244, 0.5)",background:"var(--ls-primary-background-color)",foreground:"var(--ls-primary-text-color)",grid:"var(--ls-quaternary-background-color)"},OD=((b,...g)=>b.reduce((p,G,Y)=>p+G+(Y<g.length?g[Y]:""),""))`
|
|||
|
.tl-container {
|
|||
|
--tl-zoom: 1;
|
|||
|
--tl-scale: calc(1 / var(--tl-zoom));
|
|||
|
--tl-padding: 64px;
|
|||
|
--tl-shadow-color: 0deg 0% 0%;
|
|||
|
--tl-binding-distance: ${4}px;
|
|||
|
--tl-shadow-elevation-low: 0px 0.4px 0.5px hsl(var(--tl-shadow-color) / 0.04),
|
|||
|
0px 0.6px 0.8px -0.7px hsl(var(--tl-shadow-color) / 0.06),
|
|||
|
0.1px 1.2px 1.5px -1.4px hsl(var(--tl-shadow-color) / 0.08);
|
|||
|
--tl-shadow-elevation-medium: 0px 0.4px 0.5px hsl(var(--tl-shadow-color) / 0.04),
|
|||
|
0.1px 1.3px 1.7px -0.5px hsl(var(--tl-shadow-color) / 0.06),
|
|||
|
0.1px 2.8px 3.6px -1px hsl(var(--tl-shadow-color) / 0.07),
|
|||
|
0.3px 6.1px 7.8px -1.4px hsl(var(--tl-shadow-color) / 0.09);
|
|||
|
--tl-shadow-elevation-high: 0px 0.4px 0.5px hsl(var(--tl-shadow-color) / 0.04),
|
|||
|
0.1px 2.3px 3px -0.2px hsl(var(--tl-shadow-color) / 0.05),
|
|||
|
0.2px 4.1px 5.3px -0.5px hsl(var(--tl-shadow-color) / 0.06),
|
|||
|
0.4px 6.6px 8.5px -0.7px hsl(var(--tl-shadow-color) / 0.07),
|
|||
|
0.6px 10.3px 13.2px -1px hsl(var(--tl-shadow-color) / 0.08),
|
|||
|
0.9px 16px 20.6px -1.2px hsl(var(--tl-shadow-color) / 0.09),
|
|||
|
1.3px 24.3px 31.2px -1.4px hsl(var(--tl-shadow-color) / 0.1);
|
|||
|
box-sizing: border-box;
|
|||
|
position: relative;
|
|||
|
top: 0px;
|
|||
|
left: 0px;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
max-width: 100%;
|
|||
|
max-height: 100%;
|
|||
|
box-sizing: border-box;
|
|||
|
padding: 0px;
|
|||
|
margin: 0px;
|
|||
|
outline: none;
|
|||
|
z-index: 100;
|
|||
|
user-select: none;
|
|||
|
touch-action: none;
|
|||
|
overscroll-behavior: none;
|
|||
|
background-color: var(--tl-background);
|
|||
|
cursor: inherit;
|
|||
|
box-sizing: border-box;
|
|||
|
color: var(--tl-foreground);
|
|||
|
-webkit-user-select: none;
|
|||
|
-webkit-user-drag: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-overlay {
|
|||
|
background: none;
|
|||
|
fill: transparent;
|
|||
|
position: absolute;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
touch-action: none;
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-snap-line {
|
|||
|
stroke: var(--tl-accent);
|
|||
|
stroke-width: calc(1px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-snap-point {
|
|||
|
stroke: var(--tl-accent);
|
|||
|
stroke-width: calc(1px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-canvas {
|
|||
|
position: absolute;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
touch-action: none;
|
|||
|
pointer-events: all;
|
|||
|
overflow: clip;
|
|||
|
outline: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-layer {
|
|||
|
position: absolute;
|
|||
|
top: 0px;
|
|||
|
left: 0px;
|
|||
|
height: 0px;
|
|||
|
width: 0px;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-absolute {
|
|||
|
position: absolute;
|
|||
|
top: 0px;
|
|||
|
left: 0px;
|
|||
|
transform-origin: center center;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-positioned {
|
|||
|
position: absolute;
|
|||
|
transform-origin: center center;
|
|||
|
pointer-events: none;
|
|||
|
display: flex;
|
|||
|
align-items: center;
|
|||
|
justify-content: center;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-positioned-svg {
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
overflow: hidden;
|
|||
|
contain: layout style size;
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-positioned-div {
|
|||
|
position: relative;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
padding: var(--tl-padding);
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-positioned-inner {
|
|||
|
position: relative;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
}
|
|||
|
|
|||
|
.tl-counter-scaled {
|
|||
|
transform: scale(var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-dashed {
|
|||
|
stroke-dasharray: calc(2px * var(--tl-scale)), calc(2px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-transparent {
|
|||
|
fill: transparent;
|
|||
|
stroke: transparent;
|
|||
|
}
|
|||
|
|
|||
|
.tl-corner-handle {
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
fill: var(--tl-background);
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-rotate-handle {
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
fill: var(--tl-background);
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-user {
|
|||
|
left: -4px;
|
|||
|
top: -4px;
|
|||
|
height: 8px;
|
|||
|
width: 8px;
|
|||
|
border-radius: 100%;
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-indicator {
|
|||
|
fill: transparent;
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-indicator-container {
|
|||
|
transform-origin: 0 0;
|
|||
|
fill: transparent;
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-user-indicator-bounds {
|
|||
|
border-style: solid;
|
|||
|
border-width: calc(1px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-selected {
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
}
|
|||
|
|
|||
|
.tl-hovered {
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
}
|
|||
|
|
|||
|
.tl-clone-target {
|
|||
|
pointer-events: all;
|
|||
|
}
|
|||
|
|
|||
|
.tl-clone-target:hover .tl-clone-button {
|
|||
|
opacity: 1;
|
|||
|
}
|
|||
|
|
|||
|
.tl-clone-button-target {
|
|||
|
cursor: pointer;
|
|||
|
pointer-events: all;
|
|||
|
}
|
|||
|
|
|||
|
.tl-clone-button-target:hover .tl-clone-button {
|
|||
|
fill: var(--tl-selectStroke);
|
|||
|
}
|
|||
|
|
|||
|
.tl-clone-button {
|
|||
|
opacity: 0;
|
|||
|
r: calc(8px * var(--tl-scale));
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
fill: var(--tl-background);
|
|||
|
}
|
|||
|
|
|||
|
.tl-bounds {
|
|||
|
pointer-events: none;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-bounds-bg {
|
|||
|
stroke: none;
|
|||
|
fill: var(--tl-selectFill);
|
|||
|
pointer-events: all;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-bounds-fg {
|
|||
|
fill: transparent;
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
stroke-width: calc(1.5px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-brush {
|
|||
|
fill: var(--tl-brushFill);
|
|||
|
stroke: var(--tl-brushStroke);
|
|||
|
stroke-width: calc(1px * var(--tl-scale));
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-dot {
|
|||
|
fill: var(--tl-background);
|
|||
|
stroke: var(--tl-foreground);
|
|||
|
stroke-width: 2px;
|
|||
|
}
|
|||
|
|
|||
|
.tl-handle {
|
|||
|
fill: var(--tl-background);
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
stroke-width: 1.5px;
|
|||
|
pointer-events: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-handle-bg {
|
|||
|
fill: transparent;
|
|||
|
stroke: none;
|
|||
|
r: calc(16px / max(1, var(--tl-zoom)));
|
|||
|
pointer-events: all;
|
|||
|
cursor: grab;
|
|||
|
}
|
|||
|
|
|||
|
.tl-handle-bg:active {
|
|||
|
pointer-events: all;
|
|||
|
fill: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-handle-bg:hover {
|
|||
|
cursor: grab;
|
|||
|
fill: var(--tl-selectFill);
|
|||
|
}
|
|||
|
|
|||
|
.tl-binding-indicator {
|
|||
|
fill: transparent;
|
|||
|
stroke: var(--tl-binding);
|
|||
|
}
|
|||
|
|
|||
|
.tl-centered {
|
|||
|
display: grid;
|
|||
|
place-content: center;
|
|||
|
place-items: center;
|
|||
|
}
|
|||
|
|
|||
|
.tl-centered > * {
|
|||
|
grid-column: 1;
|
|||
|
grid-row: 1;
|
|||
|
}
|
|||
|
|
|||
|
.tl-centered-g {
|
|||
|
transform: translate(var(--tl-padding), var(--tl-padding));
|
|||
|
}
|
|||
|
|
|||
|
.tl-current-parent > *[data-shy='true'] {
|
|||
|
opacity: 1;
|
|||
|
}
|
|||
|
|
|||
|
.tl-binding {
|
|||
|
fill: none;
|
|||
|
stroke: var(--tl-selectStroke);
|
|||
|
stroke-width: calc(2px * var(--tl-scale));
|
|||
|
}
|
|||
|
|
|||
|
.tl-counter-scaled-positioned {
|
|||
|
position: absolute;
|
|||
|
top: 0;
|
|||
|
left: 0;
|
|||
|
pointer-events: none;
|
|||
|
padding: 0;
|
|||
|
contain: layout style size;
|
|||
|
}
|
|||
|
|
|||
|
.tl-fade-in {
|
|||
|
opacity: 1;
|
|||
|
transition-timing-function: ease-in-out;
|
|||
|
transition-property: opacity;
|
|||
|
transition-duration: 0.12s;
|
|||
|
transition-delay: 0;
|
|||
|
}
|
|||
|
|
|||
|
.tl-fade-out {
|
|||
|
opacity: 0;
|
|||
|
transition-timing-function: ease-out;
|
|||
|
transition-property: opacity;
|
|||
|
transition-duration: 0.12s;
|
|||
|
transition-delay: 0;
|
|||
|
}
|
|||
|
|
|||
|
.tl-counter-scaled-positioned > .tl-positioned-div {
|
|||
|
user-select: none;
|
|||
|
padding: 64px;
|
|||
|
}
|
|||
|
|
|||
|
.tl-context-bar > * {
|
|||
|
grid-column: 1;
|
|||
|
grid-row: 1;
|
|||
|
}
|
|||
|
|
|||
|
.tl-bounds-detail {
|
|||
|
padding: 2px 3px;
|
|||
|
border-radius: 1px;
|
|||
|
white-space: nowrap;
|
|||
|
width: fit-content;
|
|||
|
text-align: center;
|
|||
|
font-size: 12px;
|
|||
|
font-weight: 500;
|
|||
|
background-color: var(--tl-selectStroke);
|
|||
|
color: var(--tl-background);
|
|||
|
}
|
|||
|
|
|||
|
.tl-grid-canvas {
|
|||
|
position: absolute;
|
|||
|
touch-action: none;
|
|||
|
pointer-events: none;
|
|||
|
user-select: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-grid {
|
|||
|
position: absolute;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
touch-action: none;
|
|||
|
pointer-events: none;
|
|||
|
user-select: none;
|
|||
|
}
|
|||
|
|
|||
|
.tl-grid-dot {
|
|||
|
fill: var(--tl-grid);
|
|||
|
}
|
|||
|
|
|||
|
.tl-html-canvas {
|
|||
|
position: absolute;
|
|||
|
top: 0px;
|
|||
|
left: 0px;
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
zindex: 20000;
|
|||
|
pointer-events: none;
|
|||
|
border: 2px solid red;
|
|||
|
}
|
|||
|
|
|||
|
.tl-direction-indicator {
|
|||
|
z-index: 100000;
|
|||
|
position: absolute;
|
|||
|
top: 0px;
|
|||
|
left: 0px;
|
|||
|
fill: var(--tl-selectStroke);
|
|||
|
}
|
|||
|
`,Vy=sf(W(22)),Ty=sf(W(22)),Rv={},Xk={toVector(b,g){void 0===b&&(b=g);return Array.isArray(b)?b:[b,b]},add(b,g){return[b[0]+g[0],b[1]+g[1]]},sub(b,g){return[b[0]-g[0],b[1]-g[1]]},addTo(b,g){b[0]+=g[0];b[1]+=g[1]},subTo(b,g){b[0]-=g[0];b[1]-=g[1]}},Uy={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}},ND=["enter","leave"],MD=["gotpointercapture","lostpointercapture"],
|
|||
|
Sy=class{constructor(b,g,p){this.ctrl=b;this.args=g;this.key=p;this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(b){this.ctrl.state[this.key]=b}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const {state:b,
|
|||
|
shared:g,ingKey:p,args:G}=this;g[p]=b._active=b.active=b._blocked=b._force=!1;b._step=[!1,!1];b.intentional=!1;b._movement=[0,0];b._distance=[0,0];b._direction=[0,0];b._delta=[0,0];b._bounds=[[-Infinity,Infinity],[-Infinity,Infinity]];b.args=G;b.axis=void 0;b.memo=void 0;b.elapsedTime=0;b.direction=[0,0];b.distance=[0,0];b.overflow=[0,0];b._movementBound=[!1,!1];b.velocity=[0,0];b.movement=[0,0];b.delta=[0,0];b.timeStamp=0}start(b){const g=this.state,p=this.config;g._active||(this.reset(),this.computeInitial(),
|
|||
|
g._active=!0,g.target=b.target,g.currentTarget=b.currentTarget,g.lastOffset=p.from?Ti(p.from,g):g.offset,g.offset=g.lastOffset);g.startTime=g.timeStamp=b.timeStamp}computeValues(b){const g=this.state;g._values=b;g.values=this.config.transform(b)}computeInitial(){const b=this.state;b._initial=b._values;b.initial=b.values}compute(b){const {state:g,config:p,shared:G}=this;g.args=this.args;var Y=0;if(b){g.event=b;p.preventDefault&&b.cancelable&&g.event.preventDefault();g.type=b.type;G.touches=this.ctrl.pointerIds.size||
|
|||
|
this.ctrl.touchIds.size;G.locked=!!document.pointerLockElement;Y=Object;var la=Y.assign,pa={};"buttons"in b&&(pa.buttons=b.buttons);if("shiftKey"in b){const {shiftKey:Mc,altKey:Tc,metaKey:vd,ctrlKey:de}=b;Object.assign(pa,{shiftKey:Mc,altKey:Tc,metaKey:vd,ctrlKey:de})}la.call(Y,G,pa);G.down=G.pressed=1===G.buttons%2||0<G.touches;Y=b.timeStamp-g.timeStamp;g.timeStamp=b.timeStamp;g.elapsedTime=g.timeStamp-g.startTime}g._active&&(la=g._delta.map(Math.abs),Xk.addTo(g._distance,la));this.axisIntent&&this.axisIntent(b);
|
|||
|
const [Ga,Qa]=g._movement,[Za,fb]=p.threshold,{_step:mb,values:Lb}=g;p.hasCustomTransform?(!1===mb[0]&&(mb[0]=Math.abs(Ga)>=Za&&Lb[0]),!1===mb[1]&&(mb[1]=Math.abs(Qa)>=fb&&Lb[1])):(!1===mb[0]&&(mb[0]=Math.abs(Ga)>=Za&&Math.sign(Ga)*Za),!1===mb[1]&&(mb[1]=Math.abs(Qa)>=fb&&Math.sign(Qa)*fb));g.intentional=!1!==mb[0]||!1!==mb[1];if(g.intentional){la=[0,0];if(p.hasCustomTransform){const [Mc,Tc]=Lb;la[0]=!1!==mb[0]?Mc-mb[0]:0;la[1]=!1!==mb[1]?Tc-mb[1]:0}else la[0]=!1!==mb[0]?Ga-mb[0]:0,la[1]=!1!==mb[1]?
|
|||
|
Qa-mb[1]:0;this.restrictToAxis&&!g._blocked&&this.restrictToAxis(la);pa=g.offset;var Tb=g._active&&!g._blocked||g.active;Tb&&(g.first=g._active&&!g.active,g.last=!g._active&&g.active,g.active=G[this.ingKey]=g._active,b&&(g.first&&("bounds"in p&&(g._bounds=Ti(p.bounds,g)),this.setup&&this.setup()),g.movement=la,this.computeOffset()));var [Pb,lc]=g.offset,[[xc,$b],[sc,oc]]=g._bounds;g.overflow=[Pb<xc?-1:Pb>$b?1:0,lc<sc?-1:lc>oc?1:0];g._movementBound[0]=g.overflow[0]?!1===g._movementBound[0]?g._movement[0]:
|
|||
|
g._movementBound[0]:!1;g._movementBound[1]=g.overflow[1]?!1===g._movementBound[1]?g._movement[1]:g._movementBound[1]:!1;g.offset=Gi(g._bounds,g.offset,g._active?p.rubberband||[0,0]:[0,0]);g.delta=Xk.sub(g.offset,pa);this.computeMovement();Tb&&(!g.last||32<Y)&&(g.delta=Xk.sub(g.offset,pa),b=g.delta.map(Math.abs),Xk.addTo(g.distance,b),g.direction=g.delta.map(Math.sign),g._direction=g._delta.map(Math.sign),!g.first&&0<Y&&(g.velocity=[b[0]/Y,b[1]/Y]))}}emit(){const b=this.state;var g=this.shared;const p=
|
|||
|
this.config;b._active||this.clean();if(!b._blocked&&b.intentional||b._force||p.triggerAllEvents)g=this.handler(Gg(Gg(Gg({},g),b),{},{[this.aliasKey]:b.values})),void 0!==g&&(b.memo=g)}clean(){this.eventStore.clean();this.timeoutStore.clean()}},ct=class extends Sy{constructor(...b){super(...b);Nh(this,"aliasKey","xy")}reset(){super.reset();this.state.axis=void 0}init(){this.state.offset=[0,0];this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=Xk.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=
|
|||
|
Xk.sub(this.state.offset,this.state.lastOffset)}axisIntent(b){const g=this.state,p=this.config;!g.axis&&b&&(b="object"===typeof p.axisThreshold?p.axisThreshold[bl(b)]:p.axisThreshold,g.axis=vi(g._movement,b));g._blocked=(p.lockDirection||!!p.axis)&&!g.axis||!!p.axis&&p.axis!==g.axis}restrictToAxis(b){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case "x":b[1]=0;break;case "y":b[0]=0}}},LD=b=>b,hp={enabled(b=!0){return b},eventOptions(b,g,p){return Gg(Gg({},p.shared.eventOptions),
|
|||
|
b)},preventDefault(b=!1){return b},triggerAllEvents(b=!1){return b},rubberband(b=0){switch(b){case !0:return[.15,.15];case !1:return[0,0];default:return Xk.toVector(b)}},from(b){if("function"===typeof b)return b;if(null!=b)return Xk.toVector(b)},transform(b,g,p){b=b||p.shared.transform;this.hasCustomTransform=!!b;return b||LD},threshold(b){return Xk.toVector(b,0)}},Zm=Gg(Gg({},hp),{},{axis(b,g,{axis:p}){this.lockDirection="lock"===p;if(!this.lockDirection)return p},axisThreshold(b=0){return b},bounds(b=
|
|||
|
{}){if("function"===typeof b)return la=>Zm.bounds(b(la));if("current"in b)return()=>b.current;if("function"===typeof HTMLElement&&b instanceof HTMLElement)return b;const {left:g=-Infinity,right:p=Infinity,top:G=-Infinity,bottom:Y=Infinity}=b;return[[g,p],[G,Y]]}}),Xy={ArrowRight:(b=1)=>[10*b,0],ArrowLeft:(b=1)=>[-10*b,0],ArrowUp:(b=1)=>[0,-10*b],ArrowDown:(b=1)=>[0,10*b]},KD=class extends ct{constructor(...b){super(...b);Nh(this,"ingKey","dragging")}reset(){super.reset();const b=this.state;b._pointerId=
|
|||
|
void 0;b._pointerActive=!1;b._keyboardActive=!1;b._preventScroll=!1;b._delayed=!1;b.swipe=[0,0];b.tap=!1;b.canceled=!1;b.cancel=this.cancel.bind(this)}setup(){const b=this.state;if(b._bounds instanceof HTMLElement){const g=b._bounds.getBoundingClientRect(),p=b.currentTarget.getBoundingClientRect();b._bounds=Zm.bounds({left:g.left-p.left+b.offset[0],right:g.right-p.right+b.offset[0],top:g.top-p.top+b.offset[1],bottom:g.bottom-p.bottom+b.offset[1]})}}cancel(){const b=this.state;b.canceled||(b.canceled=
|
|||
|
!0,b._active=!1,setTimeout(()=>{this.compute();this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean();this.state._pointerActive=!1;this.state._keyboardActive=!1;super.clean()}pointerDown(b){const g=this.config,p=this.state;if(null==b.buttons||(Array.isArray(g.pointerButtons)?g.pointerButtons.includes(b.buttons):-1===g.pointerButtons||g.pointerButtons===b.buttons)){var G=this.ctrl.setEventIds(b);g.pointerCapture&&b.target.setPointerCapture(b.pointerId);
|
|||
|
G&&1<G.size&&p._pointerActive||(this.start(b),this.setupPointer(b),p._pointerId=Ci(b),p._pointerActive=!0,this.computeValues(rj(b)),this.computeInitial(),g.preventScrollAxis&&"mouse"!==bl(b)?(p._active=!1,this.setupScrollPrevention(b)):0<g.delay?(this.setupDelayTrigger(b),g.triggerAllEvents&&(this.compute(b),this.emit())):this.startPointerDrag(b))}}startPointerDrag(b){const g=this.state;g._active=!0;g._preventScroll=!0;g._delayed=!1;this.compute(b);this.emit()}pointerMove(b){const g=this.state,p=
|
|||
|
this.config;if(g._pointerActive&&(g.type!==b.type||b.timeStamp!==g.timeStamp)){var G=Ci(b);if(void 0===g._pointerId||G===g._pointerId)G=rj(b),document.pointerLockElement===b.target?g._delta=[b.movementX,b.movementY]:(g._delta=Xk.sub(G,g._values),this.computeValues(G)),Xk.addTo(g._movement,g._delta),this.compute(b),g._delayed&&g.intentional?(this.timeoutStore.remove("dragDelay"),g.active=!1,this.startPointerDrag(b)):p.preventScrollAxis&&!g._preventScroll?g.axis&&(g.axis===p.preventScrollAxis||"xy"===
|
|||
|
p.preventScrollAxis?(g._active=!1,this.clean()):(this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(b))):this.emit()}}pointerUp(b){this.ctrl.setEventIds(b);try{this.config.pointerCapture&&b.target.hasPointerCapture(b.pointerId)&&b.target.releasePointerCapture(b.pointerId)}catch(pa){}const g=this.state,p=this.config;if(g._active&&g._pointerActive){var G=Ci(b);if(void 0===g._pointerId||G===g._pointerId){this.state._pointerActive=!1;this.setActive();this.compute(b);var [Y,la]=g._distance;
|
|||
|
g.tap=Y<=p.tapsThreshold&&la<=p.tapsThreshold;if(g.tap&&p.filterTaps)g._force=!0;else{const [pa,Ga]=g.direction,[Qa,Za]=g.velocity,[fb,mb]=g.movement,[Lb,Tb]=p.swipe.velocity,[Pb,lc]=p.swipe.distance;g.elapsedTime<p.swipe.duration&&(Math.abs(Qa)>Lb&&Math.abs(fb)>Pb&&(g.swipe[0]=pa),Math.abs(Za)>Tb&&Math.abs(mb)>lc&&(g.swipe[1]=Ga))}this.emit()}}}pointerClick(b){!this.state.tap&&0<b.detail&&(b.preventDefault(),b.stopPropagation())}setupPointer(b){const g=this.config,p=g.device;g.pointerLock&&b.currentTarget.requestPointerLock();
|
|||
|
g.pointerCapture||(this.eventStore.add(this.sharedConfig.window,p,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,p,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,p,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(b){this.state._preventScroll&&b.cancelable&&b.preventDefault()}setupScrollPrevention(b){this.state._preventScroll=
|
|||
|
!1;"persist"in b&&"function"===typeof b.persist&&b.persist();const g=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",g);this.eventStore.add(this.sharedConfig.window,"touch","cancel",g);this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,b)}setupDelayTrigger(b){this.state._delayed=!0;this.timeoutStore.add("dragDelay",()=>{this.state._step=
|
|||
|
[0,0];this.startPointerDrag(b)},this.config.delay)}keyDown(b){const g=Xy[b.key];if(g){const p=this.state,G=b.shiftKey?10:b.altKey?.1:1;this.start(b);p._delta=g(G);p._keyboardActive=!0;Xk.addTo(p._movement,p._delta);this.compute(b);this.emit()}}keyUp(b){b.key in Xy&&(this.state._keyboardActive=!1,this.setActive(),this.compute(b),this.emit())}bind(b){const g=this.config.device;b(g,"start",this.pointerDown.bind(this));this.config.pointerCapture&&(b(g,"change",this.pointerMove.bind(this)),b(g,"end",this.pointerUp.bind(this)),
|
|||
|
b(g,"cancel",this.pointerUp.bind(this)),b("lostPointerCapture","",this.pointerUp.bind(this)));this.config.keys&&(b("key","down",this.keyDown.bind(this)),b("key","up",this.keyUp.bind(this)));this.config.filterTaps&&b("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},dr="undefined"!==typeof window&&window.document&&window.document.createElement;try{var nz="constructor"in GestureEvent}catch(b){nz=!1}var tE=nz,Tr=dr&&"ontouchstart"in window||dr&&1<window.navigator.maxTouchPoints,Tv=dr&&
|
|||
|
"ontouchstart"in window||dr&&1<window.navigator.maxTouchPoints,Wy=dr&&"onpointerdown"in window,Vv=dr&&"exitPointerLock"in window.document,et={mouse:0,touch:0,pen:8},$D=Gg(Gg({},Zm),{},{device(b,g,{pointer:{touch:p=!1,lock:G=!1,mouse:Y=!1}={}}){this.pointerLock=G&&Vv;return Tr&&p?"touch":this.pointerLock?"mouse":Wy&&!Y?"pointer":Tr?"touch":"mouse"},preventScrollAxis(b,g,{preventScroll:p}){this.preventScrollDelay="number"===typeof p?p:p||void 0===p&&b?250:void 0;if(Tv&&!1!==p)return b?b:void 0!==p?
|
|||
|
"y":void 0},pointerCapture(b,g,{pointer:{capture:p=!0,buttons:G=1,keys:Y=!0}={}}){this.pointerButtons=G;this.keys=Y;return!this.pointerLock&&"pointer"===this.device&&p},threshold(b,g,{filterTaps:p=!1,tapsThreshold:G=3,axis:Y}){b=Xk.toVector(b,p?G:Y?1:0);this.filterTaps=p;this.tapsThreshold=G;return b},swipe({velocity:b=.5,distance:g=50,duration:p=250}={}){return{velocity:this.transform(Xk.toVector(b)),distance:this.transform(Xk.toVector(g)),duration:p}},delay(b=0){switch(b){case !0:return 180;case !1:return 0;
|
|||
|
default:return b}},axisThreshold(b){return b?Gg(Gg({},et),b):et}}),uE=class extends Sy{constructor(...b){super(...b);Nh(this,"ingKey","pinching");Nh(this,"aliasKey","da")}init(){this.state.offset=[1,0];this.state.lastOffset=[1,0];this.state._pointerEvents=new Map}reset(){super.reset();const b=this.state;b._touchIds=[];b.canceled=!1;b.cancel=this.cancel.bind(this);b.turns=0}computeOffset(){const {type:b,movement:g,lastOffset:p}=this.state;this.state.offset="wheel"===b?Xk.add(g,p):[(1+g[0])*p[0],g[1]+
|
|||
|
p[1]]}computeMovement(){const {offset:b,lastOffset:g}=this.state;this.state.movement=[b[0]/g[0],b[1]-g[1]]}axisIntent(){const b=this.state,[g,p]=b._movement;if(!b.axis){const G=30*Math.abs(g)-Math.abs(p);0>G?b.axis="angle":0<G&&(b.axis="scale")}}restrictToAxis(b){this.config.lockDirection&&("scale"===this.state.axis?b[1]=0:"angle"===this.state.axis&&(b[0]=0))}cancel(){const b=this.state;b.canceled||setTimeout(()=>{b.canceled=!0;b._active=!1;this.compute();this.emit()},0)}touchStart(b){this.ctrl.setEventIds(b);
|
|||
|
var g=this.state;const p=this.ctrl.touchIds;g._active&&g._touchIds.every(G=>p.has(G))||2>p.size||(this.start(b),g._touchIds=Array.from(p).slice(0,2),g=jk(b,g._touchIds),this.pinchStart(b,g))}pointerStart(b){if(null==b.buttons||1===b.buttons%2){this.ctrl.setEventIds(b);b.target.setPointerCapture(b.pointerId);var g=this.state,p=g._pointerEvents,G=this.ctrl.pointerIds;g._active&&Array.from(p.keys()).every(Y=>G.has(Y))||(2>p.size&&p.set(b.pointerId,b),2>g._pointerEvents.size||(this.start(b),g=ql(...Array.from(p.values())),
|
|||
|
this.pinchStart(b,g)))}}pinchStart(b,g){this.state.origin=g.origin;this.computeValues([g.distance,g.angle]);this.computeInitial();this.compute(b);this.emit()}touchMove(b){if(this.state._active){var g=jk(b,this.state._touchIds);this.pinchMove(b,g)}}pointerMove(b){var g=this.state._pointerEvents;g.has(b.pointerId)&&g.set(b.pointerId,b);this.state._active&&(g=ql(...Array.from(g.values())),this.pinchMove(b,g))}pinchMove(b,g){const p=this.state,G=g.angle-p._values[1];let Y=0;270<Math.abs(G)&&(Y+=Math.sign(G));
|
|||
|
this.computeValues([g.distance,g.angle-360*Y]);p.origin=g.origin;p.turns=Y;p._movement=[p._values[0]/p._initial[0]-1,p._values[1]-p._initial[1]];this.compute(b);this.emit()}touchEnd(b){this.ctrl.setEventIds(b);this.state._active&&this.state._touchIds.some(g=>!this.ctrl.touchIds.has(g))&&(this.state._active=!1,this.compute(b),this.emit())}pointerEnd(b){const g=this.state;this.ctrl.setEventIds(b);try{b.target.releasePointerCapture(b.pointerId)}catch(p){}g._pointerEvents.has(b.pointerId)&&g._pointerEvents.delete(b.pointerId);
|
|||
|
g._active&&2>g._pointerEvents.size&&(g._active=!1,this.compute(b),this.emit())}gestureStart(b){b.cancelable&&b.preventDefault();const g=this.state;g._active||(this.start(b),this.computeValues([b.scale,b.rotation]),g.origin=[b.clientX,b.clientY],this.compute(b),this.emit())}gestureMove(b){b.cancelable&&b.preventDefault();if(this.state._active){var g=this.state;this.computeValues([b.scale,b.rotation]);g.origin=[b.clientX,b.clientY];var p=g._movement;g._movement=[b.scale-1,b.rotation];g._delta=Xk.sub(g._movement,
|
|||
|
p);this.compute(b);this.emit()}}gestureEnd(b){this.state._active&&(this.state._active=!1,this.compute(b),this.emit())}wheel(b){const g=this.config.modifierKey;if(!g||b[g])this.state._active?this.wheelChange(b):this.wheelStart(b),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelStart(b){this.start(b);this.wheelChange(b)}wheelChange(b){"uv"in b||b.cancelable&&b.preventDefault();const g=this.state;g._delta=[-Yh(b)[1]/100*g.offset[0],0];Xk.addTo(g._movement,g._delta);cl(g);this.state.origin=
|
|||
|
[b.clientX,b.clientY];this.compute(b);this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(b){const g=this.config.device;g&&(b(g,"start",this[g+"Start"].bind(this)),b(g,"change",this[g+"Move"].bind(this)),b(g,"end",this[g+"End"].bind(this)),b(g,"cancel",this[g+"End"].bind(this)));this.config.pinchOnWheel&&b("wheel","",this.wheel.bind(this),{passive:!1})}},mE=Gg(Gg({},hp),{},{device(b,g,{shared:p,pointer:{touch:G=!1}={}}){if(p.target&&!Tr&&tE)return"gesture";
|
|||
|
if(Tr&&G)return"touch";if(Tv){if(Wy)return"pointer";if(Tr)return"touch"}},bounds(b,g,{scaleBounds:p={},angleBounds:G={}}){const Y=pa=>{pa=Ti(p,pa);pa=Object.assign({},{min:-Infinity,max:Infinity},pa||{});return[pa.min,pa.max]},la=pa=>{pa=Ti(G,pa);pa=Object.assign({},{min:-Infinity,max:Infinity},pa||{});return[pa.min,pa.max]};return"function"!==typeof p&&"function"!==typeof G?[Y(),la()]:pa=>[Y(pa),la(pa)]},threshold(b,g,p){this.lockDirection="lock"===p.axis;return Xk.toVector(b,this.lockDirection?
|
|||
|
[.1,3]:0)},modifierKey(b){return void 0===b?"ctrlKey":b},pinchOnWheel(b=!0){return b}}),vE=class extends ct{constructor(...b){super(...b);Nh(this,"ingKey","moving")}move(b){this.config.mouseOnly&&"mouse"!==b.pointerType||(this.state._active?this.moveChange(b):this.moveStart(b),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(b){this.start(b);this.computeValues(rj(b));this.compute(b);this.computeInitial();this.emit()}moveChange(b){if(this.state._active){var g=rj(b),p=this.state;
|
|||
|
p._delta=Xk.sub(g,p._values);Xk.addTo(p._movement,p._delta);this.computeValues(g);this.compute(b);this.emit()}}moveEnd(b){this.state._active&&(this.state._active=!1,this.compute(b),this.emit())}bind(b){b("pointer","change",this.move.bind(this));b("pointer","leave",this.moveEnd.bind(this))}},wE=Gg(Gg({},Zm),{},{mouseOnly:(b=!0)=>b}),xE=class extends ct{constructor(...b){super(...b);Nh(this,"ingKey","scrolling")}scroll(b){this.state._active||this.start(b);this.scrollChange(b);this.timeoutStore.add("scrollEnd",
|
|||
|
this.scrollEnd.bind(this))}scrollChange(b){b.cancelable&&b.preventDefault();const g=this.state;var p,G;const {scrollX:Y,scrollY:la,scrollLeft:pa,scrollTop:Ga}=b.currentTarget;var Qa=[null!==(p=null!==Y&&void 0!==Y?Y:pa)&&void 0!==p?p:0,null!==(G=null!==la&&void 0!==la?la:Ga)&&void 0!==G?G:0];g._delta=Xk.sub(Qa,g._values);Xk.addTo(g._movement,g._delta);this.computeValues(Qa);this.compute(b);this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(b){b("scroll",
|
|||
|
"",this.scroll.bind(this))}},yE=Zm,zE=class extends ct{constructor(...b){super(...b);Nh(this,"ingKey","wheeling")}wheel(b){this.state._active||this.start(b);this.wheelChange(b);this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(b){const g=this.state;g._delta=Yh(b);Xk.addTo(g._movement,g._delta);cl(g);this.compute(b);this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(b){b("wheel","",this.wheel.bind(this))}},AE=Zm,BE=class extends ct{constructor(...b){super(...b);
|
|||
|
Nh(this,"ingKey","hovering")}enter(b){this.config.mouseOnly&&"mouse"!==b.pointerType||(this.start(b),this.computeValues(rj(b)),this.compute(b),this.emit())}leave(b){if(!this.config.mouseOnly||"mouse"===b.pointerType){var g=this.state;if(g._active){g._active=!1;var p=rj(b);g._movement=g._delta=Xk.sub(p,g._values);this.computeValues(p);this.compute(b);g.delta=g.movement;this.emit()}}}bind(b){b("pointer","enter",this.enter.bind(this));b("pointer","leave",this.leave.bind(this))}},CE=Gg(Gg({},Zm),{},{mouseOnly:(b=
|
|||
|
!0)=>b}),aw=new Map,bw=new Map,DE={key:"drag",engine:KD,resolver:$D},EE={key:"hover",engine:BE,resolver:CE},jE={key:"move",engine:vE,resolver:wE},lE={key:"pinch",engine:uE,resolver:mE},kE={key:"scroll",engine:xE,resolver:yE},gE={key:"wheel",engine:zE,resolver:AE},$v=sf(W(22)),hE={target(b){if(b)return()=>"current"in b?b.current:b},enabled(b=!0){return b},window(b=dr?window:void 0){return b},eventOptions({passive:b=!0,capture:g=!1}={}){return{passive:b,capture:g}},transform(b){return b}},iE=["target",
|
|||
|
"eventOptions","window","enabled","transform"],dz=class{constructor(b,g){Nh(this,"_listeners",new Set);this._ctrl=b;this._gestureKey=g}add(b,g,p,G,Y){const la=this._listeners,pa=Th(g,p),Ga=Gg(Gg({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),Y);b.addEventListener(pa,G,Ga);const Qa=()=>{b.removeEventListener(pa,G,Ga);la.delete(Qa)};la.add(Qa);return Qa}clean(){this._listeners.forEach(b=>b());this._listeners.clear()}},dE=class{constructor(){Nh(this,"_timeouts",new Map)}add(b,
|
|||
|
g,p=140,...G){this.remove(b);this._timeouts.set(b,window.setTimeout(g,p,...G))}remove(b){(b=this._timeouts.get(b))&&window.clearTimeout(b)}clean(){this._timeouts.forEach(b=>void window.clearTimeout(b));this._timeouts.clear()}},eE=class{constructor(b){Nh(this,"gestures",new Set);Nh(this,"_targetEventStore",new dz(this));Nh(this,"gestureEventStores",{});Nh(this,"gestureTimeoutStores",{});Nh(this,"handlers",{});Nh(this,"config",{});Nh(this,"pointerIds",new Set);Nh(this,"touchIds",new Set);Nh(this,"state",
|
|||
|
{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}});b.drag&&Mi(this,"drag");b.wheel&&Mi(this,"wheel");b.scroll&&Mi(this,"scroll");b.move&&Mi(this,"move");b.pinch&&Mi(this,"pinch");b.hover&&Mi(this,"hover")}setEventIds(b){if("touches"in b)return this.touchIds=new Set(gn(b));if("pointerId"in b)return"pointerup"===b.type||"pointercancel"===b.type?this.pointerIds.delete(b.pointerId):"pointerdown"===b.type&&this.pointerIds.add(b.pointerId),this.pointerIds}applyHandlers(b,g){this.handlers=b;this.nativeHandlers=
|
|||
|
g}applyConfig(b,g){this.config=Pg(b,g,this.config)}clean(){this._targetEventStore.clean();for(const b of this.gestures)this.gestureEventStores[b].clean(),this.gestureTimeoutStores[b].clean()}effect(){this.config.shared.target&&this.bind();return()=>this._targetEventStore.clean()}bind(...b){var g=this.config.shared;const p={};let G;if(g.target&&(G=g.target(),!G))return;if(g.enabled){for(const Y of this.gestures){const la=this.config[Y],pa=ez(p,la.eventOptions,!!G);la.enabled&&(new (aw.get(Y))(this,
|
|||
|
b,Y)).bind(pa)}g=ez(p,g.eventOptions,!!G);for(const Y in this.nativeHandlers)g(Y,"",la=>this.nativeHandlers[Y](Gg(Gg({},this.state.shared),{},{event:la,args:b})),void 0,!0)}for(const Y in p)p[Y]=gj(...p[Y]);if(!G)return p;for(const Y in p){const {device:la,capture:pa,passive:Ga}=Li(Y);this._targetEventStore.add(G,la,"",p[Y],{capture:pa,passive:Ga})}}},ez=(b,g,p)=>(G,Y,la,pa={},Ga=!1)=>{var Qa,Za;const fb=null!==(Qa=pa.capture)&&void 0!==Qa?Qa:g.capture;pa=null!==(Za=pa.passive)&&void 0!==Za?Za:g.passive;
|
|||
|
G=Ga?G:Oh(G,Y,fb);p&&pa&&(G+="Passive");b[G]=b[G]||[];b[G].push(la)},fE=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/,hu=sf(W(22)),Zv=sf(W(22)),fz=sf(W(22)),oz=sf(W(22)),FE=sf(W(22)),bE=sf(W(22)),aE=sf(W(22)),GE=sf(W(22)),HE={none:(b,g)=>"none",["default"]:(b,g)=>"default",pointer:(b,g)=>"pointer",crosshair:(b,g)=>"crosshair",move:(b,g)=>"move",wait:(b,g)=>"wait",progress:(b,g)=>"progress",grab:(b,g)=>ij('\x3cpath d\x3d"m13.5557 17.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121" fill\x3d"%23fff"/\x3e\x3cg stroke\x3d"%23000" stroke-linecap\x3d"round" stroke-width\x3d".75"\x3e\x3cpath d\x3d"m13.5557 17.5742c-.098-.375-.196-.847-.406-1.552-.167-.557-.342-.859-.47-1.233-.155-.455-.303-.721-.496-1.181-.139-.329-.364-1.048-.457-1.44-.119-.509.033-.924.244-1.206.253-.339.962-.49 1.357-.351.371.13.744.512.916.788.288.46.357.632.717 1.542.393.992.564 1.918.611 2.231l.085.452c-.001-.04-.043-1.122-.044-1.162-.035-1.029-.06-1.823-.038-2.939.002-.126.064-.587.084-.715.078-.5.305-.8.673-.979.412-.201.926-.215 1.401-.017.423.173.626.55.687 1.022.014.109.094.987.093 1.107-.013 1.025.006 1.641.015 2.174.004.231.003 1.625.017 1.469.061-.656.094-3.189.344-3.942.144-.433.405-.746.794-.929.431-.203 1.113-.07 1.404.243.285.305.446.692.482 1.153.032.405-.019.897-.02 1.245 0 .867-.021 1.324-.037 2.121-.001.038-.015.298.023.182.094-.28.188-.542.266-.745.049-.125.241-.614.359-.859.114-.234.211-.369.415-.688.2-.313.415-.448.668-.561.54-.235 1.109.112 1.301.591.086.215.009.713-.028 1.105-.061.647-.254 1.306-.352 1.648-.128.447-.274 1.235-.34 1.601-.072.394-.234 1.382-.359 1.82-.086.301-.371.978-.652 1.384 0 0-1.074 1.25-1.192 1.812-.117.563-.078.567-.101.965-.024.399.121.923.121.923s-.802.104-1.234.034c-.391-.062-.875-.841-1-1.078-.172-.328-.539-.265-.682-.023-.225.383-.709 1.07-1.051 1.113-.668.084-2.054.03-3.139.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.284-.36-.629-1.093-1.243-1.985-.348-.504-1.027-1.085-1.284-1.579-.223-.425-.331-.954-.19-1.325.225-.594.675-.897 1.362-.832.519.05.848.206 1.238.537.225.19.573.534.75.748.163.195.203.276.377.509.23.307.302.459.214.121" stroke-linejoin\x3d"round"/\x3e\x3cpath d\x3d"m20.5664 21.7344v-3.459"/\x3e\x3cpath d\x3d"m18.5508 21.7461-.016-3.473"/\x3e\x3cpath d\x3d"m16.5547 18.3047.021 3.426"/\x3e\x3c/g\x3e',
|
|||
|
b,g),grabbing:(b,g)=>ij("\x3cpath d\x3d'm13.5732 12.0361c.48-.178 1.427-.069 1.677.473.213.462.396 1.241.406 1.075.024-.369-.024-1.167.137-1.584.117-.304.347-.59.686-.691.285-.086.62-.116.916-.055.313.064.642.287.765.499.362.623.368 1.899.385 1.831.064-.272.07-1.229.283-1.584.141-.235.497-.445.687-.479.294-.052.656-.068.964-.008.249.049.586.344.677.487.219.344.342 1.316.379 1.658.016.141.074-.393.293-.736.406-.639 1.844-.763 1.898.639.026.654.02.624.02 1.064 0 .516-.012.828-.04 1.202-.03.399-.116 1.304-.241 1.742-.086.301-.371.978-.653 1.384 0 0-1.074 1.25-1.191 1.812-.117.563-.078.567-.102.965-.023.399.121.923.121.923s-.801.104-1.234.034c-.391-.062-.875-.84-1-1.078-.172-.328-.539-.265-.682-.023-.224.383-.709 1.07-1.05 1.113-.669.084-2.055.03-3.14.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.283-.36-1.002-.929-1.243-1.985-.213-.936-.192-1.395.037-1.77.232-.381.67-.589.854-.625.208-.042.692-.039.875.062.223.123.313.159.488.391.23.307.312.456.213.121-.076-.262-.322-.595-.434-.97-.109-.361-.401-.943-.38-1.526.008-.221.103-.771.832-1.042' fill\x3d'%23fff'/\x3e\x3cg stroke\x3d'%23000' stroke-width\x3d'.75'\x3e\x3cpath d\x3d'm13.5732 12.0361c.48-.178 1.427-.069 1.677.473.213.462.396 1.241.406 1.075.024-.369-.024-1.167.137-1.584.117-.304.347-.59.686-.691.285-.086.62-.116.916-.055.313.064.642.287.765.499.362.623.368 1.899.385 1.831.064-.272.07-1.229.283-1.584.141-.235.497-.445.687-.479.294-.052.656-.068.964-.008.249.049.586.344.677.487.219.344.342 1.316.379 1.658.016.141.074-.393.293-.736.406-.639 1.844-.763 1.898.639.026.654.02.624.02 1.064 0 .516-.012.828-.04 1.202-.03.399-.116 1.304-.241 1.742-.086.301-.371.978-.653 1.384 0 0-1.074 1.25-1.191 1.812-.117.563-.078.567-.102.965-.023.399.121.923.121.923s-.801.104-1.234.034c-.391-.062-.875-.84-1-1.078-.172-.328-.539-.265-.682-.023-.224.383-.709 1.07-1.05 1.113-.669.084-2.055.03-3.14.02 0 0 .185-1.011-.227-1.358-.305-.26-.83-.784-1.144-1.06l-.832-.921c-.283-.36-1.002-.929-1.243-1.985-.213-.936-.192-1.395.037-1.77.232-.381.67-.589.854-.625.208-.042.692-.039.875.062.223.123.313.159.488.391.23.307.312.456.213.121-.076-.262-.322-.595-.434-.97-.109-.361-.401-.943-.38-1.526.008-.221.103-.771.832-1.042z' stroke-linejoin\x3d'round'/\x3e\x3cpath d\x3d'm20.5664 19.7344v-3.459' stroke-linecap\x3d'round'/\x3e\x3cpath d\x3d'm18.5508 19.7461-.016-3.473' stroke-linecap\x3d'round'/\x3e\x3cpath d\x3d'm16.5547 16.3047.021 3.426' stroke-linecap\x3d'round'/\x3e\x3c/g\x3e",
|
|||
|
b,g),text:(b,g)=>ij("\x3cpath d\x3d'm6.94 2v-1c-1.35866267-.08246172-2.66601117.53165299-3.47 1.63-.80398883-1.09834701-2.11133733-1.71246172-3.47-1.63v1c1.30781678-.16635468 2.55544738.59885876 3 1.84v5.1h-1v1h1v4.16c-.4476345 1.2386337-1.69302129 2.002471-3 1.84v1c1.35687108.0731933 2.6600216-.5389494 3.47-1.63.8099784 1.0910506 2.11312892 1.7031933 3.47 1.63v-1c-1.28590589.133063-2.49760499-.6252793-2.94-1.84v-4.18h1v-1h-1v-5.08c.43943906-1.21710975 1.65323743-1.97676587 2.94-1.84z' transform\x3d'translate(14 9)'/\x3e",
|
|||
|
b,g),["resize-edge"]:(b,g)=>ij("\x3cpath d\x3d'm9 17.9907v.005l5.997 5.996.001-3.999h1.999 2.02v4l5.98-6.001-5.98-5.999.001 4.019-2.021.002h-2l.001-4.022zm1.411.003 3.587-3.588-.001 2.587h3.5 2.521v-2.585l3.565 3.586-3.564 3.585-.001-2.585h-2.521l-3.499-.001-.001 2.586z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm17.4971 18.9932h2.521v2.586l3.565-3.586-3.565-3.585v2.605h-2.521-3.5v-2.607l-3.586 3.587 3.586 3.586v-2.587z' fill\x3d'%23000'/\x3e",b,g),["resize-corner"]:(b,g)=>ij("\x3cpath d\x3d'm19.7432 17.0869-4.072 4.068 2.829 2.828-8.473-.013-.013-8.47 2.841 2.842 4.075-4.068 1.414-1.415-2.844-2.842h8.486v8.484l-2.83-2.827z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm18.6826 16.7334-4.427 4.424 1.828 1.828-5.056-.016-.014-5.054 1.842 1.841 4.428-4.422 2.474-2.475-1.844-1.843h5.073v5.071l-1.83-1.828z' fill\x3d'%23000'/\x3e",
|
|||
|
b,g),["ew-resize"]:(b,g)=>ij("\x3cpath d\x3d'm9 17.9907v.005l5.997 5.996.001-3.999h1.999 2.02v4l5.98-6.001-5.98-5.999.001 4.019-2.021.002h-2l.001-4.022zm1.411.003 3.587-3.588-.001 2.587h3.5 2.521v-2.585l3.565 3.586-3.564 3.585-.001-2.585h-2.521l-3.499-.001-.001 2.586z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm17.4971 18.9932h2.521v2.586l3.565-3.586-3.565-3.585v2.605h-2.521-3.5v-2.607l-3.586 3.587 3.586 3.586v-2.587z' fill\x3d'%23000'/\x3e",b,g),["ns-resize"]:(b,g)=>ij("\x3cpath d\x3d'm9 17.9907v.005l5.997 5.996.001-3.999h1.999 2.02v4l5.98-6.001-5.98-5.999.001 4.019-2.021.002h-2l.001-4.022zm1.411.003 3.587-3.588-.001 2.587h3.5 2.521v-2.585l3.565 3.586-3.564 3.585-.001-2.585h-2.521l-3.499-.001-.001 2.586z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm17.4971 18.9932h2.521v2.586l3.565-3.586-3.565-3.585v2.605h-2.521-3.5v-2.607l-3.586 3.587 3.586 3.586v-2.587z' fill\x3d'%23000'/\x3e",
|
|||
|
b+90,g),["nesw-resize"]:(b,g)=>ij("\x3cpath d\x3d'm19.7432 17.0869-4.072 4.068 2.829 2.828-8.473-.013-.013-8.47 2.841 2.842 4.075-4.068 1.414-1.415-2.844-2.842h8.486v8.484l-2.83-2.827z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm18.6826 16.7334-4.427 4.424 1.828 1.828-5.056-.016-.014-5.054 1.842 1.841 4.428-4.422 2.474-2.475-1.844-1.843h5.073v5.071l-1.83-1.828z' fill\x3d'%23000'/\x3e",b,g),["nwse-resize"]:(b,g)=>ij("\x3cpath d\x3d'm19.7432 17.0869-4.072 4.068 2.829 2.828-8.473-.013-.013-8.47 2.841 2.842 4.075-4.068 1.414-1.415-2.844-2.842h8.486v8.484l-2.83-2.827z' fill\x3d'%23fff'/\x3e\x3cpath d\x3d'm18.6826 16.7334-4.427 4.424 1.828 1.828-5.056-.016-.014-5.054 1.842 1.841 4.428-4.422 2.474-2.475-1.844-1.843h5.073v5.071l-1.83-1.828z' fill\x3d'%23000'/\x3e",
|
|||
|
b+90,g),rotate:(b,g)=>ij('\x3cg\x3e\x3cpath d\x3d"M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill\x3d"black"/\x3e\x3cpath fill-rule\x3d"evenodd" clip-rule\x3d"evenodd" d\x3d"M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill\x3d"white"/\x3e\x3c/g\x3e',
|
|||
|
b+45,g),["nwse-rotate"]:(b,g)=>ij('\x3cg\x3e\x3cpath d\x3d"M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill\x3d"black"/\x3e\x3cpath fill-rule\x3d"evenodd" clip-rule\x3d"evenodd" d\x3d"M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill\x3d"white"/\x3e\x3c/g\x3e',
|
|||
|
b,g),["nesw-rotate"]:(b,g)=>ij('\x3cg\x3e\x3cpath d\x3d"M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill\x3d"black"/\x3e\x3cpath fill-rule\x3d"evenodd" clip-rule\x3d"evenodd" d\x3d"M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill\x3d"white"/\x3e\x3c/g\x3e',
|
|||
|
b+90,g),["senw-rotate"]:(b,g)=>ij('\x3cg\x3e\x3cpath d\x3d"M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill\x3d"black"/\x3e\x3cpath fill-rule\x3d"evenodd" clip-rule\x3d"evenodd" d\x3d"M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill\x3d"white"/\x3e\x3c/g\x3e',
|
|||
|
b+180,g),["swne-rotate"]:(b,g)=>ij('\x3cg\x3e\x3cpath d\x3d"M22.4789 9.45728L25.9935 12.9942L22.4789 16.5283V14.1032C18.126 14.1502 14.6071 17.6737 14.5675 22.0283H17.05L13.513 25.543L9.97889 22.0283H12.5674C12.6071 16.5691 17.0214 12.1503 22.4789 12.1031L22.4789 9.45728Z" fill\x3d"black"/\x3e\x3cpath fill-rule\x3d"evenodd" clip-rule\x3d"evenodd" d\x3d"M21.4789 7.03223L27.4035 12.9945L21.4789 18.9521V15.1868C18.4798 15.6549 16.1113 18.0273 15.649 21.0284H19.475L13.5128 26.953L7.55519 21.0284H11.6189C12.1243 15.8155 16.2679 11.6677 21.4789 11.1559L21.4789 7.03223ZM22.4789 12.1031C17.0214 12.1503 12.6071 16.5691 12.5674 22.0284H9.97889L13.513 25.543L17.05 22.0284H14.5675C14.5705 21.6896 14.5947 21.3558 14.6386 21.0284C15.1157 17.4741 17.9266 14.6592 21.4789 14.1761C21.8063 14.1316 22.1401 14.1069 22.4789 14.1032V16.5284L25.9935 12.9942L22.4789 9.45729L22.4789 12.1031Z" fill\x3d"white"/\x3e\x3c/g\x3e',
|
|||
|
b+270,g)},IE=sf(W(22));sf(W(22));var pz=W(22),qz=sf(W(22));if(!W(22).useState)throw Error("mobx-react-lite requires React with Hooks support");if(!Ag)throw Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var cE=W(31),gt=sf(W(22)),rz="undefined"===typeof FinalizationRegistry?void 0:FinalizationRegistry,JE=1E4,KE=function(b){var g="function"===typeof Symbol&&Symbol.iterator,p=g&&b[g],G=0;if(p)return p.call(b);if(b&&"number"===typeof b.length)return{next:function(){b&&G>=
|
|||
|
b.length&&(b=void 0);return{value:b&&b[G++],done:!b}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.");},sz=rz?um(rz):rh(),LE=sz.addReactionToTrack,ME=sz.recordReactionAsCommitted,tz=function(b,g){var p="function"===typeof Symbol&&b[Symbol.iterator];if(!p)return b;b=p.call(b);var G,Y=[];try{for(;(void 0===g||0<g--)&&!(G=b.next()).done;)Y.push(G.value)}catch(pa){var la={error:pa}}finally{try{G&&!G.done&&(p=b["return"])&&p.call(b)}finally{if(la)throw la.error;}}return Y},
|
|||
|
NE=function(){return function(){}}(),Xr=W(22),hz="function"===typeof Symbol&&Symbol.for,gz=hz?Symbol.for("react.forward_ref"):"function"===typeof Xr.forwardRef&&(0,Xr.forwardRef)(function(b){return null}).$$typeof,kz=hz?Symbol.for("react.memo"):"function"===typeof Xr.memo&&(0,Xr.memo)(function(b){return null}).$$typeof,qE={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};kk.displayName="Observer";W(22);W(22);W(22);(function(b){b||=fm;Ie({reactionScheduler:b})})(cE.unstable_batchedUpdates);
|
|||
|
var rE=sf(W(22));tb=W(588);var so=rE.forwardRef(function(b,g){var {children:p,opacity:G,centered:Y,className:la=""}=b,pa=zf(b,["children","opacity","centered","className"]);return(0,tb.jsx)(kk,{children:()=>(0,tb.jsx)("div",{ref:g,className:`tl-positioned-div ${la}`,style:G?{opacity:G}:void 0,draggable:!1,children:(0,tb.jsx)("div",hf(pe({className:`tl-positioned-inner ${Y?"tl-centered":""}`},pa),{children:p}))})})}),pE=sf(W(22));tb=W(588);var to=pE.forwardRef(function(b,g){var {id:p,className:G="",
|
|||
|
style:Y,children:la}=b,pa=zf(b,["id","className","style","children"]);return(0,tb.jsx)(kk,{children:()=>(0,tb.jsx)("svg",{ref:g,style:Y,className:`tl-positioned-svg ${G}`,children:(0,tb.jsx)("g",hf(pe({id:p,className:"tl-centered-g"},pa),{children:la}))})})}),ft=sf(W(22)),jz=sf(W(22)),iu=sf(W(22));tb=W(588);var hq=cf(function(b){var {id:g,bounds:p,zIndex:G,rotation:Y=0,className:la="",children:pa}=b;b=zf(b,"id bounds zIndex rotation className children".split(" "));const Ga=iu.useRef(null);iu.useLayoutEffect(()=>
|
|||
|
{Ga.current.style.transform=`translate(
|
|||
|
calc(${p.minX}px - var(--tl-padding)),
|
|||
|
calc(${p.minY}px - var(--tl-padding)))
|
|||
|
rotate(${Y+(p.rotation||0)}rad)`},[p.minX,p.minY,Y,p.rotation]);iu.useLayoutEffect(()=>{const Qa=Ga.current;Qa.style.width=`calc(${Math.floor(p.width)}px + (var(--tl-padding) * 2))`;Qa.style.height=`calc(${Math.floor(p.height)}px + (var(--tl-padding) * 2))`},[p.width,p.height]);iu.useLayoutEffect(()=>{const Qa=Ga.current;void 0!==G&&(Qa.style.zIndex=G.toString())},[G]);return(0,tb.jsx)("div",hf(pe({id:g,ref:Ga,className:`tl-positioned ${la}`,"aria-label":"container"},b),{children:pa}))}),
|
|||
|
oE=sf(W(22));tb=W(588);var nE=cf(function({shapes:b,hidden:g,bounds:p,rotation:G=0}){const {components:{ContextBar:Y},viewport:{bounds:la,camera:{point:[pa,Ga],zoom:Qa}}}=ui(),Za=oE.useRef(null);var fb=vf.getRotatedBounds(p,G);fb=vf.multiplyBounds(fb,Qa);hj(Za,p,G,10005);if(!Y)throw Error("Expected a ContextBar component.");const mb=vf.translateBounds(fb,[pa*Qa,Ga*Qa]);return(0,tb.jsx)("div",{ref:Za,className:"tl-counter-scaled-positioned","aria-label":"context-bar-container","data-html2canvas-ignore":"true",
|
|||
|
children:(0,tb.jsx)(Y,{hidden:g,shapes:b,bounds:p,offsets:{left:mb.minX,right:la.width-mb.maxX,top:mb.minY,bottom:la.height-mb.maxY,width:mb.width,height:mb.height},scaledBounds:fb,rotation:G})})}),iz=sf(W(22));tb=W(588);var uz=cf(function({children:b}){const g=iz.useRef(null),{viewport:p}=ui(),G=g.current,{zoom:Y,point:la}=p.camera;iz.useEffect(()=>{G&&(G.style.transform=`scale(${Y}) translate3d(${la[0]}px, ${la[1]}px, 0)`)},[Y,la,G]);return(0,tb.jsx)("div",{ref:g,className:"tl-absolute tl-layer",
|
|||
|
children:b})});tb=W(588);var vz=cf(function({shape:b,isHovered:g=!1,isSelected:p=!1,isBinding:G=!1,isEditing:Y=!1,isLocked:la=!1,meta:pa}){const {bounds:Ga,props:{scale:Qa,rotation:Za=0},ReactIndicator:fb}=b;return(0,tb.jsx)(hq,{"data-type":"Indicator","data-html2canvas-ignore":"true",bounds:Ga,rotation:Za,scale:Qa,zIndex:Y?1E3:1E4,children:(0,tb.jsx)(to,{children:(0,tb.jsx)("g",{className:`tl-indicator-container ${p?"tl-selected":"tl-hovered"} ${la?"tl-locked":""}`,children:(0,tb.jsx)(fb,{isEditing:Y,
|
|||
|
isBinding:G,isHovered:g,isLocked:la,isSelected:p,isErasing:!1,meta:pa})})})})}),wz=sf(W(22));tb=W(588);var OE=cf(function({bounds:b,shape:g}){const {viewport:{camera:{zoom:p}},components:{QuickLinks:G}}=ui();var Y=Ye();const la=gm(g);if(!G)throw Error("Expected a QuickLinks component.");Y=50>b.height*p||!Y.selectedShapesArray.includes(g);return(0,tb.jsx)(hq,{bounds:b,className:"tl-quick-links-container","data-html2canvas-ignore":"true",children:(0,tb.jsx)(so,{children:(0,tb.jsx)("span",hf(pe({style:{position:"absolute",
|
|||
|
top:"100%",pointerEvents:"all",transformOrigin:"left top",paddingTop:"8px",transform:"scale(var(--tl-scale))",minWidth:"320px"}},la),{onPointerDown:pa=>pa.stopPropagation(),children:(0,tb.jsx)(G,{className:"tl-backlinks-count "+(Y?"tl-backlinks-count-rounded":""),id:g.id,shape:g})}))})})});tb=W(588);var PE=cf(function({bounds:b,shape:g}){const {viewport:{camera:{zoom:p}},components:{BacklinksCount:G}}=ui();var Y=Ye();if(!G)throw Error("Expected a BacklinksCount component.");const la=pa=>pa.stopPropagation();
|
|||
|
Y=50>b.height*p||!Y.selectedShapesArray.includes(g)||g.hideSelection;return(0,tb.jsx)(hq,{bounds:b,className:"tl-backlinks-count-container",children:(0,tb.jsx)(so,{children:(0,tb.jsx)("span",{style:{position:"absolute",left:"100%",pointerEvents:"all",transformOrigin:"left top",transform:"translateY(6px) scale(var(--tl-scale))"},onPointerDown:la,onWheelCapture:la,onKeyDown:la,title:"Shape Backlinks",children:(0,tb.jsx)(G,{className:"tl-backlinks-count "+(Y?"tl-backlinks-count-rounded":""),id:g.id,
|
|||
|
shape:g})})})})}),QE=sf(W(22));tb=W(588);var RE=cf(function({bounds:b,hidden:g,shapes:p,rotation:G=0,detail:Y="size"}){const {components:{SelectionDetail:la},viewport:{camera:{zoom:pa}}}=ui(),Ga=QE.useRef(null),Qa=vf.multiplyBounds(b,pa);hj(Ga,b,G,10003);if(!la)throw Error("Expected a SelectionDetail component.");return(0,tb.jsx)("div",{ref:Ga,className:`tl-counter-scaled-positioned ${g?"tl-fade-out":""}`,"aria-label":"bounds-detail-container","data-html2canvas-ignore":"true",children:(0,tb.jsx)(la,
|
|||
|
{shapes:p,bounds:b,scaledBounds:Qa,zoom:pa,rotation:G,detail:Y})})});tb=W(588);var SE=cf(function({shape:b,isHovered:g=!1,isSelected:p=!1,isBinding:G=!1,isErasing:Y=!1,isEditing:la=!1,onEditingEnd:pa,asset:Ga,meta:Qa,zIndex:Za}){const {bounds:fb,props:{rotation:mb,scale:Lb},ReactComponent:Tb}=b,Pb=Ye(),lc=gm(b);var xc=Pb.getParentGroup(b);xc=Pb.selectedIds.has(null==xc?void 0:xc.id);return(0,tb.jsx)(hq,{"data-shape-id":b.id,"data-html2canvas-ignore":!p&&!xc&&0!==Pb.selectedShapes.size||null,zIndex:Za,
|
|||
|
"data-type":"Shape",bounds:fb,rotation:mb,scale:Lb,children:(0,tb.jsx)(Tb,{meta:Qa,isEditing:la,isBinding:G,isHovered:g,isSelected:p,isErasing:Y,events:lc,asset:Ga,onEditingEnd:pa})})});tb=W(588);var xz=[[-1,.15,64],[.05,.375,16],[.15,1,4],[.7,2.5,1]],TE=cf(function({size:b}){const {viewport:{camera:{point:g,zoom:p}}}=ui();return(0,tb.jsxs)("svg",{className:"tl-grid",version:"1.1",xmlns:"http://www.w3.org/2000/svg","data-html2canvas-ignore":"true",children:[(0,tb.jsx)("defs",{children:xz.map(([G,
|
|||
|
Y,la],pa)=>{la=la*b*p;var Ga=g[0]*p,Qa=g[1]*p;Ga=0<Ga?Ga%la:la+Ga%la;Qa=0<Qa?Qa%la:la+Qa%la;G=Rl(p,[G,Y],[0,1]);return(0,tb.jsx)("pattern",{id:`grid-${pa}`,width:la,height:la,patternUnits:"userSpaceOnUse",children:!(2<G||.1>G)&&(0,tb.jsx)("circle",{className:"tl-grid-dot",cx:Ga,cy:Qa,r:1.5,opacity:Math.max(0,Math.min(G,1))})},`grid-pattern-${pa}`)})}),xz.map((G,Y)=>(0,tb.jsx)("rect",{width:"100%",height:"100%",fill:`url(#grid-${Y})`},`grid-rect-${Y}`))]})}),yz=cf(function({size:b}){return(0,tb.jsx)(TE,
|
|||
|
{size:b})});tb=W(588);var zz=cf(function({bounds:b}){const g=Hj("background");return(0,tb.jsx)(to,hf(pe({"data-html2canvas-ignore":"true"},g),{children:(0,tb.jsx)("rect",{className:"tl-bounds-bg",width:Math.max(1,b.width),height:Math.max(1,b.height),pointerEvents:"all",rx:8,ry:8})}))});W(22);tb=W(588);var Az=cf(function({scaledBounds:b,shapes:g,detail:p="size",rotation:G=0}){var Y;const la=1===g.length?G:null!=(Y=b.rotation)?Y:0;return(0,tb.jsx)(so,{centered:!0,children:(0,tb.jsx)("div",{className:"tl-bounds-detail",
|
|||
|
style:{transform:la<zn||la>3*zn?`rotate(${la}rad) translateY(${b.height/2+24}px)`:`rotate(${Math.PI+la}rad) translateY(${b.height/2+32}px)`,padding:"2px 3px",borderRadius:"1px"},children:1===g.length&&"line"===g[0].type?`${ke.dist(g[0].props.handles.start.point,g[0].props.handles.end.point).toFixed()}`:"size"===p?`${b.width.toFixed()} \xD7 ${b.height.toFixed()}`:`\u2220${qm.radiansToDegrees(qm.clampRadians(G)).toFixed()}\xB0`})})});tb=W(588);var UE={top_left_corner:"tl-cursor-nwse",top_right_corner:"tl-cursor-nesw",
|
|||
|
bottom_right_corner:"tl-cursor-nwse",bottom_left_corner:"tl-cursor-nesw"},ju=cf(function({cx:b,cy:g,size:p,targetSize:G,corner:Y,isHidden:la}){const pa=Hj(Y);return(0,tb.jsxs)("g",hf(pe({opacity:la?0:1},pa),{children:[(0,tb.jsx)("rect",{className:"tl-transparent "+(la?"":UE[Y]),"aria-label":`${Y} target`,x:b-1.25*G,y:g-1.25*G,width:2.5*G,height:2.5*G,pointerEvents:la?"none":"all"}),(0,tb.jsx)("rect",{className:"tl-corner-handle","aria-label":`${Y} handle`,x:b-p/2,y:g-p/2,width:p,height:p,pointerEvents:"none"})]}))});
|
|||
|
tb=W(588);var VE={top_edge:"tl-cursor-ns",right_edge:"tl-cursor-ew",bottom_edge:"tl-cursor-ns",left_edge:"tl-cursor-ew"},ku=cf(function({x:b,y:g,width:p,height:G,targetSize:Y,edge:la,disabled:pa,isHidden:Ga}){const Qa=Hj(la);return(0,tb.jsx)("rect",pe({pointerEvents:Ga||pa?"none":"all",className:"tl-transparent tl-edge-handle "+(Ga?"":VE[la]),"aria-label":`${la} target`,opacity:Ga?0:1,x:b-Y,y:g-Y,width:Math.max(1,p+2*Y),height:Math.max(1,G+2*Y)},Qa))});W(22);tb=W(588);cf(function({cx:b,cy:g,size:p,
|
|||
|
targetSize:G,isHidden:Y}){const la=Hj("rotate");return(0,tb.jsxs)("g",hf(pe({opacity:Y?0:1},la),{children:[(0,tb.jsx)("circle",{className:"tl-transparent ","aria-label":"rotate target",cx:b,cy:g,r:G,pointerEvents:Y?"none":"all"}),(0,tb.jsx)("circle",{className:"tl-rotate-handle","aria-label":"rotate handle",cx:b,cy:g,r:p/2,pointerEvents:"none"})]}))});W(22);tb=W(588);var lu=cf(function({cx:b,cy:g,targetSize:p,corner:G,isHidden:Y}){const la=Hj(G);return(0,tb.jsx)("g",hf(pe({opacity:Y?0:1},la),{children:(0,tb.jsx)("rect",
|
|||
|
{className:"tl-transparent","aria-label":`${G} target`,x:b-2.5*p,y:g-2.5*p,width:3*p,height:3*p,pointerEvents:Y?"none":"all"})}))});tb=W(588);var Bz=cf(function({bounds:b,showResizeHandles:g,showRotateHandles:p,shapes:G}){var Y,la;const pa=Ye();let {width:Ga,height:Qa}=b;var Za=pa.viewport.camera.zoom;b=8/Za;Za=6/Za;const fb=1===G.length?G[0].canResize:[!0,!0],mb=null!=(la=null==(Y=pa.editingShape)?void 0:Y.props.borderRadius)?la:0;return(0,tb.jsx)(tb.Fragment,{children:0<G.length&&(0,tb.jsxs)(to,
|
|||
|
{children:[!pa.editingShape&&(0,tb.jsx)("rect",{className:"tl-bounds-fg",width:Math.max(Ga,1),height:Math.max(Qa,1),rx:mb,ry:mb,pointerEvents:"none"}),(0,tb.jsx)(ku,{x:2*Za,y:0,width:Ga-4*Za,height:0,targetSize:Za,edge:"top_edge",disabled:!fb[1],isHidden:!g}),(0,tb.jsx)(ku,{x:Ga,y:2*Za,width:0,height:Qa-4*Za,targetSize:Za,edge:"right_edge",disabled:!fb[0],isHidden:!g}),(0,tb.jsx)(ku,{x:2*Za,y:Qa,width:Ga-4*Za,height:0,targetSize:Za,edge:"bottom_edge",disabled:!fb[1],isHidden:!g}),(0,tb.jsx)(ku,{x:0,
|
|||
|
y:2*Za,width:0,height:Qa-4*Za,targetSize:Za,edge:"left_edge",disabled:!fb[0],isHidden:!g}),(0,tb.jsx)(lu,{cx:0,cy:0,targetSize:Za,corner:"top_left_resize_corner",isHidden:!p}),(0,tb.jsx)(lu,{cx:Ga+2*Za,cy:0,targetSize:Za,corner:"top_right_resize_corner",isHidden:!p}),(0,tb.jsx)(lu,{cx:Ga+2*Za,cy:Qa+2*Za,targetSize:Za,corner:"bottom_right_resize_corner",isHidden:!p}),(0,tb.jsx)(lu,{cx:0,cy:Qa+2*Za,targetSize:Za,corner:"bottom_left_resize_corner",isHidden:!p}),(null==fb?void 0:fb.every(Lb=>Lb))&&(0,tb.jsxs)(tb.Fragment,
|
|||
|
{children:[(0,tb.jsx)(ju,{cx:0,cy:0,size:b,targetSize:Za,corner:"top_left_corner",isHidden:!g}),(0,tb.jsx)(ju,{cx:Ga,cy:0,size:b,targetSize:Za,corner:"top_right_corner",isHidden:!g}),(0,tb.jsx)(ju,{cx:Ga,cy:Qa,size:b,targetSize:Za,corner:"bottom_right_corner",isHidden:!g}),(0,tb.jsx)(ju,{cx:0,cy:Qa,size:b,targetSize:Za,corner:"bottom_left_corner",isHidden:!g})]})]})})});tb=W(588);var Cz=cf(function({bounds:b}){return(0,tb.jsx)(hq,{bounds:b,zIndex:10001,children:(0,tb.jsx)(to,{children:(0,tb.jsx)("rect",
|
|||
|
{className:"tl-brush",x:0,y:0,width:b.width,height:b.height})})})});tb=W(588);cf(function(){return(0,tb.jsx)(tb.Fragment,{})});tb=W(588);var Dz=cf(function({shape:b,handle:g,id:p}){b=Jm(b,p);const [G,Y]=g.point;return(0,tb.jsxs)("g",hf(pe({className:"tl-handle","aria-label":"handle"},b),{transform:`translate(${G}, ${Y})`,children:[(0,tb.jsx)("circle",{className:"tl-handle-bg",pointerEvents:"all"}),(0,tb.jsx)("circle",{className:"tl-counter-scaled tl-handle",pointerEvents:"none",r:4})]}))}),Ez=sf(W(22));
|
|||
|
tb=W(588);var cw=cf(function({direction:b}){const {viewport:{bounds:g}}=ui(),p=Ez.useRef(null);Ez.useLayoutEffect(()=>{const G=p.current;if(G){var Y=[g.width/2,g.height/2],la=vf.getRectangleSides([12,12],[g.width-24,g.height-24]);for(const [,[pa,Ga]]of la)la=w(Y,b,pa,Ga),la.didIntersect&&(la=la.points[0],G.style.transform=`translate(${la[0]-6}px,${la[1]-6}px) rotate(${ke.toAngle(b)}rad)`)}},[b,g]);return(0,tb.jsx)("div",{ref:p,className:"tl-direction-indicator","data-html2canvas-ignore":"true",children:(0,tb.jsx)("svg",
|
|||
|
{height:12,width:12,children:(0,tb.jsx)("polygon",{points:"0,0 12,6 0,12"})})})});tb=W(588);var WE=cf(function({id:b,className:g,brush:p,shapes:G,assets:Y,bindingShapes:la,editingShape:pa,hoveredShape:Ga,hoveredGroup:Qa,selectionBounds:Za,selectedShapes:fb,erasingShapes:mb,selectionDirectionHint:Lb,cursor:Tb="default",cursorRotation:Pb=0,selectionRotation:lc=0,showSelection:xc=!0,showHandles:$b=!0,showSelectionRotation:sc=!1,showResizeHandles:oc=!0,showRotateHandles:Mc=!0,showSelectionDetail:Tc=!0,
|
|||
|
showContextBar:vd=!0,showGrid:de=!0,gridSize:ne=8,onEditingEnd:De=UD,theme:$e=vp,children:mf}){var Te;const rf=ft.useRef(null),{viewport:Vd,components:rd,meta:sd}=ui(),ud=Ye(),ie=ft.useCallback(Bf=>{ud.inputs.updateContainerOffset([Bf.minX,Bf.minY])},[]);hk($e,b);Cl(rf);Bl(rf,Vd,ie);Mk(rf);Yj();Km(rf,Tb,Pb);em(rf);Dk(rf);b=vg();const jf=(Tb=1===(null==fb?void 0:fb.length)&&fb[0])&&"handles"in Tb.props?null==fb?void 0:fb[0]:void 0,tf=ft.useMemo(()=>new Set(fb||[]),[fb]),gg=ft.useMemo(()=>new Set(mb||
|
|||
|
[]),[mb]);Tb=1===(null==fb?void 0:fb.length)?fb[0]:void 0;Qa=[...(new Set([Qa,Ga]))].filter(si);return(0,tb.jsxs)("div",{ref:rf,className:`tl-container ${null!=g?g:""}`,children:[(0,tb.jsxs)("div",hf(pe({tabIndex:-1,className:"tl-absolute tl-canvas"},b),{children:[de&&rd.Grid&&(0,tb.jsx)(rd.Grid,{size:ne}),(0,tb.jsxs)(uz,{children:[rd.SelectionBackground&&fb&&Za&&xc&&(0,tb.jsx)(hq,{"data-type":"SelectionBackground",bounds:Za,zIndex:2,"data-html2canvas-ignore":"true",children:(0,tb.jsx)(rd.SelectionBackground,
|
|||
|
{shapes:fb,bounds:Za,showResizeHandles:oc,showRotateHandles:Mc})}),G&&G.map((Bf,Sf)=>(0,tb.jsx)(SE,{shape:Bf,asset:Y&&Bf.props.assetId?Y[Bf.props.assetId]:void 0,isEditing:Bf===pa,isHovered:Bf===Ga,isBinding:null==la?void 0:la.includes(Bf),isSelected:tf.has(Bf),isErasing:gg.has(Bf),meta:sd,zIndex:1E3+Sf,onEditingEnd:De},"shape_"+Bf.id)),!ud.isIn("select.pinching")&&(null==fb?void 0:fb.map(Bf=>(0,tb.jsx)(vz,{shape:Bf,isEditing:Bf===pa,isHovered:!1,isBinding:!1,isSelected:!0,isLocked:Bf.props.isLocked},
|
|||
|
"selected_indicator_"+Bf.id))),Qa.map(Bf=>Bf!==pa&&(0,tb.jsx)(vz,{shape:Bf},"hovered_indicator_"+Bf.id)),Tb&&rd.BacklinksCount&&(0,tb.jsx)(PE,{hidden:!1,bounds:Tb.bounds,shape:Tb}),Ga&&Ga!==Tb&&rd.QuickLinks&&(0,tb.jsx)(OE,{hidden:!1,bounds:Ga.bounds,shape:Ga}),p&&rd.Brush&&(0,tb.jsx)(rd.Brush,{bounds:p}),fb&&Za&&(0,tb.jsxs)(tb.Fragment,{children:[xc&&rd.SelectionForeground&&(0,tb.jsx)(hq,{"data-type":"SelectionForeground","data-html2canvas-ignore":"true",bounds:Za,zIndex:pa&&fb.includes(pa)?1002:
|
|||
|
10002,children:(0,tb.jsx)(rd.SelectionForeground,{shapes:fb.filter(Bf=>!Bf.props.isLocked),bounds:Za,showResizeHandles:oc,showRotateHandles:Mc})}),$b&&jf&&rd.Handle&&(0,tb.jsx)(hq,{"data-type":"onlySelectedShapeWithHandles","data-html2canvas-ignore":"true",bounds:Za,zIndex:10003,children:(0,tb.jsx)(to,{children:Object.entries(null!=(Te=jf.props.handles)?Te:{}).map(([Bf,Sf])=>ft.createElement(rd.Handle,{key:`${Sf.id}_handle_${Sf.id}`,shape:jf,handle:Sf,id:Bf}))})}),fb&&rd.SelectionDetail&&(0,tb.jsx)(RE,
|
|||
|
{"data-html2canvas-ignore":"true",shapes:fb,bounds:Za,detail:sc?"rotation":"size",hidden:!Tc,rotation:lc},"detail"+fb.map(Bf=>Bf.id).join(""))]})]}),Lb&&Za&&fb&&(0,tb.jsx)(cw,{direction:Lb,bounds:Za,shapes:fb}),(0,tb.jsx)("div",{id:"tl-dev-tools-canvas-anchor","data-html2canvas-ignore":"true"})]})),(0,tb.jsx)(uz,{children:fb&&Za&&(0,tb.jsx)(tb.Fragment,{children:fb&&rd.ContextBar&&(0,tb.jsx)(nE,{shapes:fb.filter(Bf=>!Bf.props.isLocked),hidden:!vd,bounds:Tb?Tb.bounds:Za,rotation:Tb?Tb.props.rotation:
|
|||
|
0},"context"+fb.map(Bf=>Bf.id).join(""))})}),mf]})}),Fz=sf(W(22)),Gz=sf(W(22));tb=W(588);cf(function({children:b}){const g=Gz.useRef(null),{viewport:p}=ui();Gz.useEffect(()=>Ld(()=>{const G=g.current;if(G){var {zoom:Y,point:la}=p.camera;G.style.transform=`scale(${Y}) translateX(${la[0]}px) translateY(${la[1]}px)`}}),[]);return(0,tb.jsx)("svg",{className:"tl-absolute tl-overlay",pointerEvents:"none",children:(0,tb.jsx)("g",{ref:g,pointerEvents:"none",children:b})})});tb=W(588);var XE=cf(function(b){const g=
|
|||
|
vn(b),p=xk(b.id);Nk(g,b);xj(g,b);return(0,tb.jsx)(p.Provider,{value:g,children:b.children})});tb=W(588);var YE=cf(function({id:b="noid",viewport:g,inputs:p,callbacks:G=vp,meta:Y=vp,components:la=vp,children:pa}){const [Ga,Qa]=Fz.useState(()=>{const {Brush:fb,ContextBar:mb,DirectionIndicator:Lb,Grid:Tb,Handle:Pb,SelectionBackground:lc,SelectionDetail:xc,SelectionForeground:$b}=la,sc=zf(la,"Brush ContextBar DirectionIndicator Grid Handle SelectionBackground SelectionDetail SelectionForeground".split(" "));
|
|||
|
return{id:b,viewport:g,inputs:p,callbacks:G,meta:Y,components:hf(pe({},sc),{Brush:null===fb?void 0:Cz,ContextBar:mb,DirectionIndicator:null===Lb?void 0:cw,Grid:null===Tb?void 0:yz,Handle:null===Pb?void 0:Dz,SelectionBackground:null===lc?void 0:zz,SelectionDetail:null===xc?void 0:Az,SelectionForeground:null===$b?void 0:Bz})}});Fz.useLayoutEffect(()=>{const {Brush:fb,ContextBar:mb,DirectionIndicator:Lb,Grid:Tb,Handle:Pb,SelectionBackground:lc,SelectionDetail:xc,SelectionForeground:$b}=la,sc=zf(la,"Brush ContextBar DirectionIndicator Grid Handle SelectionBackground SelectionDetail SelectionForeground".split(" "));
|
|||
|
return Ld(()=>{Qa({id:b,viewport:g,inputs:p,callbacks:G,meta:Y,components:hf(pe({},sc),{Brush:null===fb?void 0:Cz,ContextBar:mb,DirectionIndicator:null===Lb?void 0:cw,Grid:null===Tb?void 0:yz,Handle:null===Pb?void 0:Dz,SelectionBackground:null===lc?void 0:zz,SelectionDetail:null===xc?void 0:Az,SelectionForeground:null===$b?void 0:Bz})})})},[]);const Za=tm(b);return(0,tb.jsx)(Za.Provider,{value:Ga,children:pa})});tb=W(588);tb=W(588);var ZE=cf(function(b){const g=Ye();return(0,tb.jsx)(rg,pe({viewport:g.viewport,
|
|||
|
inputs:g.inputs,callbacks:g._events,brush:g.brush,editingShape:g.editingShape,hoveredShape:g.hoveredShape,hoveredGroup:g.hoveredGroup,bindingShapes:g.bindingShapes,selectionDirectionHint:g.selectionDirectionHint,selectionBounds:g.selectionBounds,selectedShapes:g.selectedShapesArray,erasingShapes:g.erasingShapesArray,shapes:g.shapes,assets:g.assets,showGrid:g.settings.showGrid,showSelection:g.showSelection,showSelectionRotation:g.showSelectionRotation,showResizeHandles:g.showResizeHandles,showRotateHandles:g.showRotateHandles,
|
|||
|
showSelectionDetail:g.showSelectionDetail,showContextBar:g.showContextBar,cursor:g.cursors.cursor,cursorRotation:g.cursors.rotation,selectionRotation:g.selectionRotation,onEditingEnd:g.clearEditingState},b))});tb=W(588);var Yr=sf(W(22)),mu=sf(W(22));tb=W(588);var $E="add-link block-search block connector group internal-link link-to-block link-to-page link-to-whiteboard move-to-sidebar-right object-compact object-expanded open-as-page page-search page references-hide references-show select-cursor text ungroup whiteboard-element whiteboard".split(" "),
|
|||
|
Bh=b=>{var {name:g,className:p}=b;b=zf(b,["name","className"]);const G=$E.includes(g)?"tie tie-":"ti ti-";return(0,tb.jsx)("i",pe({className:[G+g,p].join(" ")},b))},fh=W(22),aF=W(22),fr=W(22),Nn=W(22),dw=W(22),bF=W(31),$m=W(22),ip=(0,$m.forwardRef)((b,g)=>{var {children:p}=b;b=zf(b,["children"]);const G=$m.Children.toArray(p),Y=G.find(sg);if(Y){const la=Y.props.children;p=G.map(pa=>pa===Y?1<$m.Children.count(la)?$m.Children.only(null):(0,$m.isValidElement)(la)?la.props.children:null:pa);return(0,$m.createElement)(ew,
|
|||
|
df({},b,{ref:g}),(0,$m.isValidElement)(la)?(0,$m.cloneElement)(la,void 0,p):null)}return(0,$m.createElement)(ew,df({},b,{ref:g}),p)});ip.displayName="Slot";var ew=(0,$m.forwardRef)((b,g)=>{const {children:p}=b;b=zf(b,["children"]);return(0,$m.isValidElement)(p)?(0,$m.cloneElement)(p,hf(pe({},kj(b,p.props)),{ref:Ek(g,p.ref)})):1<$m.Children.count(p)?$m.Children.only(null):null});ew.displayName="SlotClone";var Hz=({children:b})=>(0,$m.createElement)($m.Fragment,null,b),il="a button div h2 h3 img label li nav ol p span svg ul".split(" ").reduce((b,
|
|||
|
g)=>{const p=(0,dw.forwardRef)((G,Y)=>{var {asChild:la}=G;G=zf(G,["asChild"]);la=la?ip:g;(0,dw.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]);return(0,dw.createElement)(la,df({},G,{ref:Y}))});p.displayName=`Primitive.${g}`;return hf(pe({},b),{[g]:p})},{}),fw=W(22),cF=W(22),Iz,dF=(0,Nn.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gw=(0,Nn.forwardRef)((b,g)=>{var p;const {disableOutsidePointerEvents:G=!1,onEscapeKeyDown:Y,onPointerDownOutside:la,
|
|||
|
onFocusOutside:pa,onInteractOutside:Ga,onDismiss:Qa}=b,Za=zf(b,"disableOutsidePointerEvents onEscapeKeyDown onPointerDownOutside onFocusOutside onInteractOutside onDismiss".split(" ")),fb=(0,Nn.useContext)(dF),[mb,Lb]=(0,Nn.useState)(null),Tb=null!==(p=null===mb||void 0===mb?void 0:mb.ownerDocument)&&void 0!==p?p:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,Pb]=(0,Nn.useState)({});g=Df(g,oc=>Lb(oc));p=Array.from(fb.layers);var [lc]=[...fb.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|||
|
lc=p.indexOf(lc);const xc=mb?p.indexOf(mb):-1;p=0<fb.layersWithOutsidePointerEventsDisabled.size;const $b=xc>=lc;lc=Pj(oc=>{const Mc=oc.target,Tc=[...fb.branches].some(vd=>vd.contains(Mc));$b&&!Tc&&(null===la||void 0===la||la(oc),null===Ga||void 0===Ga||Ga(oc),oc.defaultPrevented||null===Qa||void 0===Qa||Qa())},Tb);const sc=Tl(oc=>{const Mc=oc.target;[...fb.branches].some(Tc=>Tc.contains(Mc))||(null===pa||void 0===pa||pa(oc),null===Ga||void 0===Ga||Ga(oc),oc.defaultPrevented||null===Qa||void 0===
|
|||
|
Qa||Qa())},Tb);lk(oc=>{xc===fb.layers.size-1&&(null===Y||void 0===Y||Y(oc),!oc.defaultPrevented&&Qa&&(oc.preventDefault(),Qa()))},Tb);(0,Nn.useEffect)(()=>{if(mb)return G&&(0===fb.layersWithOutsidePointerEventsDisabled.size&&(Iz=Tb.body.style.pointerEvents,Tb.body.style.pointerEvents="none"),fb.layersWithOutsidePointerEventsDisabled.add(mb)),fb.layers.add(mb),Lk(),()=>{G&&1===fb.layersWithOutsidePointerEventsDisabled.size&&(Tb.body.style.pointerEvents=Iz)}},[mb,Tb,G,fb]);(0,Nn.useEffect)(()=>()=>
|
|||
|
{mb&&(fb.layers.delete(mb),fb.layersWithOutsidePointerEventsDisabled.delete(mb),Lk())},[mb,fb]);(0,Nn.useEffect)(()=>{const oc=()=>Pb({});document.addEventListener("dismissableLayer.update",oc);return()=>document.removeEventListener("dismissableLayer.update",oc)},[]);return(0,Nn.createElement)(il.div,df({},Za,{ref:g,style:pe({pointerEvents:p?$b?"auto":"none":void 0},b.style),onFocusCapture:If(b.onFocusCapture,sc.onFocusCapture),onBlurCapture:If(b.onBlurCapture,sc.onBlurCapture),onPointerDownCapture:If(b.onPointerDownCapture,
|
|||
|
lc.onPointerDownCapture)}))}),Jz=sf(W(22)),eF=W(22),Om=(null===globalThis||void 0===globalThis?0:globalThis.document)?eF.useLayoutEffect:()=>{},fF=Jz["useId".toString()]||(()=>{}),gF=0,lm=W(22),hF=(b,g,p)=>Zh(void 0,null,function*(){const {placement:G="bottom",strategy:Y="absolute",middleware:la=[],platform:pa}=p,Ga=yield null==pa.isRTL?void 0:pa.isRTL(g);let Qa=yield pa.getElementRects({reference:b,floating:g,strategy:Y}),{x:Za,y:fb}=ul(Qa,G,Ga),mb=G,Lb={},Tb=0;for(let Pb=0;Pb<la.length;Pb++){const {name:lc,
|
|||
|
fn:xc}=la[Pb],{x:$b,y:sc,data:oc,reset:Mc}=yield xc({x:Za,y:fb,initialPlacement:G,placement:mb,strategy:Y,middlewareData:Lb,rects:Qa,platform:pa,elements:{reference:b,floating:g}});Za=null!=$b?$b:Za;fb=null!=sc?sc:fb;Lb=hf(pe({},Lb),{[lc]:pe(pe({},Lb[lc]),oc)});Mc&&50>=Tb&&(Tb++,"object"==typeof Mc&&(Mc.placement&&(mb=Mc.placement),Mc.rects&&(Qa=!0===Mc.rects?yield pa.getElementRects({reference:b,floating:g,strategy:Y}):Mc.rects),{x:Za,y:fb}=ul(Qa,mb,Ga)),Pb=-1)}return{x:Za,y:fb,placement:mb,strategy:Y,
|
|||
|
middlewareData:Lb}}),hw=Math.min,jp=Math.max,iw=b=>({name:"arrow",options:b,fn(g){return Zh(this,null,function*(){const {element:p,padding:G=0}=null!=b?b:{},{x:Y,y:la,placement:pa,rects:Ga,platform:Qa}=g;if(null==p)return{};const Za=hn(G),fb={x:Y,y:la},mb=Ck(pa),Lb=pa.split("-")[1],Tb=mk(mb);var Pb=yield Qa.getDimensions(p);const lc="y"===mb?"top":"left",xc="y"===mb?"bottom":"right";var $b=Ga.reference[Tb]+Ga.reference[mb]-fb[mb]-Ga.floating[Tb];const sc=fb[mb]-Ga.reference[mb];var oc=yield null==
|
|||
|
Qa.getOffsetParent?void 0:Qa.getOffsetParent(p);let Mc=oc?"y"===mb?oc.clientHeight||0:oc.clientWidth||0:0;0===Mc&&(Mc=Ga.floating[Tb]);oc=Za[lc];const Tc=Mc-Pb[Tb]-Za[xc];Pb=Mc/2-Pb[Tb]/2+($b/2-sc/2);$b=jp(oc,hw(Pb,Tc));return{[mb]:fb[mb]-(0<("start"===Lb?Za[lc]:Za[xc])&&Pb!==$b&&Ga.reference[Tb]<=Ga.floating[Tb]?Pb<oc?oc-Pb:Tc-Pb:0),data:{[mb]:$b,centerOffset:Pb-$b}}})}}),Kz={left:"right",right:"left",bottom:"top",top:"bottom"},iF={start:"end",end:"start"},Lz=["top","right","bottom","left"];Lz.reduce((b,
|
|||
|
g)=>b.concat(g,g+"-start",g+"-end"),[]);var Mz=function(b){return void 0===b&&(b={}),{name:"flip",options:b,fn(g){return Zh(this,null,function*(){var p;const {placement:G,middlewareData:Y,rects:la,initialPlacement:pa,platform:Ga,elements:Qa}=g;var Za=b;const {mainAxis:fb=!0,crossAxis:mb=!0,fallbackPlacements:Lb,fallbackStrategy:Tb="bestFit",flipAlignment:Pb=!0}=Za;Za=zf(Za,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"]);const lc=Vi(G);var xc=Lb||(lc!==pa&&Pb?function(vd){const de=
|
|||
|
wm(vd);return[Sj(vd),de,Sj(de)]}(pa):[wm(pa)]);xc=[pa,...xc];const $b=yield rl(g,Za),sc=[];Za=(null==(p=Y.flip)?void 0:p.overflows)||[];if(fb&&sc.push($b[lc]),mb){const {main:vd,cross:de}=tl(G,la,yield null==Ga.isRTL?void 0:Ga.isRTL(Qa.floating));sc.push($b[vd],$b[de])}if(Za=[...Za,{placement:G,overflows:sc}],!sc.every(vd=>0>=vd)){var oc,Mc;p=(null!=(oc=null==(Mc=Y.flip)?void 0:Mc.index)?oc:0)+1;if(oc=xc[p])return{data:{index:p,overflows:Za},reset:{placement:oc}};oc="bottom";switch(Tb){case "bestFit":var Tc;
|
|||
|
(Mc=null==(Tc=Za.map(vd=>[vd,vd.overflows.filter(de=>0<de).reduce((de,ne)=>de+ne,0)]).sort((vd,de)=>vd[1]-de[1])[0])?void 0:Tc[0].placement)&&(oc=Mc);break;case "initialPlacement":oc=pa}if(G!==oc)return{reset:{placement:oc}}}return{}})}}},Nz=function(b){b=void 0===b?{}:b;let {strategy:g="referenceHidden"}=b,p=zf(b,["strategy"]);return{name:"hide",fn(G){return Zh(this,null,function*(){var {rects:Y}=G;switch(g){case "referenceHidden":return Y=Pk(yield rl(G,hf(pe({},p),{elementContext:"reference"})),
|
|||
|
Y.reference),{data:{referenceHiddenOffsets:Y,referenceHidden:nk(Y)}};case "escaped":return Y=Pk(yield rl(G,hf(pe({},p),{altBoundary:!0})),Y.floating),{data:{escapedOffsets:Y,escaped:nk(Y)}};default:return{}}})}}},Oz=function(b){return void 0===b&&(b=0),{name:"offset",options:b,fn(g){return Zh(this,null,function*(){const {x:p,y:G}=g,Y=yield function(la,pa){return Zh(this,null,function*(){const {placement:Ga,platform:Qa,elements:Za}=la;var fb=yield null==Qa.isRTL?void 0:Qa.isRTL(Za.floating),mb=Vi(Ga);
|
|||
|
const Lb=Ga.split("-")[1],Tb="x"===Ck(Ga);mb=["left","top"].includes(mb)?-1:1;fb=fb&&Tb?-1:1;const Pb="function"==typeof pa?pa(la):pa;let {mainAxis:lc,crossAxis:xc,alignmentAxis:$b}="number"==typeof Pb?{mainAxis:Pb,crossAxis:0,alignmentAxis:null}:pe({mainAxis:0,crossAxis:0,alignmentAxis:null},Pb);return Lb&&"number"==typeof $b&&(xc="end"===Lb?-1*$b:$b),Tb?{x:xc*fb,y:lc*mb}:{x:lc*mb,y:xc*fb}})}(g,b);return{x:p+Y.x,y:G+Y.y,data:Y}})}}},Pz=function(b){return void 0===b&&(b={}),{name:"shift",options:b,
|
|||
|
fn(g){return Zh(this,null,function*(){const {x:p,y:G,placement:Y}=g;var la=b;const {mainAxis:pa=!0,crossAxis:Ga=!1,limiter:Qa={fn:Tb=>{let {x:Pb,y:lc}=Tb;return{x:Pb,y:lc}}}}=la;var Za=zf(la,["mainAxis","crossAxis","limiter"]);la={x:p,y:G};Za=yield rl(g,Za);const fb=Ck(Vi(Y)),mb="x"===fb?"y":"x";let Lb=la[fb];la=la[mb];pa&&(Lb=jp(Lb+Za["y"===fb?"top":"left"],hw(Lb,Lb-Za["y"===fb?"bottom":"right"])));Ga&&(la=jp(la+Za["y"===mb?"top":"left"],hw(la,la-Za["y"===mb?"bottom":"right"])));la=Qa.fn(hf(pe({},
|
|||
|
g),{[fb]:Lb,[mb]:la}));return hf(pe({},la),{data:{x:la.x-p,y:la.y-G}})})}}},Qz=function(b){return void 0===b&&(b={}),{options:b,fn(g){const {x:p,y:G,placement:Y,rects:la,middlewareData:pa}=g,{offset:Ga=0,mainAxis:Qa=!0,crossAxis:Za=!0}=b;var fb={x:p,y:G};g=Ck(Y);const mb="x"===g?"y":"x";let Lb=fb[g];fb=fb[mb];var Tb="function"==typeof Ga?Ga(hf(pe({},la),{placement:Y})):Ga;Tb="number"==typeof Tb?{mainAxis:Tb,crossAxis:0}:pe({mainAxis:0,crossAxis:0},Tb);if(Qa){var Pb="y"===g?"height":"width",lc=la.reference[g]-
|
|||
|
la.floating[Pb]+Tb.mainAxis;Pb=la.reference[g]+la.reference[Pb]-Tb.mainAxis;Lb<lc?Lb=lc:Lb>Pb&&(Lb=Pb)}if(Za){var xc,$b,sc,oc;const Mc="y"===g?"width":"height";lc=["top","left"].includes(Vi(Y));Pb=la.reference[mb]-la.floating[Mc]+(lc&&null!=(xc=null==($b=pa.offset)?void 0:$b[mb])?xc:0)+(lc?0:Tb.crossAxis);xc=la.reference[mb]+la.reference[Mc]+(lc?0:null!=(sc=null==(oc=pa.offset)?void 0:oc[mb])?sc:0)-(lc?Tb.crossAxis:0);fb<Pb?fb=Pb:fb>xc&&(fb=xc)}return{[g]:Lb,[mb]:fb}}}},jF=function(b){return void 0===
|
|||
|
b&&(b={}),{name:"size",options:b,fn(g){return Zh(this,null,function*(){const {placement:p,rects:G,platform:Y,elements:la}=g;var pa=b,{apply:Ga}=pa;pa=zf(pa,["apply"]);pa=yield rl(g,pa);var Qa=Vi(p),Za=p.split("-")[1],fb,mb;"top"===Qa||"bottom"===Qa?(fb=Qa,mb=Za===((yield null==Y.isRTL?void 0:Y.isRTL(la.floating))?"start":"end")?"left":"right"):(mb=Qa,fb="end"===Za?"top":"bottom");Qa=jp(pa.left,0);Za=jp(pa.right,0);const Lb=jp(pa.top,0),Tb=jp(pa.bottom,0);mb={availableHeight:G.floating.height-(["left",
|
|||
|
"right"].includes(p)?2*(0!==Lb||0!==Tb?Lb+Tb:jp(pa.top,pa.bottom)):pa[fb]),availableWidth:G.floating.width-(["top","bottom"].includes(p)?2*(0!==Qa||0!==Za?Qa+Za:jp(pa.left,pa.right)):pa[mb])};fb=yield Y.getDimensions(la.floating);null==Ga||Ga(pe(pe({},g),mb));Ga=yield Y.getDimensions(la.floating);return fb.width!==Ga.width||fb.height!==Ga.height?{reset:{rects:!0}}:{}})}}},Rz=Math.min,ht=Math.max,nu=Math.round,kF={getClippingRect:function(b){let {element:g,boundary:p,rootBoundary:G,strategy:Y}=b;b=
|
|||
|
[...("clippingAncestors"===p?fk(g):[].concat(p)),G];b=b.reduce((la,pa)=>{pa=Ig(g,pa,Y);return la.top=ht(pa.top,la.top),la.right=Rz(pa.right,la.right),la.bottom=Rz(pa.bottom,la.bottom),la.left=ht(pa.left,la.left),la},Ig(g,b[0],Y));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(b){let {rect:g,offsetParent:p,strategy:G}=b;var Y=Jj(p);const la=wl(p);if(p===la)return g;b={scrollLeft:0,scrollTop:0};var pa=0,Ga=0;(Y||!Y&&
|
|||
|
"fixed"!==G)&&(("body"!==Aj(p)||hm(la))&&(b=ak(p)),Jj(p))&&(Y=sj(p,!0),pa=Y.x+p.clientLeft,Ga=Y.y+p.clientTop);return hf(pe({},g),{x:g.x-b.scrollLeft+pa,y:g.y-b.scrollTop+Ga})},isElement:zj,getDimensions:wk,getOffsetParent:pk,getDocumentElement:wl,getElementRects:b=>{let {reference:g,floating:p,strategy:G}=b;b=pk(p);var Y=Jj(b);const la=wl(b);var pa;if(pa=Y)pa=sj(b),pa=nu(pa.width)!==b.offsetWidth||nu(pa.height)!==b.offsetHeight;pa=sj(g,pa,"fixed"===G);let Ga={scrollLeft:0,scrollTop:0};var Qa=0,Za=
|
|||
|
0;if(Y||!Y&&"fixed"!==G)(("body"!==Aj(b)||hm(la))&&(Ga=ak(b)),Jj(b))?(Y=sj(b,!0),Qa=Y.x+b.clientLeft,Za=Y.y+b.clientTop):la&&(Qa=ok(la));return{reference:{x:pa.left+Ga.scrollLeft-Qa,y:pa.top+Ga.scrollTop-Za,width:pa.width,height:pa.height},floating:hf(pe({},wk(p)),{x:0,y:0})}},getClientRects:b=>Array.from(b.getClientRects()),isRTL:b=>"rtl"===Rk(b).direction},lF=(b,g,p)=>hF(b,g,pe({platform:kF},p)),go=sf(W(22),1),Sz=W(22),mF=sf(W(31),1),jw="undefined"!==typeof document?Sz.useLayoutEffect:Sz.useEffect,
|
|||
|
Tz=b=>{const {element:g,padding:p}=b;return{name:"arrow",options:b,fn(G){if(Object.prototype.hasOwnProperty.call(g,"current")){if(null!=g.current)return iw({element:g.current,padding:p}).fn(G)}else if(g)return iw({element:g,padding:p}).fn(G);return{}}}},kw=W(22),nF=(0,kw.forwardRef)((b,g)=>{const {children:p,width:G=10,height:Y=5}=b,la=zf(b,["children","width","height"]);return(0,kw.createElement)(il.svg,df({},la,{ref:g,width:G,height:Y,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),b.asChild?p:
|
|||
|
(0,kw.createElement)("polygon",{points:"0,0 30,0 15,10"}))}),oF=W(22),[lw,Zr]=yj("Popper"),[pF,Uz]=lw("Popper"),mw=(0,lm.forwardRef)((b,g)=>{const {__scopePopper:p,virtualRef:G}=b;b=zf(b,["__scopePopper","virtualRef"]);const Y=Uz("PopperAnchor",p),la=(0,lm.useRef)(null);g=Df(g,la);(0,lm.useEffect)(()=>{Y.onAnchorChange((null===G||void 0===G?void 0:G.current)||la.current)});return G?null:(0,lm.createElement)(il.div,df({},b,{ref:g}))}),[qF,rF]=lw("PopperContent"),[sF,tF]=lw("PopperContent",{hasParent:!1,
|
|||
|
positionUpdateFns:new Set}),nw=(0,lm.forwardRef)((b,g)=>{var p,G,Y,la,pa,Ga,Qa,Za;const {__scopePopper:fb,side:mb="bottom",sideOffset:Lb=0,align:Tb="center",alignOffset:Pb=0,arrowPadding:lc=0,collisionBoundary:xc=[],collisionPadding:$b=0,sticky:sc="partial",hideWhenDetached:oc=!1,avoidCollisions:Mc=!0}=b;b=zf(b,"__scopePopper side sideOffset align alignOffset arrowPadding collisionBoundary collisionPadding sticky hideWhenDetached avoidCollisions".split(" "));const Tc=Uz("PopperContent",fb),[vd,de]=
|
|||
|
(0,lm.useState)(null);g=Df(g,ll=>de(ll));const [ne,De]=(0,lm.useState)(null);var $e=Wf(ne),mf=null!==(p=null===$e||void 0===$e?void 0:$e.width)&&void 0!==p?p:0;p=null!==(G=null===$e||void 0===$e?void 0:$e.height)&&void 0!==G?G:0;G=mb+("center"!==Tb?"-"+Tb:"");$e="number"===typeof $b?$b:pe({top:0,right:0,bottom:0,left:0},$b);const Te=Array.isArray(xc)?xc:[xc],rf=0<Te.length;$e={padding:$e,boundary:Te.filter(Bj),altBoundary:rf};const {reference:Vd,floating:rd,strategy:sd,x:ud,y:ie,placement:jf,middlewareData:tf,
|
|||
|
update:gg}=Xi({strategy:"fixed",placement:G,whileElementsMounted:Lh,middleware:[Oz({mainAxis:Lb+p,alignmentAxis:Pb}),Mc?Pz(pe({mainAxis:!0,crossAxis:!1,limiter:"partial"===sc?Qz():void 0},$e)):void 0,ne?Tz({element:ne,padding:lc}):void 0,Mc?Mz(pe({},$e)):void 0,vF({arrowWidth:mf,arrowHeight:p}),oc?Nz({strategy:"referenceHidden"}):void 0].filter(Mg)});Om(()=>{Vd(Tc.anchor)},[Vd,Tc.anchor]);const Bf=null!==ud&&null!==ie,[Sf,hh]=mi(jf);mf=null===(Y=tf.arrow)||void 0===Y?void 0:Y.x;Y=null===(la=tf.arrow)||
|
|||
|
void 0===la?void 0:la.y;la=0!==(null===(pa=tf.arrow)||void 0===pa?void 0:pa.centerOffset);const [Ff,jh]=(0,lm.useState)();Om(()=>{vd&&jh(window.getComputedStyle(vd).zIndex)},[vd]);const {hasParent:sh,positionUpdateFns:oj}=tF("PopperContent",fb),kl=!sh;(0,lm.useLayoutEffect)(()=>{if(!kl)return oj.add(gg),()=>{oj.delete(gg)}},[kl,oj,gg]);(0,lm.useLayoutEffect)(()=>{kl&&Bf&&Array.from(oj).reverse().forEach(ll=>requestAnimationFrame(ll))},[kl,Bf,oj]);pa=hf(pe({"data-side":Sf,"data-align":hh},b),{ref:g,
|
|||
|
style:hf(pe({},b.style),{animation:Bf?void 0:"none",opacity:null!==(Ga=tf.hide)&&void 0!==Ga&&Ga.referenceHidden?0:void 0})});return(0,lm.createElement)("div",{ref:rd,"data-radix-popper-content-wrapper":"",style:{position:sd,left:0,top:0,transform:Bf?`translate3d(${Math.round(ud)}px, ${Math.round(ie)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Ff,["--radix-popper-transform-origin"]:[null===(Qa=tf.transformOrigin)||void 0===Qa?void 0:Qa.x,null===(Za=tf.transformOrigin)||void 0===
|
|||
|
Za?void 0:Za.y].join(" ")}},(0,lm.createElement)(qF,{scope:fb,placedSide:Sf,onArrowChange:De,arrowX:mf,arrowY:Y,shouldHideArrow:la},kl?(0,lm.createElement)(sF,{scope:fb,hasParent:!0,positionUpdateFns:oj},(0,lm.createElement)(il.div,pa)):(0,lm.createElement)(il.div,pa)))}),uF={top:"bottom",right:"left",bottom:"top",left:"right"},Vz=(0,lm.forwardRef)(function(b,g){var {__scopePopper:p}=b;b=zf(b,["__scopePopper"]);p=rF("PopperArrow",p);return(0,lm.createElement)("span",{ref:p.onArrowChange,style:{position:"absolute",
|
|||
|
left:p.arrowX,top:p.arrowY,[uF[p.placedSide]]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[p.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[p.placedSide],visibility:p.shouldHideArrow?"hidden":void 0}},(0,lm.createElement)(nF,df({},b,{ref:g,style:hf(pe({},b.style),{display:"block"})})))}),vF=b=>({name:"transformOrigin",options:b,fn(g){var p,
|
|||
|
G,Y,la,pa;const {placement:Ga,rects:Qa,middlewareData:Za}=g,fb=(g=0!==(null===(p=Za.arrow)||void 0===p?void 0:p.centerOffset))?0:b.arrowWidth;p=g?0:b.arrowHeight;const [mb,Lb]=mi(Ga),Tb={start:"0%",center:"50%",end:"100%"}[Lb],Pb=(null!==(G=null===(Y=Za.arrow)||void 0===Y?void 0:Y.x)&&void 0!==G?G:0)+fb/2;G=(null!==(la=null===(pa=Za.arrow)||void 0===pa?void 0:pa.y)&&void 0!==la?la:0)+p/2;pa=la="";"bottom"===mb?(la=g?Tb:`${Pb}px`,pa=`${-p}px`):"top"===mb?(la=g?Tb:`${Pb}px`,pa=`${Qa.floating.height+
|
|||
|
p}px`):"right"===mb?(la=`${-p}px`,pa=g?Tb:`${G}px`):"left"===mb&&(la=`${Qa.floating.width+p}px`,pa=g?Tb:`${G}px`);return{data:{x:la,y:pa}}}}),ow=b=>{const {__scopePopper:g,children:p}=b,[G,Y]=(0,lm.useState)(null);return(0,lm.createElement)(pF,{scope:g,anchor:G,onAnchorChange:Y},p)},Wz=W(22),wF=sf(W(31)),xF=(0,Wz.forwardRef)((b,g)=>{var p;const {container:G=null===globalThis||void 0===globalThis?void 0:null===(p=globalThis.document)||void 0===p?void 0:p.body}=b;b=zf(b,["container"]);return G?wF.default.createPortal((0,Wz.createElement)(il.div,
|
|||
|
df({},b,{ref:g})),G):null}),Ep=W(22),yF=W(31),it=b=>{const {present:g,children:p}=b;b=xg(g);const G="function"===typeof p?p({present:b.isPresent}):Ep.Children.only(p),Y=Df(b.ref,G.ref);return"function"===typeof p||b.isPresent?(0,Ep.cloneElement)(G,{ref:Y}):null};it.displayName="Presence";var ou=W(22),Xz=W(22),zF=(0,Xz.forwardRef)((b,g)=>(0,Xz.createElement)(il.span,df({},b,{ref:g,style:pe({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",
|
|||
|
whiteSpace:"nowrap",wordWrap:"normal"},b.style)}))),[pu]=yj("Tooltip",[Zr]),qu=Zr(),[AF,pw]=pu("TooltipProvider"),[BF,jt]=pu("Tooltip"),CF=(0,fh.forwardRef)((b,g)=>{var {__scopeTooltip:p}=b;const G=zf(b,["__scopeTooltip"]),Y=jt("TooltipTrigger",p),la=pw("TooltipTrigger",p);p=qu(p);const pa=(0,fh.useRef)(null);g=Df(g,pa,Y.onTriggerChange);const Ga=(0,fh.useRef)(!1),Qa=(0,fh.useRef)(!1),Za=(0,fh.useCallback)(()=>Ga.current=!1,[]);(0,fh.useEffect)(()=>()=>document.removeEventListener("pointerup",Za),
|
|||
|
[Za]);return(0,fh.createElement)(mw,df({asChild:!0},p),(0,fh.createElement)(il.button,df({"aria-describedby":Y.open?Y.contentId:void 0,"data-state":Y.stateAttribute},G,{ref:g,onPointerMove:If(b.onPointerMove,fb=>{"touch"===fb.pointerType||Qa.current||la.isPointerInTransitRef.current||(Y.onTriggerEnter(),Qa.current=!0)}),onPointerLeave:If(b.onPointerLeave,()=>{Y.onTriggerLeave();Qa.current=!1}),onPointerDown:If(b.onPointerDown,()=>{Ga.current=!0;document.addEventListener("pointerup",Za,{once:!0})}),
|
|||
|
onFocus:If(b.onFocus,()=>{if(!Ga.current)Y.onOpen()}),onBlur:If(b.onBlur,Y.onClose),onClick:If(b.onClick,Y.onClose)})))}),[DF,EF]=pu("TooltipPortal",{forceMount:void 0}),FF=(0,fh.forwardRef)((b,g)=>{var p=EF("TooltipContent",b.__scopeTooltip);const {forceMount:G=p.forceMount,side:Y="top"}=b;p=zf(b,["forceMount","side"]);b=jt("TooltipContent",b.__scopeTooltip);return(0,fh.createElement)(it,{present:G||b.open},b.disableHoverableContent?(0,fh.createElement)(Yz,df({side:Y},p,{ref:g})):(0,fh.createElement)(GF,
|
|||
|
df({side:Y},p,{ref:g})))}),GF=(0,fh.forwardRef)((b,g)=>{const p=jt("TooltipContent",b.__scopeTooltip),G=pw("TooltipContent",b.__scopeTooltip),Y=(0,fh.useRef)(null);g=Df(g,Y);const [la,pa]=(0,fh.useState)(null),{trigger:Ga,onClose:Qa}=p,Za=Y.current,{onPointerInTransitChange:fb}=G,mb=(0,fh.useCallback)(()=>{pa(null);fb(!1)},[fb]),Lb=(0,fh.useCallback)((Tb,Pb)=>{const lc=$i({x:Tb.clientX,y:Tb.clientY},Tb.currentTarget.getBoundingClientRect()),xc="right"===lc||"bottom"===lc?-5:5;Tb="right"===lc||"left"===
|
|||
|
lc?{x:Tb.clientX+xc,y:Tb.clientY}:{x:Tb.clientX,y:Tb.clientY+xc};Pb=Pb.getBoundingClientRect();const {top:$b,right:sc,bottom:oc,left:Mc}=Pb;Pb=Rb([Tb,{x:Mc,y:$b},{x:sc,y:$b},{x:sc,y:oc},{x:Mc,y:oc}]);pa(Pb);fb(!0)},[fb]);(0,fh.useEffect)(()=>()=>mb(),[mb]);(0,fh.useEffect)(()=>{if(Ga&&Za){const Tb=lc=>Lb(lc,Za),Pb=lc=>Lb(lc,Ga);Ga.addEventListener("pointerleave",Tb);Za.addEventListener("pointerleave",Pb);return()=>{Ga.removeEventListener("pointerleave",Tb);Za.removeEventListener("pointerleave",Pb)}}},
|
|||
|
[Ga,Za,Lb,mb]);(0,fh.useEffect)(()=>{if(la){const Tb=Pb=>{var lc=Pb.target;Pb={x:Pb.clientX,y:Pb.clientY};lc=(null===Ga||void 0===Ga?void 0:Ga.contains(lc))||(null===Za||void 0===Za?void 0:Za.contains(lc));const {x:xc,y:$b}=Pb;Pb=!1;for(let sc=0,oc=la.length-1;sc<la.length;oc=sc++){const Mc=la[sc].x,Tc=la[sc].y,vd=la[oc].x,de=la[oc].y;Tc>$b!==de>$b&&xc<(vd-Mc)*($b-Tc)/(de-Tc)+Mc&&(Pb=!Pb)}Pb=!Pb;lc?mb():Pb&&(mb(),Qa())};document.addEventListener("pointermove",Tb);return()=>document.removeEventListener("pointermove",
|
|||
|
Tb)}},[Ga,Za,la,Qa,mb]);return(0,fh.createElement)(Yz,df({},b,{ref:g}))}),[HF,IF]=pu("Tooltip",{isInside:!1}),Yz=(0,fh.forwardRef)((b,g)=>{const {__scopeTooltip:p,children:G,"aria-label":Y,onEscapeKeyDown:la,onPointerDownOutside:pa}=b;b=zf(b,["__scopeTooltip","children","aria-label","onEscapeKeyDown","onPointerDownOutside"]);const Ga=jt("TooltipContent",p),Qa=qu(p),{onClose:Za}=Ga;(0,fh.useEffect)(()=>{document.addEventListener("tooltip.open",Za);return()=>document.removeEventListener("tooltip.open",
|
|||
|
Za)},[Za]);(0,fh.useEffect)(()=>{if(Ga.trigger){const fb=mb=>{mb=mb.target;null!==mb&&void 0!==mb&&mb.contains(Ga.trigger)&&Za()};window.addEventListener("scroll",fb,{capture:!0});return()=>window.removeEventListener("scroll",fb,{capture:!0})}},[Ga.trigger,Za]);return(0,fh.createElement)(gw,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:la,onPointerDownOutside:pa,onFocusOutside:fb=>fb.preventDefault(),onDismiss:Za},(0,fh.createElement)(nw,df({"data-state":Ga.stateAttribute},Qa,b,{ref:g,
|
|||
|
style:hf(pe({},b.style),{["--radix-tooltip-content-transform-origin"]:"var(--radix-popper-transform-origin)"})}),(0,fh.createElement)(Hz,null,G),(0,fh.createElement)(HF,{scope:p,isInside:!0},(0,fh.createElement)(zF,{id:Ga.contentId,role:"tooltip"},Y||G))))}),JF=(0,fh.forwardRef)((b,g)=>{const {__scopeTooltip:p}=b;b=zf(b,["__scopeTooltip"]);const G=qu(p);return IF("TooltipArrow",p).isInside?null:(0,fh.createElement)(Vz,df({},G,b,{ref:g}))}),KF=b=>{const {__scopeTooltip:g,delayDuration:p=700,skipDelayDuration:G=
|
|||
|
300,disableHoverableContent:Y=!1,children:la}=b,[pa,Ga]=(0,fh.useState)(!0),Qa=(0,fh.useRef)(!1),Za=(0,fh.useRef)(0);(0,fh.useEffect)(()=>{const fb=Za.current;return()=>window.clearTimeout(fb)},[]);return(0,fh.createElement)(AF,{scope:g,isOpenDelayed:pa,delayDuration:p,onOpen:(0,fh.useCallback)(()=>{window.clearTimeout(Za.current);Ga(!1)},[]),onClose:(0,fh.useCallback)(()=>{window.clearTimeout(Za.current);Za.current=window.setTimeout(()=>Ga(!0),G)},[G]),isPointerInTransitRef:Qa,onPointerInTransitChange:(0,fh.useCallback)(fb=>
|
|||
|
{Qa.current=fb},[]),disableHoverableContent:Y},la)},LF=b=>{const {__scopeTooltip:g,children:p,open:G,defaultOpen:Y=!1,onOpenChange:la,disableHoverableContent:pa,delayDuration:Ga}=b,Qa=pw("Tooltip",b.__scopeTooltip);b=qu(g);const [Za,fb]=(0,fh.useState)(null),mb=xi(),Lb=(0,fh.useRef)(0),Tb=null!==pa&&void 0!==pa?pa:Qa.disableHoverableContent,Pb=null!==Ga&&void 0!==Ga?Ga:Qa.delayDuration,lc=(0,fh.useRef)(!1),[xc=!1,$b]=Kj({prop:G,defaultProp:Y,onChange:vd=>{if(vd)Qa.onOpen(),document.dispatchEvent(new CustomEvent("tooltip.open"));
|
|||
|
else Qa.onClose();null===la||void 0===la||la(vd)}}),sc=(0,fh.useMemo)(()=>xc?lc.current?"delayed-open":"instant-open":"closed",[xc]),oc=(0,fh.useCallback)(()=>{window.clearTimeout(Lb.current);lc.current=!1;$b(!0)},[$b]),Mc=(0,fh.useCallback)(()=>{window.clearTimeout(Lb.current);$b(!1)},[$b]),Tc=(0,fh.useCallback)(()=>{window.clearTimeout(Lb.current);Lb.current=window.setTimeout(()=>{lc.current=!0;$b(!0)},Pb)},[Pb,$b]);(0,fh.useEffect)(()=>()=>window.clearTimeout(Lb.current),[]);return(0,fh.createElement)(ow,
|
|||
|
b,(0,fh.createElement)(BF,{scope:g,contentId:mb,open:xc,stateAttribute:sc,trigger:Za,onTriggerChange:fb,onTriggerEnter:(0,fh.useCallback)(()=>{Qa.isOpenDelayed?Tc():oc()},[Qa.isOpenDelayed,Tc,oc]),onTriggerLeave:(0,fh.useCallback)(()=>{Tb?Mc():window.clearTimeout(Lb.current)},[Mc,Tb]),onOpen:oc,onClose:Mc,disableHoverableContent:Tb},p))},MF=CF,NF=b=>{const {__scopeTooltip:g,forceMount:p,children:G,container:Y}=b;b=jt("TooltipPortal",g);return(0,fh.createElement)(DF,{scope:g,forceMount:p},(0,fh.createElement)(it,
|
|||
|
{present:p||b.open},(0,fh.createElement)(xF,{asChild:!0,container:Y},G)))},OF=FF,PF=JF;tb=W(588);tb=W(588);tb=W(588);var QF=({style:b,icon:g,onClick:p})=>(0,tb.jsx)("button",{"data-html2canvas-ignore":"true",style:b,className:"tl-circle-button",onPointerDown:p,children:(0,tb.jsx)("div",{className:"tl-circle-button-icons-wrapper",children:(0,tb.jsx)(Bh,{name:g})})}),vo=W(22),Wg=W(22),kp=sf(W(22)),Zz=W(22),RF=(0,Zz.createContext)(void 0),SF=W(22),qw=0,iq=W(22),$z={bubbles:!1,cancelable:!0},aA=(0,iq.forwardRef)((b,
|
|||
|
g)=>{const {loop:p=!1,trapped:G=!1,onMountAutoFocus:Y,onUnmountAutoFocus:la}=b;b=zf(b,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]);const [pa,Ga]=(0,iq.useState)(null),Qa=pf(Y),Za=pf(la),fb=(0,iq.useRef)(null);g=Df(g,Tb=>Ga(Tb));const mb=(0,iq.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,iq.useEffect)(()=>{if(G){let Tb=function(lc){!mb.paused&&pa&&(lc=lc.target,pa.contains(lc)?fb.current=lc:Bc(fb.current,{select:!0}))},Pb=function(lc){!mb.paused&&
|
|||
|
pa&&(pa.contains(lc.relatedTarget)||Bc(fb.current,{select:!0}))};document.addEventListener("focusin",Tb);document.addEventListener("focusout",Pb);return()=>{document.removeEventListener("focusin",Tb);document.removeEventListener("focusout",Pb)}}},[G,pa,mb.paused]);(0,iq.useEffect)(()=>{if(pa){bA.add(mb);const Tb=document.activeElement;if(!pa.contains(Tb)){const Pb=new CustomEvent("focusScope.autoFocusOnMount",$z);pa.addEventListener("focusScope.autoFocusOnMount",Qa);pa.dispatchEvent(Pb);Pb.defaultPrevented||
|
|||
|
(Qb(Sc(sb(pa)),{select:!0}),document.activeElement===Tb&&Bc(pa))}return()=>{pa.removeEventListener("focusScope.autoFocusOnMount",Qa);setTimeout(()=>{const Pb=new CustomEvent("focusScope.autoFocusOnUnmount",$z);pa.addEventListener("focusScope.autoFocusOnUnmount",Za);pa.dispatchEvent(Pb);Pb.defaultPrevented||Bc(null!==Tb&&void 0!==Tb?Tb:document.body,{select:!0});pa.removeEventListener("focusScope.autoFocusOnUnmount",Za);bA.remove(mb)},0)}}},[pa,Qa,Za,mb]);const Lb=(0,iq.useCallback)(Tb=>{if((p||G)&&
|
|||
|
!mb.paused){var Pb=document.activeElement;if("Tab"===Tb.key&&!Tb.altKey&&!Tb.ctrlKey&&!Tb.metaKey&&Pb){const xc=Tb.currentTarget;var lc=xc;const $b=sb(lc),sc=Mb($b,lc);lc=Mb($b.reverse(),lc);const [oc,Mc]=[sc,lc];oc&&Mc?Tb.shiftKey||Pb!==Mc?Tb.shiftKey&&Pb===oc&&(Tb.preventDefault(),p&&Bc(Mc,{select:!0})):(Tb.preventDefault(),p&&Bc(oc,{select:!0})):Pb===xc&&Tb.preventDefault()}}},[p,G,mb.paused]);return(0,iq.createElement)(il.div,df({tabIndex:-1},b,{ref:g,onKeyDown:Lb}))}),bA=function(){let b=[];
|
|||
|
return{add(g){const p=b[0];g===p||null!==p&&void 0!==p&&p.pause();b=Oc(b,g);b.unshift(g)},remove(g){var p;b=Oc(b,g);null===(p=b[0])||void 0===p||p.resume()}}}(),mm=W(22),TF={bubbles:!1,cancelable:!0},[rw,cA,UF]=Eb("RovingFocusGroup"),[VF,ru]=yj("RovingFocusGroup",[UF]),[WF,XF]=VF("RovingFocusGroup"),dA=(0,mm.forwardRef)((b,g)=>(0,mm.createElement)(rw.Provider,{scope:b.__scopeRovingFocusGroup},(0,mm.createElement)(rw.Slot,{scope:b.__scopeRovingFocusGroup},(0,mm.createElement)(YF,df({},b,{ref:g}))))),
|
|||
|
YF=(0,mm.forwardRef)((b,g)=>{const {__scopeRovingFocusGroup:p,orientation:G,loop:Y=!1,dir:la,currentTabStopId:pa,defaultCurrentTabStopId:Ga,onCurrentTabStopIdChange:Qa,onEntryFocus:Za}=b,fb=zf(b,"__scopeRovingFocusGroup orientation loop dir currentTabStopId defaultCurrentTabStopId onCurrentTabStopIdChange onEntryFocus".split(" ")),mb=(0,mm.useRef)(null);g=Df(g,mb);const Lb=Ub(la),[Tb=null,Pb]=Kj({prop:pa,defaultProp:Ga,onChange:Qa}),[lc,xc]=(0,mm.useState)(!1),$b=pf(Za),sc=cA(p),oc=(0,mm.useRef)(!1),
|
|||
|
[Mc,Tc]=(0,mm.useState)(0);(0,mm.useEffect)(()=>{const vd=mb.current;if(vd)return vd.addEventListener("rovingFocusGroup.onEntryFocus",$b),()=>vd.removeEventListener("rovingFocusGroup.onEntryFocus",$b)},[$b]);return(0,mm.createElement)(WF,{scope:p,orientation:G,dir:Lb,loop:Y,currentTabStopId:Tb,onItemFocus:(0,mm.useCallback)(vd=>Pb(vd),[Pb]),onItemShiftTab:(0,mm.useCallback)(()=>xc(!0),[]),onFocusableItemAdd:(0,mm.useCallback)(()=>Tc(vd=>vd+1),[]),onFocusableItemRemove:(0,mm.useCallback)(()=>Tc(vd=>
|
|||
|
vd-1),[])},(0,mm.createElement)(il.div,df({tabIndex:lc||0===Mc?-1:0,"data-orientation":G},fb,{ref:g,style:pe({outline:"none"},b.style),onMouseDown:If(b.onMouseDown,()=>{oc.current=!0}),onFocus:If(b.onFocus,vd=>{var de=!oc.current;if(vd.target===vd.currentTarget&&de&&!lc&&(de=new CustomEvent("rovingFocusGroup.onEntryFocus",TF),vd.currentTarget.dispatchEvent(de),!de.defaultPrevented)){vd=sc().filter(De=>De.focusable);de=vd.find(De=>De.active);const ne=vd.find(De=>De.id===Tb);vd=[de,ne,...vd].filter(Boolean).map(De=>
|
|||
|
De.ref.current);Rd(vd)}oc.current=!1}),onBlur:If(b.onBlur,()=>xc(!1))})))}),eA=(0,mm.forwardRef)((b,g)=>{const {__scopeRovingFocusGroup:p,focusable:G=!0,active:Y=!1}=b,la=zf(b,["__scopeRovingFocusGroup","focusable","active"]),pa=xi(),Ga=XF("RovingFocusGroupItem",p),Qa=Ga.currentTabStopId===pa,Za=cA(p),{onFocusableItemAdd:fb,onFocusableItemRemove:mb}=Ga;(0,mm.useEffect)(()=>{if(G)return fb(),()=>mb()},[G,fb,mb]);return(0,mm.createElement)(rw.ItemSlot,{scope:p,id:pa,focusable:G,active:Y},(0,mm.createElement)(il.span,
|
|||
|
df({tabIndex:Qa?0:-1,"data-orientation":Ga.orientation},la,{ref:g,onMouseDown:If(b.onMouseDown,Lb=>{if(G)Ga.onItemFocus(pa);else Lb.preventDefault()}),onFocus:If(b.onFocus,()=>Ga.onItemFocus(pa)),onKeyDown:If(b.onKeyDown,Lb=>{if("Tab"===Lb.key&&Lb.shiftKey)Ga.onItemShiftTab();else if(Lb.target===Lb.currentTarget){var Tb=xd(Lb,Ga.orientation,Ga.dir);if(void 0!==Tb){Lb.preventDefault();let Pb=Za().filter(lc=>lc.focusable).map(lc=>lc.ref.current);if("last"===Tb)Pb.reverse();else if("prev"===Tb||"next"===
|
|||
|
Tb)"prev"===Tb&&Pb.reverse(),Lb=Pb.indexOf(Lb.currentTarget),Pb=Ga.loop?Ed(Pb,Lb+1):Pb.slice(Lb+1);setTimeout(()=>Rd(Pb))}}})})))}),ZF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},$F=function(b){return"undefined"===typeof document?null:(Array.isArray(b)?b[0]:b).ownerDocument.body},$r=new WeakMap,su=new WeakMap,tu={},sw=0,tw=function(b,g,p){void 0===g&&(g=$F(b));void 0===p&&(p="data-aria-hidden");var G=Array.isArray(b)?
|
|||
|
b:[b];tu[p]||(tu[p]=new WeakMap);var Y=tu[p],la=[],pa=new Set,Ga=function(Za){Za&&!pa.has(Za)&&(pa.add(Za),Ga(Za.parentNode))};G.forEach(Ga);var Qa=function(Za){!Za||0<=G.indexOf(Za)||Array.prototype.forEach.call(Za.children,function(fb){if(pa.has(fb))Qa(fb);else{var mb=fb.getAttribute("aria-hidden");mb=null!==mb&&"false"!==mb;var Lb=($r.get(fb)||0)+1,Tb=(Y.get(fb)||0)+1;$r.set(fb,Lb);Y.set(fb,Tb);la.push(fb);1===Lb&&mb&&su.set(fb,!0);1===Tb&&fb.setAttribute(p,"true");mb||fb.setAttribute("aria-hidden",
|
|||
|
"true")}})};Qa(g);pa.clear();sw++;return function(){la.forEach(function(Za){var fb=$r.get(Za)-1,mb=Y.get(Za)-1;$r.set(Za,fb);Y.set(Za,mb);fb||(su.has(Za)||Za.removeAttribute("aria-hidden"),su.delete(Za));mb||Za.removeAttribute(p)});sw--;sw||($r=new WeakMap,$r=new WeakMap,su=new WeakMap,tu={})}},aG=sf(Lq(),1),{__assign:jq,__rest:fA,__spreadArray:bG}=aG.default,gA=sf(W(22)),Fp=sf(W(22)),cG=W(22),dG=sf(W(22)),hA=function(b){var g=b.sideCar;b=fA(b,["sideCar"]);if(!g)throw Error("Sidecar: please provide `sideCar` property to import the right car");
|
|||
|
g=g.read();if(!g)throw Error("Sidecar medium not found");return dG.createElement(g,jq({},b))};hA.isSideCarExport=!0;var iA=function(b){void 0===b&&(b={});var g=Zf(null);g.options=jq({async:!0,ssr:!1},b);return g}(),uw=function(){},uu=Fp.forwardRef(function(b,g){var p=Fp.useRef(null),G=Fp.useState({onScrollCapture:uw,onWheelCapture:uw,onTouchMoveCapture:uw}),Y=G[0];G=G[1];var la=b.forwardProps,pa=b.children,Ga=b.className,Qa=b.removeScrollBar,Za=b.enabled,fb=b.shards,mb=b.sideCar,Lb=b.noIsolation,
|
|||
|
Tb=b.inert,Pb=b.allowPinchZoom,lc=b.as;lc=void 0===lc?"div":lc;b=fA(b,"forwardProps children className removeScrollBar enabled shards sideCar noIsolation inert allowPinchZoom as".split(" "));g=Gd([p,g]);Y=jq(jq({},b),Y);return Fp.createElement(Fp.Fragment,null,Za&&Fp.createElement(mb,{sideCar:iA,removeScrollBar:Qa,shards:fb,noIsolation:Lb,inert:Tb,setCallbacks:G,allowPinchZoom:!!Pb,lockRef:p}),la?Fp.cloneElement(Fp.Children.only(pa),jq(jq({},Y),{ref:g})):Fp.createElement(lc,jq({},Y,{className:Ga,
|
|||
|
ref:g}),pa))});uu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uu.classNames={fullWidth:"width-before-scroll-bar",zeroRight:"right-scroll-bar-position"};var Dm=sf(W(22)),jA=sf(W(22)),eG=sf(W(22)),fG=function(){var b=0,g=null;return{add:function(p){if(0==b){if(document){var G=document.createElement("style");G.type="text/css";var Y="undefined"!==typeof __webpack_nonce__?__webpack_nonce__:void 0;Y&&G.setAttribute("nonce",Y)}else G=null;if(g=G)G=g,G.styleSheet?G.styleSheet.cssText=p:G.appendChild(document.createTextNode(p)),
|
|||
|
p=g,(document.head||document.getElementsByTagName("head")[0]).appendChild(p)}b++},remove:function(){b--;!b&&g&&(g.parentNode&&g.parentNode.removeChild(g),g=null)}}},gG=function(){var b=fG();return function(g,p){eG.useEffect(function(){b.add(g);return function(){b.remove()}},[g&&p])}},kA=function(){var b=gG();return function(g){b(g.styles,g.dynamic);return null}},hG={left:0,top:0,right:0,gap:0},iG=kA(),jG=function(b,g,p,G){var Y=b.left,la=b.top,pa=b.right;b=b.gap;void 0===p&&(p="margin");return"\n .".concat("with-scroll-bars-hidden",
|
|||
|
" {\n overflow: hidden ").concat(G,";\n padding-right: ").concat(b,"px ").concat(G,";\n }\n body {\n overflow: hidden ").concat(G,";\n overscroll-behavior: contain;\n ").concat([g&&"position: relative ".concat(G,";"),"margin"===p&&"\n padding-left: ".concat(Y,"px;\n padding-top: ").concat(la,"px;\n padding-right: ").concat(pa,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(b,"px ").concat(G,";\n "),"padding"===p&&"padding-right: ".concat(b,"px ").concat(G,
|
|||
|
";")].filter(Boolean).join(""),"\n }\n \n .").concat("right-scroll-bar-position"," {\n right: ").concat(b,"px ").concat(G,";\n }\n \n .").concat("width-before-scroll-bar"," {\n margin-right: ").concat(b,"px ").concat(G,";\n }\n \n .").concat("right-scroll-bar-position"," .").concat("right-scroll-bar-position"," {\n right: 0 ").concat(G,";\n }\n \n .").concat("width-before-scroll-bar"," .").concat("width-before-scroll-bar"," {\n margin-right: 0 ").concat(G,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",
|
|||
|
": ").concat(b,"px;\n }\n")},kG=function(b){var g=b.noRelative,p=b.noImportant;b=b.gapMode;var G=void 0===b?"margin":b;b=jA.useMemo(function(){var Y=G;void 0===Y&&(Y="margin");if("undefined"===typeof window)Y=hG;else{var la=window.getComputedStyle(document.body),pa=la["padding"===Y?"paddingTop":"marginTop"],Ga=la["padding"===Y?"paddingRight":"marginRight"];Y=[parseInt(la["padding"===Y?"paddingLeft":"marginLeft"]||"",10)||0,parseInt(pa||"",10)||0,parseInt(Ga||"",10)||0];Y={left:Y[0],top:Y[1],right:Y[2],
|
|||
|
gap:Math.max(0,window.innerWidth-document.documentElement.clientWidth+Y[2]-Y[0])}}return Y},[G]);return jA.createElement(iG,{styles:jG(b,!g,G,p?"":"!important")})},vw=!1;if("undefined"!==typeof window)try{var vu=Object.defineProperty({},"passive",{get:function(){return vw=!0}});window.addEventListener("test",vu,vu);window.removeEventListener("test",vu,vu)}catch(b){vw=!1}var as=vw?{passive:!1}:!1,kq=function(b,g){var p=window.getComputedStyle(b);return"hidden"!==p[g]&&!(p.overflowY===p.overflowX&&
|
|||
|
"TEXTAREA"!==b.tagName&&"visible"===p[g])},lA=function(b,g){do{"undefined"!==typeof ShadowRoot&&g instanceof ShadowRoot&&(g=g.host);if(mA(b,g)){var p=nA(b,g);if(p[1]>p[2])return!0}g=g.parentNode}while(g&&g!==document.body);return!1},mA=function(b,g){return"v"===b?kq(g,"overflowY"):kq(g,"overflowX")},nA=function(b,g){return"v"===b?[g.scrollTop,g.scrollHeight,g.clientHeight]:[g.scrollLeft,g.scrollWidth,g.clientWidth]},wu=function(b){return"changedTouches"in b?[b.changedTouches[0].clientX,b.changedTouches[0].clientY]:
|
|||
|
[0,0]},oA=function(b){return b&&"current"in b?b.current:b},lG=function(b){return"\n .block-interactivity-".concat(b," {pointer-events: none;}\n .allow-interactivity-").concat(b," {pointer-events: all;}\n")},mG=0,bs=[];iA.useMedium(function(b){var g=Dm.useRef([]),p=Dm.useRef([0,0]),G=Dm.useRef(),Y=Dm.useState(mG++)[0],la=Dm.useState(function(){return kA()})[0],pa=Dm.useRef(b);Dm.useEffect(function(){pa.current=b},[b]);Dm.useEffect(function(){if(b.inert){document.body.classList.add("block-interactivity-".concat(Y));
|
|||
|
var Pb=bG([b.lockRef.current],(b.shards||[]).map(oA),!0).filter(Boolean);Pb.forEach(function(lc){return lc.classList.add("allow-interactivity-".concat(Y))});return function(){document.body.classList.remove("block-interactivity-".concat(Y));Pb.forEach(function(lc){return lc.classList.remove("allow-interactivity-".concat(Y))})}}},[b.inert,b.lockRef.current,b.shards]);var Ga=Dm.useCallback(function(Pb,lc){if("touches"in Pb&&2===Pb.touches.length)return!pa.current.allowPinchZoom;var xc=wu(Pb),$b=p.current,
|
|||
|
sc="deltaX"in Pb?Pb.deltaX:$b[0]-xc[0];$b="deltaY"in Pb?Pb.deltaY:$b[1]-xc[1];var oc=Pb.target,Mc=Math.abs(sc)>Math.abs($b)?"h":"v";if("touches"in Pb&&"h"===Mc&&"range"===oc.type)return!1;var Tc=lA(Mc,oc);if(!Tc)return!0;Tc?xc=Mc:(xc="v"===Mc?"h":"v",Tc=lA(Mc,oc));if(!Tc)return!1;!G.current&&"changedTouches"in Pb&&(sc||$b)&&(G.current=xc);if(!xc)return!0;xc=G.current||xc;$b="h"===xc?sc:$b;sc=window.getComputedStyle(lc).direction;sc="h"===xc&&"rtl"===sc?-1:1;Mc=sc*$b;Pb=Pb.target;$b=lc.contains(Pb);
|
|||
|
oc=!1;Mc=0<Mc;var vd=Tc=0;do{var de=nA(xc,Pb),ne=de[0];de=de[1]-de[2]-sc*ne;(ne||de)&&mA(xc,Pb)&&(Tc+=de,vd+=ne);Pb=Pb.parentNode}while(!$b&&Pb!==document.body||$b&&(lc.contains(Pb)||lc===Pb));Mc&&0===Tc?oc=!0:Mc||0!==vd||(oc=!0);return oc},[]),Qa=Dm.useCallback(function(Pb){if(bs.length&&bs[bs.length-1]===la){var lc="deltaY"in Pb?[Pb.deltaX,Pb.deltaY]:wu(Pb),xc=g.current.filter(function($b){var sc;if(sc=$b.name===Pb.type&&$b.target===Pb.target)$b=$b.delta,sc=$b[0]===lc[0]&&$b[1]===lc[1];return sc})[0];
|
|||
|
xc&&xc.should?Pb.cancelable&&Pb.preventDefault():xc||(xc=(pa.current.shards||[]).map(oA).filter(Boolean).filter(function($b){return $b.contains(Pb.target)}),(0<xc.length?Ga(Pb,xc[0]):!pa.current.noIsolation)&&Pb.cancelable&&Pb.preventDefault())}},[]),Za=Dm.useCallback(function(Pb,lc,xc,$b){var sc={name:Pb,delta:lc,target:xc,should:$b};g.current.push(sc);setTimeout(function(){g.current=g.current.filter(function(oc){return oc!==sc})},1)},[]),fb=Dm.useCallback(function(Pb){p.current=wu(Pb);G.current=
|
|||
|
void 0},[]),mb=Dm.useCallback(function(Pb){Za(Pb.type,[Pb.deltaX,Pb.deltaY],Pb.target,Ga(Pb,b.lockRef.current))},[]),Lb=Dm.useCallback(function(Pb){Za(Pb.type,wu(Pb),Pb.target,Ga(Pb,b.lockRef.current))},[]);Dm.useEffect(function(){bs.push(la);b.setCallbacks({onScrollCapture:mb,onWheelCapture:mb,onTouchMoveCapture:Lb});document.addEventListener("wheel",Qa,as);document.addEventListener("touchmove",Qa,as);document.addEventListener("touchstart",fb,as);return function(){bs=bs.filter(function(Pb){return Pb!==
|
|||
|
la});document.removeEventListener("wheel",Qa,as);document.removeEventListener("touchmove",Qa,as);document.removeEventListener("touchstart",fb,as)}},[]);var Tb=b.removeScrollBar;return Dm.createElement(Dm.Fragment,null,b.inert?Dm.createElement(la,{styles:lG(Y)}):null,Tb?Dm.createElement(kG,{gapMode:"margin"}):null)});var xu=gA.forwardRef(function(b,g){return gA.createElement(uu,jq({},b,{ref:g,sideCar:hA}))});xu.classNames=uu.classNames;var ww=["Enter"," "],pA=["ArrowUp","PageDown","End"],nG=["ArrowDown",
|
|||
|
"PageUp","Home",...pA];[...ww];[...ww];var [xw,oG,pG]=Eb("Menu"),[gr,yu]=yj("Menu",[pG,Zr,ru]),yw=Zr(),qA=ru(),[qG,zu]=gr("Menu"),[rG,zw]=gr("Menu"),rA=(0,Wg.forwardRef)((b,g)=>{var {__scopeMenu:p}=b;b=zf(b,["__scopeMenu"]);p=yw(p);return(0,Wg.createElement)(mw,df({},p,b,{ref:g}))}),[,sG]=gr("MenuPortal",{forceMount:void 0}),[tG,sA]=gr("MenuContent"),tA=(0,Wg.forwardRef)((b,g)=>{var p=sG("MenuContent",b.__scopeMenu);({forceMount:p=p.forceMount}=b);const G=zf(b,["forceMount"]),Y=zu("MenuContent",b.__scopeMenu),
|
|||
|
la=zw("MenuContent",b.__scopeMenu);return(0,Wg.createElement)(xw.Provider,{scope:b.__scopeMenu},(0,Wg.createElement)(it,{present:p||Y.open},(0,Wg.createElement)(xw.Slot,{scope:b.__scopeMenu},la.modal?(0,Wg.createElement)(uG,df({},G,{ref:g})):(0,Wg.createElement)(vG,df({},G,{ref:g})))))}),uG=(0,Wg.forwardRef)((b,g)=>{const p=zu("MenuContent",b.__scopeMenu),G=(0,Wg.useRef)(null);g=Df(g,G);(0,Wg.useEffect)(()=>{const Y=G.current;if(Y)return tw(Y)},[]);return(0,Wg.createElement)(uA,df({},b,{ref:g,trapFocus:p.open,
|
|||
|
disableOutsidePointerEvents:p.open,disableOutsideScroll:!0,onFocusOutside:If(b.onFocusOutside,Y=>Y.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>p.onOpenChange(!1)}))}),vG=(0,Wg.forwardRef)((b,g)=>{const p=zu("MenuContent",b.__scopeMenu);return(0,Wg.createElement)(uA,df({},b,{ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>p.onOpenChange(!1)}))}),uA=(0,Wg.forwardRef)((b,g)=>{const {__scopeMenu:p,loop:G=!1,trapFocus:Y,onOpenAutoFocus:la,onCloseAutoFocus:pa,
|
|||
|
disableOutsidePointerEvents:Ga,onEscapeKeyDown:Qa,onPointerDownOutside:Za,onFocusOutside:fb,onInteractOutside:mb,onDismiss:Lb,disableOutsideScroll:Tb}=b,Pb=zf(b,"__scopeMenu loop trapFocus onOpenAutoFocus onCloseAutoFocus disableOutsidePointerEvents onEscapeKeyDown onPointerDownOutside onFocusOutside onInteractOutside onDismiss disableOutsideScroll".split(" ")),lc=zu("MenuContent",p),xc=zw("MenuContent",p),$b=yw(p),sc=qA(p),oc=oG(p),[Mc,Tc]=(0,Wg.useState)(null),vd=(0,Wg.useRef)(null);g=Df(g,vd,lc.onContentChange);
|
|||
|
const de=(0,Wg.useRef)(0),ne=(0,Wg.useRef)(""),De=(0,Wg.useRef)(0),$e=(0,Wg.useRef)(null),mf=(0,Wg.useRef)("right"),Te=(0,Wg.useRef)(0),rf=Tb?xu:Wg.Fragment,Vd=Tb?{as:ip,allowPinchZoom:!0}:void 0,rd=ud=>{var ie,jf;ud=ne.current+ud;const tf=oc().filter(Ff=>!Ff.disabled),gg=document.activeElement,Bf=null===(ie=tf.find(Ff=>Ff.ref.current===gg))||void 0===ie?void 0:ie.textValue;ie=tf.map(Ff=>Ff.textValue);const Sf=Me(ie,ud,Bf),hh=null===(jf=tf.find(Ff=>Ff.textValue===Sf))||void 0===jf?void 0:jf.ref.current;
|
|||
|
(function sh(jh){ne.current=jh;window.clearTimeout(de.current);""!==jh&&(de.current=window.setTimeout(()=>sh(""),1E3))})(ud);hh&&setTimeout(()=>hh.focus())};(0,Wg.useEffect)(()=>()=>window.clearTimeout(de.current),[]);vb();const sd=(0,Wg.useCallback)(ud=>{var ie,jf,tf;if(tf=mf.current===(null===(ie=$e.current)||void 0===ie?void 0:ie.side)){if(ie=null===(jf=$e.current)||void 0===jf?void 0:jf.area){const {x:gg,y:Bf}={x:ud.clientX,y:ud.clientY};ud=!1;for(let Sf=0,hh=ie.length-1;Sf<ie.length;hh=Sf++){jf=
|
|||
|
ie[Sf].x;tf=ie[Sf].y;const Ff=ie[hh].x,jh=ie[hh].y;tf>Bf!==jh>Bf&&gg<(Ff-jf)*(Bf-tf)/(jh-tf)+jf&&(ud=!ud)}ie=ud}else ie=!1;tf=ie}return tf},[]);return(0,Wg.createElement)(tG,{scope:p,searchRef:ne,onItemEnter:(0,Wg.useCallback)(ud=>{sd(ud)&&ud.preventDefault()},[sd]),onItemLeave:(0,Wg.useCallback)(ud=>{var ie;sd(ud)||(null===(ie=vd.current)||void 0===ie||ie.focus(),Tc(null))},[sd]),onTriggerLeave:(0,Wg.useCallback)(ud=>{sd(ud)&&ud.preventDefault()},[sd]),pointerGraceTimerRef:De,onPointerGraceIntentChange:(0,Wg.useCallback)(ud=>
|
|||
|
{$e.current=ud},[])},(0,Wg.createElement)(rf,Vd,(0,Wg.createElement)(aA,{asChild:!0,trapped:Y,onMountAutoFocus:If(la,ud=>{var ie;ud.preventDefault();null===(ie=vd.current)||void 0===ie||ie.focus()}),onUnmountAutoFocus:pa},(0,Wg.createElement)(gw,{asChild:!0,disableOutsidePointerEvents:Ga,onEscapeKeyDown:Qa,onPointerDownOutside:Za,onFocusOutside:fb,onInteractOutside:mb,onDismiss:Lb},(0,Wg.createElement)(dA,df({asChild:!0},sc,{dir:xc.dir,orientation:"vertical",loop:G,currentTabStopId:Mc,onCurrentTabStopIdChange:Tc,
|
|||
|
onEntryFocus:ud=>{xc.isUsingKeyboardRef.current||ud.preventDefault()}}),(0,Wg.createElement)(nw,df({role:"menu","aria-orientation":"vertical","data-state":lc.open?"open":"closed","data-radix-menu-content":"",dir:xc.dir},$b,Pb,{ref:g,style:pe({outline:"none"},Pb.style),onKeyDown:If(Pb.onKeyDown,ud=>{var ie=ud.target.closest("[data-radix-menu-content]")===ud.currentTarget;const jf=ud.ctrlKey||ud.altKey||ud.metaKey,tf=1===ud.key.length;ie&&("Tab"===ud.key&&ud.preventDefault(),!jf&&tf&&rd(ud.key));ud.target===
|
|||
|
vd.current&&nG.includes(ud.key)&&(ud.preventDefault(),ie=oc().filter(gg=>!gg.disabled).map(gg=>gg.ref.current),pA.includes(ud.key)&&ie.reverse(),xe(ie))}),onBlur:If(b.onBlur,ud=>{ud.currentTarget.contains(ud.target)||(window.clearTimeout(de.current),ne.current="")}),onPointerMove:If(b.onPointerMove,Oe(ud=>{const ie=Te.current!==ud.clientX;ud.currentTarget.contains(ud.target)&&ie&&(mf.current=ud.clientX>Te.current?"right":"left",Te.current=ud.clientX)}))})))))))}),vA=(0,Wg.forwardRef)((b,g)=>{const {disabled:p=
|
|||
|
!1,onSelect:G}=b,Y=zf(b,["disabled","onSelect"]),la=(0,Wg.useRef)(null),pa=zw("MenuItem",b.__scopeMenu),Ga=sA("MenuItem",b.__scopeMenu);g=Df(g,la);const Qa=(0,Wg.useRef)(!1);return(0,Wg.createElement)(wG,df({},Y,{ref:g,disabled:p,onClick:If(b.onClick,()=>{const Za=la.current;if(!p&&Za){const fb=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});Za.addEventListener("menu.itemSelect",mb=>null===G||void 0===G?void 0:G(mb),{once:!0});sl(Za,fb);if(fb.defaultPrevented)Qa.current=!1;else pa.onClose()}}),
|
|||
|
onPointerDown:Za=>{var fb;null===(fb=b.onPointerDown)||void 0===fb||fb.call(b,Za);Qa.current=!0},onPointerUp:If(b.onPointerUp,Za=>{var fb;Qa.current||null===(fb=Za.currentTarget)||void 0===fb||fb.click()}),onKeyDown:If(b.onKeyDown,Za=>{const fb=""!==Ga.searchRef.current;p||fb&&" "===Za.key||!ww.includes(Za.key)||(Za.currentTarget.click(),Za.preventDefault())})}))}),wG=(0,Wg.forwardRef)((b,g)=>{const {__scopeMenu:p,disabled:G=!1,textValue:Y}=b,la=zf(b,["__scopeMenu","disabled","textValue"]),pa=sA("MenuItem",
|
|||
|
p),Ga=qA(p),Qa=(0,Wg.useRef)(null);g=Df(g,Qa);const [Za,fb]=(0,Wg.useState)(!1),[mb,Lb]=(0,Wg.useState)("");(0,Wg.useEffect)(()=>{const Tb=Qa.current;if(Tb){var Pb;Lb((null!==(Pb=Tb.textContent)&&void 0!==Pb?Pb:"").trim())}},[la.children]);return(0,Wg.createElement)(xw.ItemSlot,{scope:p,disabled:G,textValue:null!==Y&&void 0!==Y?Y:mb},(0,Wg.createElement)(eA,df({asChild:!0},Ga,{focusable:!G}),(0,Wg.createElement)(il.div,df({role:"menuitem","data-highlighted":Za?"":void 0,"aria-disabled":G||void 0,
|
|||
|
"data-disabled":G?"":void 0},la,{ref:g,onPointerMove:If(b.onPointerMove,Oe(Tb=>{if(G)pa.onItemLeave(Tb);else pa.onItemEnter(Tb),Tb.defaultPrevented||Tb.currentTarget.focus()})),onPointerLeave:If(b.onPointerLeave,Oe(Tb=>pa.onItemLeave(Tb))),onFocus:If(b.onFocus,()=>fb(!0)),onBlur:If(b.onBlur,()=>fb(!1))}))))});gr("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});gr("MenuItemIndicator",{checked:!1});var xG=(0,Wg.forwardRef)((b,g)=>{b=zf(b,["__scopeMenu"]);return(0,Wg.createElement)(il.div,df({role:"separator",
|
|||
|
"aria-orientation":"horizontal"},b,{ref:g}))});gr("MenuSub");var wA=b=>{const {__scopeMenu:g,open:p=!1,children:G,dir:Y,onOpenChange:la,modal:pa=!0}=b;b=yw(g);const [Ga,Qa]=(0,Wg.useState)(null),Za=(0,Wg.useRef)(!1),fb=pf(la),mb=Ub(Y);(0,Wg.useEffect)(()=>{const Lb=()=>{Za.current=!0;document.addEventListener("pointerdown",Tb,{capture:!0,once:!0});document.addEventListener("pointermove",Tb,{capture:!0,once:!0})},Tb=()=>Za.current=!1;document.addEventListener("keydown",Lb,{capture:!0});return()=>{document.removeEventListener("keydown",
|
|||
|
Lb,{capture:!0});document.removeEventListener("pointerdown",Tb,{capture:!0});document.removeEventListener("pointermove",Tb,{capture:!0})}},[]);return(0,Wg.createElement)(ow,b,(0,Wg.createElement)(qG,{scope:g,open:p,onOpenChange:fb,content:Ga,onContentChange:Qa},(0,Wg.createElement)(rG,{scope:g,onClose:(0,Wg.useCallback)(()=>fb(!1),[fb]),isUsingKeyboardRef:Za,dir:mb,modal:pa},G)))},[yG]=yj("DropdownMenu",[yu]),Au=yu(),[zG,xA]=yG("DropdownMenu"),AG=(0,vo.forwardRef)((b,g)=>{const {__scopeDropdownMenu:p,
|
|||
|
disabled:G=!1}=b,Y=zf(b,["__scopeDropdownMenu","disabled"]),la=xA("DropdownMenuTrigger",p),pa=Au(p);return(0,vo.createElement)(rA,df({asChild:!0},pa),(0,vo.createElement)(il.button,df({type:"button",id:la.triggerId,"aria-haspopup":"menu","aria-expanded":la.open,"aria-controls":la.open?la.contentId:void 0,"data-state":la.open?"open":"closed","data-disabled":G?"":void 0,disabled:G},Y,{ref:Ek(g,la.triggerRef),onPointerDown:If(b.onPointerDown,Ga=>{G||0!==Ga.button||!1!==Ga.ctrlKey||(la.onOpenToggle(),
|
|||
|
la.open||Ga.preventDefault())}),onKeyDown:If(b.onKeyDown,Ga=>{if(!G){if(["Enter"," "].includes(Ga.key))la.onOpenToggle();if("ArrowDown"===Ga.key)la.onOpenChange(!0);["Enter"," ","ArrowDown"].includes(Ga.key)&&Ga.preventDefault()}})})))}),BG=(0,vo.forwardRef)((b,g)=>{var {__scopeDropdownMenu:p}=b;const G=zf(b,["__scopeDropdownMenu"]),Y=xA("DropdownMenuContent",p);p=Au(p);const la=(0,vo.useRef)(!1);return(0,vo.createElement)(tA,df({id:Y.contentId,"aria-labelledby":Y.triggerId},p,G,{ref:g,onCloseAutoFocus:If(b.onCloseAutoFocus,
|
|||
|
pa=>{var Ga;la.current||null===(Ga=Y.triggerRef.current)||void 0===Ga||Ga.focus();la.current=!1;pa.preventDefault()}),onInteractOutside:If(b.onInteractOutside,pa=>{pa=pa.detail.originalEvent;const Ga=0===pa.button&&!0===pa.ctrlKey;pa=2===pa.button||Ga;if(!Y.modal||pa)la.current=!0}),style:hf(pe({},b.style),{["--radix-dropdown-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"})}))}),kt=(0,vo.forwardRef)((b,g)=>{var {__scopeDropdownMenu:p}=b;b=zf(b,["__scopeDropdownMenu"]);p=Au(p);
|
|||
|
return(0,vo.createElement)(vA,df({},p,b,{ref:g}))}),CG=b=>{const {__scopeDropdownMenu:g,children:p,dir:G,open:Y,defaultOpen:la,onOpenChange:pa,modal:Ga=!0}=b;b=Au(g);const Qa=(0,vo.useRef)(null),[Za=!1,fb]=Kj({prop:Y,defaultProp:la,onChange:pa});return(0,vo.createElement)(zG,{scope:g,triggerId:xi(),triggerRef:Qa,contentId:xi(),open:Za,onOpenChange:fb,onOpenToggle:(0,vo.useCallback)(()=>fb(mb=>!mb),[fb]),modal:Ga},(0,vo.createElement)(wA,df({},b,{open:Za,onOpenChange:fb,dir:G,modal:Ga}),p))},an=sf(W(22)).default.createContext({}),
|
|||
|
DG=sf(W(22));tb=W(588);var bn=b=>{var {action:g}=b;b=zf(b,["action"]);var {renderers:p}=DG.useContext(an);p=null==p?void 0:p.KeyboardShortcut;return(0,tb.jsx)("div",hf(pe({className:"tl-menu-right-slot"},b),{children:(0,tb.jsx)(p,{action:g})}))};W(22);tb=W(588);var EG=cf(function(){const b=Ye(),g=p=>{p.preventDefault()};return(0,tb.jsxs)(CG,{children:[(0,tb.jsx)(AG,{className:"tl-button text-sm px-2 important",id:"tl-zoom",children:(100*b.viewport.camera.zoom).toFixed(0)+"%"}),(0,tb.jsxs)(BG,{onCloseAutoFocus:p=>
|
|||
|
p.preventDefault(),className:"tl-menu",id:"zoomPopup",sideOffset:12,children:[(0,tb.jsxs)(kt,{className:"tl-menu-item",onSelect:g,onClick:b.api.zoomToFit,children:["Zoom to drawing",(0,tb.jsx)(bn,{action:"whiteboard/zoom-to-fit"})]}),(0,tb.jsxs)(kt,{className:"tl-menu-item",onSelect:g,onClick:b.api.zoomToSelection,disabled:0===b.selectedShapesArray.length,children:["Zoom to fit selection",(0,tb.jsx)(bn,{action:"whiteboard/zoom-to-selection"})]}),(0,tb.jsxs)(kt,{className:"tl-menu-item",onSelect:g,
|
|||
|
onClick:b.api.zoomIn,children:["Zoom in",(0,tb.jsx)(bn,{action:"whiteboard/zoom-in"})]}),(0,tb.jsxs)(kt,{className:"tl-menu-item",onSelect:g,onClick:b.api.zoomOut,children:["Zoom out",(0,tb.jsx)(bn,{action:"whiteboard/zoom-out"})]}),(0,tb.jsxs)(kt,{className:"tl-menu-item",onSelect:g,onClick:b.api.resetZoom,children:["Reset zoom",(0,tb.jsx)(bn,{action:"whiteboard/reset-zoom"})]})]})]})}),yA=W(22),zA=["horizontal","vertical"],hr=(0,yA.forwardRef)((b,g)=>{const {decorative:p,orientation:G="horizontal"}=
|
|||
|
b;b=zf(b,["decorative","orientation"]);const Y=zA.includes(G)?G:"horizontal";return(0,yA.createElement)(il.div,df({"data-orientation":Y},p?{role:"none"}:{"aria-orientation":"vertical"===Y?Y:void 0,role:"separator"},b,{ref:g}))});hr.propTypes={orientation(b,g,p){b=b[g];g=String(b);return b&&!zA.includes(b)?Error(`Invalid prop \`orientation\` of value \`${g}\` supplied to \`${p}\`, expected one of:
|
|||
|
- horizontal
|
|||
|
- vertical
|
|||
|
|
|||
|
Defaulting to \`${"horizontal"}\`.`):null}};tb=W(588);var FG=cf(function(){const b=Ye(),g=mu.useCallback(()=>{b.api.undo()},[b]),p=mu.useCallback(()=>{b.api.redo()},[b]),G=mu.useCallback(()=>{b.api.zoomIn()},[b]),Y=mu.useCallback(()=>{b.api.zoomOut()},[b]);return(0,tb.jsxs)("div",{className:"tl-action-bar","data-html2canvas-ignore":"true",children:[!b.readOnly&&(0,tb.jsxs)("div",{className:"tl-toolbar tl-history-bar",children:[(0,tb.jsx)(ka,{tooltip:"Undo",onClick:g,children:(0,tb.jsx)(Bh,{name:"arrow-back-up"})}),
|
|||
|
(0,tb.jsx)(ka,{tooltip:"Redo",onClick:p,children:(0,tb.jsx)(Bh,{name:"arrow-forward-up"})})]}),(0,tb.jsxs)("div",{className:`tl-toolbar tl-zoom-bar ${b.readOnly?"":"ml-4"}`,children:[(0,tb.jsx)(ka,{tooltip:"Zoom in",onClick:G,id:"tl-zoom-in",children:(0,tb.jsx)(Bh,{name:"plus"})}),(0,tb.jsx)(ka,{tooltip:"Zoom out",onClick:Y,id:"tl-zoom-out",children:(0,tb.jsx)(Bh,{name:"minus"})}),(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"vertical"}),(0,tb.jsx)(EG,{})]})]})}),AA=sf(W(22)),GG=sf(W(31));
|
|||
|
tb=W(588);var Bu=b=>`[${b.map(g=>{var p;return null!=(p=null==g?void 0:g.toFixed(2))?p:"-"}).join(", ")}]`,HG=cf(()=>{var b;const {viewport:{bounds:g,camera:{point:p,zoom:G}},inputs:Y}=ui(),la=AA.default.useRef();AA.default.useEffect(()=>{const Ga=document.getElementById("tl-statusbar-anchor");la.current=Ga},[]);const pa=[["Z",null!=(b=null==G?void 0:G.toFixed(2))?b:"null"],["MP",Bu(Y.currentPoint)],["MS",Bu(Y.currentScreenPoint)],["VP",Bu(p)],["VBR",Bu([g.maxX,g.maxY])]].map(Ga=>Ga.join("")).join("|");
|
|||
|
b=la.current?GG.default.createPortal((0,tb.jsx)("div",{style:{flex:1,display:"flex",alignItems:"center"},children:pa}),la.current):null;return(0,tb.jsx)(tb.Fragment,{children:b})}),Cu=sf(W(22));tb=W(588);var lp=cf(b=>{var {id:g,icon:p,tooltip:G,tooltipSide:Y="left",handleClick:la}=b;b=zf(b,["id","icon","tooltip","tooltipSide","handleClick"]);var pa;const Ga=Ye(),Qa=null==(pa=[...Ga.Tools,Rr,Qr])?void 0:pa.find(Za=>Za.id===g);pa=(pa=null==Qa?void 0:Qa.shortcut)&&G?(0,tb.jsxs)("div",{className:"flex",
|
|||
|
children:[G,(0,tb.jsx)(bn,{action:pa})]}):G;return(0,tb.jsx)(ka,hf(pe({},b),{tooltipSide:Y,tooltip:pa,"data-tool":g,"data-selected":g===Ga.selectedTool.id,onClick:la,children:"string"===typeof p?(0,tb.jsx)(Bh,{name:p}):p}))}),Tj=W(22),[BA]=yj("Popover",[Zr]),Du=Zr(),[IG,lt]=BA("Popover"),CA=(0,Tj.forwardRef)((b,g)=>{var {__scopePopover:p}=b;const G=zf(b,["__scopePopover"]),Y=lt("PopoverTrigger",p);p=Du(p);g=Df(g,Y.triggerRef);b=(0,Tj.createElement)(il.button,df({type:"button","aria-haspopup":"dialog",
|
|||
|
"aria-expanded":Y.open,"aria-controls":Y.contentId,"data-state":Y.open?"open":"closed"},G,{ref:g,onClick:If(b.onClick,Y.onOpenToggle)}));return Y.hasCustomAnchor?b:(0,Tj.createElement)(mw,df({asChild:!0},p),b)}),[,JG]=BA("PopoverPortal",{forceMount:void 0}),DA=(0,Tj.forwardRef)((b,g)=>{var p=JG("PopoverContent",b.__scopePopover);({forceMount:p=p.forceMount}=b);const G=zf(b,["forceMount"]);b=lt("PopoverContent",b.__scopePopover);return(0,Tj.createElement)(it,{present:p||b.open},b.modal?(0,Tj.createElement)(KG,
|
|||
|
df({},G,{ref:g})):(0,Tj.createElement)(LG,df({},G,{ref:g})))}),KG=(0,Tj.forwardRef)((b,g)=>{const p=lt("PopoverContent",b.__scopePopover),G=(0,Tj.useRef)(null);g=Df(g,G);const Y=(0,Tj.useRef)(!1);(0,Tj.useEffect)(()=>{const la=G.current;if(la)return tw(la)},[]);return(0,Tj.createElement)(xu,{as:ip,allowPinchZoom:!0},(0,Tj.createElement)(EA,df({},b,{ref:g,trapFocus:p.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:If(b.onCloseAutoFocus,la=>{var pa;la.preventDefault();Y.current||null===(pa=p.triggerRef.current)||
|
|||
|
void 0===pa||pa.focus()}),onPointerDownOutside:If(b.onPointerDownOutside,la=>{la=la.detail.originalEvent;const pa=0===la.button&&!0===la.ctrlKey;Y.current=2===la.button||pa},{checkForDefaultPrevented:!1}),onFocusOutside:If(b.onFocusOutside,la=>la.preventDefault(),{checkForDefaultPrevented:!1})})))}),LG=(0,Tj.forwardRef)((b,g)=>{const p=lt("PopoverContent",b.__scopePopover),G=(0,Tj.useRef)(!1);return(0,Tj.createElement)(EA,df({},b,{ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:Y=>
|
|||
|
{var la;null===(la=b.onCloseAutoFocus)||void 0===la||la.call(b,Y);if(!Y.defaultPrevented){var pa;G.current||null===(pa=p.triggerRef.current)||void 0===pa||pa.focus();Y.preventDefault()}G.current=!1},onInteractOutside:Y=>{var la,pa;null===(la=b.onInteractOutside)||void 0===la||la.call(b,Y);Y.defaultPrevented||(G.current=!0);la=Y.target;(null===(pa=p.triggerRef.current)||void 0===pa?0:pa.contains(la))&&Y.preventDefault()}}))}),EA=(0,Tj.forwardRef)((b,g)=>{const {__scopePopover:p,trapFocus:G,onOpenAutoFocus:Y,
|
|||
|
onCloseAutoFocus:la,disableOutsidePointerEvents:pa,onEscapeKeyDown:Ga,onPointerDownOutside:Qa,onFocusOutside:Za,onInteractOutside:fb}=b;b=zf(b,"__scopePopover trapFocus onOpenAutoFocus onCloseAutoFocus disableOutsidePointerEvents onEscapeKeyDown onPointerDownOutside onFocusOutside onInteractOutside".split(" "));const mb=lt("PopoverContent",p),Lb=Du(p);vb();return(0,Tj.createElement)(aA,{asChild:!0,loop:!0,trapped:G,onMountAutoFocus:Y,onUnmountAutoFocus:la},(0,Tj.createElement)(gw,{asChild:!0,disableOutsidePointerEvents:pa,
|
|||
|
onInteractOutside:fb,onEscapeKeyDown:Ga,onPointerDownOutside:Qa,onFocusOutside:Za,onDismiss:()=>mb.onOpenChange(!1)},(0,Tj.createElement)(nw,df({"data-state":mb.open?"open":"closed",role:"dialog",id:mb.contentId},Lb,b,{ref:g,style:hf(pe({},b.style),{["--radix-popover-content-transform-origin"]:"var(--radix-popper-transform-origin)"})}))))}),FA=(0,Tj.forwardRef)((b,g)=>{var {__scopePopover:p}=b;b=zf(b,["__scopePopover"]);p=Du(p);return(0,Tj.createElement)(Vz,df({},p,b,{ref:g}))}),GA=b=>{const {__scopePopover:g,
|
|||
|
children:p,open:G,defaultOpen:Y,onOpenChange:la,modal:pa=!1}=b;b=Du(g);const Ga=(0,Tj.useRef)(null),[Qa,Za]=(0,Tj.useState)(!1),[fb=!1,mb]=Kj({prop:G,defaultProp:Y,onChange:la});return(0,Tj.createElement)(ow,b,(0,Tj.createElement)(IG,{scope:g,contentId:xi(),triggerRef:Ga,open:fb,onOpenChange:mb,onOpenToggle:(0,Tj.useCallback)(()=>mb(Lb=>!Lb),[mb]),hasCustomAnchor:Qa,onCustomAnchorAdd:(0,Tj.useCallback)(()=>Za(!0),[]),onCustomAnchorRemove:(0,Tj.useCallback)(()=>Za(!1),[]),modal:pa},p))};tb=W(588);
|
|||
|
var HA=cf(function(b){var {popoverSide:g="left",setGeometry:p,activeGeometry:G,chevron:Y=!0}=b;b=zf(b,["popoverSide","setGeometry","activeGeometry","chevron"]);const la=[{id:"box",icon:"square",tooltip:"Rectangle"},{id:"ellipse",icon:"circle",tooltip:"Circle"},{id:"polygon",icon:"triangle",tooltip:"Triangle"}];var pa={id:"shapes",icon:"triangle-square-circle",tooltip:"Shape"};pa=G?la.find(Ga=>Ga.id===G):pa;return(0,tb.jsxs)(GA,{children:[(0,tb.jsx)(CA,{asChild:!0,children:(0,tb.jsxs)("div",hf(pe({},
|
|||
|
b),{className:"tl-geometry-tools-pane-anchor",children:[(0,tb.jsx)(lp,hf(pe({},pa),{tooltipSide:g})),Y&&(0,tb.jsx)(Bh,{"data-selected":G,className:"tl-popover-indicator",name:"chevron-down-left"})]}))}),(0,tb.jsxs)(DA,{className:"tl-popover-content",side:g,sideOffset:15,children:[(0,tb.jsx)("div",{className:`tl-toolbar tl-geometry-toolbar ${["left","right"].includes(g)?"flex-col":"flex-row"}`,children:la.map(Ga=>(0,tb.jsx)(lp,{id:Ga.id,icon:Ga.icon,tooltip:G?Ga.tooltip:"",handleClick:p,tooltipSide:g},
|
|||
|
Ga.id))}),(0,tb.jsx)(FA,{className:"tl-popover-arrow"})]})]})}),ti=W(22),IA=W(22),JA=["PageUp","PageDown"],KA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],LA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},[Aw,MG,NG]=Eb("Slider"),[MA]=yj("Slider",[NG]),[OG,Eu]=MA("Slider"),PG=(0,ti.forwardRef)((b,g)=>{function p(Te){const rf=
|
|||
|
mh(De,Te);la(Te,rf)}function G(Te){la(Te,vd.current)}function Y(){De[vd.current]!==mf.current[vd.current]&&xc(De)}function la(Te,rf,{commit:Vd}={commit:!1}){const rd=(String(Za).split(".")[1]||"").length;Te=Dg(Math.round((Te-Ga)/Za)*Za+Ga,rd);const sd=tg(Te,[Ga,Qa]);$e((ud=[])=>{const ie=cj(ud,sd,rf);var jf=Lb*Za;if(0<jf){const tf=Tg(ie);jf=Math.min(...tf)>=jf}else jf=!0;return jf?(vd.current=ie.indexOf(sd),(jf=String(ie)!==String(ud))&&Vd&&xc(ie),jf?ie:ud):ud})}const {name:pa,min:Ga=0,max:Qa=100,
|
|||
|
step:Za=1,orientation:fb="horizontal",disabled:mb=!1,minStepsBetweenThumbs:Lb=0,defaultValue:Tb=[Ga],value:Pb,onValueChange:lc=()=>{},onValueCommit:xc=()=>{},inverted:$b=!1}=b,sc=zf(b,"name min max step orientation disabled minStepsBetweenThumbs defaultValue value onValueChange onValueCommit inverted".split(" ")),[oc,Mc]=(0,ti.useState)(null);g=Df(g,Te=>Mc(Te));const Tc=(0,ti.useRef)(new Set),vd=(0,ti.useRef)(0);var de="horizontal"===fb;const ne=oc?!!oc.closest("form"):!0;de=de?QG:RG;const [De=[],
|
|||
|
$e]=Kj({prop:Pb,defaultProp:Tb,onChange:Te=>{var rf;null===(rf=[...Tc.current][vd.current])||void 0===rf||rf.focus();lc(Te)}}),mf=(0,ti.useRef)(De);return(0,ti.createElement)(OG,{scope:b.__scopeSlider,disabled:mb,min:Ga,max:Qa,valueIndexToChangeRef:vd,thumbs:Tc.current,values:De,orientation:fb},(0,ti.createElement)(Aw.Provider,{scope:b.__scopeSlider},(0,ti.createElement)(Aw.Slot,{scope:b.__scopeSlider},(0,ti.createElement)(de,df({"aria-disabled":mb,"data-disabled":mb?"":void 0},sc,{ref:g,onPointerDown:If(sc.onPointerDown,
|
|||
|
()=>{mb||(mf.current=De)}),min:Ga,max:Qa,inverted:$b,onSlideStart:mb?void 0:p,onSlideMove:mb?void 0:G,onSlideEnd:mb?void 0:Y,onHomeKeyDown:()=>!mb&&la(Ga,0,{commit:!0}),onEndKeyDown:()=>!mb&&la(Qa,De.length-1,{commit:!0}),onStepKeyDown:({event:Te,direction:rf})=>{if(!mb){Te=JA.includes(Te.key)||Te.shiftKey&&KA.includes(Te.key);const Vd=vd.current;la(De[Vd]+Za*(Te?10:1)*rf,Vd,{commit:!0})}}})))),ne&&De.map((Te,rf)=>(0,ti.createElement)(WG,{key:rf,name:pa?pa+(1<De.length?"[]":""):void 0,value:Te})))}),
|
|||
|
[NA,OA]=MA("Slider",{startEdge:"left",endEdge:"right",size:"width",direction:1}),QG=(0,ti.forwardRef)((b,g)=>{function p(sc){const oc=Pb.current||Lb.getBoundingClientRect(),Mc=bh([0,oc.width],$b?[G,Y]:[Y,G]);Pb.current=oc;return Mc(sc-oc.left)}const {min:G,max:Y,dir:la,inverted:pa,onSlideStart:Ga,onSlideMove:Qa,onSlideEnd:Za,onStepKeyDown:fb}=b,mb=zf(b,"min max dir inverted onSlideStart onSlideMove onSlideEnd onStepKeyDown".split(" ")),[Lb,Tb]=(0,ti.useState)(null);g=Df(g,sc=>Tb(sc));const Pb=(0,ti.useRef)(),
|
|||
|
lc=Ub(la),xc="ltr"===lc,$b=xc&&!pa||!xc&&pa;return(0,ti.createElement)(NA,{scope:b.__scopeSlider,startEdge:$b?"left":"right",endEdge:$b?"right":"left",direction:$b?1:-1,size:"width"},(0,ti.createElement)(PA,df({dir:lc,"data-orientation":"horizontal"},mb,{ref:g,style:hf(pe({},mb.style),{["--radix-slider-thumb-transform"]:"translateX(-50%)"}),onSlideStart:sc=>{sc=p(sc.clientX);null===Ga||void 0===Ga||Ga(sc)},onSlideMove:sc=>{sc=p(sc.clientX);null===Qa||void 0===Qa||Qa(sc)},onSlideEnd:()=>{Pb.current=
|
|||
|
void 0;null===Za||void 0===Za||Za()},onStepKeyDown:sc=>{const oc=LA[$b?"from-left":"from-right"].includes(sc.key);null===fb||void 0===fb||fb({event:sc,direction:oc?-1:1})}})))}),RG=(0,ti.forwardRef)((b,g)=>{function p(Pb){const lc=Lb.current||mb.current.getBoundingClientRect(),xc=bh([0,lc.height],Tb?[Y,G]:[G,Y]);Lb.current=lc;return xc(Pb-lc.top)}const {min:G,max:Y,inverted:la,onSlideStart:pa,onSlideMove:Ga,onSlideEnd:Qa,onStepKeyDown:Za}=b,fb=zf(b,"min max inverted onSlideStart onSlideMove onSlideEnd onStepKeyDown".split(" ")),
|
|||
|
mb=(0,ti.useRef)(null);g=Df(g,mb);const Lb=(0,ti.useRef)(),Tb=!la;return(0,ti.createElement)(NA,{scope:b.__scopeSlider,startEdge:Tb?"bottom":"top",endEdge:Tb?"top":"bottom",size:"height",direction:Tb?1:-1},(0,ti.createElement)(PA,df({"data-orientation":"vertical"},fb,{ref:g,style:hf(pe({},fb.style),{["--radix-slider-thumb-transform"]:"translateY(50%)"}),onSlideStart:Pb=>{Pb=p(Pb.clientY);null===pa||void 0===pa||pa(Pb)},onSlideMove:Pb=>{Pb=p(Pb.clientY);null===Ga||void 0===Ga||Ga(Pb)},onSlideEnd:()=>
|
|||
|
{Lb.current=void 0;null===Qa||void 0===Qa||Qa()},onStepKeyDown:Pb=>{const lc=LA[Tb?"from-bottom":"from-top"].includes(Pb.key);null===Za||void 0===Za||Za({event:Pb,direction:lc?-1:1})}})))}),PA=(0,ti.forwardRef)((b,g)=>{const {__scopeSlider:p,onSlideStart:G,onSlideMove:Y,onSlideEnd:la,onHomeKeyDown:pa,onEndKeyDown:Ga,onStepKeyDown:Qa}=b,Za=zf(b,"__scopeSlider onSlideStart onSlideMove onSlideEnd onHomeKeyDown onEndKeyDown onStepKeyDown".split(" ")),fb=Eu("Slider",p);return(0,ti.createElement)(il.span,
|
|||
|
df({},Za,{ref:g,onKeyDown:If(b.onKeyDown,mb=>{"Home"===mb.key?(pa(mb),mb.preventDefault()):"End"===mb.key?(Ga(mb),mb.preventDefault()):JA.concat(KA).includes(mb.key)&&(Qa(mb),mb.preventDefault())}),onPointerDown:If(b.onPointerDown,mb=>{const Lb=mb.target;Lb.setPointerCapture(mb.pointerId);mb.preventDefault();fb.thumbs.has(Lb)?Lb.focus():G(mb)}),onPointerMove:If(b.onPointerMove,mb=>{mb.target.hasPointerCapture(mb.pointerId)&&Y(mb)}),onPointerUp:If(b.onPointerUp,mb=>{const Lb=mb.target;Lb.hasPointerCapture(mb.pointerId)&&
|
|||
|
(Lb.releasePointerCapture(mb.pointerId),la(mb))})}))}),SG=(0,ti.forwardRef)((b,g)=>{var {__scopeSlider:p}=b;b=zf(b,["__scopeSlider"]);p=Eu("SliderTrack",p);return(0,ti.createElement)(il.span,df({"data-disabled":p.disabled?"":void 0,"data-orientation":p.orientation},b,{ref:g}))}),TG=(0,ti.forwardRef)((b,g)=>{var {__scopeSlider:p}=b;const G=zf(b,["__scopeSlider"]),Y=Eu("SliderRange",p);p=OA("SliderRange",p);var la=(0,ti.useRef)(null);g=Df(g,la);var pa=Y.values.length;la=Y.values.map(Ga=>Tf(Ga,Y.min,
|
|||
|
Y.max));pa=1<pa?Math.min(...la):0;la=100-Math.max(...la);return(0,ti.createElement)(il.span,df({"data-orientation":Y.orientation,"data-disabled":Y.disabled?"":void 0},G,{ref:g,style:hf(pe({},b.style),{[p.startEdge]:pa+"%",[p.endEdge]:la+"%"})}))}),UG=(0,ti.forwardRef)((b,g)=>{const p=MG(b.__scopeSlider),[G,Y]=(0,ti.useState)(null);g=Df(g,pa=>Y(pa));const la=(0,ti.useMemo)(()=>G?p().findIndex(pa=>pa.ref.current===G):-1,[p,G]);return(0,ti.createElement)(VG,df({},b,{ref:g,index:la}))}),VG=(0,ti.forwardRef)((b,
|
|||
|
g)=>{const {__scopeSlider:p,index:G}=b,Y=zf(b,["__scopeSlider","index"]),la=Eu("SliderThumb",p),pa=OA("SliderThumb",p),[Ga,Qa]=(0,ti.useState)(null);g=Df(g,Tb=>Qa(Tb));var Za=Wf(Ga);const fb=la.values[G],mb=void 0===fb?0:Tf(fb,la.min,la.max),Lb=og(G,la.values.length);Za=(Za=null===Za||void 0===Za?void 0:Za[pa.size])?Rg(Za,mb,pa.direction):0;(0,ti.useEffect)(()=>{if(Ga)return la.thumbs.add(Ga),()=>{la.thumbs.delete(Ga)}},[Ga,la.thumbs]);return(0,ti.createElement)("span",{style:{transform:"var(--radix-slider-thumb-transform)",
|
|||
|
position:"absolute",[pa.startEdge]:`calc(${mb}% + ${Za}px)`}},(0,ti.createElement)(Aw.ItemSlot,{scope:b.__scopeSlider},(0,ti.createElement)(il.span,df({role:"slider","aria-label":b["aria-label"]||Lb,"aria-valuemin":la.min,"aria-valuenow":fb,"aria-valuemax":la.max,"aria-orientation":la.orientation,"data-orientation":la.orientation,"data-disabled":la.disabled?"":void 0,tabIndex:la.disabled?void 0:0},Y,{ref:g,style:void 0===fb?{display:"none"}:b.style,onFocus:If(b.onFocus,()=>{la.valueIndexToChangeRef.current=
|
|||
|
G})}))))}),WG=b=>{const {value:g}=b;b=zf(b,["value"]);const p=(0,ti.useRef)(null),G=Vf(g);(0,ti.useEffect)(()=>{const Y=p.current,la=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(G!==g&&la){const pa=new Event("input",{bubbles:!0});la.call(Y,g);Y.dispatchEvent(pa)}},[G,g]);return(0,ti.createElement)("input",df({style:{display:"none"}},b,{ref:p,defaultValue:g}))},XG=PG,YG=SG,ZG=TG,$G=UG,Fu=sf(W(22));tb=W(588);var QA=cf(b=>{var {side:g,align:p,alignOffset:G,label:Y,
|
|||
|
arrow:la,children:pa,border:Ga}=b;b=zf(b,"side align alignOffset label arrow children border".split(" "));const Qa=Fu.useRef(null),[Za,fb]=Fu.useState(!1),{viewport:{bounds:mb,camera:{point:Lb,zoom:Tb}}}=Ye(),[Pb,lc]=Fu.useState(0);Fu.useEffect(()=>{if(Qa.current&&Za){var xc=Qa.current.getBoundingClientRect();vf.boundsContain(mb,{minX:xc.x,minY:xc.y,maxX:xc.right,maxY:xc.bottom,width:xc.width,height:xc.height})||lc($b=>$b+1)}},[Lb[0],Lb[1],Tb,Za]);return(0,tb.jsxs)(GA,{onOpenChange:xc=>fb(xc),children:[(0,tb.jsx)(CA,
|
|||
|
hf(pe({},b),{"data-border":Ga,className:"tl-button tl-popover-trigger-button",children:Y})),(0,tb.jsxs)(DA,{ref:Qa,className:"tl-popover-content",align:p,alignOffset:G,side:g,sideOffset:15,collisionBoundary:document.querySelector(".logseq-tldraw"),children:[pa,la&&(0,tb.jsx)(FA,{className:"tl-popover-arrow"})]},"popover-content-"+Pb)]})}),aH=sf(W(22));tb=W(588);var bH=sf(W(22)),yf=W(22),RA=W(31),mp=sf(W(22)),On=W(22),Bw=W(22),cH=W(31),Fn="a button div form h2 h3 img input label li nav ol p span svg ul".split(" ").reduce((b,
|
|||
|
g)=>{const p=(0,Bw.forwardRef)((G,Y)=>{var {asChild:la}=G;G=zf(G,["asChild"]);la=la?ip:g;(0,Bw.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]);return(0,Bw.createElement)(la,df({},G,{ref:Y}))});p.displayName=`Primitive.${g}`;return hf(pe({},b),{[g]:p})},{}),SA,dH=(0,On.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eH=(0,On.forwardRef)((b,g)=>{var p;const {disableOutsidePointerEvents:G=!1,onEscapeKeyDown:Y,onPointerDownOutside:la,onFocusOutside:pa,
|
|||
|
onInteractOutside:Ga,onDismiss:Qa}=b,Za=zf(b,"disableOutsidePointerEvents onEscapeKeyDown onPointerDownOutside onFocusOutside onInteractOutside onDismiss".split(" ")),fb=(0,On.useContext)(dH),[mb,Lb]=(0,On.useState)(null),Tb=null!==(p=null===mb||void 0===mb?void 0:mb.ownerDocument)&&void 0!==p?p:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,Pb]=(0,On.useState)({});g=Df(g,oc=>Lb(oc));p=Array.from(fb.layers);var [lc]=[...fb.layersWithOutsidePointerEventsDisabled].slice(-1);lc=
|
|||
|
p.indexOf(lc);const xc=mb?p.indexOf(mb):-1;p=0<fb.layersWithOutsidePointerEventsDisabled.size;const $b=xc>=lc;lc=Qf(oc=>{const Mc=oc.target,Tc=[...fb.branches].some(vd=>vd.contains(Mc));$b&&!Tc&&(null===la||void 0===la||la(oc),null===Ga||void 0===Ga||Ga(oc),oc.defaultPrevented||null===Qa||void 0===Qa||Qa())},Tb);const sc=aj(oc=>{const Mc=oc.target;[...fb.branches].some(Tc=>Tc.contains(Mc))||(null===pa||void 0===pa||pa(oc),null===Ga||void 0===Ga||Ga(oc),oc.defaultPrevented||null===Qa||void 0===Qa||
|
|||
|
Qa())},Tb);lk(oc=>{xc===fb.layers.size-1&&(null===Y||void 0===Y||Y(oc),!oc.defaultPrevented&&Qa&&(oc.preventDefault(),Qa()))},Tb);(0,On.useEffect)(()=>{if(mb)return G&&(0===fb.layersWithOutsidePointerEventsDisabled.size&&(SA=Tb.body.style.pointerEvents,Tb.body.style.pointerEvents="none"),fb.layersWithOutsidePointerEventsDisabled.add(mb)),fb.layers.add(mb),th(),()=>{G&&1===fb.layersWithOutsidePointerEventsDisabled.size&&(Tb.body.style.pointerEvents=SA)}},[mb,Tb,G,fb]);(0,On.useEffect)(()=>()=>{mb&&
|
|||
|
(fb.layers.delete(mb),fb.layersWithOutsidePointerEventsDisabled.delete(mb),th())},[mb,fb]);(0,On.useEffect)(()=>{const oc=()=>Pb({});document.addEventListener("dismissableLayer.update",oc);return()=>document.removeEventListener("dismissableLayer.update",oc)},[]);return(0,On.createElement)(Fn.div,df({},Za,{ref:g,style:pe({pointerEvents:p?$b?"auto":"none":void 0},b.style),onFocusCapture:If(b.onFocusCapture,sc.onFocusCapture),onBlurCapture:If(b.onBlurCapture,sc.onBlurCapture),onPointerDownCapture:If(b.onPointerDownCapture,
|
|||
|
lc.onPointerDownCapture)}))}),lq=W(22),TA={bubbles:!1,cancelable:!0},fH=(0,lq.forwardRef)((b,g)=>{const {loop:p=!1,trapped:G=!1,onMountAutoFocus:Y,onUnmountAutoFocus:la}=b;b=zf(b,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]);const [pa,Ga]=(0,lq.useState)(null),Qa=pf(Y),Za=pf(la),fb=(0,lq.useRef)(null);g=Df(g,Tb=>Ga(Tb));const mb=(0,lq.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,lq.useEffect)(()=>{if(G){let Tb=function(lc){!mb.paused&&pa&&(lc=lc.target,
|
|||
|
pa.contains(lc)?fb.current=lc:Yi(fb.current,{select:!0}))},Pb=function(lc){!mb.paused&&pa&&(pa.contains(lc.relatedTarget)||Yi(fb.current,{select:!0}))};document.addEventListener("focusin",Tb);document.addEventListener("focusout",Pb);return()=>{document.removeEventListener("focusin",Tb);document.removeEventListener("focusout",Pb)}}},[G,pa,mb.paused]);(0,lq.useEffect)(()=>{if(pa){UA.add(mb);const Tb=document.activeElement;if(!pa.contains(Tb)){const Pb=new CustomEvent("focusScope.autoFocusOnMount",TA);
|
|||
|
pa.addEventListener("focusScope.autoFocusOnMount",Qa);pa.dispatchEvent(Pb);Pb.defaultPrevented||(ck(Rm(zi(pa)),{select:!0}),document.activeElement===Tb&&Yi(pa))}return()=>{pa.removeEventListener("focusScope.autoFocusOnMount",Qa);setTimeout(()=>{const Pb=new CustomEvent("focusScope.autoFocusOnUnmount",TA);pa.addEventListener("focusScope.autoFocusOnUnmount",Za);pa.dispatchEvent(Pb);Pb.defaultPrevented||Yi(null!==Tb&&void 0!==Tb?Tb:document.body,{select:!0});pa.removeEventListener("focusScope.autoFocusOnUnmount",
|
|||
|
Za);UA.remove(mb)},0)}}},[pa,Qa,Za,mb]);const Lb=(0,lq.useCallback)(Tb=>{if((p||G)&&!mb.paused){var Pb=document.activeElement;if("Tab"===Tb.key&&!Tb.altKey&&!Tb.ctrlKey&&!Tb.metaKey&&Pb){const xc=Tb.currentTarget;var lc=xc;const $b=zi(lc),sc=tk($b,lc);lc=tk($b.reverse(),lc);const [oc,Mc]=[sc,lc];oc&&Mc?Tb.shiftKey||Pb!==Mc?Tb.shiftKey&&Pb===oc&&(Tb.preventDefault(),p&&Yi(Mc,{select:!0})):(Tb.preventDefault(),p&&Yi(oc,{select:!0})):Pb===xc&&Tb.preventDefault()}}},[p,G,mb.paused]);return(0,lq.createElement)(Fn.div,
|
|||
|
df({tabIndex:-1},b,{ref:g,onKeyDown:Lb}))}),UA=function(){let b=[];return{add(g){const p=b[0];g===p||null!==p&&void 0!==p&&p.pause();b=om(b,g);b.unshift(g)},remove(g){var p;b=om(b,g);null===(p=b[0])||void 0===p||p.resume()}}}(),nn=W(22),[Cw,VA]=yj("Popper"),[gH,WA]=Cw("Popper"),hH=(0,nn.forwardRef)((b,g)=>{const {__scopePopper:p,virtualRef:G}=b;b=zf(b,["__scopePopper","virtualRef"]);const Y=WA("PopperAnchor",p),la=(0,nn.useRef)(null);g=Df(g,la);(0,nn.useEffect)(()=>{Y.onAnchorChange((null===G||void 0===
|
|||
|
G?void 0:G.current)||la.current)});return G?null:(0,nn.createElement)(Fn.div,df({},b,{ref:g}))}),[iH]=Cw("PopperContent"),[jH,kH]=Cw("PopperContent",{hasParent:!1,positionUpdateFns:new Set}),lH=(0,nn.forwardRef)((b,g)=>{var p,G,Y,la,pa,Ga,Qa,Za;const {__scopePopper:fb,side:mb="bottom",sideOffset:Lb=0,align:Tb="center",alignOffset:Pb=0,arrowPadding:lc=0,collisionBoundary:xc=[],collisionPadding:$b=0,sticky:sc="partial",hideWhenDetached:oc=!1,avoidCollisions:Mc=!0,onPlaced:Tc}=b,vd=zf(b,"__scopePopper side sideOffset align alignOffset arrowPadding collisionBoundary collisionPadding sticky hideWhenDetached avoidCollisions onPlaced".split(" ")),
|
|||
|
de=WA("PopperContent",fb),[ne,De]=(0,nn.useState)(null);g=Df(g,qp=>De(qp));const [$e,mf]=(0,nn.useState)(null);var Te=Wf($e),rf=null!==(p=null===Te||void 0===Te?void 0:Te.width)&&void 0!==p?p:0;p=null!==(G=null===Te||void 0===Te?void 0:Te.height)&&void 0!==G?G:0;G=mb+("center"!==Tb?"-"+Tb:"");Te="number"===typeof $b?$b:pe({top:0,right:0,bottom:0,left:0},$b);const Vd=Array.isArray(xc)?xc:[xc],rd=0<Vd.length;Te={padding:Te,boundary:Vd.filter(dn),altBoundary:rd};const {reference:sd,floating:ud,strategy:ie,
|
|||
|
x:jf,y:tf,placement:gg,middlewareData:Bf,update:Sf}=Xi({strategy:"fixed",placement:G,whileElementsMounted:Lh,middleware:[mH(),Oz({mainAxis:Lb+p,alignmentAxis:Pb}),Mc?Pz(pe({mainAxis:!0,crossAxis:!1,limiter:"partial"===sc?Qz():void 0},Te)):void 0,$e?Tz({element:$e,padding:lc}):void 0,Mc?Mz(pe({},Te)):void 0,jF(hf(pe({},Te),{apply:({elements:qp,availableWidth:qK,availableHeight:rK})=>{qp.floating.style.setProperty("--radix-popper-available-width",`${qK}px`);qp.floating.style.setProperty("--radix-popper-available-height",
|
|||
|
`${rK}px`)}})),nH({arrowWidth:rf,arrowHeight:p}),oc?Nz({strategy:"referenceHidden"}):void 0].filter(ug)});Om(()=>{sd(de.anchor)},[sd,de.anchor]);const hh=null!==jf&&null!==tf,[Ff,jh]=cn(gg),sh=pf(Tc);Om(()=>{hh&&(null===sh||void 0===sh||sh())},[hh,sh]);rf=null===(Y=Bf.arrow)||void 0===Y?void 0:Y.x;Y=null===(la=Bf.arrow)||void 0===la?void 0:la.y;la=0!==(null===(pa=Bf.arrow)||void 0===pa?void 0:pa.centerOffset);const [oj,kl]=(0,nn.useState)();Om(()=>{ne&&kl(window.getComputedStyle(ne).zIndex)},[ne]);
|
|||
|
const {hasParent:ll,positionUpdateFns:pp}=kH("PopperContent",fb),Ip=!ll;(0,nn.useLayoutEffect)(()=>{if(!Ip)return pp.add(Sf),()=>{pp.delete(Sf)}},[Ip,pp,Sf]);Om(()=>{Ip&&hh&&Array.from(pp).reverse().forEach(qp=>requestAnimationFrame(qp))},[Ip,hh,pp]);pa=hf(pe({"data-side":Ff,"data-align":jh},vd),{ref:g,style:hf(pe({},vd.style),{animation:hh?void 0:"none",opacity:null!==(Ga=Bf.hide)&&void 0!==Ga&&Ga.referenceHidden?0:void 0})});return(0,nn.createElement)("div",{ref:ud,"data-radix-popper-content-wrapper":"",
|
|||
|
style:{position:ie,left:0,top:0,transform:hh?`translate3d(${Math.round(jf)}px, ${Math.round(tf)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:oj,["--radix-popper-transform-origin"]:[null===(Qa=Bf.transformOrigin)||void 0===Qa?void 0:Qa.x,null===(Za=Bf.transformOrigin)||void 0===Za?void 0:Za.y].join(" ")},dir:b.dir},(0,nn.createElement)(iH,{scope:fb,placedSide:Ff,onArrowChange:mf,arrowX:rf,arrowY:Y,shouldHideArrow:la},Ip?(0,nn.createElement)(jH,{scope:fb,hasParent:!0,positionUpdateFns:pp},
|
|||
|
(0,nn.createElement)(Fn.div,pa)):(0,nn.createElement)(Fn.div,pa)))}),mH=()=>({name:"anchorCssProperties",fn(b){const {rects:g,elements:p}=b,{width:G,height:Y}=g.reference;p.floating.style.setProperty("--radix-popper-anchor-width",`${G}px`);p.floating.style.setProperty("--radix-popper-anchor-height",`${Y}px`);return{}}}),nH=b=>({name:"transformOrigin",options:b,fn(g){var p,G,Y,la,pa;const {placement:Ga,rects:Qa,middlewareData:Za}=g,fb=(g=0!==(null===(p=Za.arrow)||void 0===p?void 0:p.centerOffset))?
|
|||
|
0:b.arrowWidth;p=g?0:b.arrowHeight;const [mb,Lb]=cn(Ga),Tb={start:"0%",center:"50%",end:"100%"}[Lb],Pb=(null!==(G=null===(Y=Za.arrow)||void 0===Y?void 0:Y.x)&&void 0!==G?G:0)+fb/2;G=(null!==(la=null===(pa=Za.arrow)||void 0===pa?void 0:pa.y)&&void 0!==la?la:0)+p/2;pa=la="";"bottom"===mb?(la=g?Tb:`${Pb}px`,pa=`${-p}px`):"top"===mb?(la=g?Tb:`${Pb}px`,pa=`${Qa.floating.height+p}px`):"right"===mb?(la=`${-p}px`,pa=g?Tb:`${G}px`):"left"===mb&&(la=`${Qa.floating.width+p}px`,pa=g?Tb:`${G}px`);return{data:{x:la,
|
|||
|
y:pa}}}}),oH=b=>{const {__scopePopper:g,children:p}=b,[G,Y]=(0,nn.useState)(null);return(0,nn.createElement)(gH,{scope:g,anchor:G,onAnchorChange:Y},p)},XA=W(22),pH=sf(W(31)),qH=(0,XA.forwardRef)((b,g)=>{var p;const {container:G=null===globalThis||void 0===globalThis?void 0:null===(p=globalThis.document)||void 0===p?void 0:p.body}=b;b=zf(b,["container"]);return G?pH.default.createPortal((0,XA.createElement)(Fn.div,df({},b,{ref:g})),G):null}),YA=W(22),rH=(0,YA.forwardRef)((b,g)=>(0,YA.createElement)(Fn.span,
|
|||
|
df({},b,{ref:g,style:pe({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"},b.style)}))),sH=[" ","Enter","ArrowUp","ArrowDown"],tH=[" ","Enter"],[Gu,Hu,uH]=function(b){var g=b+"CollectionProvider";const [p,G]=yj(g),[Y,la]=p(g,{collectionRef:{current:null},itemMap:new Map}),pa=fb=>{const {scope:mb,children:Lb}=fb;fb=mp.default.useRef(null);const Tb=mp.default.useRef(new Map).current;return mp.default.createElement(Y,
|
|||
|
{scope:mb,itemMap:Tb,collectionRef:fb},Lb)};Object.assign(pa,{displayName:g});const Ga=b+"CollectionSlot";g=mp.default.forwardRef((fb,mb)=>{const {scope:Lb,children:Tb}=fb;fb=la(Ga,Lb);mb=Df(mb,fb.collectionRef);return mp.default.createElement(ip,{ref:mb},Tb)});Object.assign(g,{displayName:Ga});const Qa=b+"CollectionItemSlot",Za=mp.default.forwardRef((fb,mb)=>{const {scope:Lb,children:Tb}=fb,Pb=zf(fb,["scope","children"]),lc=mp.default.useRef(null);fb=Df(mb,lc);const xc=la(Qa,Lb);mp.default.useEffect(()=>
|
|||
|
{xc.itemMap.set(lc,pe({ref:lc},Pb));return()=>void xc.itemMap.delete(lc)});return mp.default.createElement(ip,{["data-radix-collection-item"]:"",ref:fb},Tb)});Object.assign(Za,{displayName:Qa});return[{Provider:pa,Slot:g,ItemSlot:Za},function(fb){const mb=la(b+"CollectionConsumer",fb);return mp.default.useCallback(()=>{const Lb=mb.collectionRef.current;if(!Lb)return[];const Tb=Array.from(Lb.querySelectorAll("[data-radix-collection-item]"));return Array.from(mb.itemMap.values()).sort((Pb,lc)=>Tb.indexOf(Pb.ref.current)-
|
|||
|
Tb.indexOf(lc.ref.current))},[mb.collectionRef,mb.itemMap])},G]}("Select"),[cs]=yj("Select",[uH,VA]),Dw=VA(),[vH,ir]=cs("Select"),[wH,xH]=cs("Select"),yH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,disabled:G=!1}=b;b=zf(b,["__scopeSelect","disabled"]);const Y=Dw(p),la=ir("SelectTrigger",p),pa=la.disabled||G;g=Df(g,la.onTriggerChange);const Ga=Hu(p),[Qa,Za,fb]=am(mb=>{const Lb=Ga().filter(Pb=>!Pb.disabled),Tb=Lb.find(Pb=>Pb.value===la.value);mb=Zk(Lb,mb,Tb);if(void 0!==mb)la.onValueChange(mb.value)});
|
|||
|
return(0,yf.createElement)(hH,df({asChild:!0},Y),(0,yf.createElement)(Fn.button,df({type:"button",role:"combobox","aria-controls":la.contentId,"aria-expanded":la.open,"aria-required":la.required,"aria-autocomplete":"none",dir:la.dir,"data-state":la.open?"open":"closed",disabled:pa,"data-disabled":pa?"":void 0,"data-placeholder":void 0===la.value?"":void 0},b,{ref:g,onClick:If(b.onClick,mb=>{mb.currentTarget.focus()}),onPointerDown:If(b.onPointerDown,mb=>{const Lb=mb.target;Lb.hasPointerCapture(mb.pointerId)&&
|
|||
|
Lb.releasePointerCapture(mb.pointerId);0===mb.button&&!1===mb.ctrlKey&&(pa||(la.onOpenChange(!0),fb()),la.triggerPointerDownPosRef.current={x:Math.round(mb.pageX),y:Math.round(mb.pageY)},mb.preventDefault())}),onKeyDown:If(b.onKeyDown,mb=>{const Lb=""!==Qa.current;mb.ctrlKey||mb.altKey||mb.metaKey||1!==mb.key.length||Za(mb.key);Lb&&" "===mb.key||!sH.includes(mb.key)||(pa||(la.onOpenChange(!0),fb()),mb.preventDefault())})})))}),zH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,children:G,placeholder:Y}=
|
|||
|
b;b=zf(b,["__scopeSelect","className","style","children","placeholder"]);const la=ir("SelectValue",p),{onValueNodeHasChildrenChange:pa}=la,Ga=void 0!==G;g=Df(g,la.onValueNodeChange);Om(()=>{pa(Ga)},[pa,Ga]);return(0,yf.createElement)(Fn.span,df({},b,{ref:g,style:{pointerEvents:"none"}}),void 0===la.value&&void 0!==Y?Y:G)}),AH=(0,yf.forwardRef)((b,g)=>{const {children:p}=b;b=zf(b,["__scopeSelect","children"]);return(0,yf.createElement)(Fn.span,df({"aria-hidden":!0},b,{ref:g}),p||"▼")}),BH=(0,yf.forwardRef)((b,
|
|||
|
g)=>{const p=ir("SelectContent",b.__scopeSelect),[G,Y]=(0,yf.useState)();Om(()=>{Y(new DocumentFragment)},[]);return p.open?(0,yf.createElement)(CH,df({},b,{ref:g})):G?(0,RA.createPortal)((0,yf.createElement)(ZA,{scope:b.__scopeSelect},(0,yf.createElement)(Gu.Slot,{scope:b.__scopeSelect},(0,yf.createElement)("div",null,b.children))),G):null}),[ZA,jr]=cs("SelectContent"),CH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,position:G="item-aligned",onCloseAutoFocus:Y,onEscapeKeyDown:la,onPointerDownOutside:pa,
|
|||
|
side:Ga,sideOffset:Qa,align:Za,alignOffset:fb,arrowPadding:mb,collisionBoundary:Lb,collisionPadding:Tb,sticky:Pb,hideWhenDetached:lc,avoidCollisions:xc}=b;b=zf(b,"__scopeSelect position onCloseAutoFocus onEscapeKeyDown onPointerDownOutside side sideOffset align alignOffset arrowPadding collisionBoundary collisionPadding sticky hideWhenDetached avoidCollisions".split(" "));const $b=ir("SelectContent",p),[sc,oc]=(0,yf.useState)(null),[Mc,Tc]=(0,yf.useState)(null);g=Df(g,Ff=>oc(Ff));const [vd,de]=(0,yf.useState)(null),
|
|||
|
[ne,De]=(0,yf.useState)(null),$e=Hu(p),[mf,Te]=(0,yf.useState)(!1),rf=(0,yf.useRef)(!1);(0,yf.useEffect)(()=>{if(sc)return tw(sc)},[sc]);vb();const Vd=(0,yf.useCallback)(Ff=>{const [jh,...sh]=$e().map(ll=>ll.ref.current),[oj]=sh.slice(-1),kl=document.activeElement;for(const ll of Ff){if(ll===kl)break;null===ll||void 0===ll||ll.scrollIntoView({block:"nearest"});ll===jh&&Mc&&(Mc.scrollTop=0);ll===oj&&Mc&&(Mc.scrollTop=Mc.scrollHeight);null===ll||void 0===ll||ll.focus();if(document.activeElement!==kl)break}},
|
|||
|
[$e,Mc]),rd=(0,yf.useCallback)(()=>Vd([vd,sc]),[Vd,vd,sc]);(0,yf.useEffect)(()=>{mf&&rd()},[mf,rd]);const {onOpenChange:sd,triggerPointerDownPosRef:ud}=$b;(0,yf.useEffect)(()=>{if(sc){var Ff=0,jh=0;const sh=kl=>{var ll,pp,Ip,qp;Ff=Math.abs(Math.round(kl.pageX)-(null!==(ll=null===(pp=ud.current)||void 0===pp?void 0:pp.x)&&void 0!==ll?ll:0));jh=Math.abs(Math.round(kl.pageY)-(null!==(Ip=null===(qp=ud.current)||void 0===qp?void 0:qp.y)&&void 0!==Ip?Ip:0))},oj=kl=>{10>=Ff&&10>=jh?kl.preventDefault():sc.contains(kl.target)||
|
|||
|
sd(!1);document.removeEventListener("pointermove",sh);ud.current=null};null!==ud.current&&(document.addEventListener("pointermove",sh),document.addEventListener("pointerup",oj,{capture:!0,once:!0}));return()=>{document.removeEventListener("pointermove",sh);document.removeEventListener("pointerup",oj,{capture:!0})}}},[sc,sd,ud]);(0,yf.useEffect)(()=>{const Ff=()=>sd(!1);window.addEventListener("blur",Ff);window.addEventListener("resize",Ff);return()=>{window.removeEventListener("blur",Ff);window.removeEventListener("resize",
|
|||
|
Ff)}},[sd]);const [ie,jf]=am(Ff=>{const jh=$e().filter(kl=>!kl.disabled),sh=jh.find(kl=>kl.ref.current===document.activeElement),oj=Zk(jh,Ff,sh);oj&&setTimeout(()=>oj.ref.current.focus())}),tf=(0,yf.useCallback)((Ff,jh,sh)=>{sh=!rf.current&&!sh;if(void 0!==$b.value&&$b.value===jh||sh)de(Ff),sh&&(rf.current=!0)},[$b.value]),gg=(0,yf.useCallback)(()=>null===sc||void 0===sc?void 0:sc.focus(),[sc]),Bf=(0,yf.useCallback)((Ff,jh,sh)=>{sh=!rf.current&&!sh;(void 0!==$b.value&&$b.value===jh||sh)&&De(Ff)},
|
|||
|
[$b.value]),Sf="popper"===G?$A:DH,hh=Sf===$A?{side:Ga,sideOffset:Qa,align:Za,alignOffset:fb,arrowPadding:mb,collisionBoundary:Lb,collisionPadding:Tb,sticky:Pb,hideWhenDetached:lc,avoidCollisions:xc}:{};return(0,yf.createElement)(ZA,{scope:p,content:sc,viewport:Mc,onViewportChange:Tc,itemRefCallback:tf,selectedItem:vd,onItemLeave:gg,itemTextRefCallback:Bf,focusSelectedItem:rd,selectedItemText:ne,position:G,isPositioned:mf,searchRef:ie},(0,yf.createElement)(xu,{as:ip,allowPinchZoom:!0},(0,yf.createElement)(fH,
|
|||
|
{asChild:!0,trapped:$b.open,onMountAutoFocus:Ff=>{Ff.preventDefault()},onUnmountAutoFocus:If(Y,Ff=>{var jh;null===(jh=$b.trigger)||void 0===jh||jh.focus({preventScroll:!0});Ff.preventDefault()})},(0,yf.createElement)(eH,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:la,onPointerDownOutside:pa,onFocusOutside:Ff=>Ff.preventDefault(),onDismiss:()=>$b.onOpenChange(!1)},(0,yf.createElement)(Sf,df({role:"listbox",id:$b.contentId,"data-state":$b.open?"open":"closed",dir:$b.dir,onContextMenu:Ff=>
|
|||
|
Ff.preventDefault()},b,hh,{onPlaced:()=>Te(!0),ref:g,style:pe({display:"flex",flexDirection:"column",outline:"none"},b.style),onKeyDown:If(b.onKeyDown,Ff=>{var jh=Ff.ctrlKey||Ff.altKey||Ff.metaKey;"Tab"===Ff.key&&Ff.preventDefault();jh||1!==Ff.key.length||jf(Ff.key);if(["ArrowUp","ArrowDown","Home","End"].includes(Ff.key)){let sh=$e().filter(oj=>!oj.disabled).map(oj=>oj.ref.current);["ArrowUp","End"].includes(Ff.key)&&(sh=sh.slice().reverse());["ArrowUp","ArrowDown"].includes(Ff.key)&&(jh=sh.indexOf(Ff.target),
|
|||
|
sh=sh.slice(jh+1));setTimeout(()=>Vd(sh));Ff.preventDefault()}})}))))))}),DH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,onPlaced:G}=b;b=zf(b,["__scopeSelect","onPlaced"]);const Y=ir("SelectContent",p);var la=jr("SelectContent",p);const [pa,Ga]=(0,yf.useState)(null),[Qa,Za]=(0,yf.useState)(null);g=Df(g,Mc=>Za(Mc));const fb=Hu(p),mb=(0,yf.useRef)(!1),Lb=(0,yf.useRef)(!0),{viewport:Tb,selectedItem:Pb,selectedItemText:lc,focusSelectedItem:xc}=la,$b=(0,yf.useCallback)(()=>{if(Y.trigger&&Y.valueNode&&
|
|||
|
pa&&Qa&&Tb&&Pb&&lc){var Mc=Y.trigger.getBoundingClientRect(),Tc=Qa.getBoundingClientRect(),vd=Y.valueNode.getBoundingClientRect(),de=lc.getBoundingClientRect();"rtl"!==Y.dir?(de=vd.left-(de.left-Tc.left),vd=Mc.width+(Mc.left-de),Tc=tg(de,[10,window.innerWidth-10-Math.max(vd,Tc.width)]),pa.style.minWidth=vd+"px",pa.style.left=Tc+"px"):(de=window.innerWidth-vd.right-(Tc.right-de.right),vd=Mc.width+(window.innerWidth-Mc.right-de),Tc=tg(de,[10,window.innerWidth-10-Math.max(vd,Tc.width)]),pa.style.minWidth=
|
|||
|
vd+"px",pa.style.right=Tc+"px");const rf=fb();Tc=window.innerHeight-20;var ne=Tb.scrollHeight,De=window.getComputedStyle(Qa);vd=parseInt(De.borderTopWidth,10);var $e=parseInt(De.paddingTop,10);de=parseInt(De.borderBottomWidth,10);De=parseInt(De.paddingBottom,10);var mf=vd+$e+ne+De+de;ne=Math.min(5*Pb.offsetHeight,mf);var Te=window.getComputedStyle(Tb);De=parseInt(Te.paddingTop,10);Te=parseInt(Te.paddingBottom,10);const Vd=Mc.top+Mc.height/2-10,rd=Tc-Vd;Mc=Pb.offsetHeight/2;$e=vd+$e+(Pb.offsetTop+
|
|||
|
Mc);mf-=$e;$e<=Vd?(vd=Pb===rf[rf.length-1].ref.current,pa.style.bottom="0px",pa.style.height=$e+Math.max(rd,Mc+(vd?Te:0)+(Qa.clientHeight-Tb.offsetTop-Tb.offsetHeight)+de)+"px"):(de=Pb===rf[0].ref.current,pa.style.top="0px",pa.style.height=Math.max(Vd,vd+Tb.offsetTop+(de?De:0)+Mc)+mf+"px",Tb.scrollTop=$e-Vd+Tb.offsetTop);pa.style.margin="10px 0";pa.style.minHeight=ne+"px";pa.style.maxHeight=Tc+"px";null===G||void 0===G||G();requestAnimationFrame(()=>mb.current=!0)}},[fb,Y.trigger,Y.valueNode,pa,Qa,
|
|||
|
Tb,Pb,lc,Y.dir,G]);Om(()=>$b(),[$b]);const [sc,oc]=(0,yf.useState)();Om(()=>{Qa&&oc(window.getComputedStyle(Qa).zIndex)},[Qa]);la=(0,yf.useCallback)(Mc=>{Mc&&!0===Lb.current&&($b(),null===xc||void 0===xc||xc(),Lb.current=!1)},[$b,xc]);return(0,yf.createElement)(EH,{scope:p,contentWrapper:pa,shouldExpandOnScrollRef:mb,onScrollButtonChange:la},(0,yf.createElement)("div",{ref:Ga,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:sc}},(0,yf.createElement)(Fn.div,df({},b,{ref:g,style:pe({boxSizing:"border-box",
|
|||
|
maxHeight:"100%"},b.style)}))))}),$A=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,align:G="start",collisionPadding:Y=10}=b;b=zf(b,["__scopeSelect","align","collisionPadding"]);const la=Dw(p);return(0,yf.createElement)(lH,df({},la,b,{ref:g,align:G,collisionPadding:Y,style:hf(pe({boxSizing:"border-box"},b.style),{"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)",
|
|||
|
"--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"})}))}),[EH,Ew]=cs("SelectContent",{}),FH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p}=b;b=zf(b,["__scopeSelect"]);const G=jr("SelectViewport",p),Y=Ew("SelectViewport",p);g=Df(g,G.onViewportChange);const la=(0,yf.useRef)(0);return(0,yf.createElement)(yf.Fragment,null,(0,yf.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),
|
|||
|
(0,yf.createElement)(Gu.Slot,{scope:p},(0,yf.createElement)(Fn.div,df({"data-radix-select-viewport":"",role:"presentation"},b,{ref:g,style:pe({position:"relative",flex:1,overflow:"auto"},b.style),onScroll:If(b.onScroll,pa=>{pa=pa.currentTarget;const {contentWrapper:Ga,shouldExpandOnScrollRef:Qa}=Y;if(null!==Qa&&void 0!==Qa&&Qa.current&&Ga){var Za=Math.abs(la.current-pa.scrollTop);if(0<Za){var fb=window.innerHeight-20,mb=parseFloat(Ga.style.minHeight);const Lb=parseFloat(Ga.style.height);mb=Math.max(mb,
|
|||
|
Lb);mb<fb&&(Za=mb+Za,fb=Math.min(fb,Za),Za-=fb,Ga.style.height=fb+"px","0px"===Ga.style.bottom&&(pa.scrollTop=0<Za?Za:0,Ga.style.justifyContent="flex-end"))}}la.current=pa.scrollTop})}))))});cs("SelectGroup");var [aB,GH]=cs("SelectItem"),HH=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,value:G,disabled:Y=!1,textValue:la}=b;b=zf(b,["__scopeSelect","value","disabled","textValue"]);const pa=ir("SelectItem",p),Ga=jr("SelectItem",p),Qa=pa.value===G,[Za,fb]=(0,yf.useState)(null!==la&&void 0!==la?la:
|
|||
|
""),[mb,Lb]=(0,yf.useState)(!1);g=Df(g,lc=>{var xc;return null===(xc=Ga.itemRefCallback)||void 0===xc?void 0:xc.call(Ga,lc,G,Y)});const Tb=xi(),Pb=()=>{Y||(pa.onValueChange(G),pa.onOpenChange(!1))};return(0,yf.createElement)(aB,{scope:p,value:G,disabled:Y,textId:Tb,isSelected:Qa,onItemTextChange:(0,yf.useCallback)(lc=>{fb(xc=>{var $b;return xc||(null!==($b=null===lc||void 0===lc?void 0:lc.textContent)&&void 0!==$b?$b:"").trim()})},[])},(0,yf.createElement)(Gu.ItemSlot,{scope:p,value:G,disabled:Y,
|
|||
|
textValue:Za},(0,yf.createElement)(Fn.div,df({role:"option","aria-labelledby":Tb,"data-highlighted":mb?"":void 0,"aria-selected":Qa&&mb,"data-state":Qa?"checked":"unchecked","aria-disabled":Y||void 0,"data-disabled":Y?"":void 0,tabIndex:Y?void 0:-1},b,{ref:g,onFocus:If(b.onFocus,()=>Lb(!0)),onBlur:If(b.onBlur,()=>Lb(!1)),onPointerUp:If(b.onPointerUp,Pb),onPointerMove:If(b.onPointerMove,lc=>{if(Y){var xc;null===(xc=Ga.onItemLeave)||void 0===xc||xc.call(Ga)}else lc.currentTarget.focus({preventScroll:!0})}),
|
|||
|
onPointerLeave:If(b.onPointerLeave,lc=>{if(lc.currentTarget===document.activeElement){var xc;null===(xc=Ga.onItemLeave)||void 0===xc||xc.call(Ga)}}),onKeyDown:If(b.onKeyDown,lc=>{var xc;if(""===(null===(xc=Ga.searchRef)||void 0===xc?void 0:xc.current)||" "!==lc.key)tH.includes(lc.key)&&Pb()," "===lc.key&&lc.preventDefault()})}))))}),IH=(0,yf.forwardRef)((b,g)=>{var {__scopeSelect:p}=b;b=zf(b,["__scopeSelect","className","style"]);const G=ir("SelectItemText",p),Y=jr("SelectItemText",p),la=GH("SelectItemText",
|
|||
|
p);p=xH("SelectItemText",p);const [pa,Ga]=(0,yf.useState)(null);g=Df(g,Lb=>Ga(Lb),la.onItemTextChange,Lb=>{var Tb;return null===(Tb=Y.itemTextRefCallback)||void 0===Tb?void 0:Tb.call(Y,Lb,la.value,la.disabled)});const Qa=null===pa||void 0===pa?void 0:pa.textContent,Za=(0,yf.useMemo)(()=>(0,yf.createElement)("option",{key:la.value,value:la.value,disabled:la.disabled},Qa),[la.disabled,la.value,Qa]),{onNativeOptionAdd:fb,onNativeOptionRemove:mb}=p;Om(()=>{fb(Za);return()=>mb(Za)},[fb,mb,Za]);return(0,yf.createElement)(yf.Fragment,
|
|||
|
null,(0,yf.createElement)(Fn.span,df({id:la.textId},b,{ref:g})),la.isSelected&&G.valueNode&&!G.valueNodeHasChildren?(0,RA.createPortal)(b.children,G.valueNode):null)}),JH=(0,yf.forwardRef)((b,g)=>{const p=jr("SelectScrollUpButton",b.__scopeSelect),G=Ew("SelectScrollUpButton",b.__scopeSelect),[Y,la]=(0,yf.useState)(!1);g=Df(g,G.onScrollButtonChange);Om(()=>{if(p.viewport&&p.isPositioned){let pa=function(){la(0<Ga.scrollTop)};const Ga=p.viewport;pa();Ga.addEventListener("scroll",pa);return()=>Ga.removeEventListener("scroll",
|
|||
|
pa)}},[p.viewport,p.isPositioned]);return Y?(0,yf.createElement)(bB,df({},b,{ref:g,onAutoScroll:()=>{const {viewport:pa,selectedItem:Ga}=p;pa&&Ga&&(pa.scrollTop-=Ga.offsetHeight)}})):null}),KH=(0,yf.forwardRef)((b,g)=>{const p=jr("SelectScrollDownButton",b.__scopeSelect),G=Ew("SelectScrollDownButton",b.__scopeSelect),[Y,la]=(0,yf.useState)(!1);g=Df(g,G.onScrollButtonChange);Om(()=>{if(p.viewport&&p.isPositioned){let pa=function(){la(Math.ceil(Ga.scrollTop)<Ga.scrollHeight-Ga.clientHeight)};const Ga=
|
|||
|
p.viewport;pa();Ga.addEventListener("scroll",pa);return()=>Ga.removeEventListener("scroll",pa)}},[p.viewport,p.isPositioned]);return Y?(0,yf.createElement)(bB,df({},b,{ref:g,onAutoScroll:()=>{const {viewport:pa,selectedItem:Ga}=p;pa&&Ga&&(pa.scrollTop+=Ga.offsetHeight)}})):null}),bB=(0,yf.forwardRef)((b,g)=>{const {__scopeSelect:p,onAutoScroll:G}=b;b=zf(b,["__scopeSelect","onAutoScroll"]);const Y=jr("SelectScrollButton",p),la=(0,yf.useRef)(null),pa=Hu(p),Ga=(0,yf.useCallback)(()=>{null!==la.current&&
|
|||
|
(window.clearInterval(la.current),la.current=null)},[]);(0,yf.useEffect)(()=>()=>Ga(),[Ga]);Om(()=>{var Qa;const Za=pa().find(fb=>fb.ref.current===document.activeElement);null===Za||void 0===Za||null===(Qa=Za.ref.current)||void 0===Qa||Qa.scrollIntoView({block:"nearest"})},[pa]);return(0,yf.createElement)(Fn.div,df({"aria-hidden":!0},b,{ref:g,style:pe({flexShrink:0},b.style),onPointerMove:If(b.onPointerMove,()=>{var Qa;null===(Qa=Y.onItemLeave)||void 0===Qa||Qa.call(Y);null===la.current&&(la.current=
|
|||
|
window.setInterval(G,50))}),onPointerLeave:If(b.onPointerLeave,()=>{Ga()})}))}),cB=(0,yf.forwardRef)((b,g)=>{const {value:p}=b;b=zf(b,["value"]);const G=(0,yf.useRef)(null);g=Df(g,G);const Y=Vf(p);(0,yf.useEffect)(()=>{const la=G.current,pa=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(Y!==p&&pa){const Ga=new Event("change",{bubbles:!0});pa.call(la,p);la.dispatchEvent(Ga)}},[Y,p]);return(0,yf.createElement)(rH,{asChild:!0},(0,yf.createElement)("select",df({},b,
|
|||
|
{ref:g,defaultValue:p})))});cB.displayName="BubbleSelect";var LH=b=>{const {__scopeSelect:g,children:p,open:G,defaultOpen:Y,onOpenChange:la,value:pa,defaultValue:Ga,onValueChange:Qa,dir:Za,name:fb,autoComplete:mb,disabled:Lb,required:Tb}=b,Pb=Dw(g),[lc,xc]=(0,yf.useState)(null),[$b,sc]=(0,yf.useState)(null),[oc,Mc]=(0,yf.useState)(!1),Tc=Ub(Za),[vd=!1,de]=Kj({prop:G,defaultProp:Y,onChange:la}),[ne,De]=Kj({prop:pa,defaultProp:Ga,onChange:Qa}),$e=(0,yf.useRef)(null),mf=lc?!!lc.closest("form"):!0,[Te,
|
|||
|
rf]=(0,yf.useState)(new Set),Vd=Array.from(Te).map(rd=>rd.props.value).join(";");return(0,yf.createElement)(oH,Pb,(0,yf.createElement)(vH,{required:Tb,scope:g,trigger:lc,onTriggerChange:xc,valueNode:$b,onValueNodeChange:sc,valueNodeHasChildren:oc,onValueNodeHasChildrenChange:Mc,contentId:xi(),value:ne,onValueChange:De,open:vd,onOpenChange:de,dir:Tc,triggerPointerDownPosRef:$e,disabled:Lb},(0,yf.createElement)(Gu.Provider,{scope:g},(0,yf.createElement)(wH,{scope:b.__scopeSelect,onNativeOptionAdd:(0,yf.useCallback)(rd=>
|
|||
|
{rf(sd=>(new Set(sd)).add(rd))},[]),onNativeOptionRemove:(0,yf.useCallback)(rd=>{rf(sd=>{sd=new Set(sd);sd.delete(rd);return sd})},[])},p)),mf?(0,yf.createElement)(cB,{key:Vd,"aria-hidden":!0,required:Tb,tabIndex:-1,name:fb,autoComplete:mb,value:ne,onChange:rd=>De(rd.target.value),disabled:Lb},void 0===ne?(0,yf.createElement)("option",{value:""}):null,Array.from(Te)):null))},MH=yH,NH=zH,OH=AH,PH=b=>(0,yf.createElement)(qH,df({asChild:!0},b)),QH=BH,RH=FH,SH=HH,TH=IH,UH=JH,VH=KH;tb=W(588);tb=W(588);
|
|||
|
tb=W(588);var WH=cf(function(){const b=Ye(),g=Cu.useCallback(la=>{b.api.setColor(la)},[]),p=Cu.useCallback(la=>{(la=la.currentTarget.dataset.tool)&&b.selectTool(la)},[]),[G,Y]=Cu.useState(()=>{var la;return null!=(la=Object.values(Up).find(pa=>pa===b.selectedTool.id))?la:Object.values(Up)[0]});Cu.useEffect(()=>{Y(la=>{var pa;return null!=(pa=Object.values(Up).find(Ga=>Ga===b.selectedTool.id))?pa:la})},[b.selectedTool.id]);return(0,tb.jsx)("div",{className:"tl-primary-tools","data-html2canvas-ignore":"true",
|
|||
|
children:(0,tb.jsxs)("div",{className:"tl-toolbar tl-tools-floating-panel",children:[(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("select"),tooltip:"Select",id:"select",icon:"select-cursor"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("move"),tooltip:"Pan",id:"move",icon:b.isIn("move.panning")?"hand-grab":"hand-stop"}),(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"horizontal"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("logseq-portal"),tooltip:"Add block or page",id:"logseq-portal",
|
|||
|
icon:"circle-plus"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("pencil"),tooltip:"Draw",id:"pencil",icon:"ballpen"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("highlighter"),tooltip:"Highlight",id:"highlighter",icon:"highlight"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("erase"),tooltip:"Eraser",id:"erase",icon:"eraser"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("line"),tooltip:"Connector",id:"line",icon:"connector"}),(0,tb.jsx)(lp,{handleClick:()=>b.selectTool("text"),tooltip:"Text",id:"text",
|
|||
|
icon:"text"}),(0,tb.jsx)(HA,{activeGeometry:G,setGeometry:p}),(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"horizontal",style:{margin:"0 -4px"}}),(0,tb.jsx)(pg,{popoverSide:"left",color:b.settings.color,setColor:g}),(0,tb.jsx)(Jh,{scaleLevel:b.settings.scaleLevel,popoverSide:"left",compact:!0})]})})});tb=W(588);var XH=cf(function(){const b=Ye();return(0,tb.jsxs)("div",{className:"tl-statusbar","data-html2canvas-ignore":"true",children:[b.selectedTool.id," | ",b.selectedTool.currentState.id,
|
|||
|
(0,tb.jsx)("div",{style:{flex:1}}),(0,tb.jsx)("div",{id:"tl-statusbar-anchor",className:"flex gap-1"})]})});tb=W(588);var YH=cf(function(){const b=Ye();return(0,tb.jsxs)(tb.Fragment,{children:[wh()&&(0,tb.jsx)(XH,{}),wh()&&(0,tb.jsx)(HG,{}),!b.readOnly&&(0,tb.jsx)(WH,{}),(0,tb.jsx)(FG,{})]})}),mt=sf(W(22)),Gp=sf(W(22)),ZH=sf(W(22)),$H=sf(W(22));tb=W(588);var dB=({id:b,showReferenceContent:g=!1})=>{var p;const {handlers:{isWhiteboardPage:G,redirectToPage:Y,sidebarAddBlock:la,queryBlockByUUID:pa},renderers:{Breadcrumb:Ga,
|
|||
|
PageName:Qa}}=$H.default.useContext(an);var Za="";let fb=dk(b)?"B":"P",mb="";if(dk(b)){Za=pa(b);if(!Za)return(0,tb.jsx)("span",{className:"p-2",children:"Invalid reference. Did you remove it?"});mb=Za.content;Za="whiteboard-shape"===(null==(p=Za.properties)?void 0:p["ls-type"])?"link-to-whiteboard":"link-to-block"}else Za=G(b)?"link-to-whiteboard":"link-to-page";p=mb&&23<mb.length?mb.slice(0,20)+"...":mb;return(0,tb.jsxs)("button",{className:"inline-flex gap-1 items-center w-full",onPointerDown:Lb=>
|
|||
|
{Lb.stopPropagation();Lb.shiftKey?la(b,"B"===fb?"block":"page"):Y(b)},children:[(0,tb.jsx)(Bh,{name:Za}),(0,tb.jsx)("span",{className:"pointer-events-none block-link-reference-row",children:"P"===fb?(0,tb.jsx)(Qa,{pageName:b}):(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)(Ga,{levelLimit:1,blockId:b,endSeparator:g}),g&&p]})})]})},Pm=sf(W(22)),Pn=W(22),aI=["children"],Iu="undefined"!==typeof document?Pn.useLayoutEffect:Pn.useEffect,gh=sf(W(22)),hi=W(22),bI=W(31),nt,Em,cI="undefined"!=typeof document?
|
|||
|
hi.useLayoutEffect:hi.useEffect;!function(b){b[b.DEBUG=0]="DEBUG";b[b.INFO=1]="INFO";b[b.WARN=2]="WARN";b[b.ERROR=3]="ERROR"}(Em||={});var dI=((nt={})[Em.DEBUG]="debug",nt[Em.INFO]="log",nt[Em.WARN]="warn",nt[Em.ERROR]="error",nt),mq=qh(function(){var b=Pd(Em.ERROR);return{log:Pd(function(g,p,G){var Y;void 0===G&&(G=Em.INFO);G>=(null!=(Y=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?Y:b(4))&&console[dI[G]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",
|
|||
|
g,p)}),logLevel:b}},[],{singleton:!0}),Qn=qh(function(){var b=Uf(),g=Uf(),p=Pd(0),G=Uf(),Y=Pd(0),la=Uf(),pa=Uf(),Ga=Pd(0),Qa=Pd(0),Za=Pd(0),fb=Pd(0),mb=Uf(),Lb=Uf(),Tb=Pd(!1),Pb=Pd(!1);return $d(Ge(b,$f(function(lc){return lc.scrollTop})),g),$d(Ge(b,$f(function(lc){return lc.scrollHeight})),pa),$d(g,Y),{scrollContainerState:b,scrollTop:g,viewportHeight:la,headerHeight:Ga,fixedHeaderHeight:Qa,fixedFooterHeight:Za,footerHeight:fb,scrollHeight:pa,smoothScrollTargetReached:G,react18ConcurrentRendering:Pb,
|
|||
|
scrollTo:mb,scrollBy:Lb,statefulScrollTop:Y,deviation:p,scrollingInProgress:Tb}},[],{singleton:!0}),Oi={lvl:0},Fw=qh(function(){return{recalcInProgress:Pd(!1)}},[],{singleton:!0}),eI={offsetHeight:"height",offsetWidth:"width"},Hp=qh(function(b){var g=b[0].log,p=b[1].recalcInProgress;b=Uf();var G=Uf(),Y=Qi(G,0),la=Uf(),pa=Uf(),Ga=Pd(0),Qa=Pd([]),Za=Pd(void 0),fb=Pd(void 0),mb=Pd(function(sc,oc){return gl(sc,eI[oc])}),Lb=Pd(void 0),Tb=Pd(0),Pb={offsetTree:[],sizeTree:Oi,groupOffsetTree:Oi,lastIndex:0,
|
|||
|
lastOffset:0,lastSize:0,groupIndices:[]},lc=Qi(Ge(b,eg(Qa,g,Tb),ol(Bi,Pb),kg()),Pb);$d(Ge(Qa,Ug(function(sc){return 0<sc.length}),eg(lc,Tb),$f(function(sc){var oc=sc[0],Mc=sc[1],Tc=sc[2];sc=oc.reduce(function(vd,de,ne){return ua(vd,de,Gh(de,Mc.offsetTree,Tc)||ne)},Oi);return mg({},Mc,{groupIndices:oc,groupOffsetTree:sc})})),lc);$d(Ge(G,eg(lc),Ug(function(sc){return sc[0]<sc[1].lastIndex}),$f(function(sc){var oc=sc[1];return[{startIndex:sc[0],endIndex:oc.lastIndex,size:oc.lastSize}]})),b);$d(Za,fb);
|
|||
|
var xc=Qi(Ge(Za,$f(function(sc){return void 0===sc})),!0);$d(Ge(fb,Ug(function(sc){return void 0!==sc&&lc(4).sizeTree===Oi}),$f(function(sc){return[{startIndex:0,endIndex:0,size:sc}]})),b);Pb=pj(Ge(b,eg(lc),ol(function(sc,oc){oc=oc[1];return{changed:oc!==sc.sizes,sizes:oc}},{changed:!1,sizes:Pb}),$f(function(sc){return sc.changed})));dg(Ge(Ga,ol(function(sc,oc){return{diff:sc.prev-oc,prev:oc}},{diff:0,prev:0}),$f(function(sc){return sc.diff})),function(sc){0<sc?(p(0,!0),la(0,sc)):0>sc&&pa(0,sc)});
|
|||
|
dg(Ge(Ga,eg(g)),function(sc){0>sc[0]&&(0,sc[1])("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:Ga},Em.ERROR)});g=pj(la);$d(Ge(la,eg(lc),$f(function(sc){var oc=sc[0];sc=sc[1];if(0<sc.groupIndices.length)throw Error("Virtuoso: prepending items does not work with groups");return $a(sc.sizeTree).reduce(function(Mc,Tc){var vd=Tc.k;Tc=Tc.v;return{ranges:[].concat(Mc.ranges,[{startIndex:Mc.prevIndex,endIndex:vd+oc-
|
|||
|
1,size:Mc.prevSize}]),prevIndex:vd+oc,prevSize:Tc}},{ranges:[],prevIndex:0,prevSize:sc.lastSize}).ranges})),b);var $b=pj(Ge(pa,eg(lc,Tb),$f(function(sc){return Gh(-sc[0],sc[1].offsetTree,sc[2])})));return $d(Ge(pa,eg(lc,Tb),$f(function(sc){var oc=sc[0],Mc=sc[1];sc=sc[2];if(0<Mc.groupIndices.length)throw Error("Virtuoso: shifting items does not work with groups");var Tc=$a(Mc.sizeTree).reduce(function(vd,de){return ua(vd,Math.max(0,de.k+oc),de.v)},Oi);return mg({},Mc,{sizeTree:Tc},ai(Mc.offsetTree,
|
|||
|
0,Tc,sc))})),lc),{data:Lb,totalCount:G,sizeRanges:b,groupIndices:Qa,defaultItemSize:fb,fixedItemSize:Za,unshiftWith:la,shiftWith:pa,shiftWithOffset:$b,beforeUnshiftWith:g,firstItemIndex:Ga,gap:Tb,sizes:lc,listRefresh:Pb,statefulTotalCount:Y,trackItemSizes:xc,itemSize:mb}},re(mq,Fw),{singleton:!0}),fI="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style,ot=qh(function(b){function g(){xc&&(xc(),xc=null);sc&&(sc(),sc=null);$b&&(clearTimeout($b),$b=null);Ga(0,!1)}var p=b[0],
|
|||
|
G=p.sizes,Y=p.totalCount,la=p.listRefresh;p=p.gap;var pa=b[1],Ga=pa.scrollingInProgress,Qa=pa.viewportHeight,Za=pa.scrollTo,fb=pa.smoothScrollTargetReached,mb=pa.headerHeight,Lb=pa.footerHeight,Tb=pa.fixedHeaderHeight;pa=pa.fixedFooterHeight;b=b[2].log;var Pb=Uf(),lc=Pd(0),xc=null,$b=null,sc=null;return $d(Ge(Pb,eg(G,Qa,Y,lc,mb,Lb,b),eg(p,Tb,pa),$f(function(oc){var Mc=oc[0],Tc=Mc[0],vd=Mc[1],de=Mc[2],ne=Mc[3],De=Mc[4],$e=Mc[5],mf=Mc[6],Te=Mc[7],rf=oc[1];Mc=oc[2];oc=oc[3];var Vd=Ch(Tc),rd=Vd.align,
|
|||
|
sd=Vd.behavior,ud=Vd.offset;--ne;Vd=ig(Vd,vd,ne);$e=Gh(Vd,vd.offsetTree,rf)+$e;"end"===rd?($e+=Mc+xa(vd.sizeTree,Vd)[1]-de+oc,Vd===ne&&($e+=mf)):"center"===rd?$e+=(Mc+xa(vd.sizeTree,Vd)[1]-de+oc)/2:$e-=De;ud&&($e+=ud);var ie=function(tf){g();tf?(Te("retrying to scroll to",{location:Tc},Em.DEBUG),Pb(0,Tc)):Te("list did not change, scroll successful",{},Em.DEBUG)};if(g(),"smooth"===sd){var jf=!1;sc=dg(la,function(tf){jf=jf||tf});xc=Ke(fb,function(){ie(jf)})}else xc=Ke(Ge(la,function(tf){var gg=setTimeout(function(){tf(!1)},
|
|||
|
150);return function(Bf){Bf&&(tf(!0),clearTimeout(gg))}}),ie);$b=setTimeout(function(){g()},1200);Ga(0,!0);return Te("scrolling from index to",{index:Vd,top:$e,behavior:sd},Em.DEBUG),{top:$e,behavior:sd}})),Za),{scrollToIndex:Pb,topListHeight:lc}},re(Hp,Qn,mq),{singleton:!0}),gI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},pt=qh(function(b){var g=b[0],p=g.scrollContainerState;b=g.scrollTop;var G=g.viewportHeight,Y=g.headerHeight,
|
|||
|
la=g.footerHeight,pa=g.scrollBy;g=Pd(!1);var Ga=Pd(!0),Qa=Uf(),Za=Uf(),fb=Pd(4),mb=Pd(0),Lb=Qi(Ge(pi(Ge(Ah(b),Uk(1),Pf(!0)),Ge(Ah(b),Uk(1),Pf(!1),Hl(100))),kg()),!1),Tb=Qi(Ge(pi(Ge(pa,Pf(!0)),Ge(pa,Pf(!1),Hl(200))),kg()),!1);$d(Ge(Ki(Ah(b),Ah(mb)),$f(function(Pb){return Pb[0]<=Pb[1]}),kg()),Ga);$d(Ge(Ga,Jf(50)),Za);G=pj(Ge(Ki(p,Ah(G),Ah(Y),Ah(la),Ah(fb)),ol(function(Pb,lc){var xc,$b,sc=lc[0],oc=sc.scrollTop;sc=sc.scrollHeight;var Mc=lc[1],Tc={viewportHeight:Mc,scrollTop:oc,scrollHeight:sc};return oc+
|
|||
|
Mc-sc>-lc[4]?(oc>Pb.state.scrollTop?(xc="SCROLLED_DOWN",$b=Pb.state.scrollTop-oc):(xc="SIZE_DECREASED",$b=Pb.state.scrollTop-oc||Pb.scrollTopDelta),{atBottom:!0,state:Tc,atBottomBecause:xc,scrollTopDelta:$b}):{atBottom:!1,notAtBottomBecause:Tc.scrollHeight>Pb.state.scrollHeight?"SIZE_INCREASED":Mc<Pb.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":oc<Pb.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:Tc}},gI),kg(function(Pb,lc){return Pb&&Pb.atBottom===lc.atBottom})));
|
|||
|
Y=Qi(Ge(p,ol(function(Pb,lc){var xc=lc.scrollTop,$b=lc.scrollHeight;lc=lc.viewportHeight;return 1.01>Math.abs(Pb.scrollHeight-$b)?{scrollTop:xc,scrollHeight:$b,jump:0,changed:!1}:Pb.scrollTop!==xc&&1>$b-(xc+lc)?{scrollHeight:$b,scrollTop:xc,jump:Pb.scrollTop-xc,changed:!0}:{scrollHeight:$b,scrollTop:xc,jump:0,changed:!0}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Ug(function(Pb){return Pb.changed}),$f(function(Pb){return Pb.jump})),0);$d(Ge(G,$f(function(Pb){return Pb.atBottom})),g);$d(Ge(g,
|
|||
|
Jf(50)),Qa);la=Pd("down");$d(Ge(p,$f(function(Pb){return Pb.scrollTop}),kg(),ol(function(Pb,lc){return Tb(4)?{direction:Pb.direction,prevScrollTop:lc}:{direction:lc<Pb.prevScrollTop?"up":"down",prevScrollTop:lc}},{direction:"down",prevScrollTop:0}),$f(function(Pb){return Pb.direction})),la);$d(Ge(p,Jf(50),Pf("none")),la);p=Pd(0);return $d(Ge(Lb,Ug(function(Pb){return!Pb}),Pf(0)),p),$d(Ge(b,Jf(100),eg(Lb),Ug(function(Pb){return!!Pb[1]}),ol(function(Pb,lc){return[Pb[1],lc[0]]},[0,0]),$f(function(Pb){return Pb[1]-
|
|||
|
Pb[0]})),p),{isScrolling:Lb,isAtTop:Ga,isAtBottom:g,atBottomState:G,atTopStateChange:Za,atBottomStateChange:Qa,scrollDirection:la,atBottomThreshold:fb,atTopThreshold:mb,scrollVelocity:p,lastJumpDueToItemResize:Y}},re(Qn)),kr=qh(function(b){var g=b[0].log;b=Pd(!1);var p=pj(Ge(b,Ug(function(G){return G}),kg()));return dg(b,function(G){G&&g(4)("props updated",{},Em.DEBUG)}),{propsReady:b,didMount:p}},re(mq),{singleton:!0}),Gw=qh(function(b){var g=b[0],p=g.sizes,G=g.listRefresh;g=g.defaultItemSize;var Y=
|
|||
|
b[1].scrollTop,la=b[2].scrollToIndex;b=b[3].didMount;var pa=Pd(!0),Ga=Pd(0);return $d(Ge(b,eg(Ga),Ug(function(Qa){return!!Qa[1]}),Pf(!1)),pa),dg(Ge(Ki(G,b),eg(pa,p,g),Ug(function(Qa){var Za=Qa[1],fb=Qa[3];return Qa[0][1]&&(Qa[2].sizeTree!==Oi||void 0!==fb)&&!Za}),eg(Ga)),function(Qa){var Za=Qa[1];setTimeout(function(){Ke(Y,function(){pa(0,!0)});la(0,Za)})}),{scrolledToInitialItem:pa,initialTopMostItemIndex:Ga}},re(Hp,Qn,ot,kr),{singleton:!0}),hI=qh(function(b){function g(lc){Qa(0,{index:"LAST",align:"end",
|
|||
|
behavior:lc})}function p(lc){var xc=Ke(Ga,function($b){!lc||$b.atBottom||"SIZE_INCREASED"!==$b.notAtBottomBecause||Pb||(mb(4)("scrolling to bottom due to increased size",{},Em.DEBUG),g("auto"))});setTimeout(xc,100)}var G=b[0],Y=G.totalCount,la=G.listRefresh,pa=b[1];G=pa.isAtBottom;var Ga=pa.atBottomState,Qa=b[2].scrollToIndex;pa=b[3].scrolledToInitialItem;var Za=b[4],fb=Za.propsReady;Za=Za.didMount;var mb=b[5].log;b=b[6].scrollingInProgress;var Lb=Pd(!1),Tb=Uf(),Pb=null;return dg(Ge(Ki(Ge(Ah(Y),Uk(1)),
|
|||
|
Za),eg(Ah(Lb),G,pa,b),$f(function(lc){var xc=lc[0],$b=xc[0];xc=xc[1]&&lc[3];var sc="auto";xc&&(sc=lc[1],lc=lc[2]||lc[4],sc="function"==typeof sc?ih(sc(lc)):lc&&ih(sc),xc=xc&&!!sc);return{totalCount:$b,shouldFollow:xc,followOutputBehavior:sc}}),Ug(function(lc){return lc.shouldFollow})),function(lc){var xc=lc.totalCount,$b=lc.followOutputBehavior;Pb&&(Pb(),Pb=null);Pb=Ke(la,function(){mb(4)("following output to ",{totalCount:xc},Em.DEBUG);g($b);Pb=null})}),dg(Ge(Ki(Ah(Lb),Y,fb),Ug(function(lc){return lc[0]&&
|
|||
|
lc[2]}),ol(function(lc,xc){xc=xc[1];return{refreshed:lc.value===xc,value:xc}},{refreshed:!1,value:0}),Ug(function(lc){return lc.refreshed}),eg(Lb,Y)),function(lc){p(!1!==lc[1])}),dg(Tb,function(){p(!1!==Lb(4))}),dg(Ki(Ah(Lb),Ga),function(lc){var xc=lc[1];lc[0]&&!xc.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===xc.notAtBottomBecause&&g("auto")}),{followOutput:Lb,autoscrollToBottom:Tb}},re(Hp,pt,ot,Gw,kr,mq,Qn)),eB=qh(function(b){var g=b[0],p=g.totalCount,G=g.groupIndices;g=g.sizes;var Y=b[1];b=Y.scrollTop;
|
|||
|
Y=Y.headerHeight;var la=Uf(),pa=Uf(),Ga=pj(Ge(la,$f(Cj)));return $d(Ge(Ga,$f(function(Qa){return Qa.totalCount})),p),$d(Ge(Ga,$f(function(Qa){return Qa.groupIndices})),G),$d(Ge(Ki(b,g,Y),Ug(function(Qa){return Qa[1].groupOffsetTree!==Oi}),$f(function(Qa){return xa(Qa[1].groupOffsetTree,Math.max(Qa[0]-Qa[2],0),"v")[0]}),kg(),$f(function(Qa){return[Qa]})),pa),{groupCounts:la,topItemsIndexes:pa}},re(Hp,Qn)),Hw=qh(function(b){var g=b[0];b=g.scrollTop;var p=g.viewportHeight,G=g.deviation,Y=g.headerHeight,
|
|||
|
la=g.fixedHeaderHeight;g=Uf();var pa=Pd(0),Ga=Pd(0),Qa=Pd(0);b=Qi(Ge(Ki(Ah(b),Ah(p),Ah(Y),Ah(g,li),Ah(Qa),Ah(pa),Ah(la),Ah(G),Ah(Ga)),$f(function(Za){var fb=Za[0],mb=Za[1],Lb=Za[2],Tb=Za[3],Pb=Tb[0];Tb=Tb[1];var lc=Za[4],xc=Za[6],$b=Za[7],sc=Za[8],oc=fb-$b;Za=Za[5]+xc;var Mc=Math.max(Lb-oc,0),Tc="none",vd="number"==typeof sc?sc:sc.top||0;sc="number"==typeof sc?sc:sc.bottom||0;return Pb-=$b,Tb+=Lb+xc,Pb+(Lb+xc)>fb+Za-vd&&(Tc="up"),Tb-$b<fb-Mc+mb+sc&&(Tc="down"),"none"!==Tc?[Math.max(oc-Lb-Pl(lc,"top",
|
|||
|
Tc)-vd,0),oc-Mc-xc+mb+Pl(lc,"bottom",Tc)+sc]:null}),Ug(function(Za){return null!=Za}),kg(li)),[0,0]);return{listBoundary:g,overscan:Qa,topListHeight:pa,increaseViewportBy:Ga,visibleRange:b}},re(Qn),{singleton:!0}),fB={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0},ds=qh(function(b){var g=b[0],p=g.sizes,G=g.totalCount,Y=g.data,la=g.firstItemIndex,pa=g.gap,Ga=b[1],Qa=b[2],Za=Qa.visibleRange;g=Qa.listBoundary;Qa=Qa.topListHeight;var fb=b[3],
|
|||
|
mb=fb.scrolledToInitialItem,Lb=fb.initialTopMostItemIndex;fb=b[4].topListHeight;var Tb=b[5],Pb=b[6].didMount,lc=b[7].recalcInProgress;b=Pd([]);var xc=Uf();$d(Ga.topItemsIndexes,b);p=Qi(Ge(Ki(Pb,lc,Ah(Za,li),Ah(G),Ah(p),Ah(Lb),mb,Ah(b),Ah(la),Ah(pa),Y),Ug(function($b){return $b[0]&&!$b[1]}),$f(function($b){var sc=$b[2],oc=sc[0],Mc=sc[1];sc=$b[3];var Tc=$b[5],vd=$b[6],de=$b[7],ne=$b[8],De=$b[9],$e=$b[10];$b=$b[4];var mf=$b.sizeTree,Te=$b.offsetTree;if(0===sc||0===oc&&0===Mc)return mg({},fB,{totalCount:sc});
|
|||
|
if(mf===Oi)return im(function(Bf,Sf,hh){return Sf.groupOffsetTree!==Oi?(Bf=Rf(Bf,Sf),[{index:xa(Sf.groupOffsetTree,Bf)[0],size:0,offset:0},{index:Bf,size:0,offset:0,data:hh&&hh[0]}]):[{index:Bf,size:0,offset:0,data:hh&&hh[0]}]}("number"==typeof Tc?Tc:"LAST"===Tc.index?sc-1:Tc.index,$b,$e),[],sc,De,$b,ne);Tc=[];if(0<de.length){var rf,Vd=de[0],rd=de[de.length-1],sd=0;for(mf=Wl(Fd(mf,Vd,rd));!(rf=mf()).done;){var ud=rf.value;rf=ud.value;var ie=Math.min(ud.end,rd);for(ud=Math.max(ud.start,Vd);ud<=ie;ud++)Tc.push({index:ud,
|
|||
|
size:rf,offset:sd,data:$e&&$e[ud]}),sd+=rf}}if(!vd)return im([],Tc,sc,De,$b,ne);var jf=0<de.length?de[de.length-1]+1:0,tf=function(Bf,Sf,hh,Ff){return void 0===Ff&&(Ff=0),0<Ff&&(Sf=Math.max(Sf,Bf[Cf(Bf,Ff,tj)].offset)),Md((sh=hh,kl=Cf(jh=Bf,Sf,oj=yg),ll=Cf(jh,sh,oj,kl),jh.slice(kl,ll+1)),nh);var jh,sh,oj,kl,ll}(Te,oc,Mc,jf);if(0===tf.length)return null;var gg=sc-1;return im($k([],function(Bf){for(var Sf,hh=Wl(tf);!(Sf=hh()).done;){var Ff=Sf.value,jh=Ff.value;Sf=jh.offset;var sh=Ff.start,oj=jh.size;
|
|||
|
jh.offset<oc&&(jh=(sh+=Math.floor((oc-jh.offset+De)/(oj+De)))-Ff.start,Sf+=jh*oj+jh*De);sh<jf&&(Sf+=(jf-sh)*oj,sh=jf);for(Ff=Math.min(Ff.end,gg);sh<=Ff&&!(Sf>=Mc);sh++)Bf.push({index:sh,size:oj,offset:Sf,data:$e&&$e[sh]}),Sf+=oj+De}}),Tc,sc,De,$b,ne)}),Ug(function($b){return null!==$b}),kg()),fB);return $d(Ge(Y,Ug(function($b){return void 0!==$b}),$f(function($b){return $b.length})),G),$d(Ge(p,$f(function($b){return $b.topListHeight})),fb),$d(fb,Qa),$d(Ge(p,$f(function($b){return[$b.top,$b.bottom]})),
|
|||
|
g),$d(Ge(p,$f(function($b){return $b.items})),xc),mg({listState:p,topItemsIndexes:b,endReached:pj(Ge(p,Ug(function($b){return 0<$b.items.length}),eg(G,Y),Ug(function($b){var sc=$b[0].items;return sc[sc.length-1].originalIndex===$b[1]-1}),$f(function($b){return[$b[1]-1,$b[2]]}),kg(li),$f(function($b){return $b[0]}))),startReached:pj(Ge(p,Jf(200),Ug(function($b){var sc=$b.items;return 0<sc.length&&sc[0].originalIndex===$b.topItems.length}),$f(function($b){return $b.items[0].index}),kg())),rangeChanged:pj(Ge(p,
|
|||
|
Ug(function($b){return 0<$b.items.length}),$f(function($b){$b=$b.items;for(var sc=0,oc=$b.length-1;"group"===$b[sc].type&&sc<oc;)sc++;for(;"group"===$b[oc].type&&oc>sc;)oc--;return{startIndex:$b[sc].index,endIndex:$b[oc].index}}),kg(Xj))),itemsRendered:xc},Tb)},re(Hp,eB,Hw,Gw,ot,pt,kr,Fw),{singleton:!0}),iI=qh(function(b){var g=b[0],p=g.sizes,G=g.firstItemIndex,Y=g.data;g=g.gap;var la=b[1].listState;b=b[2].didMount;var pa=Pd(0);return $d(Ge(b,eg(pa),Ug(function(Ga){return 0!==Ga[1]}),eg(p,G,g,Y),
|
|||
|
$f(function(Ga){var Qa=Ga[0][1],Za=Ga[1],fb=Ga[2],mb=Ga[3];Ga=Ga[4];var Lb=void 0===Ga?[]:Ga;Ga=0;if(0<Za.groupIndices.length)for(var Tb,Pb=Wl(Za.groupIndices);!((Tb=Pb()).done||Tb.value-Ga>=Qa);)Ga++;Qa+=Ga;return im(Array.from({length:Qa}).map(function(lc,xc){return{index:xc,size:0,offset:0,data:Lb[xc]}}),[],Qa,mb,Za,fb)})),la),{initialItemCount:pa}},re(Hp,ds,kr),{singleton:!0}),gB=qh(function(b){b=b[0].scrollVelocity;var g=Pd(!1),p=Uf(),G=Pd(!1);return $d(Ge(b,eg(G,g,p),Ug(function(Y){return!!Y[1]}),
|
|||
|
$f(function(Y){var la=Y[0],pa=Y[1],Ga=Y[2];Y=Y[3];var Qa=pa.enter;if(Ga){if((0,pa.exit)(la,Y))return!1}else if(Qa(la,Y))return!0;return Ga}),kg()),g),dg(Ge(Ki(g,b,p),eg(G)),function(Y){var la=Y[0];Y=Y[1];return la[0]&&Y&&Y.change&&Y.change(la[1],la[2])}),{isSeeking:g,scrollSeekConfiguration:G,scrollVelocity:b,scrollSeekRangeChanged:p}},re(pt),{singleton:!0}),jI=qh(function(b){b=b[0].topItemsIndexes;var g=Pd(0);return $d(Ge(g,Ug(function(p){return 0<p}),$f(function(p){return Array.from({length:p}).map(function(G,
|
|||
|
Y){return Y})})),b),{topItemCount:g}},re(ds)),Iw=qh(function(b){var g=b[0],p=g.footerHeight,G=g.headerHeight,Y=g.fixedHeaderHeight;g=g.fixedFooterHeight;var la=b[1].listState;b=Uf();p=Qi(Ge(Ki(p,g,G,Y,la),$f(function(pa){var Ga=pa[4];return pa[0]+pa[1]+pa[2]+pa[3]+Ga.offsetBottom+Ga.bottom})),0);return $d(Ah(p),b),{totalListHeight:p,totalListHeightChanged:b}},re(Qn,ds),{singleton:!0}),kI=ap(function(){return/iP(ad|hone|od).+Version\/[\d.]+.*Safari/i.test(navigator.userAgent)}),lI=qh(function(b){function g(xc){0<
|
|||
|
xc?(G(0,{top:-xc,behavior:"auto"}),la(0,0)):(la(0,0),G(0,{top:-xc,behavior:"auto"}))}var p=b[0],G=p.scrollBy,Y=p.scrollTop,la=p.deviation,pa=p.scrollingInProgress,Ga=b[1];p=Ga.isScrolling;var Qa=Ga.isAtBottom,Za=Ga.scrollDirection,fb=b[3],mb=fb.beforeUnshiftWith,Lb=fb.shiftWithOffset,Tb=fb.sizes;fb=fb.gap;var Pb=b[4].log,lc=b[5].recalcInProgress;b=pj(Ge(b[2].listState,eg(Ga.lastJumpDueToItemResize),ol(function(xc,$b){var sc=xc[1],oc=$b[0],Mc=oc.items,Tc=oc.totalCount;oc=oc.bottom+oc.offsetBottom;
|
|||
|
var vd=0;return xc[2]===Tc&&0<sc.length&&0<Mc.length&&(0===Mc[0].originalIndex&&0===sc[0].originalIndex||0!=(vd=oc-xc[3])&&(vd+=$b[1])),[vd,Mc,Tc,oc]},[0,[],0,0]),Ug(function(xc){return 0!==xc[0]}),eg(Y,Za,pa,Qa,Pb),Ug(function(xc){return!xc[3]&&0!==xc[1]&&"up"===xc[2]}),$f(function(xc){var $b=xc[0][0];return(0,xc[5])("Upward scrolling compensation",{amount:$b},Em.DEBUG),$b})));return dg(Ge(b,eg(la,p)),function(xc){var $b=xc[0],sc=xc[1];xc[2]&&kI()?la(0,sc-$b):g(-$b)}),dg(Ge(Ki(Qi(p,!1),la,lc),Ug(function(xc){return!xc[0]&&
|
|||
|
!xc[2]&&0!==xc[1]}),$f(function(xc){return xc[1]}),Jf(1)),g),$d(Ge(Lb,$f(function(xc){return{top:-xc}})),G),dg(Ge(mb,eg(Tb,fb),$f(function(xc){var $b=xc[0];return $b*xc[1].lastSize+$b*xc[2]})),function(xc){la(0,xc);requestAnimationFrame(function(){fj(G,{top:xc});requestAnimationFrame(function(){la(0,0);lc(0,!1)})})}),{deviation:la}},re(Qn,pt,ds,Hp,mq,Fw)),mI=qh(function(b){var g=b[0].totalListHeight,p=b[1].didMount,G=b[2].scrollTo;b=Pd(0);return dg(Ge(p,eg(b),Ug(function(Y){return 0!==Y[1]}),$f(function(Y){return{top:Y[1]}})),
|
|||
|
function(Y){Ke(Ge(g,Ug(function(la){return 0!==la})),function(){setTimeout(function(){G(0,Y)})})}),{initialScrollTop:b}},re(Iw,kr,Qn),{singleton:!0}),nI=qh(function(b){var g=b[0].viewportHeight;b=b[1].totalListHeight;var p=Pd(!1);return{alignToBottom:p,paddingTopAddition:Qi(Ge(Ki(p,g,b),Ug(function(G){return G[0]}),$f(function(G){return Math.max(0,G[1]-G[2])}),kg()),0)}},re(Qn,Iw),{singleton:!0}),hB=qh(function(b){var g=b[0];b=g.scrollTo;g=g.scrollContainerState;var p=Uf(),G=Uf(),Y=Uf(),la=Pd(!1),
|
|||
|
pa=Pd(void 0);return $d(Ge(Ki(p,G),$f(function(Ga){var Qa=Ga[0];return{scrollTop:Math.max(0,Qa.scrollTop-Ga[1].offsetTop),scrollHeight:Qa.scrollHeight,viewportHeight:Qa.viewportHeight}})),g),$d(Ge(b,eg(G),$f(function(Ga){var Qa=Ga[0];return mg({},Qa,{top:Qa.top+Ga[1].offsetTop})})),Y),{useWindowScroll:la,customScrollParent:pa,windowScrollContainerState:p,windowViewportRect:G,windowScrollTo:Y}},re(Qn)),oI=["done","behavior","align"],pI=qh(function(b){var g=b[0],p=g.sizes,G=g.totalCount;g=g.gap;var Y=
|
|||
|
b[1],la=Y.scrollTop,pa=Y.viewportHeight,Ga=Y.headerHeight,Qa=Y.fixedHeaderHeight,Za=Y.fixedFooterHeight,fb=Y.scrollingInProgress;b=b[2].scrollToIndex;Y=Uf();return $d(Ge(Y,eg(p,pa,G,Ga,Qa,Za,la),eg(g),$f(function(mb){var Lb=mb[0],Tb=Lb[0],Pb=Lb[1],lc=Lb[2],xc=Lb[3],$b=Lb[4],sc=Lb[5],oc=Lb[6];Lb=Lb[7];var Mc=mb[1];mb=Tb.done;var Tc=Tb.behavior,vd=Tb.align,de=yi(Tb,oI),ne=null;Tb=ig(Tb,Pb,xc-1);$b=Gh(Tb,Pb.offsetTree,Mc)+$b+sc;return $b<Lb+sc?ne=mg({},de,{behavior:Tc,align:null!=vd?vd:"start"}):$b+
|
|||
|
xa(Pb.sizeTree,Tb)[1]>Lb+lc-oc&&(ne=mg({},de,{behavior:Tc,align:null!=vd?vd:"end"})),ne?mb&&Ke(Ge(fb,Uk(1),Ug(function(De){return!1===De})),mb):mb&&mb(),ne}),Ug(function(mb){return null!==mb})),b),{scrollIntoView:Y}},re(Hp,Qn,ot,ds,mq),{singleton:!0}),qI=["listState","topItemsIndexes"],rI=qh(function(b){return mg({},b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])},re(Hw,iI,kr,gB,Iw,mI,nI,hB,pI)),iB=qh(function(b){var g=b[0],p=g.totalCount,G=g.sizeRanges,Y=g.fixedItemSize,la=g.defaultItemSize,pa=g.trackItemSizes,
|
|||
|
Ga=g.itemSize,Qa=g.data,Za=g.firstItemIndex,fb=g.groupIndices,mb=g.statefulTotalCount;g=g.gap;var Lb=b[1],Tb=Lb.initialTopMostItemIndex;Lb=Lb.scrolledToInitialItem;var Pb=b[2],lc=b[3],xc=b[4],$b=xc.listState,sc=xc.topItemsIndexes;xc=yi(xc,qI);var oc=b[5].scrollToIndex,Mc=b[7].topItemCount,Tc=b[8].groupCounts,vd=b[9];b=b[10];return $d(xc.rangeChanged,vd.scrollSeekRangeChanged),$d(Ge(vd.windowViewportRect,$f(function(de){return de.visibleHeight})),Pb.viewportHeight),mg({totalCount:p,data:Qa,firstItemIndex:Za,
|
|||
|
sizeRanges:G,initialTopMostItemIndex:Tb,scrolledToInitialItem:Lb,topItemsIndexes:sc,topItemCount:Mc,groupCounts:Tc,fixedItemHeight:Y,defaultItemHeight:la,gap:g},lc,{statefulTotalCount:mb,listState:$b,scrollToIndex:oc,trackItemSizes:pa,itemSize:Ga,groupIndices:fb},xc,vd,Pb,b)},re(Hp,Gw,Qn,hI,ds,ot,lI,jI,eB,rI,mq)),jB=ap(function(){if("undefined"==typeof document)return"sticky";var b=document.createElement("div");return b.style.position="-webkit-sticky","-webkit-sticky"===b.style.position?"-webkit-sticky":
|
|||
|
"sticky"}),Ju=gh.createContext(void 0),kB=gh.createContext(void 0),sI=["placeholder"],tI=["style","children"],uI=["style","children"],vI=qh(function(){var b=Pd(function(Qa){return"Item "+Qa}),g=Pd(null),p=Pd(function(Qa){return"Group "+Qa}),G=Pd({}),Y=Pd($g),la=Pd("div"),pa=Pd(Ei),Ga=function(Qa,Za){return void 0===Za&&(Za=null),Qi(Ge(G,$f(function(fb){return fb[Qa]}),kg()),Za)};return{context:g,itemContent:b,groupContent:p,components:G,computeItemKey:Y,headerFooterTag:la,scrollerRef:pa,FooterComponent:Ga("Footer"),
|
|||
|
HeaderComponent:Ga("Header"),TopItemListComponent:Ga("TopItemList"),ListComponent:Ga("List","div"),ItemComponent:Ga("Item","div"),GroupComponent:Ga("Group","div"),ScrollerComponent:Ga("Scroller","div"),EmptyPlaceholder:Ga("EmptyPlaceholder"),ScrollSeekPlaceholder:Ga("ScrollSeekPlaceholder")}}),wI=qh(function(b){function g(Y,la,pa){$d(Ge(Y,eg(G.components),$f(function(Ga){var Qa,Za=Ga[0];Ga=Ga[1];return console.warn("react-virtuoso: "+pa+" property is deprecated. Pass components."+la+" instead."),
|
|||
|
mg({},Ga,((Qa={})[la]=Za,Qa))})),G.components)}var p=b[0],G=b[1];b={item:ym(G.itemContent,"Rename the %citem%c prop to %citemContent."),group:ym(G.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:ym(p.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:ym(p.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:ym(p.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:Uf(),
|
|||
|
maxHeightCacheSize:Uf(),footer:Uf(),header:Uf(),HeaderContainer:Uf(),FooterContainer:Uf(),ItemContainer:Uf(),ScrollContainer:Uf(),GroupContainer:Uf(),ListContainer:Uf(),emptyComponent:Uf(),scrollSeek:Uf()};return dg(b.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),dg(b.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),
|
|||
|
dg(b.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),dg(b.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),dg(b.scrollSeek,function(Y){var la=Y.placeholder;
|
|||
|
Y=yi(Y,sI);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead.");la=mg({},(0,G.components)(4),{ScrollSeekPlaceholder:la});(0,G.components)(0,la);(0,p.scrollSeekConfiguration)(0,Y)}),g(b.footer,"Footer","footer"),g(b.header,"Header","header"),g(b.ItemContainer,"Item","ItemContainer"),g(b.ListContainer,"List","ListContainer"),g(b.ScrollContainer,"Scroller","ScrollContainer"),g(b.emptyComponent,
|
|||
|
"EmptyPlaceholder","emptyComponent"),g(b.GroupContainer,"Group","GroupContainer"),mg({},p,G,b)},re(iB,vI)),xI=function(b){return gh.createElement("div",{style:{height:b.height}})},yI={position:jB(),zIndex:1,overflowAnchor:"none"},zI={overflowAnchor:"none"},lB=gh.memo(function(b){b=b.showTopList;b=void 0!==b&&b;var g=nj("listState"),p=wo("sizeRanges"),G=nj("useWindowScroll"),Y=nj("customScrollParent"),la=wo("windowScrollContainerState"),pa=wo("scrollContainerState");G=Y||G?la:pa;var Ga=nj("itemContent"),
|
|||
|
Qa=nj("context"),Za=nj("groupContent");la=nj("trackItemSizes");pa=nj("itemSize");var fb=nj("log"),mb=wo("gap");p=Si(p,pa,la,b?Ei:G,fb,mb,Y).callbackRef;Y=gh.useState(0);var Lb=Y[0],Tb=Y[1];Jw("deviation",function(Mc){Lb!==Mc&&Tb(Mc)});Y=nj("EmptyPlaceholder");var Pb=nj("ScrollSeekPlaceholder")||xI;G=nj("ListComponent");var lc=nj("ItemComponent"),xc=nj("GroupComponent"),$b=nj("computeItemKey"),sc=nj("isSeeking"),oc=0<nj("groupIndices").length;la=nj("paddingTopAddition");la=b?{}:{boxSizing:"border-box",
|
|||
|
paddingTop:g.offsetTop+la,paddingBottom:g.offsetBottom,marginTop:Lb};return!b&&0===g.totalCount&&Y?(0,hi.createElement)(Y,bi(Y,Qa)):(0,hi.createElement)(G,mg({},bi(G,Qa),{ref:p,style:la,"data-test-id":b?"virtuoso-top-item-list":"virtuoso-item-list"}),(b?g.topItems:g.items).map(function(Mc){var Tc=Mc.originalIndex,vd=$b(Tc+g.firstItemIndex,Mc.data,Qa);return sc?(0,hi.createElement)(Pb,mg({},bi(Pb,Qa),{key:vd,index:Mc.index,height:Mc.size,type:Mc.type||"item"},"group"===Mc.type?{}:{groupIndex:Mc.groupIndex})):
|
|||
|
"group"===Mc.type?(0,hi.createElement)(xc,mg({},bi(xc,Qa),{key:vd,"data-index":Tc,"data-known-size":Mc.size,"data-item-index":Mc.index,style:yI}),Za(Mc.index)):(0,hi.createElement)(lc,mg({},bi(lc,Qa),{key:vd,"data-index":Tc,"data-known-size":Mc.size,"data-item-index":Mc.index,"data-item-group-index":Mc.groupIndex,style:zI}),oc?Ga(Mc.index,Mc.groupIndex,Mc.data,Qa):Ga(Mc.index,Mc.data,Qa))}))}),AI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},es=
|
|||
|
{width:"100%",height:"100%",position:"absolute",top:0},BI={width:"100%",position:jB(),top:0},CI=gh.memo(function(){var b=nj("HeaderComponent"),g=wo("headerHeight"),p=nj("headerFooterTag"),G=Yf(function(la){return g(gl(la,"height"))}),Y=nj("context");return b?(0,hi.createElement)(p,{ref:G},(0,hi.createElement)(b,bi(b,Y))):null}),DI=gh.memo(function(){var b=nj("FooterComponent"),g=wo("footerHeight"),p=nj("headerFooterTag"),G=Yf(function(la){return g(gl(la,"height"))}),Y=nj("context");return b?(0,hi.createElement)(p,
|
|||
|
{ref:G},(0,hi.createElement)(b,bi(b,Y))):null}),EI=function(b){b=b.children;var g=(0,hi.useContext)(Ju),p=wo("viewportHeight"),G=wo("fixedItemHeight"),Y=Yf(oi(p,function(la){return gl(la,"height")}));return gh.useEffect(function(){g&&(p(g.viewportHeight),G(g.itemHeight))},[g,p,G]),gh.createElement("div",{style:es,ref:Y,"data-viewport-type":"element"},b)},FI=function(b){b=b.children;var g=(0,hi.useContext)(Ju),p=wo("windowViewportRect"),G=wo("fixedItemHeight"),Y=nj("customScrollParent");Y=jn(p,Y);
|
|||
|
return gh.useEffect(function(){g&&(G(g.itemHeight),p({offsetTop:0,visibleHeight:g.viewportHeight,visibleWidth:100}))},[g,p,G]),gh.createElement("div",{ref:Y,style:es,"data-viewport-type":"window"},b)},GI=function(b){b=b.children;var g=nj("TopItemListComponent"),p=nj("headerHeight");p=mg({},BI,{marginTop:p+"px"});var G=nj("context");return(0,hi.createElement)(g||"div",{style:p,context:G},b)},Ku=Sm(wI,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",
|
|||
|
itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",
|
|||
|
headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",
|
|||
|
ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems",autoscrollToBottom:"autoscrollToBottom"},events:{isScrolling:"isScrolling",endReached:"endReached",
|
|||
|
startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},gh.memo(function(b){var g=nj("useWindowScroll"),p=0<nj("topItemsIndexes").length,G=nj("customScrollParent"),Y=G||g?FI:EI;return gh.createElement(G||g?JI:II,mg({},b),gh.createElement(Y,null,gh.createElement(CI,null),gh.createElement(lB,null),gh.createElement(DI,
|
|||
|
null)),p&&gh.createElement(GI,null,gh.createElement(lB,{showTopList:!0})))})),HI=Ku.Component,wo=Ku.usePublisher,nj=Ku.useEmitterValue,Jw=Ku.useEmitter,II=Wn({usePublisher:wo,useEmitterValue:nj,useEmitter:Jw}),JI=en({usePublisher:wo,useEmitterValue:nj,useEmitter:Jw}),mB={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},KI={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},nB=Math.round,oB=Math.ceil,Lu=Math.floor,Kw=Math.min,fs=Math.max,
|
|||
|
LI=qh(function(b){var g=b[0],p=g.overscan,G=g.visibleRange,Y=g.listBoundary,la=b[1];g=la.scrollTop;var pa=la.viewportHeight,Ga=la.scrollBy,Qa=la.scrollTo,Za=la.smoothScrollTargetReached,fb=la.scrollContainerState,mb=la.footerHeight;la=la.headerHeight;var Lb=b[2],Tb=b[3],Pb=b[4],lc=Pb.propsReady,xc=Pb.didMount,$b=b[5];Pb=$b.windowViewportRect;var sc=$b.windowScrollTo,oc=$b.useWindowScroll,Mc=$b.customScrollParent;$b=$b.windowScrollContainerState;b=b[6];var Tc=Pd(0),vd=Pd(0),de=Pd(mB),ne=Pd({height:0,
|
|||
|
width:0}),De=Pd({height:0,width:0}),$e=Uf(),mf=Uf(),Te=Pd(0),rf=Pd(void 0),Vd=Pd({row:0,column:0});$d(Ge(Ki(xc,vd,rf),Ug(function(rd){return 0!==rd[1]}),$f(function(rd){return{items:Xn(0,rd[1]-1,rd[2]),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),de);$d(Ge(Ki(Ah(Tc),G,Ah(Vd,Ao),Ah(De,function(rd,sd){return rd&&rd.width===sd.width&&rd.height===sd.height}),rf),eg(ne),$f(function(rd){var sd=rd[0],ud=sd[0],ie=sd[1],jf=ie[0],tf=ie[1],gg=sd[2],Bf=sd[3],Sf=sd[4],hh=rd[1];rd=gg.row;
|
|||
|
var Ff=gg.column;sd=Bf.height;ie=Bf.width;var jh=hh.width;if(0===ud||0===jh)return mB;if(0===ie)return mg({},KI,{items:Xn(0,0,Sf)});Ff=fs(1,Lu((jh+Ff)/(ie+Ff)));jf=Ff*Lu((jf+rd)/(sd+rd));tf=Ff*oB((tf+rd)/(sd+rd))-1;tf=Kw(ud-1,fs(tf,Ff-1));jf=Xn(Kw(tf,fs(0,jf)),tf,Sf);Bf=sm(hh,gg,Bf,jf);gg=Bf.top;Bf=Bf.bottom;ud=oB(ud/Ff);return{items:jf,offsetTop:gg,offsetBottom:ud*sd+(ud-1)*rd-Bf,top:gg,bottom:Bf,itemHeight:sd,itemWidth:ie}})),de);$d(Ge(rf,Ug(function(rd){return void 0!==rd}),$f(function(rd){return rd.length})),
|
|||
|
Tc);$d(Ge(ne,$f(function(rd){return rd.height})),pa);$d(Ge(Ki(ne,De,de,Vd),$f(function(rd){rd=sm(rd[0],rd[3],rd[1],rd[2].items);return[rd.top,rd.bottom]}),kg(li)),Y);G=pj(Ge(Ah(de),Ug(function(rd){return 0<rd.items.length}),eg(Tc),Ug(function(rd){var sd=rd[0].items;return sd[sd.length-1].index===rd[1]-1}),$f(function(rd){return rd[1]-1}),kg()));Y=pj(Ge(Ah(de),Ug(function(rd){rd=rd.items;return 0<rd.length&&0===rd[0].index}),Pf(0),kg()));pa=pj(Ge(Ah(de),Ug(function(rd){return 0<rd.items.length}),$f(function(rd){rd=
|
|||
|
rd.items;return{startIndex:rd[0].index,endIndex:rd[rd.length-1].index}}),kg(Xj)));$d(pa,Tb.scrollSeekRangeChanged);$d(Ge($e,eg(ne,De,Tc,Vd),$f(function(rd){var sd=rd[1],ud=rd[2],ie=rd[3],jf=rd[4],tf=Ch(rd[0]);rd=tf.align;var gg=tf.behavior,Bf=tf.offset;tf=tf.index;"LAST"===tf&&(tf=ie-1);ie=Tm(sd,jf,ud,fs(0,tf,Kw(ie-1,tf)));return"end"===rd?ie=nB(ie-sd.height+ud.height):"center"===rd&&(ie=nB(ie-sd.height/2+ud.height/2)),Bf&&(ie+=Bf),{top:ie,behavior:gg}})),Qa);xc=Qi(Ge(de,$f(function(rd){return rd.offsetBottom+
|
|||
|
rd.bottom})),0);return $d(Ge(Pb,$f(function(rd){return{width:rd.visibleWidth,height:rd.visibleHeight}})),ne),mg({data:rf,totalCount:Tc,viewportDimensions:ne,itemDimensions:De,scrollTop:g,scrollHeight:mf,overscan:p,scrollBy:Ga,scrollTo:Qa,scrollToIndex:$e,smoothScrollTargetReached:Za,windowViewportRect:Pb,windowScrollTo:sc,useWindowScroll:oc,customScrollParent:Mc,windowScrollContainerState:$b,deviation:Te,scrollContainerState:fb,footerHeight:mb,headerHeight:la,initialItemCount:vd,gap:Vd},Tb,{gridState:de,
|
|||
|
totalListHeight:xc},Lb,{startReached:Y,endReached:G,rangeChanged:pa,propsReady:lc},b)},re(Hw,Qn,pt,gB,kr,hB,mq)),MI=["placeholder"],NI=qh(function(){var b=Pd(function(Za){return"Item "+Za}),g=Pd({}),p=Pd(null),G=Pd("virtuoso-grid-item"),Y=Pd("virtuoso-grid-list"),la=Pd($g),pa=Pd("div"),Ga=Pd(Ei),Qa=function(Za,fb){return void 0===fb&&(fb=null),Qi(Ge(g,$f(function(mb){return mb[Za]}),kg()),fb)};return{context:p,itemContent:b,components:g,computeItemKey:la,itemClassName:G,listClassName:Y,headerFooterTag:pa,
|
|||
|
scrollerRef:Ga,FooterComponent:Qa("Footer"),HeaderComponent:Qa("Header"),ListComponent:Qa("List","div"),ItemComponent:Qa("Item","div"),ScrollerComponent:Qa("Scroller","div"),ScrollSeekPlaceholder:Qa("ScrollSeekPlaceholder","div")}}),OI=qh(function(b){function g(Y,la,pa){$d(Ge(Y,eg(G.components),$f(function(Ga){var Qa,Za=Ga[0];Ga=Ga[1];return console.warn("react-virtuoso: "+pa+" property is deprecated. Pass components."+la+" instead."),mg({},Ga,((Qa={})[la]=Za,Qa))})),G.components)}var p=b[0],G=b[1];
|
|||
|
b={item:ym(G.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:Uf(),ScrollContainer:Uf(),ListContainer:Uf(),emptyComponent:Uf(),scrollSeek:Uf()};return dg(b.scrollSeek,function(Y){var la=Y.placeholder;Y=yi(Y,MI);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead.");la=mg({},(0,G.components)(4),{ScrollSeekPlaceholder:la});(0,G.components)(0,la);(0,p.scrollSeekConfiguration)(0,
|
|||
|
Y)}),g(b.ItemContainer,"Item","ItemContainer"),g(b.ListContainer,"List","ListContainer"),g(b.ScrollContainer,"Scroller","ScrollContainer"),mg({},p,G,b)},re(LI,NI)),PI=gh.memo(function(){var b=Kl("gridState"),g=Kl("listClassName"),p=Kl("itemClassName"),G=Kl("itemContent"),Y=Kl("computeItemKey"),la=Kl("isSeeking"),pa=So("scrollHeight"),Ga=Kl("ItemComponent"),Qa=Kl("ListComponent"),Za=Kl("ScrollSeekPlaceholder"),fb=Kl("context"),mb=So("itemDimensions"),Lb=So("gap"),Tb=Kl("log"),Pb=Yf(function(lc){pa(lc.parentElement.parentElement.scrollHeight);
|
|||
|
var xc=lc.firstChild;xc&&mb(xc.getBoundingClientRect());Lb({row:al("row-gap",getComputedStyle(lc).rowGap,Tb),column:al("column-gap",getComputedStyle(lc).columnGap,Tb)})});return(0,hi.createElement)(Qa,mg({ref:Pb,className:g},bi(Qa,fb),{style:{paddingTop:b.offsetTop,paddingBottom:b.offsetBottom}}),b.items.map(function(lc){var xc=Y(lc.index,lc.data,fb);return la?(0,hi.createElement)(Za,mg({key:xc},bi(Za,fb),{index:lc.index,height:b.itemHeight,width:b.itemWidth})):(0,hi.createElement)(Ga,mg({},bi(Ga,
|
|||
|
fb),{className:p,"data-index":lc.index,key:xc}),G(lc.index,lc.data,fb))}))}),QI=gh.memo(function(){var b=Kl("HeaderComponent"),g=So("headerHeight"),p=Kl("headerFooterTag"),G=Yf(function(la){return g(gl(la,"height"))}),Y=Kl("context");return b?(0,hi.createElement)(p,{ref:G},(0,hi.createElement)(b,bi(b,Y))):null}),RI=gh.memo(function(){var b=Kl("FooterComponent"),g=So("footerHeight"),p=Kl("headerFooterTag"),G=Yf(function(la){return g(gl(la,"height"))}),Y=Kl("context");return b?(0,hi.createElement)(p,
|
|||
|
{ref:G},(0,hi.createElement)(b,bi(b,Y))):null}),SI=function(b){b=b.children;var g=(0,hi.useContext)(kB),p=So("itemDimensions"),G=So("viewportDimensions"),Y=Yf(function(la){G(la.getBoundingClientRect())});return gh.useEffect(function(){g&&(G({height:g.viewportHeight,width:g.viewportWidth}),p({height:g.itemHeight,width:g.itemWidth}))},[g,G,p]),gh.createElement("div",{style:es,ref:Y},b)},TI=function(b){b=b.children;var g=(0,hi.useContext)(kB),p=So("windowViewportRect"),G=So("itemDimensions"),Y=Kl("customScrollParent");
|
|||
|
Y=jn(p,Y);return gh.useEffect(function(){g&&(G({height:g.itemHeight,width:g.itemWidth}),p({offsetTop:0,visibleHeight:g.viewportHeight,visibleWidth:g.viewportWidth}))},[g,p,G]),gh.createElement("div",{ref:Y,style:es},b)},Lw=Sm(OI,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",
|
|||
|
listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",
|
|||
|
atTopStateChange:"atTopStateChange"}},gh.memo(function(b){b=mg({},b);var g=Kl("useWindowScroll"),p=Kl("customScrollParent"),G=p||g?TI:SI;return gh.createElement(p||g?VI:UI,mg({},b),gh.createElement(G,null,gh.createElement(QI,null),gh.createElement(PI,null),gh.createElement(RI,null)))})),So=Lw.usePublisher,Kl=Lw.useEmitterValue,pB=Lw.useEmitter,UI=Wn({usePublisher:So,useEmitterValue:Kl,useEmitter:pB}),VI=en({usePublisher:So,useEmitterValue:Kl,useEmitter:pB}),WI=qh(function(){var b=Pd(function(Qa){return gh.createElement("td",
|
|||
|
null,"Item $",Qa)}),g=Pd(null),p=Pd(null),G=Pd(null),Y=Pd({}),la=Pd($g),pa=Pd(Ei),Ga=function(Qa,Za){return void 0===Za&&(Za=null),Qi(Ge(Y,$f(function(fb){return fb[Qa]}),kg()),Za)};return{context:g,itemContent:b,fixedHeaderContent:p,fixedFooterContent:G,components:Y,computeItemKey:la,scrollerRef:pa,TableComponent:Ga("Table","table"),TableHeadComponent:Ga("TableHead","thead"),TableFooterComponent:Ga("TableFoot","tfoot"),TableBodyComponent:Ga("TableBody","tbody"),TableRowComponent:Ga("TableRow","tr"),
|
|||
|
ScrollerComponent:Ga("Scroller","div"),EmptyPlaceholder:Ga("EmptyPlaceholder"),ScrollSeekPlaceholder:Ga("ScrollSeekPlaceholder"),FillerRow:Ga("FillerRow")}}),XI=qh(function(b){return mg({},b[0],b[1])},re(iB,WI)),YI=function(b){return gh.createElement("tr",null,gh.createElement("td",{style:{height:b.height}}))},ZI=function(b){return gh.createElement("tr",null,gh.createElement("td",{style:{height:b.height,padding:0,border:0}}))},$I=gh.memo(function(){var b=Uj("listState"),g=To("sizeRanges"),p=Uj("useWindowScroll"),
|
|||
|
G=Uj("customScrollParent"),Y=To("windowScrollContainerState"),la=To("scrollContainerState");p=G||p?Y:la;var pa=Uj("itemContent");Y=Uj("trackItemSizes");G=Si(g,Uj("itemSize"),Y,p,Uj("log"),void 0,G);g=G.callbackRef;var Ga=G.ref;G=gh.useState(0);var Qa=G[0],Za=G[1];Nw("deviation",function($b){Qa!==$b&&(Ga.current.style.marginTop=$b+"px",Za($b))});Y=Uj("EmptyPlaceholder");var fb=Uj("ScrollSeekPlaceholder")||YI;p=Uj("FillerRow")||ZI;G=Uj("TableBodyComponent");var mb=Uj("TableRowComponent"),Lb=Uj("computeItemKey"),
|
|||
|
Tb=Uj("isSeeking");la=Uj("paddingTopAddition");var Pb=Uj("firstItemIndex"),lc=Uj("statefulTotalCount"),xc=Uj("context");if(0===lc&&Y)return(0,hi.createElement)(Y,bi(Y,xc));Y=b.offsetTop+la+Qa;la=b.offsetBottom;Y=0<Y?gh.createElement(p,{height:Y,key:"padding-top"}):null;p=0<la?gh.createElement(p,{height:la,key:"padding-bottom"}):null;b=b.items.map(function($b){var sc=$b.originalIndex,oc=Lb(sc+Pb,$b.data,xc);return Tb?(0,hi.createElement)(fb,mg({},bi(fb,xc),{key:oc,index:$b.index,height:$b.size,type:$b.type||
|
|||
|
"item"})):(0,hi.createElement)(mb,mg({},bi(mb,xc),{key:oc,"data-index":sc,"data-known-size":$b.size,"data-item-index":$b.index,style:{overflowAnchor:"none"}}),pa($b.index,$b.data,xc))});return(0,hi.createElement)(G,mg({ref:g,"data-test-id":"virtuoso-item-list"},bi(G,xc)),[Y].concat(b,[p]))}),aJ=function(b){b=b.children;var g=(0,hi.useContext)(Ju),p=To("viewportHeight"),G=To("fixedItemHeight"),Y=Yf(oi(p,function(la){return gl(la,"height")}));return gh.useEffect(function(){g&&(p(g.viewportHeight),G(g.itemHeight))},
|
|||
|
[g,p,G]),gh.createElement("div",{style:es,ref:Y,"data-viewport-type":"element"},b)},bJ=function(b){b=b.children;var g=(0,hi.useContext)(Ju),p=To("windowViewportRect"),G=To("fixedItemHeight"),Y=Uj("customScrollParent");Y=jn(p,Y);return gh.useEffect(function(){g&&(G(g.itemHeight),p({offsetTop:0,visibleHeight:g.viewportHeight,visibleWidth:100}))},[g,p,G]),gh.createElement("div",{ref:Y,style:es,"data-viewport-type":"window"},b)},Mw=Sm(XI,{required:{},optional:{context:"context",followOutput:"followOutput",
|
|||
|
firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",
|
|||
|
itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",react18ConcurrentRendering:"react18ConcurrentRendering"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy"},events:{isScrolling:"isScrolling",
|
|||
|
endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},gh.memo(function(b){var g=Uj("useWindowScroll"),p=Uj("customScrollParent"),G=To("fixedHeaderHeight"),Y=To("fixedFooterHeight"),la=Uj("fixedHeaderContent"),pa=Uj("fixedFooterContent"),Ga=Uj("context");G=Yf(oi(G,function(mb){return gl(mb,
|
|||
|
"height")}));var Qa=Yf(oi(Y,function(mb){return gl(mb,"height")}));Y=p||g?dJ:cJ;g=p||g?bJ:aJ;p=Uj("TableComponent");var Za=Uj("TableHeadComponent"),fb=Uj("TableFooterComponent");la=la?gh.createElement(Za,mg({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:G},bi(Za,Ga)),la()):null;pa=pa?gh.createElement(fb,mg({key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:Qa},bi(fb,Ga)),pa()):null;return gh.createElement(Y,mg({},b),gh.createElement(g,null,gh.createElement(p,mg({style:{borderSpacing:0}},
|
|||
|
bi(p,Ga)),[la,gh.createElement($I,{key:"TableBody"}),pa])))})),To=Mw.usePublisher,Uj=Mw.useEmitterValue,Nw=Mw.useEmitter,cJ=Wn({usePublisher:To,useEmitterValue:Uj,useEmitter:Nw}),dJ=en({usePublisher:To,useEmitterValue:Uj,useEmitter:Nw}),qB=sf(W(22)),np=function(b){function g(p){p=b.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+p+" for more information.")||this;if(void 0===p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|||
|
return p}un(g,b);return g}(Zn(Error)),rB={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",
|
|||
|
darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",
|
|||
|
gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
|
|||
|
lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",
|
|||
|
olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",
|
|||
|
slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},eJ=/^#[a-fA-F0-9]{6}$/,fJ=/^#[a-fA-F0-9]{8}$/,gJ=/^#[a-fA-F0-9]{3}$/,hJ=/^#[a-fA-F0-9]{4}$/,Ow=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,iJ=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,
|
|||
|
jJ=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,kJ=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Pw=function(b){return 7===b.length&&b[1]===b[2]&&b[3]===b[4]&&b[5]===b[6]?"#"+b[1]+b[3]+b[5]:b},lJ=Bo(Co,Co.length,[]);tb=W(588);var Uo=sf(W(22)),ho=class{static insertTextFirefox(b,g){b.setRangeText(g,b.selectionStart||0,b.selectionEnd||
|
|||
|
0,"end");b.dispatchEvent(new InputEvent("input",{data:g,inputType:"insertText",isComposing:!1}))}static insert(b,g){const p=b.ownerDocument,G=p.activeElement;G!==b&&b.focus();p.execCommand("insertText",!1,g)||ho.insertTextFirefox(b,g);G===p.body?b.blur():G instanceof HTMLElement&&G!==b&&G.focus()}static set(b,g){b.select();ho.insert(b,g)}static getSelection(b){const {selectionStart:g,selectionEnd:p}=b;return b.value.slice(g?g:void 0,p?p:void 0)}static wrapSelection(b,g,p){const {selectionStart:G,
|
|||
|
selectionEnd:Y}=b,la=ho.getSelection(b);ho.insert(b,g+la+(null!=p?p:g));b.selectionStart=(G||0)+g.length;b.selectionEnd=(Y||0)+g.length}static replace(b,g,p){let G=0;b.value.replace(g,(...Y)=>{const la=G+Y[Y.length-2],pa=Y[0].length;b.selectionStart=la;b.selectionEnd=la+pa;Y="string"===typeof p?p:p(...Y);ho.insert(b,Y);b.selectionStart=la;G+=Y.length-pa;return Y})}static findLineEnd(b,g){const p=b.lastIndexOf("\n",g-1)+1;return"\t"!==b.charAt(p)?g:p+1}static indent(b){var g;const {selectionStart:p,
|
|||
|
selectionEnd:G,value:Y}=b;var la=Y.slice(p,G);if((la=null==(g=/\n/g.exec(la))?void 0:g.length)&&0<la){g=Y.lastIndexOf("\n",p-1)+1;var pa=b.value.slice(g,G-1);la=pa.replace(/^|\n/g,"$\x26 ");pa=la.length-pa.length;b.setSelectionRange(g,G-1);ho.insert(b,la);b.setSelectionRange(p+1,G+pa)}else ho.insert(b," ")}static unindent(b){const {selectionStart:g,selectionEnd:p,value:G}=b;var Y=G.lastIndexOf("\n",g-1)+1;const la=ho.findLineEnd(G,p);var pa=b.value.slice(Y,la);const Ga=pa.replace(/(^|\n)(\t| {1,2})/g,
|
|||
|
"$1");pa=pa.length-Ga.length;b.setSelectionRange(Y,la);ho.insert(b,Ga);Y=(Y=/\t| {1,2}/.exec(G.slice(Y,g)))?Y[0].length:0;b.setSelectionRange(g-Y,Math.max(g-Y,p-pa))}};tb=W(588);var Mu=b=>b.stopPropagation(),Nu=Uo.memo(function({font:b,text:g,color:p,fontStyle:G,fontSize:Y,fontWeight:la,offsetX:pa=0,offsetY:Ga=0,scale:Qa=1,isEditing:Za=!1,pointerEvents:fb=!1,onBlur:mb,onChange:Lb}){const Tb=Uo.useRef(null),Pb=Uo.useRef(!1),lc=Uo.useCallback(Tc=>{Lb(Ur.normalizeText(Tc.currentTarget.value))},[Lb]),
|
|||
|
xc=Uo.useCallback(Tc=>{if("Escape"!==Tc.key)if("Tab"===Tc.key&&0===g.length)Tc.preventDefault();else{if("Meta"!==Tc.key&&!Tc.metaKey)Tc.stopPropagation();else if("z"===Tc.key&&Tc.metaKey){document.execCommand(Tc.shiftKey?"redo":"undo",!1);Tc.stopPropagation();Tc.preventDefault();return}"Tab"===Tc.key&&(Tc.preventDefault(),Tc.shiftKey?ho.unindent(Tc.currentTarget):ho.indent(Tc.currentTarget),null==Lb?void 0:Lb(Ur.normalizeText(Tc.currentTarget.value)))}},[Lb]),$b=Uo.useCallback(Tc=>{Za&&(Tc.currentTarget.setSelectionRange(0,
|
|||
|
0),null==mb?void 0:mb())},[mb]),sc=Uo.useCallback(Tc=>{Za&&Pb.current&&document.activeElement===Tc.currentTarget&&Tc.currentTarget.select()},[Za]),oc=Uo.useCallback(Tc=>{Za&&Tc.stopPropagation()},[Za]);Uo.useEffect(()=>{Za&&requestAnimationFrame(()=>{Pb.current=!0;const Tc=Tb.current;Tc&&(Tc.focus(),Tc.select())})},[Za,mb]);const Mc=Uo.useRef(null);Uo.useLayoutEffect(()=>{const Tc=Mc.current;if(Tc){var vd=Xh(g||"Enter text",{fontFamily:"var(--ls-font-family)",fontSize:Y,lineHeight:1,fontWeight:la},
|
|||
|
4);Tc.style.transform=`scale(${Qa}, ${Qa}) translate(${pa}px, ${Ga}px)`;Tc.style.width=vd[0]+1+"px";Tc.style.height=vd[1]+1+"px"}},[g,la,Y,Ga,pa,Qa]);return(0,tb.jsx)("div",{className:"tl-text-label-wrapper",children:(0,tb.jsxs)("div",{className:"tl-text-label-inner-wrapper",ref:Mc,style:{font:b,fontStyle:G,fontSize:Y,fontWeight:la,color:p,pointerEvents:fb?"all":"none",userSelect:Za?"text":"none"},children:[Za?(0,tb.jsx)("textarea",{ref:Tb,style:{font:b,color:p,fontStyle:G,fontSize:Y,fontWeight:la},
|
|||
|
className:"tl-text-label-textarea",name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"Enter text",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:g,color:p,onFocus:sc,onChange:lc,onKeyDown:xc,onBlur:$b,onPointerDown:oc,onContextMenu:Mu,onCopy:Mu,onPaste:Mu,onCut:Mu}):g,""]})})});tb=W(588);var sB={xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},gs=class extends An{constructor(){super(...arguments);ib(this,
|
|||
|
"canEdit",!0);ib(this,"ReactComponent",cf(({events:b,isErasing:g,isBinding:p,isSelected:G,isEditing:Y,onEditingEnd:la})=>{const {props:{size:[pa,Ga],stroke:Qa,fill:Za,noFill:fb,strokeWidth:mb,strokeType:Lb,borderRadius:Tb,opacity:Pb,label:lc,italic:xc,fontWeight:$b,fontSize:sc}}=this;var oc=lc||Y?Xh(lc,{fontFamily:"var(--ls-font-family)",fontSize:sc,lineHeight:1,fontWeight:$b},4):[0,0];const Mc=ke.mul(this.props.size,.5);oc=Math.max(.5,Math.min(1,pa/oc[0],Ga/oc[1]));const Tc=this.getBounds(),vd=qB.useMemo(()=>
|
|||
|
ke.sub(Mc,ke.toFixed([Tc.width/2,Tc.height/2])),[Tc,oc,Mc]),de=qB.useCallback(ne=>{var De;null==(De=this.update)?void 0:De.call(this,{label:ne})},[lc]);return(0,tb.jsxs)("div",hf(pe({},b),{style:{width:"100%",height:"100%",overflow:"hidden"},className:"tl-box-container",children:[(0,tb.jsx)(Nu,{font:"20px / 1 var(--ls-font-family)",text:lc,color:Xg(Qa,"text"),offsetX:vd[0],offsetY:vd[1],fontSize:sc,scale:oc,isEditing:Y,onChange:de,onBlur:la,fontStyle:xc?"italic":"normal",fontWeight:$b,pointerEvents:!!lc}),
|
|||
|
(0,tb.jsxs)(to,{opacity:g?.2:Pb,children:[p&&(0,tb.jsx)(no,{mode:"svg",strokeWidth:mb,size:[pa,Ga]}),(0,tb.jsx)("rect",{className:G||!fb?"tl-hitarea-fill":"tl-hitarea-stroke",x:mb/2,y:mb/2,rx:Tb,ry:Tb,width:Math.max(.01,pa-mb),height:Math.max(.01,Ga-mb),pointerEvents:"all"}),(0,tb.jsx)("rect",{x:mb/2,y:mb/2,rx:Tb,ry:Tb,width:Math.max(.01,pa-mb),height:Math.max(.01,Ga-mb),strokeWidth:mb,stroke:Xg(Qa,"stroke"),strokeDasharray:"dashed"===Lb?"8 2":void 0,fill:fb?"none":Xg(Za,"background")})]})]}))}));
|
|||
|
ib(this,"setScaleLevel",b=>Zh(this,null,function*(){this.update({scaleLevel:b,fontSize:sB[null!=b?b:"md"],strokeWidth:sB[null!=b?b:"md"]/10});this.onResetBounds()}));ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,g],borderRadius:p,isLocked:G}}=this;return(0,tb.jsx)("g",{children:(0,tb.jsx)("rect",{width:b,height:g,rx:p,ry:p,fill:"transparent",strokeDasharray:G?"8 2":void 0})})}));ib(this,"validateProps",b=>{void 0!==b.size&&(b.size[0]=Math.max(b.size[0],1),b.size[1]=Math.max(b.size[1],1));
|
|||
|
void 0!==b.borderRadius&&(b.borderRadius=Math.max(0,b.borderRadius));return cm(this,b)})}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}};ib(gs,"id","box");ib(gs,"defaultProps",{id:"box",parentId:"page",type:"box",point:[0,0],size:[100,100],borderRadius:2,stroke:"",fill:"",noFill:!1,fontWeight:400,fontSize:20,italic:!1,strokeType:"line",strokeWidth:2,opacity:1,label:""});ce([wf],gs.prototype,"scaleLevel",1);ce([qg],gs.prototype,"setScaleLevel",2);var tB=sf(W(22));tb=W(588);var uB=
|
|||
|
{xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},hs=class extends Gv{constructor(){super(...arguments);ib(this,"canEdit",!0);ib(this,"ReactComponent",cf(({isSelected:b,isErasing:g,events:p,isEditing:G,onEditingEnd:Y})=>{const {size:[la,pa],stroke:Ga,fill:Qa,noFill:Za,strokeWidth:fb,strokeType:mb,opacity:Lb,label:Tb,italic:Pb,fontWeight:lc,fontSize:xc}=this.props;var $b=Tb||G?Xh(Tb,{fontFamily:"var(--ls-font-family)",fontSize:xc,lineHeight:1,fontWeight:lc},4):[0,0];const sc=ke.mul(this.props.size,.5);$b=Math.max(.5,
|
|||
|
Math.min(1,la/$b[0],pa/$b[1]));const oc=this.getBounds(),Mc=tB.useMemo(()=>ke.sub(sc,ke.toFixed([oc.width/2,oc.height/2])),[oc,$b,sc]),Tc=tB.useCallback(vd=>{var de;null==(de=this.update)?void 0:de.call(this,{label:vd})},[Tb]);return(0,tb.jsxs)("div",hf(pe({},p),{style:{width:"100%",height:"100%",overflow:"hidden"},className:"tl-ellipse-container",children:[(0,tb.jsx)(Nu,{font:"18px / 1 var(--ls-font-family)",text:Tb,color:Xg(Ga,"text"),offsetX:Mc[0],offsetY:Mc[1],scale:$b,isEditing:G,onChange:Tc,
|
|||
|
onBlur:Y,fontStyle:Pb?"italic":"normal",fontSize:xc,fontWeight:lc,pointerEvents:!!Tb}),(0,tb.jsxs)(to,hf(pe({},p),{opacity:g?.2:Lb,children:[(0,tb.jsx)("ellipse",{className:b||!Za?"tl-hitarea-fill":"tl-hitarea-stroke",cx:la/2,cy:pa/2,rx:Math.max(.01,(la-fb)/2),ry:Math.max(.01,(pa-fb)/2)}),(0,tb.jsx)("ellipse",{cx:la/2,cy:pa/2,rx:Math.max(.01,(la-fb)/2),ry:Math.max(.01,(pa-fb)/2),strokeWidth:fb,stroke:Xg(Ga,"stroke"),strokeDasharray:"dashed"===mb?"8 2":void 0,fill:Za?"none":Xg(Qa,"background")})]}))]}))}));
|
|||
|
ib(this,"setScaleLevel",b=>Zh(this,null,function*(){this.update({scaleLevel:b,fontSize:uB[null!=b?b:"md"],strokeWidth:uB[null!=b?b:"md"]/10});this.onResetBounds()}));ib(this,"ReactIndicator",cf(()=>{const {size:[b,g],isLocked:p}=this.props;return(0,tb.jsx)("g",{children:(0,tb.jsx)("ellipse",{cx:b/2,cy:g/2,rx:b/2,ry:g/2,strokeWidth:2,fill:"transparent",strokeDasharray:p?"8 2":"undefined"})})}));ib(this,"validateProps",b=>{void 0!==b.size&&(b.size[0]=Math.max(b.size[0],1),b.size[1]=Math.max(b.size[1],
|
|||
|
1));return cm(this,b)})}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}getShapeSVGJsx(b){const {size:[g,p],stroke:G,fill:Y,noFill:la,strokeWidth:pa,strokeType:Ga,opacity:Qa}=this.props;return(0,tb.jsxs)("g",{opacity:Qa,children:[(0,tb.jsx)("ellipse",{className:la?"tl-hitarea-stroke":"tl-hitarea-fill",cx:g/2,cy:p/2,rx:Math.max(.01,(g-pa)/2),ry:Math.max(.01,(p-pa)/2)}),(0,tb.jsx)("ellipse",{cx:g/2,cy:p/2,rx:Math.max(.01,(g-pa)/2),ry:Math.max(.01,(p-pa)/2),strokeWidth:pa,stroke:Xg(G,
|
|||
|
"stroke"),strokeDasharray:"dashed"===Ga?"8 2":void 0,fill:la?"none":Xg(Y,"background")})]})}};ib(hs,"id","ellipse");ib(hs,"defaultProps",{id:"ellipse",parentId:"page",type:"ellipse",point:[0,0],size:[100,100],stroke:"",fill:"",noFill:!1,fontWeight:400,fontSize:20,italic:!1,strokeType:"line",strokeWidth:2,opacity:1,label:""});ce([wf],hs.prototype,"scaleLevel",1);ce([qg],hs.prototype,"setScaleLevel",2);tb=W(588);var Qw=class extends Xt{constructor(){super(...arguments);ib(this,"ReactComponent",cf(({events:b})=>
|
|||
|
{const g=this.getBounds(),p=Ye(),G=p.selectedShapesArray.some(la=>p.shapesInGroups([this]).includes(la)),Y=this.ReactIndicator;return(0,tb.jsxs)(to,hf(pe({},b),{children:[(0,tb.jsx)("rect",{className:"tl-hitarea-fill",x:1,y:1,width:Math.max(.01,g.width-2),height:Math.max(.01,g.height-2),pointerEvents:"all"}),G&&(0,tb.jsx)("g",{stroke:"var(--color-selectedFill)",children:(0,tb.jsx)(Y,{})})]}))}));ib(this,"ReactIndicator",cf(()=>{const b=this.getBounds();return(0,tb.jsx)("rect",{strokeDasharray:"8 2",
|
|||
|
x:-8,y:-8,rx:4,ry:4,width:b.width+16,height:b.height+16,fill:"transparent"})}))}};ib(Qw,"id","group");ib(Qw,"defaultProps",{id:"group",type:"group",parentId:"page",point:[0,0],size:[0,0],children:[]});tb=W(588);var mJ={xs:1,sm:1.6,md:2,lg:3.2,xl:4.8,xxl:6},lr=class extends Ar{constructor(b={}){super(b);ib(this,"ReactComponent",cf(({events:g,isErasing:p})=>{const {pointsPath:G,props:{stroke:Y,strokeWidth:la,opacity:pa}}=this;return(0,tb.jsx)(to,hf(pe({},g),{opacity:p?.2:1,children:(0,tb.jsx)("path",
|
|||
|
{d:G,strokeWidth:16*la,stroke:Xg(Y,"stroke"),fill:"none",pointerEvents:"all",strokeLinejoin:"round",strokeLinecap:"round",opacity:pa})}))}));ib(this,"setScaleLevel",g=>Zh(this,null,function*(){this.update({scaleLevel:g,strokeWidth:mJ[null!=g?g:"md"]});this.onResetBounds()}));ib(this,"ReactIndicator",cf(()=>{const {pointsPath:g,props:p}=this;return(0,tb.jsx)("path",{d:g,fill:"none",strokeDasharray:p.isLocked?"8 2":"undefined"})}));ib(this,"validateProps",g=>{g=cm(this,g);void 0!==g.strokeWidth&&(g.strokeWidth=
|
|||
|
Math.max(g.strokeWidth,1));return g});Ag(this)}get pointsPath(){const {points:b}=this.props;return Ks.getCurvedPathForPoints(b)}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}getShapeSVGJsx(){const {pointsPath:b,props:{stroke:g,strokeWidth:p,opacity:G}}=this;return(0,tb.jsx)("path",{d:b,strokeWidth:16*p,stroke:Xg(g,"stroke"),fill:"none",pointerEvents:"all",strokeLinejoin:"round",strokeLinecap:"round",opacity:G})}};ib(lr,"id","highlighter");ib(lr,"defaultProps",{id:"highlighter",
|
|||
|
parentId:"page",type:"highlighter",point:[0,0],points:[],isComplete:!1,stroke:"",fill:"",noFill:!0,strokeType:"line",strokeWidth:2,opacity:.5});ce([wf],lr.prototype,"pointsPath",1);ce([wf],lr.prototype,"scaleLevel",1);ce([qg],lr.prototype,"setScaleLevel",2);var Rw=sf(W(22));tb=W(588);var Sw={xs:.5,sm:.8,md:1,lg:1.5,xl:2,xxl:3},nq=class extends An{constructor(){super(...arguments);ib(this,"canChangeAspectRatio",!0);ib(this,"canFlip",!1);ib(this,"canEdit",!0);ib(this,"htmlAnchorRef",Rw.createRef());
|
|||
|
ib(this,"setScaleLevel",b=>Zh(this,null,function*(){var g;const p=ke.mul(this.props.size,Sw[null!=b?b:"md"]/Sw[null!=(g=this.props.scaleLevel)?g:"md"]);this.update({scaleLevel:b});yield Mj();this.update({size:p})}));ib(this,"onResetBounds",b=>{var g;if(this.htmlAnchorRef.current){const p=this.htmlAnchorRef.current.getBoundingClientRect(),[G,Y]=ke.div([p.width,p.height],null!=(g=null==b?void 0:b.zoom)?g:1);this.update({size:[Math.max(Math.min(G||400,1400),10),Math.max(Math.min(Y||400,1400),10)]})}return this});
|
|||
|
ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p})=>{const {props:{html:G,scaleLevel:Y}}=this,la=Vl(),pa=Ye(),Ga=pa.selectedIds.has(this.id),Qa=la||Ga&&!p||"select"!==pa.selectedTool.id,Za=Rw.useCallback(mb=>{Qa||mb.stopPropagation()},[Qa]),fb=Sw[null!=Y?Y:"md"];Rw.useEffect(()=>{0===this.props.size[1]&&(this.onResetBounds({zoom:pa.viewport.camera.zoom}),pa.persist(!0))},[]);return(0,tb.jsx)(so,hf(pe({style:{overflow:"hidden",pointerEvents:"all",opacity:g?.2:1}},b),{children:(0,tb.jsx)("div",
|
|||
|
{onWheelCapture:Za,onPointerDown:Za,onPointerUp:Za,className:"tl-html-container",style:{pointerEvents:la||!p&&!Ga?"none":"all",overflow:p?"auto":"hidden",width:`calc(100% / ${fb})`,height:`calc(100% / ${fb})`,transform:`scale(${fb})`},children:(0,tb.jsx)("div",{ref:this.htmlAnchorRef,className:"tl-html-anchor",dangerouslySetInnerHTML:{__html:G.trim()}})})}))}));ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,fill:"transparent",
|
|||
|
strokeDasharray:p?"8 2":"undefined"})}));ib(this,"validateProps",b=>{void 0!==b.size&&(b.size[0]=Math.max(b.size[0],1),b.size[1]=Math.max(b.size[1],1));return cm(this,b)})}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}};ib(nq,"id","html");ib(nq,"defaultProps",{id:"html",type:"html",parentId:"page",point:[0,0],size:[600,0],html:""});ce([wf],nq.prototype,"scaleLevel",1);ce([qg],nq.prototype,"setScaleLevel",2);var vB=sf(W(22));tb=W(588);var mr=class extends An{constructor(){super(...arguments);
|
|||
|
ib(this,"frameRef",vB.createRef());ib(this,"canEdit",!0);ib(this,"onIFrameSourceChange",b=>{this.update({url:b})});ib(this,"reload",()=>{var b,g;this.frameRef.current&&(this.frameRef.current.src=null==(g=null==(b=this.frameRef)?void 0:b.current)?void 0:g.src)});ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p})=>{vB.useRef(null);const G=Ye();return(0,tb.jsx)(so,hf(pe({style:{overflow:"hidden",pointerEvents:"all",opacity:g?.2:1}},b),{children:(0,tb.jsx)("div",{className:"tl-iframe-container",
|
|||
|
style:{pointerEvents:p||G.readOnly?"all":"none",userSelect:"none"},children:this.props.url&&(0,tb.jsx)("div",{style:{overflow:"hidden",position:"relative",height:"100%"},children:(0,tb.jsx)("iframe",{ref:this.frameRef,className:"absolute inset-0 w-full h-full m-0",width:"100%",height:"100%",src:`${this.props.url}`,frameBorder:"0",sandbox:"allow-scripts allow-same-origin"})})})}))}));ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,
|
|||
|
fill:"transparent",rx:8,ry:8,strokeDasharray:p?"8 2":"undefined"})}))}};ib(mr,"id","iframe");ib(mr,"defaultProps",{id:"iframe",type:"iframe",parentId:"page",point:[0,0],size:[853,480],url:""});ce([qg],mr.prototype,"onIFrameSourceChange",2);ce([qg],mr.prototype,"reload",2);var nJ=sf(W(22));tb=W(588);var Ou=class extends Hv{constructor(){super(...arguments);ib(this,"ReactComponent",cf(({events:b,isErasing:g,isBinding:p,asset:G})=>{const {props:{opacity:Y,objectFit:la,clipping:pa,size:[Ga,Qa]}}=this,
|
|||
|
[Za,fb,mb,Lb]=Array.isArray(pa)?pa:[pa,pa,pa,pa],{handlers:Tb}=nJ.useContext(an);return(0,tb.jsxs)(so,hf(pe({},b),{opacity:g?.2:Y,children:[p&&(0,tb.jsx)(no,{mode:"html",strokeWidth:4,size:[Ga,Qa]}),(0,tb.jsx)("div",{"data-asset-loaded":!!G,className:"tl-image-shape-container",children:G?(0,tb.jsx)("img",{src:Tb?Tb.makeAssetUrl(G.src):G.src,draggable:!1,style:{position:"relative",top:-Za,left:-Lb,width:Ga+(Lb-fb),height:Qa+(Za-mb),objectFit:la}}):"Asset is missing"})]}))}));ib(this,"ReactIndicator",
|
|||
|
cf(()=>{const {props:{size:[b,g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,fill:"transparent",strokeDasharray:p?"8 2":"undefined"})}))}getShapeSVGJsx({assets:b}){var g,p;const G=this.getBounds(),{assetId:Y,clipping:la}=this.props;if(b=b.find(pa=>pa.id===Y)){Array.isArray(la);const pa=null==(p=null==(g=window.logseq)?void 0:g.api)?void 0:p.make_asset_url;return(0,tb.jsx)("image",{width:G.width,height:G.height,href:pa?pa(b.src):b.src})}return super.getShapeSVGJsx({})}};ib(Ou,"id",
|
|||
|
"image");ib(Ou,"defaultProps",{id:"image1",parentId:"page",type:"image",point:[0,0],size:[100,100],opacity:1,assetId:"",clipping:0,objectFit:"fill",isAspectRatioLocked:!0});var Tw=sf(W(22)),oJ=sf(W(22));tb=W(588);tb=W(588);var wB={xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},pJ=oJ.memo(function({style:b,start:g,end:p,decorationStart:G,decorationEnd:Y,scaleLevel:la}){const pa=ke.dist(g,p);if(2>pa)return null;const {strokeWidth:Ga}=b,Qa=1+Ga*wB[null!=la?la:"md"]/10,Za="M"+ke.toFixed(g)+"L"+ke.toFixed(p);la=
|
|||
|
Math.min(pa/3,Ga*wB[null!=la?la:"md"]);G=G?$n(g,p,la):null;Y=Y?$n(p,g,la):null;return(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)("path",{className:"tl-stroke-hitarea",d:Za}),(0,tb.jsx)("path",{d:Za,strokeWidth:Qa,stroke:b.stroke,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"dashed"===b.strokeType?"8 4":void 0,pointerEvents:"stroke"}),G&&(0,tb.jsx)(Um,{left:G.left,middle:g,right:G.right,stroke:b.stroke,strokeWidth:Qa}),Y&&(0,tb.jsx)(Um,{left:Y.left,middle:p,right:Y.right,stroke:b.stroke,
|
|||
|
strokeWidth:Qa})]})});tb=W(588);tb=W(588);var qJ={xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},is=class extends Ms{constructor(){super(...arguments);ib(this,"hideSelection",!0);ib(this,"canEdit",!0);ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p,onEditingEnd:G})=>{const {stroke:Y,handles:{start:la,end:pa},opacity:Ga,label:Qa,italic:Za,fontWeight:fb,fontSize:mb,id:Lb}=this.props,Tb=Qa||p?Xh(Qa||"Enter text",{fontFamily:"var(--ls-font-family)",fontSize:mb,lineHeight:1,fontWeight:fb},6):[0,
|
|||
|
0],Pb=ke.med(la.point,pa.point);var lc=ke.dist(la.point,pa.point);lc=Math.max(.5,Math.min(1,Math.max(lc/(Tb[1]+128),lc/(Tb[0]+128))));const xc=this.getBounds(),$b=Tw.useMemo(()=>ke.sub(Pb,ke.toFixed([xc.width/2,xc.height/2])),[xc,lc,Pb]),sc=Tw.useCallback(oc=>{var Mc;null==(Mc=this.update)?void 0:Mc.call(this,{label:oc})},[Qa]);return(0,tb.jsxs)("div",hf(pe({},b),{style:{width:"100%",height:"100%",overflow:"hidden"},className:"tl-line-container",children:[(0,tb.jsx)(Nu,{font:"20px / 1 var(--ls-font-family)",
|
|||
|
text:Qa,fontSize:mb,color:Xg(Y,"text"),offsetX:$b[0],offsetY:$b[1],scale:lc,isEditing:p,onChange:sc,onBlur:G,fontStyle:Za?"italic":"normal",fontWeight:fb,pointerEvents:!!Qa}),(0,tb.jsxs)(to,{opacity:g?.2:Ga,id:Lb+"_svg",children:[(0,tb.jsx)(Dl,{id:Lb,bounds:xc,labelSize:Tb,offset:$b,scale:lc}),(0,tb.jsx)("g",{pointerEvents:"none",mask:Qa||p?`url(#${Lb}_clip)`:"",children:this.getShapeSVGJsx({preview:!1})})]})]}))}));ib(this,"setScaleLevel",b=>Zh(this,null,function*(){this.update({scaleLevel:b,fontSize:qJ[null!=
|
|||
|
b?b:"md"]});this.onResetBounds()}));ib(this,"ReactIndicator",cf(({isEditing:b})=>{const {id:g,decorations:p,label:G,strokeWidth:Y,fontSize:la,fontWeight:pa,handles:{start:Ga,end:Qa},isLocked:Za}=this.props,fb=this.getBounds(),mb=G||b?Xh(G,{fontFamily:"var(--ls-font-family)",fontSize:la,lineHeight:1,fontWeight:pa},6):[0,0],Lb=ke.med(Ga.point,Qa.point);var Tb=ke.dist(Ga.point,Qa.point);Tb=Math.max(.5,Math.min(1,Math.max(Tb/(mb[1]+128),Tb/(mb[0]+128))));const Pb=Tw.useMemo(()=>ke.sub(Lb,ke.toFixed([fb.width/
|
|||
|
2,fb.height/2])),[fb,Tb,Lb]);return(0,tb.jsxs)("g",{children:[(0,tb.jsx)("path",{mask:G?`url(#${g}_clip)`:"",d:Lo({strokeWidth:Y},Ga.point,Qa.point,null==p?void 0:p.start,null==p?void 0:p.end),strokeDasharray:Za?"8 2":"undefined"}),G&&!b&&(0,tb.jsx)("rect",{x:fb.width/2-mb[0]/2*Tb+Pb[0],y:fb.height/2-mb[1]/2*Tb+Pb[1],width:mb[0]*Tb,height:mb[1]*Tb,rx:4*Tb,ry:4*Tb,fill:"transparent"})]})}));ib(this,"validateProps",b=>cm(this,b))}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}getShapeSVGJsx({preview:b}){const {stroke:g,
|
|||
|
fill:p,strokeWidth:G,strokeType:Y,decorations:la,label:pa,scaleLevel:Ga,handles:{start:Qa,end:Za}}=this.props,fb=ke.med(Qa.point,Za.point);return(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)(pJ,{style:{stroke:Xg(g,"text"),fill:p,strokeWidth:G,strokeType:Y},scaleLevel:Ga,start:Qa.point,end:Za.point,decorationStart:null==la?void 0:la.start,decorationEnd:null==la?void 0:la.end}),b&&(0,tb.jsx)(tb.Fragment,{children:(0,tb.jsx)("text",{style:{transformOrigin:"top left"},fontFamily:"Inter",fontSize:20,transform:`translate(${fb[0]}, ${fb[1]})`,
|
|||
|
textAnchor:"middle",fill:Xg(g,"text"),stroke:Xg(g,"text"),children:pa})})]})}};ib(is,"id","line");ib(is,"defaultProps",{id:"line",parentId:"page",type:"line",point:[0,0],handles:{start:{id:"start",canBind:!0,point:[0,0]},end:{id:"end",canBind:!0,point:[1,1]}},stroke:"",fill:"",noFill:!0,fontWeight:400,fontSize:20,italic:!1,strokeType:"line",strokeWidth:1,opacity:1,decorations:{end:"arrow"},label:""});ce([wf],is.prototype,"scaleLevel",1);ce([qg],is.prototype,"setScaleLevel",2);var Rn=sf(W(22));tb=
|
|||
|
W(588);var qt={xs:.5,sm:.8,md:1,lg:1.5,xl:2,xxl:3},rJ=cf(({type:b,fill:g,opacity:p,children:G})=>{const Y="var(--ls-secondary-background-color)"!==g?Xg(g,"background"):"var(--ls-tertiary-background-color)";g=g&&"var(--ls-secondary-background-color)"!==g?jg(g)?`var(--ls-highlight-color-${g})`:g:"var(--ls-secondary-background-color)";return(0,tb.jsxs)("div",{className:`tl-logseq-portal-header tl-logseq-portal-header-${"P"===b?"page":"block"}`,children:[(0,tb.jsx)("div",{className:"absolute inset-0 tl-logseq-portal-header-bg",
|
|||
|
style:{opacity:p,background:"P"===b?Y:`linear-gradient(0deg, ${g}, ${Y})`}}),(0,tb.jsx)("div",{className:"relative",children:G})]})}),Ll=class extends An{constructor(b={}){var g;super(b);ib(this,"hideRotateHandle",!0);ib(this,"canChangeAspectRatio",!0);ib(this,"canFlip",!0);ib(this,"canEdit",!0);ib(this,"persist",null);ib(this,"initialHeightCalculated",!0);ib(this,"getInnerHeight",null);ib(this,"setCollapsed",p=>Zh(this,null,function*(){var G;if("B"===this.props.blockType){if(this.update({compact:p}),
|
|||
|
this.canResize[1]=!p,!p)this.onResetBounds()}else{const Y=this.props.size[1];this.canResize[1]=!p;this.update({isAutoResizing:!p,collapsed:p,size:[this.props.size[0],p?this.getHeaderHeight():this.props.collapsedHeight],collapsedHeight:p?Y:this.props.collapsedHeight})}null==(G=this.persist)?void 0:G.call(this)}));ib(this,"setScaleLevel",p=>Zh(this,null,function*(){var G;const Y=ke.mul(this.props.size,qt[null!=p?p:"md"]/qt[null!=(G=this.props.scaleLevel)?G:"md"]);this.update({scaleLevel:p});yield Mj();
|
|||
|
this.update({size:Y})}));ib(this,"onResetBounds",p=>{p=this.getAutoResizeHeight();null!==p&&1<Math.abs(p-this.props.size[1])&&(this.update({size:[this.props.size[0],p]}),this.initialHeightCalculated=!0);return this});ib(this,"onResize",(p,G)=>{var Y;const {bounds:la,rotation:pa,scale:[Ga,Qa]}=G;p=[...this.scale];0>Ga&&(p[0]*=-1);0>Qa&&(p[1]*=-1);G=la.height;this.props.isAutoResizing&&(G=null!=(Y=this.getAutoResizeHeight())?Y:G);return this.update({point:[la.minX,la.minY],size:[Math.max(1,la.width),
|
|||
|
Math.max(1,G)],scale:p,rotation:pa})});ib(this,"PortalComponent",cf(({})=>{const {props:{pageId:p,fill:G,opacity:Y}}=this,{renderers:la}=Rn.useContext(an),pa=Ye(),Ga=Rn.useRef(null),[,Qa]=this.useComponentSize(Ga,this.props.compact?".tl-logseq-cp-container \x3e .single-block":".tl-logseq-cp-container \x3e .page");if(null==la||!la.Page)return null;const {Page:Za,Block:fb}=la,[mb,Lb]=Rn.useState(!1);Rn.useEffect(()=>{var Tb,Pb;if(this.props.isAutoResizing){const lc=(null!=(Pb=null==(Tb=this.getInnerHeight)?
|
|||
|
void 0:Tb.call(this))?Pb:Qa)+this.getHeaderHeight();Qa&&1<Math.abs(lc-this.props.size[1])&&(this.update({size:[this.props.size[0],lc]}),mb&&pa.persist(!0))}},[Qa,this.props.isAutoResizing]);Rn.useEffect(()=>{this.initialHeightCalculated||setTimeout(()=>{this.onResetBounds();pa.persist(!0)})},[this.initialHeightCalculated]);Rn.useEffect(()=>{setTimeout(function(){Lb(!0)})},[]);return(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)("div",{className:"absolute inset-0 tl-logseq-cp-container-bg",style:{textRendering:.5>
|
|||
|
pa.viewport.camera.zoom?"optimizeSpeed":"auto",background:G&&"var(--ls-secondary-background-color)"!==G?jg(G)?`var(--ls-highlight-color-${G})`:G:"var(--ls-secondary-background-color)",opacity:Y}}),(0,tb.jsx)("div",{ref:Ga,className:"relative tl-logseq-cp-container",style:{overflow:this.props.isAutoResizing?"visible":"auto"},children:(mb||!this.initialHeightCalculated)&&("B"===this.props.blockType&&this.props.compact?(0,tb.jsx)(fb,{blockId:p}):(0,tb.jsx)(Za,{pageName:p}))})]})}));ib(this,"ReactComponent",
|
|||
|
cf(p=>{var G;const {events:Y,isErasing:la,isEditing:pa,isBinding:Ga}=p,{props:{opacity:Qa,pageId:Za,fill:fb,scaleLevel:mb,strokeWidth:Lb,size:Tb}}=this,Pb=Ye(),{renderers:lc,handlers:xc}=Rn.useContext(an);this.persist=()=>Pb.persist();const $b=Vl(),sc=Pb.selectedIds.has(this.id)&&1===Pb.selectedIds.size,oc=Pb.isIn("logseq-portal.creating")&&!Za,Mc=($b||sc&&!pa||"select"!==Pb.selectedTool.id)&&!oc,Tc=Rn.useCallback(rd=>{Mc||rd.stopPropagation()},[Mc]),vd=1===Pb.selectedShapesArray.length&&Pb.selectedShapesArray.some(rd=>
|
|||
|
"logseq-portal"===rd.type&&rd.props.id!==this.props.id&&Za&&rd.props.pageId===Za),de=qt[null!=mb?mb:"md"];Rn.useEffect(()=>this.props.collapsed&&pa?(this.update({size:[this.props.size[0],this.props.collapsedHeight]}),()=>{this.update({size:[this.props.size[0],this.getHeaderHeight()]})}):()=>{},[pa,this.props.collapsed]);Rn.useEffect(()=>{if(oc){const rd=[Pb.viewport.bounds.width,Pb.viewport.bounds.height],sd=Pb.viewport.getScreenPoint([this.bounds.minX,this.bounds.minY]);(sd[0]>rd[0]-400||sd[1]>rd[1]-
|
|||
|
240||1.5<Pb.viewport.camera.zoom||.5>Pb.viewport.camera.zoom)&&Pb.viewport.zoomToBounds(hf(pe({},this.bounds),{minY:this.bounds.maxY+25}))}},[Pb.viewport.bounds.height.toFixed(2)]);const ne=Rn.useCallback(rd=>{this.initialHeightCalculated=!1;const sd=dk(rd)?"B":"P";this.update({pageId:rd,size:[400,320],blockType:sd,compact:"B"===sd});Pb.selectTool("select");Pb.history.resume();Pb.history.persist()},[]),De=this.PortalComponent;var $e=Rn.useMemo(()=>{var rd;if(Za&&"B"===this.props.blockType)return null==
|
|||
|
(rd=null==xc?void 0:xc.queryBlockByUUID(Za))?void 0:rd.content},[null==xc?void 0:xc.queryBlockByUUID,Za]);$e="B"===this.props.blockType&&"string"!==typeof $e;const mf=(!this.props.collapsed||pa)&&!$e;if(null==lc||!lc.Page)return null;const {Breadcrumb:Te,PageName:rf}=lc,Vd={width:`calc(100% / ${de})`,height:`calc(100% / ${de})`,opacity:la?.2:1};1!==de&&(Vd.transform=`scale(${de})`);return(0,tb.jsxs)(so,hf(pe({style:{pointerEvents:"all"}},Y),{children:[Ga&&(0,tb.jsx)(no,{mode:"html",strokeWidth:Lb,
|
|||
|
size:Tb}),(0,tb.jsx)("div",{"data-inner-events":!Mc,onWheelCapture:Tc,onPointerDown:Tc,onPointerUp:Tc,style:{width:"100%",height:"100%",pointerEvents:$b||!pa&&!sc?"none":"all"},children:oc?(0,tb.jsx)(MB,{onChange:ne,onAddBlock:rd=>{setTimeout(()=>{var sd,ud,ie;Pb.api.editShape(this);null==(ie=null==(ud=null==(sd=window.logseq)?void 0:sd.api)?void 0:ud.edit_block)?void 0:ie.call(ud,rd)})},placeholder:"Create or search your graph..."}):(0,tb.jsxs)("div",{className:"tl-logseq-portal-container","data-collapsed":this.collapsed,
|
|||
|
"data-page-id":Za,"data-portal-selected":vd,"data-editing":pa,style:Vd,children:[!this.props.compact&&!$e&&(0,tb.jsx)(rJ,{type:null!=(G=this.props.blockType)?G:"P",fill:fb,opacity:Qa,children:"P"===this.props.blockType?(0,tb.jsx)(rf,{pageName:Za}):(0,tb.jsx)(Te,{blockId:Za})}),$e&&(0,tb.jsx)("div",{className:"tl-target-not-found",children:"Target not found"}),mf&&(0,tb.jsx)(De,pe({},p))]})})]}))}));ib(this,"ReactIndicator",cf(()=>{const p=this.getBounds();return(0,tb.jsx)("rect",{width:p.width,height:p.height,
|
|||
|
fill:"transparent",rx:8,ry:8,strokeDasharray:this.props.isLocked?"8 2":"undefined"})}));ib(this,"validateProps",p=>{var G;if(void 0!==p.size){const Y=qt[null!=(G=this.props.scaleLevel)?G:"md"];p.size[0]=Math.max(p.size[0],60*Y);p.size[1]=Math.max(p.size[1],40*Y)}return cm(this,p)});Ag(this);b.collapsed&&Object.assign(this.canResize,[!0,!1]);0===(null==(g=b.size)?void 0:g[1])&&(this.initialHeightCalculated=!1)}static isPageOrBlock(b){return b?/^\(\(.*\)\)$/.test(b)&&40===b.length?"B":"P":!1}get collapsed(){return"B"===
|
|||
|
this.props.blockType?this.props.compact:this.props.collapsed}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}useComponentSize(b,g=""){const [p,G]=Rn.useState([0,0]),Y=Ye();Rn.useEffect(()=>{setTimeout(()=>{if(null==b?0:b.current){const la=g?b.current.querySelector(g):b.current;if(la){const pa=()=>{const {width:Qa,height:Za}=la.getBoundingClientRect(),fb=ke.div([Qa,Za],Y.viewport.camera.zoom);G(fb);return fb};pa();this.getInnerHeight=()=>pa()[1];const Ga=new ResizeObserver(()=>
|
|||
|
{pa()});Ga.observe(la);return()=>{Ga.disconnect()}}}return()=>{}},10)},[b,g]);return p}getHeaderHeight(){var b;const g=qt[null!=(b=this.props.scaleLevel)?b:"md"];return this.props.compact?0:40*g}getAutoResizeHeight(){return this.getInnerHeight?this.getHeaderHeight()+this.getInnerHeight():null}getShapeSVGJsx({}){var b,g,p;const G=this.getBounds();return(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)("rect",{fill:this.props.fill&&"var(--ls-secondary-background-color)"!==this.props.fill?jg(this.props.fill)?
|
|||
|
`var(--ls-highlight-color-${this.props.fill})`:this.props.fill:"var(--ls-secondary-background-color)",stroke:Xg(this.props.fill,"background"),strokeWidth:null!=(b=this.props.strokeWidth)?b:2,fillOpacity:null!=(g=this.props.opacity)?g:.2,width:G.width,rx:8,ry:8,height:G.height}),!this.props.compact&&(0,tb.jsx)("rect",{fill:this.props.fill&&"var(--ls-secondary-background-color)"!==this.props.fill?Xg(this.props.fill,"background"):"var(--ls-tertiary-background-color)",fillOpacity:null!=(p=this.props.opacity)?
|
|||
|
p:.2,x:1,y:1,width:G.width-2,height:38,rx:8,ry:8}),(0,tb.jsx)("text",{style:{transformOrigin:"top left"},transform:`translate(${G.width/2}, ${10+G.height/2})`,textAnchor:"middle",fontFamily:"var(--ls-font-family)",fontSize:"32",fill:"var(--ls-secondary-text-color)",stroke:"var(--ls-secondary-text-color)",children:"P"===this.props.blockType?this.props.pageId:""})]})}};ib(Ll,"id","logseq-portal");ib(Ll,"defaultSearchQuery","");ib(Ll,"defaultSearchFilter",null);ib(Ll,"defaultProps",{id:"logseq-portal",
|
|||
|
type:"logseq-portal",parentId:"page",point:[0,0],size:[400,50],collapsedHeight:0,stroke:"",fill:"",noFill:!1,borderRadius:8,strokeWidth:2,strokeType:"line",opacity:1,pageId:"",collapsed:!1,compact:!1,scaleLevel:"md",isAutoResizing:!0});ce([wf],Ll.prototype,"collapsed",1);ce([qg],Ll.prototype,"setCollapsed",2);ce([wf],Ll.prototype,"scaleLevel",1);ce([qg],Ll.prototype,"setScaleLevel",2);var {min:js,PI:sJ}=Math,rt=sJ+1E-4;tb=W(588);var tJ={xs:1,sm:1.6,md:2,lg:3.2,xl:4.8,xxl:6},uJ={easing:b=>Math.sin(b*
|
|||
|
Math.PI/2),simulatePressure:!0},vJ={easing:b=>b*b,simulatePressure:!1},nr=class extends Ar{constructor(b={}){super(b);ib(this,"ReactComponent",cf(({events:g,isErasing:p})=>{const {props:{opacity:G}}=this;return(0,tb.jsx)(to,hf(pe({},g),{opacity:p?.2:G,children:this.getShapeSVGJsx()}))}));ib(this,"setScaleLevel",g=>Zh(this,null,function*(){this.update({scaleLevel:g,strokeWidth:tJ[null!=g?g:"md"]});this.onResetBounds()}));ib(this,"ReactIndicator",cf(()=>{const {pointsPath:g}=this;return(0,tb.jsx)("path",
|
|||
|
{d:g,strokeDasharray:this.props.isLocked?"8 2":"undefined"})}));ib(this,"validateProps",g=>{g=cm(this,g);void 0!==g.strokeWidth&&(g.strokeWidth=Math.max(g.strokeWidth,1));return g});Ag(this)}get pointsPath(){var b=this.props;if(2>b.points.length)var g="";else g=hf(pe({size:1+1.5*b.strokeWidth,thinning:.65,streamline:.65,smoothing:.65},.5===b.points[1][2]?uJ:vJ),{last:b.isComplete}),b=tc(b.points,g),g=Ks.getSvgPathFromStroke(Jb(b,g));return g}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?
|
|||
|
b:"md"}getShapeSVGJsx(){const {pointsPath:b,props:{stroke:g,strokeWidth:p,strokeType:G}}=this;return(0,tb.jsx)("path",{pointerEvents:"all",d:b,strokeWidth:p/2,strokeLinejoin:"round",strokeLinecap:"round",stroke:Xg(g,"text"),fill:Xg(g,"text"),strokeDasharray:"dashed"===G?"12 4":void 0})}};ib(nr,"id","pencil");ib(nr,"defaultProps",{id:"pencil",parentId:"page",type:"pencil",point:[0,0],points:[],isComplete:!1,stroke:"",fill:"",noFill:!0,strokeType:"line",strokeWidth:2,opacity:1});ce([wf],nr.prototype,
|
|||
|
"pointsPath",1);ce([wf],nr.prototype,"scaleLevel",1);ce([qg],nr.prototype,"setScaleLevel",2);var xB=sf(W(22));tb=W(588);var yB={xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},ks=class extends Vp{constructor(){super(...arguments);ib(this,"canEdit",!0);ib(this,"ReactComponent",cf(({events:b,isErasing:g,isSelected:p,isEditing:G,onEditingEnd:Y})=>{const {offset:[la,pa],props:{stroke:Ga,fill:Qa,noFill:Za,strokeWidth:fb,opacity:mb,strokeType:Lb,label:Tb,italic:Pb,fontWeight:lc,fontSize:xc}}=this,$b=this.getVertices(fb/
|
|||
|
2).join();var sc=Tb||G?Xh(Tb,{fontFamily:"var(--ls-font-family)",fontSize:xc,lineHeight:1,fontWeight:lc},4):[0,0];const oc=[this.props.size[0]/2,2*this.props.size[1]/3];sc=Math.max(.5,Math.min(1,this.props.size[0]/(2*sc[0]),this.props.size[1]/(2*sc[1])));const Mc=this.getBounds(),Tc=xB.useMemo(()=>ke.sub(oc,ke.toFixed([Mc.width/2,Mc.height/2])),[Mc,sc,oc]),vd=xB.useCallback(de=>{var ne;null==(ne=this.update)?void 0:ne.call(this,{label:de})},[Tb]);return(0,tb.jsxs)("div",hf(pe({},b),{style:{width:"100%",
|
|||
|
height:"100%",overflow:"hidden"},children:[(0,tb.jsx)(Nu,{font:"20px / 1 var(--ls-font-family)",text:Tb,fontSize:xc,color:Xg(Ga,"text"),offsetX:Tc[0],offsetY:Tc[1]/sc,scale:sc,isEditing:G,onChange:vd,onBlur:Y,fontStyle:Pb?"italic":"normal",fontWeight:lc,pointerEvents:!!Tb}),(0,tb.jsx)(to,{opacity:g?.2:mb,children:(0,tb.jsxs)("g",{transform:`translate(${la}, ${pa})`,children:[(0,tb.jsx)("polygon",{className:p||!Za?"tl-hitarea-fill":"tl-hitarea-stroke",points:$b}),(0,tb.jsx)("polygon",{points:$b,stroke:Xg(Ga,
|
|||
|
"stroke"),fill:Za?"none":Xg(Qa,"background"),strokeWidth:fb,rx:2,ry:2,strokeLinejoin:"round",strokeDasharray:"dashed"===Lb?"8 2":void 0})]})})]}))}));ib(this,"setScaleLevel",b=>Zh(this,null,function*(){this.update({scaleLevel:b,fontSize:yB[null!=b?b:"md"],strokeWidth:yB[null!=b?b:"md"]/10});this.onResetBounds()}));ib(this,"ReactIndicator",cf(()=>{const {offset:[b,g],props:{strokeWidth:p,isLocked:G}}=this;return(0,tb.jsx)("g",{children:(0,tb.jsx)("polygon",{transform:`translate(${b}, ${g})`,points:this.getVertices(p/
|
|||
|
2).join(),strokeDasharray:G?"8 2":"undefined"})})}));ib(this,"validateProps",b=>{void 0!==b.sides&&(b.sides=Math.max(b.sides,3));return cm(this,b)})}get scaleLevel(){var b;return null!=(b=this.props.scaleLevel)?b:"md"}getShapeSVGJsx(b){const {offset:[g,p],props:{stroke:G,fill:Y,noFill:la,strokeWidth:pa,opacity:Ga,strokeType:Qa}}=this;b=this.getVertices(pa/2).join();return(0,tb.jsxs)("g",{transform:`translate(${g}, ${p})`,opacity:Ga,children:[(0,tb.jsx)("polygon",{className:la?"tl-hitarea-stroke":
|
|||
|
"tl-hitarea-fill",points:b}),(0,tb.jsx)("polygon",{points:b,stroke:Xg(G,"stroke"),fill:la?"none":Xg(Y,"background"),strokeWidth:pa,rx:2,ry:2,strokeLinejoin:"round",strokeDasharray:"dashed"===Qa?"8 2":void 0})]})}};ib(ks,"id","polygon");ib(ks,"defaultProps",{id:"polygon",parentId:"page",type:"polygon",point:[0,0],size:[100,100],sides:3,ratio:1,isFlippedY:!1,stroke:"",fill:"",fontWeight:400,fontSize:20,italic:!1,noFill:!1,strokeType:"line",strokeWidth:2,opacity:1,label:""});ce([wf],ks.prototype,"scaleLevel",
|
|||
|
1);ce([qg],ks.prototype,"setScaleLevel",2);var op=sf(W(22));tb=W(588);var wJ={xs:10,sm:16,md:20,lg:32,xl:48,xxl:60},ls=class extends Iv{constructor(){super(...arguments);ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p,onEditingEnd:G})=>{const {props:{opacity:Y,fontFamily:la,fontSize:pa,fontWeight:Ga,italic:Qa,lineHeight:Za,text:fb,stroke:mb,padding:Lb}}=this,Tb=op.useRef(null),Pb=op.useRef(!1),lc=op.useRef(null),xc=op.useCallback(Tc=>{const {isSizeLocked:vd}=this.props;Tc=Ur.normalizeText(Tc.currentTarget.value);
|
|||
|
vd?this.update({text:Tc,size:this.getAutoSizedBoundingBox({text:Tc})}):this.update({text:Tc})},[]),$b=op.useCallback(Tc=>{if("Escape"!==Tc.key)if("Tab"===Tc.key&&0===fb.length)Tc.preventDefault();else{if("Meta"!==Tc.key&&!Tc.metaKey)Tc.stopPropagation();else if("z"===Tc.key&&Tc.metaKey){Tc.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1);Tc.stopPropagation();Tc.preventDefault();return}"Tab"===Tc.key&&(Tc.preventDefault(),Tc.shiftKey?ho.unindent(Tc.currentTarget):ho.indent(Tc.currentTarget),
|
|||
|
this.update({text:Ur.normalizeText(Tc.currentTarget.value)}))}},[]),sc=op.useCallback(Tc=>{p&&(Tc.currentTarget.setSelectionRange(0,0),null==G?void 0:G())},[G]),oc=op.useCallback(Tc=>{p&&Pb.current&&document.activeElement===Tc.currentTarget&&Tc.currentTarget.select()},[p]),Mc=op.useCallback(Tc=>{p&&Tc.stopPropagation()},[p]);op.useEffect(()=>{p&&requestAnimationFrame(()=>{Pb.current=!0;const Tc=Tb.current;Tc&&(Tc.focus(),Tc.select())})},[p,G]);op.useLayoutEffect(()=>{if(0===this.props.size[0]||0===
|
|||
|
this.props.size[1])this.onResetBounds()},[]);return(0,tb.jsx)(so,hf(pe({},b),{opacity:g?.2:Y,children:(0,tb.jsx)("div",{ref:lc,className:"tl-text-shape-wrapper","data-hastext":!!fb,"data-isediting":p,style:{fontFamily:la,fontStyle:Qa?"italic":"normal",fontSize:pa,fontWeight:Ga,padding:Lb,lineHeight:Za,color:Xg(mb,"text")},children:p?(0,tb.jsx)("textarea",{ref:Tb,className:"tl-text-shape-input",name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",
|
|||
|
placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:fb,onFocus:oc,onChange:xc,onKeyDown:$b,onBlur:sc,onPointerDown:Mc}):(0,tb.jsxs)(tb.Fragment,{children:[fb,""]})})}))}));ib(this,"setScaleLevel",b=>Zh(this,null,function*(){this.update({scaleLevel:b,fontSize:wJ[null!=b?b:"md"]});this.onResetBounds()}));ib(this,"ReactIndicator",cf(({isEditing:b})=>{const {props:{borderRadius:g,isLocked:p},bounds:G}=this;return b?null:(0,tb.jsx)("rect",{width:G.width,height:G.height,
|
|||
|
rx:g,ry:g,fill:"transparent",strokeDasharray:p?"8 2":"undefined"})}));ib(this,"validateProps",b=>cm(this,b));ib(this,"getBounds",()=>{const [b,g]=this.props.point,[p,G]=this.props.size;return{minX:b,minY:g,maxX:b+p,maxY:g+G,width:p,height:G}});ib(this,"onResizeStart",({isSingle:b})=>{var g;if(!b)return this;this.scale=[...(null!=(g=this.props.scale)?g:[1,1])];return this.update({isSizeLocked:!1})});ib(this,"onResetBounds",()=>{this.update({size:this.getAutoSizedBoundingBox(),isSizeLocked:!0});return this})}get scaleLevel(){var b;
|
|||
|
return null!=(b=this.props.scaleLevel)?b:"md"}getAutoSizedBoundingBox(b={}){const {text:g=this.props.text,fontFamily:p=this.props.fontFamily,fontSize:G=this.props.fontSize,fontWeight:Y=this.props.fontWeight,lineHeight:la=this.props.lineHeight,padding:pa=this.props.padding}=b,[Ga,Qa]=Xh(g,{fontFamily:p,fontSize:G,lineHeight:la,fontWeight:Y},pa);return[Ga,Qa]}getShapeSVGJsx(){var b=window.navigator.userAgent.toLowerCase();if(b.includes("webkit")&&!b.includes("chrome"))return super.getShapeSVGJsx(null);
|
|||
|
const {props:{text:g,stroke:p,fontSize:G,fontFamily:Y}}=this;b=this.getBounds();return(0,tb.jsx)("foreignObject",{width:b.width,height:b.height,children:(0,tb.jsx)("div",{style:{color:Xg(p,"text"),fontSize:G,fontFamily:Y,display:"contents"},children:g})})}};ib(ls,"id","text");ib(ls,"defaultProps",{id:"box",parentId:"page",type:"text",point:[0,0],size:[0,0],isSizeLocked:!0,text:"",lineHeight:1.2,fontSize:20,fontWeight:400,italic:!1,padding:4,fontFamily:"var(--ls-font-family)",borderRadius:0,stroke:"",
|
|||
|
fill:"",noFill:!0,strokeType:"line",strokeWidth:2,opacity:1});ce([wf],ls.prototype,"scaleLevel",1);ce([qg],ls.prototype,"setScaleLevel",2);var zB=sf(W(22));tb=W(588);var Pu=class extends An{constructor(){super(...arguments);ib(this,"canFlip",!1);ib(this,"canEdit",!0);ib(this,"canChangeAspectRatio",!1);ib(this,"ReactComponent",cf(({events:b,isErasing:g,asset:p,isEditing:G})=>{const {props:{opacity:Y}}=this,la=Vl();var pa=Ye();const Ga=pa.selectedIds.has(this.id),Qa=la||Ga&&!G||"select"!==pa.selectedTool.id;
|
|||
|
pa=zB.useCallback(fb=>{Qa||fb.stopPropagation()},[Qa]);const {handlers:Za}=zB.useContext(an);return(0,tb.jsx)(so,hf(pe({style:{overflow:"hidden",pointerEvents:"all",opacity:g?.2:Y}},b),{children:(0,tb.jsx)("div",{onWheelCapture:pa,onPointerDown:pa,onPointerUp:pa,className:"tl-video-container",style:{pointerEvents:la||!G&&!Ga?"none":"all",overflow:G?"auto":"hidden"},children:p&&(0,tb.jsx)("video",{controls:!0,src:Za?Za.makeAssetUrl(p.src):p.src})})}))}));ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,
|
|||
|
g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,fill:"transparent",strokeDasharray:p?"8 2":"undefined"})}))}};ib(Pu,"id","video");ib(Pu,"defaultProps",{id:"video1",parentId:"page",type:"video",point:[0,0],size:[100,100],opacity:1,assetId:"",clipping:0,isAspectRatioLocked:!0});tb=W(588);var AB=/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,BB=class extends An{constructor(){super(...arguments);ib(this,"aspectRatio",
|
|||
|
480/853);ib(this,"canChangeAspectRatio",!1);ib(this,"canFlip",!1);ib(this,"canEdit",!0);ib(this,"onYoutubeLinkChange",b=>{this.update({url:b,size:BB.defaultProps.size})});ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p})=>{const G=Ye();return(0,tb.jsx)(so,hf(pe({style:{overflow:"hidden",pointerEvents:"all",opacity:g?.2:1}},b),{children:(0,tb.jsx)("div",{className:"rounded-lg w-full h-full relative overflow-hidden shadow-xl tl-youtube-container",style:{pointerEvents:p||G.readOnly?"all":
|
|||
|
"none",userSelect:"none",background:`url('https://img.youtube.com/vi/${this.embedId}/mqdefault.jpg') no-repeat center/cover`},children:this.embedId?(0,tb.jsx)("div",{style:{overflow:"hidden",position:"relative",height:"100%"},children:(0,tb.jsx)("iframe",{className:"absolute inset-0 w-full h-full m-0",width:"853",height:"480",src:`https://www.youtube.com/embed/${this.embedId}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,
|
|||
|
title:"Embedded youtube"})}):(0,tb.jsx)("div",{className:"w-full h-full flex items-center justify-center p-4",style:{backgroundColor:"var(--ls-primary-background-color)"},children:(0,tb.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 502 210.649",height:"210.65",width:"128",children:(0,tb.jsxs)("g",{children:[(0,tb.jsx)("path",{d:"M498.333 45.7s-2.91-20.443-11.846-29.447C475.157 4.44 462.452 4.38 456.627 3.687c-41.7-3-104.25-3-104.25-3h-.13s-62.555 0-104.255 3c-5.826.693-18.523.753-29.86 12.566-8.933 9.004-11.84 29.447-11.84 29.447s-2.983 24.003-2.983 48.009v22.507c0 24.006 2.983 48.013 2.983 48.013s2.907 20.44 11.84 29.446c11.337 11.817 26.23 11.44 32.86 12.677 23.84 2.28 101.315 2.983 101.315 2.983s62.62-.094 104.32-3.093c5.824-.694 18.527-.75 29.857-12.567 8.936-9.006 11.846-29.446 11.846-29.446s2.98-24.007 2.98-48.013V93.709c0-24.006-2.98-48.01-2.98-48.01",
|
|||
|
fill:"#cd201f"}),(0,tb.jsx)("g",{children:(0,tb.jsx)("path",{d:"M187.934 169.537h-18.96V158.56c-7.19 8.24-13.284 12.4-19.927 12.4-5.826 0-9.876-2.747-11.9-7.717-1.23-3.02-2.103-7.736-2.103-14.663V68.744h18.957v81.833c.443 2.796 1.636 3.823 4.043 3.823 3.63 0 6.913-3.153 10.93-8.817V68.744h18.96v100.793zM102.109 139.597c.996 9.98-2.1 14.93-7.987 14.93s-8.98-4.95-7.98-14.93v-39.92c-1-9.98 2.093-14.657 7.98-14.657 5.89 0 8.993 4.677 7.996 14.657l-.01 39.92zm18.96-37.923c0-10.77-2.164-18.86-5.987-23.95-5.054-6.897-12.973-9.72-20.96-9.72-9.033 0-15.913 2.823-20.957 9.72-3.886 5.09-5.97 13.266-5.97 24.036l-.016 35.84c0 10.71 1.853 18.11 5.736 23.153 5.047 6.873 13.227 10.513 21.207 10.513 7.986 0 16.306-3.64 21.36-10.513 3.823-5.043 5.586-12.443 5.586-23.153v-35.926zM46.223 114.647v54.889h-19.96v-54.89S5.582 47.358 1.314 34.815H22.27L36.277 87.38l13.936-52.566H71.17l-24.947 79.833z"})}),
|
|||
|
(0,tb.jsxs)("g",{fill:"#fff",children:[(0,tb.jsx)("path",{d:"M440.413 96.647c0-9.33 2.557-11.874 8.59-11.874 5.99 0 8.374 2.777 8.374 11.997v10.893l-16.964.02V96.647zm35.96 25.986l-.003-20.4c0-10.656-2.1-18.456-5.88-23.5-5.06-6.823-12.253-10.436-21.317-10.436-9.226 0-16.42 3.613-21.643 10.436-3.84 5.044-6.076 13.28-6.076 23.943v34.927c0 10.596 2.46 18.013 6.296 23.003 5.227 6.813 12.42 10.216 21.87 10.216 9.44 0 16.853-3.566 21.85-10.81 2.2-3.196 3.616-6.82 4.226-10.823.164-1.81.64-5.933.64-11.753v-2.827h-18.96c0 7.247.037 11.557-.133 12.54-1.033 4.834-3.623 7.25-8.07 7.25-6.203 0-8.826-4.636-8.76-13.843v-17.923h35.96zM390.513 140.597c0 9.98-2.353 13.806-7.563 13.806-2.973 0-6.4-1.53-9.423-4.553l.02-60.523c3.02-2.98 6.43-4.55 9.403-4.55 5.21 0 7.563 2.93 7.563 12.91v42.91zm2.104-72.453c-6.647 0-13.253 4.087-19.09 11.27l.02-43.603h-17.963V169.54h17.963l.027-10.05c6.036 7.47 12.62 11.333 19.043 11.333 7.193 0 12.45-3.85 14.863-11.267 1.203-4.226 1.993-10.733 1.993-19.956V99.684c0-9.447-1.21-15.907-2.416-19.917-2.41-7.466-7.247-11.623-14.44-11.623M340.618 169.537h-18.956V158.56c-7.193 8.24-13.283 12.4-19.926 12.4-5.827 0-9.877-2.747-11.9-7.717-1.234-3.02-2.107-7.736-2.107-14.663V69.744h18.96v80.833c.443 2.796 1.633 3.823 4.043 3.823 3.63 0 6.913-3.153 10.93-8.817V69.744h18.957v99.793z"}),
|
|||
|
(0,tb.jsx)("path",{d:"M268.763 169.537h-19.956V54.77h-20.956V35.835l62.869-.024v18.96h-21.957v114.766z"})]})]})})})})}))}));ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,fill:"transparent",rx:8,ry:8,strokeDasharray:p?"8 2":"undefined"})}));ib(this,"validateProps",b=>{void 0!==b.size&&(b.size[0]=Math.max(b.size[0],1),b.size[1]=Math.max(b.size[0]*this.aspectRatio,1));return cm(this,b)})}get embedId(){var b,g;const p=this.props.url,
|
|||
|
G=p.match(AB);return null!=(g=null!=(b=null==G?void 0:G[1])?b:p)?g:""}getShapeSVGJsx(){const b=this.getBounds(),g=this.embedId;return g?(0,tb.jsxs)("g",{children:[(0,tb.jsx)("image",{width:b.width,height:b.height,href:`https://img.youtube.com/vi/${g}/mqdefault.jpg`,className:"grayscale-[50%]"}),(0,tb.jsx)("svg",{x:b.width/4,y:b.height/4,width:b.width/2,height:b.height/2,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,tb.jsx)("path",{d:"M4.76447 3.12199C5.63151 3.04859 6.56082 3 7.5 3C8.43918 3 9.36849 3.04859 10.2355 3.12199C11.2796 3.21037 11.9553 3.27008 12.472 3.39203C12.9425 3.50304 13.2048 3.64976 13.4306 3.88086C13.4553 3.90618 13.4902 3.94414 13.5133 3.97092C13.7126 4.20149 13.8435 4.4887 13.918 5.03283C13.9978 5.6156 14 6.37644 14 7.52493C14 8.66026 13.9978 9.41019 13.9181 9.98538C13.8439 10.5206 13.7137 10.8061 13.5125 11.0387C13.4896 11.0651 13.4541 11.1038 13.4296 11.1287C13.2009 11.3625 12.9406 11.5076 12.4818 11.6164C11.9752 11.7365 11.3143 11.7942 10.2878 11.8797C9.41948 11.9521 8.47566 12 7.5 12C6.52434 12 5.58052 11.9521 4.7122 11.8797C3.68572 11.7942 3.02477 11.7365 2.51816 11.6164C2.05936 11.5076 1.7991 11.3625 1.57037 11.1287C1.54593 11.1038 1.51035 11.0651 1.48748 11.0387C1.28628 10.8061 1.15612 10.5206 1.08193 9.98538C1.00221 9.41019 1 8.66026 1 7.52493C1 6.37644 1.00216 5.6156 1.082 5.03283C1.15654 4.4887 1.28744 4.20149 1.48666 3.97092C1.5098 3.94414 1.54468 3.90618 1.56942 3.88086C1.7952 3.64976 2.05752 3.50304 2.52796 3.39203C3.04473 3.27008 3.7204 3.21037 4.76447 3.12199ZM0 7.52493C0 5.28296 0 4.16198 0.729985 3.31713C0.766457 3.27491 0.815139 3.22194 0.854123 3.18204C1.63439 2.38339 2.64963 2.29744 4.68012 2.12555C5.56923 2.05028 6.52724 2 7.5 2C8.47276 2 9.43077 2.05028 10.3199 2.12555C12.3504 2.29744 13.3656 2.38339 14.1459 3.18204C14.1849 3.22194 14.2335 3.27491 14.27 3.31713C15 4.16198 15 5.28296 15 7.52493C15 9.74012 15 10.8477 14.2688 11.6929C14.2326 11.7348 14.1832 11.7885 14.1444 11.8281C13.3629 12.6269 12.3655 12.71 10.3709 12.8763C9.47971 12.9505 8.50782 13 7.5 13C6.49218 13 5.52028 12.9505 4.62915 12.8763C2.63446 12.71 1.63712 12.6269 0.855558 11.8281C0.816844 11.7885 0.767442 11.7348 0.731221 11.6929C0 10.8477 0 9.74012 0 7.52493ZM5.25 5.38264C5.25 5.20225 5.43522 5.08124 5.60041 5.15369L10.428 7.27105C10.6274 7.35853 10.6274 7.64147 10.428 7.72895L5.60041 9.84631C5.43522 9.91876 5.25 9.79775 5.25 9.61736V5.38264Z",
|
|||
|
fill:"#D10014",fillRule:"evenodd",clipRule:"evenodd"})})]}):super.getShapeSVGJsx({})}},or=BB;ib(or,"id","youtube");ib(or,"defaultProps",{id:"youtube",type:"youtube",parentId:"page",point:[0,0],size:[853,480],url:""});ce([wf],or.prototype,"embedId",1);ce([qg],or.prototype,"onYoutubeLinkChange",2);var ms=sf(W(22));tb=W(588);var CB=/https?:\/\/twitter.com\/[0-9a-zA-Z_]{1,20}\/status\/([0-9]*)/,DB=class extends An{constructor(){super(...arguments);ib(this,"canFlip",!1);ib(this,"canEdit",!0);ib(this,"initialHeightCalculated",
|
|||
|
!0);ib(this,"getInnerHeight",null);ib(this,"onTwitterLinkChange",b=>{this.update({url:b,size:DB.defaultProps.size})});ib(this,"ReactComponent",cf(({events:b,isErasing:g,isEditing:p})=>{const {renderers:{Tweet:G}}=ms.useContext(an),Y=Ye(),la=ms.useRef(null),[,pa]=this.useComponentSize(la);ms.useEffect(()=>{var Ga,Qa;const Za=null!=(Qa=null==(Ga=this.getInnerHeight)?void 0:Ga.call(this))?Qa:pa;pa&&1<Math.abs(Za-this.props.size[1])&&(this.update({size:[this.props.size[0],Za]}),Y.persist(!0))},[pa]);
|
|||
|
ms.useEffect(()=>{this.initialHeightCalculated||setTimeout(()=>{this.onResetBounds();Y.persist(!0)})},[this.initialHeightCalculated]);return(0,tb.jsx)(so,hf(pe({style:{overflow:"hidden",pointerEvents:"all",opacity:g?.2:1}},b),{children:(0,tb.jsx)("div",{className:"rounded-xl w-full h-full relative shadow-xl tl-tweet-container",style:{pointerEvents:p||Y.readOnly?"all":"none",userSelect:"none"},children:this.embedId?(0,tb.jsx)("div",{ref:la,children:(0,tb.jsx)(G,{tweetId:this.embedId})}):null})}))}));
|
|||
|
ib(this,"ReactIndicator",cf(()=>{const {props:{size:[b,g],isLocked:p}}=this;return(0,tb.jsx)("rect",{width:b,height:g,fill:"transparent",rx:8,ry:8,strokeDasharray:p?"8 2":"undefined"})}));ib(this,"onResetBounds",b=>{b=this.getAutoResizeHeight();null!==b&&1<Math.abs(b-this.props.size[1])&&(this.update({size:[this.props.size[0],b]}),this.initialHeightCalculated=!0);return this});ib(this,"onResize",(b,g)=>{var p;const {bounds:G,rotation:Y,scale:[la,pa]}=g;b=[...this.scale];0>la&&(b[0]*=-1);0>pa&&(b[1]*=
|
|||
|
-1);g=null!=(p=this.getAutoResizeHeight())?p:G.height;return this.update({point:[G.minX,G.minY],size:[Math.max(1,G.width),Math.max(1,g)],scale:b,rotation:Y})});ib(this,"validateProps",b=>{void 0!==b.size&&(b.size[0]=Math.min(Math.max(b.size[0],300),550),b.size[1]=Math.max(b.size[1],1));return cm(this,b)})}get embedId(){var b,g;const p=this.props.url,G=p.match(CB);return null!=(g=null!=(b=null==G?void 0:G[1])?b:p)?g:""}useComponentSize(b,g=""){const [p,G]=ms.useState([0,0]),Y=Ye();ms.useEffect(()=>
|
|||
|
{if(null==b?0:b.current){const la=g?b.current.querySelector(g):b.current;if(la){const pa=()=>{const {width:Qa,height:Za}=la.getBoundingClientRect(),fb=ke.div([Qa,Za],Y.viewport.camera.zoom);G(fb);return fb};pa();this.getInnerHeight=()=>pa()[1];const Ga=new ResizeObserver(()=>{pa()});Ga.observe(la);return()=>{Ga.disconnect()}}}return()=>{}},[b,g]);return p}getAutoResizeHeight(){return this.getInnerHeight?this.getInnerHeight():null}getShapeSVGJsx(){const b=this.getBounds();return this.embedId?(0,tb.jsxs)("g",
|
|||
|
{children:[(0,tb.jsx)("rect",{width:b.width,height:b.height,fill:"#15202b",rx:8,ry:8}),(0,tb.jsx)("svg",{x:b.width/4,y:b.height/4,width:b.width/2,height:b.height/2,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,tb.jsx)("path",{d:"m13.464 4.4401c0.0091 0.13224 0.0091 0.26447 0.0091 0.39793 0 4.0664-3.0957 8.7562-8.7562 8.7562v-0.0024c-1.6721 0.0024-3.3095-0.47658-4.7172-1.3797 0.24314 0.02925 0.48751 0.04387 0.73248 0.04448 1.3857 0.0013 2.7319-0.46374 3.8221-1.3199-1.3169-0.024981-2.4717-0.8836-2.8751-2.1371 0.4613 0.08897 0.93662 0.070688 1.3894-0.053016-1.4357-0.29007-2.4686-1.5515-2.4686-3.0165v-0.039001c0.42779 0.23827 0.90676 0.37051 1.3967 0.38513-1.3522-0.90372-1.769-2.7026-0.95247-4.1091 1.5625 1.9226 3.8678 3.0914 6.3425 3.2151-0.24802-1.0689 0.090798-2.1889 0.89031-2.9403 1.2395-1.1651 3.1889-1.1054 4.3541 0.13346 0.68921-0.13589 1.3498-0.38879 1.9543-0.74711-0.22974 0.71237-0.71054 1.3175-1.3528 1.702 0.60999-0.071907 1.206-0.23522 1.7672-0.48446-0.41316 0.61913-0.93358 1.1584-1.5356 1.5942z",
|
|||
|
fill:"#1d9bf0",fillRule:"evenodd",clipRule:"evenodd"})})]}):super.getShapeSVGJsx({})}},ns=DB;ib(ns,"id","tweet");ib(ns,"defaultProps",{id:"tweet",type:"tweet",parentId:"page",point:[0,0],size:[331,290],url:""});ce([wf],ns.prototype,"embedId",1);ce([qg],ns.prototype,"onTwitterLinkChange",2);tb=W(588);var EB=[gs,hs,lr,Ou,Pu,is,nr,ks,ls,or,ns,mr,nq,Ll,Qw],Uw=class extends xp{constructor(){super(...arguments);ib(this,"Shape",gs)}};ib(Uw,"id","box");ib(Uw,"shortcut","whiteboard/rectangle");var Vw=class extends xp{constructor(){super(...arguments);
|
|||
|
ib(this,"Shape",hs)}};ib(Vw,"id","ellipse");ib(Vw,"shortcut","whiteboard/ellipse");var Ww=class extends Yt{};ib(Ww,"id","erase");ib(Ww,"shortcut","whiteboard/eraser");var Xw=class extends Ns{constructor(){super(...arguments);ib(this,"Shape",lr);ib(this,"simplify",!0);ib(this,"simplifyTolerance",.618)}};ib(Xw,"id","highlighter");ib(Xw,"shortcut","whiteboard/highlighter");var Yw=class extends Vt{constructor(){super(...arguments);ib(this,"Shape",is)}};ib(Yw,"id","line");ib(Yw,"shortcut","whiteboard/connector");
|
|||
|
var Zw=class extends Ns{constructor(){super(...arguments);ib(this,"Shape",nr);ib(this,"simplify",!1)}};ib(Zw,"id","pencil");ib(Zw,"shortcut","whiteboard/pencil");var FB=class extends xp{constructor(){super(...arguments);ib(this,"Shape",ks)}};ib(FB,"id","polygon");var $w=class extends Wt{constructor(){super(...arguments);ib(this,"Shape",ls)}};ib($w,"id","text");ib($w,"shortcut","whiteboard/text");var GB=class extends xp{constructor(){super(...arguments);ib(this,"Shape",or)}};ib(GB,"id","youtube");
|
|||
|
var HB=class extends Di{constructor(){super(...arguments);ib(this,"creatingShape");ib(this,"offset",[0,0]);ib(this,"onEnter",()=>{this.app.history.pause();Hd(()=>{const b=new Ll({id:Gk(),parentId:this.app.currentPage.id,point:ke.sub(this.app.inputs.originPoint,this.offset),size:Ll.defaultProps.size,fill:this.app.settings.color,stroke:this.app.settings.color});this.creatingShape=b;this.app.currentPage.addShapes(b);this.app.setEditingShape(b);this.app.setSelectedShapes([b])})});ib(this,"onPointerDown",
|
|||
|
b=>{switch(b.type){case "shape":if(b.shape===this.creatingShape)break;this.app.selectTool("select");break;case "canvas":b.order||this.app.selectTool("select")}});ib(this,"onExit",()=>{var b;this.creatingShape&&(this.app.history.resume(),(null==(b=this.creatingShape)?0:b.props.pageId)?this.app.setSelectedShapes([this.creatingShape.id]):(this.app.deleteShapes([this.creatingShape.id]),this.app.setEditingShape()),this.creatingShape=void 0)})}};ib(HB,"id","creating");var IB=class extends Di{constructor(){super(...arguments);
|
|||
|
ib(this,"cursor","crosshair");ib(this,"onPointerDown",b=>{this.tool.transition("creating")})}};ib(IB,"id","idle");var st=class extends Wp{constructor(){super(...arguments);ib(this,"Shape",Ll);ib(this,"onPinch",b=>{this.app.viewport.pinchZoom(b.point,b.delta,b.delta[2])})}};ib(st,"id","logseq-portal");ib(st,"shortcut","whiteboard/portal");ib(st,"states",[IB,HB]);ib(st,"initial","idle");var JB=class extends xp{constructor(){super(...arguments);ib(this,"Shape",nq)}};ib(JB,"id","youtube");var KB=class extends xp{constructor(){super(...arguments);
|
|||
|
ib(this,"Shape",mr)}};ib(KB,"id","iframe");var xJ=sf(W(591));tb=W(588);var yJ=new Map(EB.map(b=>[b.id,b])),ax=class{constructor(b){ib(this,"shapes");ib(this,"pageId");ib(this,"assets");b&&this.load(b)}load(b){var g;const p=null==(g=null==b?void 0:b.pages)?void 0:g[0];this.pageId=null==p?void 0:p.id;this.assets=b.assets;this.shapes=null==p?void 0:p.shapes.map(G=>{var Y=G.type;if(!Y)throw Error("No shape type provided.");const la=yJ.get(Y);if(!la)throw Error(`Could not find shape class for ${Y}`);return new la(G)}).filter(G=>
|
|||
|
"group"!==G.type)}generatePreviewJsx(b,g){var p,G;const Y=[...(null!=(p=this.shapes)?p:[]).map(Za=>Za.getRotatedBounds())];(p=null==b?void 0:b.currentView)&&Y.push(p);let la=vf.getCommonBounds(Y);if(!la)return null;la=vf.expandBounds(la,16);la=g?vf.ensureRatio(la,g):la;const pa=Za=>[(Za[0]-la.minX).toFixed(2),(Za[1]-la.minY).toFixed(2)],[Ga,Qa]=p?pa([p.minX,p.minY]):[0,0];return la&&(0,tb.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","data-common-bound-x":la.minX.toFixed(2),"data-common-bound-y":la.minY.toFixed(2),
|
|||
|
"data-common-bound-width":la.width.toFixed(2),"data-common-bound-height":la.height.toFixed(2),viewBox:[0,0,la.width,la.height].join(" "),children:[(0,tb.jsx)("defs",{children:p&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)("rect",{id:this.pageId+"-camera-rect",transform:`translate(${Ga}, ${Qa})`,width:p.width,height:p.height}),(0,tb.jsxs)("mask",{id:this.pageId+"-camera-mask",children:[(0,tb.jsx)("rect",{width:la.width,height:la.height,fill:"white"}),(0,tb.jsx)("use",{href:`#${this.pageId}-camera-rect`,
|
|||
|
fill:"black"})]})]})}),(0,tb.jsx)("g",{id:this.pageId+"-preview-shapes",children:null==(G=this.shapes)?void 0:G.map(Za=>{var fb,mb;const {bounds:Lb,props:{rotation:Tb}}=Za,[Pb,lc]=pa([Lb.minX,Lb.minY]),xc=+(180*((null!=Tb?Tb:0)+(null!=(fb=Lb.rotation)?fb:0))/Math.PI).toFixed(2),[$b,sc]=[(Lb.width/2).toFixed(2),(Lb.height/2).toFixed(2)];return(0,tb.jsx)("g",{transform:[`translate(${Pb}, ${lc})`,`rotate(${xc}, ${$b}, ${sc})`].join(" "),children:Za.getShapeSVGJsx({assets:null!=(mb=this.assets)?mb:[]})},
|
|||
|
Za.id)})}),(0,tb.jsx)("rect",{mask:p?`url(#${this.pageId}-camera-mask)`:"",width:la.width,height:la.height,fill:"transparent"}),p&&(0,tb.jsx)("use",{id:"minimap-camera-rect","data-x":Ga,"data-y":Qa,"data-width":p.width,"data-height":p.height,href:`#${this.pageId}-camera-rect`,fill:"transparent",stroke:"red",strokeWidth:4/b.camera.zoom})]})}exportAsSVG(b){return(b=this.generatePreviewJsx(void 0,b))?xJ.default.renderToString(b):""}},zJ=sf(W(22));tb=W(588);var Qu=zJ.forwardRef((b,g)=>{var {value:p,className:G}=
|
|||
|
b;b=zf(b,["autoResize","value","className"]);return(0,tb.jsx)("div",{className:"tl-input"+(G?" "+G:""),children:(0,tb.jsxs)("div",{className:"tl-input-sizer",children:[(0,tb.jsx)("div",{className:"tl-input-hidden",children:p}),(0,tb.jsx)("input",pe({ref:g,value:p,className:"tl-text-input",type:"text"},b))]})})});tb=W(588);var oq=({type:b,active:g})=>(0,tb.jsx)("span",{className:"tl-type-tag","data-active":g,children:(0,tb.jsx)("i",{className:`tie tie-${({B:"block",P:"page",WP:"whiteboard",BA:"new-block",
|
|||
|
PA:"new-page",WA:"new-whiteboard",BS:"block-search",PS:"page-search"})[b]}`})}),LB=(b,g)=>(0,tb.jsx)("span",{children:b.split(new RegExp(`(${g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$\x26")})`,"gi")).map((p,G)=>1===G%2?(0,tb.jsx)("mark",{className:"tl-highlighted",children:p}):p).map((p,G)=>(0,tb.jsx)(Pm.default.Fragment,{children:p},G))}),AJ=(b,g)=>{const {handlers:p}=Pm.default.useContext(an),[G,Y]=Pm.default.useState(null),la=Ak(b,200);Pm.default.useEffect(()=>{let pa=!1;if(0<la.length){const Ga=
|
|||
|
{"pages?":!0,"blocks?":!0,"files?":!1};"B"===g?Ga["pages?"]=!1:"P"===g&&(Ga["blocks?"]=!1);p.search(la,Ga).then(Qa=>{pa||Y(Qa)})}else Y(null);return()=>{pa=!0}},[la,null==p?void 0:p.search]);return G},MB=cf(({className:b,style:g,placeholder:p,onChange:G,onBlur:Y,onAddBlock:la})=>{const [pa,Ga]=Pm.default.useState(Ll.defaultSearchQuery),[Qa,Za]=Pm.default.useState(Ll.defaultSearchFilter),fb=Pm.default.useRef(null),{handlers:mb,renderers:Lb}=Pm.default.useContext(an),Tb=Pm.default.useCallback(ne=>{var De;
|
|||
|
G(ne);null==(De=fb.current)?void 0:De.blur();ne&&(Ll.defaultSearchQuery="",Ll.defaultSearchFilter=null)},[]),Pb=Pm.default.useCallback(ne=>{if(ne=null==mb?void 0:mb.addNewBlock(ne))Tb(ne),null==la?void 0:la(ne);return ne},[la]),lc=Pm.default.useRef(null),[xc,$b]=Pm.default.useState(0),sc=AJ(pa,Qa),[oc,Mc]=Pm.default.useState("circle-plus"),[Tc,vd]=Pm.default.useState(!1);Pm.default.useEffect(()=>{setTimeout(()=>{var ne;null==(ne=fb.current)?void 0:ne.focus()})},[Qa]);Pm.default.useEffect(()=>{Ll.defaultSearchQuery=
|
|||
|
pa;Ll.defaultSearchFilter=Qa},[pa,Qa]);const de=Pm.default.useMemo(()=>{var ne;const De=[],$e=null==Lb?void 0:Lb.Breadcrumb;if(!$e||!mb)return[];la&&De.push({actionIcon:"circle-plus",onChosen:()=>!!Pb(pa),element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{active:!0,type:"BA"}),0<pa.length?(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)("strong",{children:"New block:"}),pa]}):(0,tb.jsx)("strong",{children:"New block"})]})});(null==(ne=null==sc?void 0:sc.pages)?
|
|||
|
0:ne.some(mf=>mf.toLowerCase()===pa.toLowerCase()))||!pa||De.push({actionIcon:"circle-plus",onChosen:()=>{Tb(pa);return!0},element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{active:!0,type:"PA"}),(0,tb.jsx)("strong",{children:"New page:"}),pa]})},{actionIcon:"circle-plus",onChosen:()=>{null==mb?void 0:mb.addNewWhiteboard(pa);Tb(pa);return!0},element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{active:!0,type:"WA"}),(0,tb.jsx)("strong",
|
|||
|
{children:"New whiteboard:"}),pa]})});0===pa.length&&null===Qa&&De.push({actionIcon:"search",onChosen:()=>{Za("B");return!0},element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{type:"BS"}),"Search only blocks"]})},{actionIcon:"search",onChosen:()=>{Za("P");return!0},element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{type:"PS"}),"Search only pages"]})});Qa&&"P"!==Qa||!sc||!sc.pages||De.push(...sc.pages.map(mf=>({actionIcon:"search",
|
|||
|
onChosen:()=>{Tb(mf);return!0},element:(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{type:mb.isWhiteboardPage(mf)?"WP":"P"}),LB(mf,pa)]})})));Qa&&"B"!==Qa||!sc||!sc.blocks||De.push(...sc.blocks.filter(mf=>mf.content&&mf.uuid).map(({content:mf,uuid:Te})=>{const rf=mb.queryBlockByUUID(Te);return{actionIcon:"search",onChosen:()=>{var Vd,rd,sd;return rf?(Tb(Te),null==(sd=null==(rd=null==(Vd=window.logseq)?void 0:Vd.api)?void 0:rd.set_blocks_id)?void 0:sd.call(rd,[Te]),
|
|||
|
!0):!1},element:rf?(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)(oq,{type:"B"}),(0,tb.jsx)("div",{className:"tl-quick-search-option-breadcrumb",children:(0,tb.jsx)($e,{blockId:Te})})]}),(0,tb.jsxs)("div",{className:"tl-quick-search-option-row",children:[(0,tb.jsx)("div",{className:"tl-quick-search-option-placeholder"}),LB(mf,pa)]})]}):(0,tb.jsx)("div",{className:"tl-quick-search-option-row",children:"Cache is outdated. Please click the 'Re-index' button in the graph's dropdown menu."})}}));
|
|||
|
return De},[pa,Qa,sc,null==Lb?void 0:Lb.Breadcrumb,mb]);Pm.default.useEffect(()=>{const ne=De=>{var $e,mf;let Te=xc;"ArrowDown"===De.key?Te=Math.min(de.length-1,xc+1):"ArrowUp"===De.key?Te=Math.max(0,xc-1):"Enter"===De.key?(null==($e=de[xc])?void 0:$e.onChosen(),De.stopPropagation(),De.preventDefault()):"Backspace"===De.key&&0===pa.length?Za(null):"Escape"===De.key&&Tb("");Te!==xc&&($e=de[Te],$b(Te),Mc($e.actionIcon),De.stopPropagation(),De.preventDefault(),(De=null==(mf=lc.current)?void 0:mf.querySelector(".tl-quick-search-option:nth-child("+
|
|||
|
(Te+1)+")"))&&(null==De?void 0:De.scrollIntoViewIfNeeded(!1)))};document.addEventListener("keydown",ne,!0);return()=>{document.removeEventListener("keydown",ne,!0)}},[de,xc,pa]);return(0,tb.jsxs)("div",{className:"tl-quick-search "+(null!=b?b:""),style:g,children:[(0,tb.jsx)(QF,{icon:oc,onClick:()=>{var ne;null==(ne=de[xc])?void 0:ne.onChosen()}}),(0,tb.jsxs)("div",{className:"tl-quick-search-input-container",children:[Qa&&(0,tb.jsxs)("div",{className:"tl-quick-search-input-filter",children:[(0,tb.jsx)(oq,
|
|||
|
{type:Qa}),"B"===Qa?"Search blocks":"Search pages",(0,tb.jsx)("div",{className:"tl-quick-search-input-filter-remove",onClick:()=>Za(null),children:(0,tb.jsx)(Bh,{name:"x"})})]}),(0,tb.jsx)(Qu,{ref:fb,type:"text",value:pa,className:"tl-quick-search-input",placeholder:null!=p?p:"Create or search your graph...",onChange:ne=>Ga(ne.target.value),onKeyDown:ne=>{"Enter"===ne.key&&Tb(pa);ne.stopPropagation()},onFocus:()=>{vd(!0)},onBlur:()=>{vd(!1);null==Y?void 0:Y()}})]}),0<de.length&&(0,tb.jsx)("div",{onWheelCapture:ne=>
|
|||
|
ne.stopPropagation(),className:"tl-quick-search-options",ref:lc,style:{visibility:Tc?"visible":"hidden",pointerEvents:Tc?"all":"none"},children:(0,tb.jsx)(HI,{style:{height:40*Math.min(Math.max(1,de.length),12)},totalCount:de.length,itemContent:ne=>{const {actionIcon:De,onChosen:$e,element:mf}=de[ne];return(0,tb.jsx)("div",{"data-focused":ne===xc,className:"tl-quick-search-option",tabIndex:0,onMouseEnter:()=>{Mc(De);$b(ne)},onPointerDownCapture:Te=>{$e()&&(Te.stopPropagation(),Te.preventDefault())},
|
|||
|
children:mf},ne)}})})]})});tb=W(588);var BJ=cf(function(b){var {pageId:g,portalType:p,refs:G,side:Y,onRefsChange:la}=b;b=zf(b,"pageId portalType shapeType refs side onRefsChange".split(" "));const pa=G.length+(g?1:0),Ga=0===G.length,Qa=fb=>{fb&&!G.includes(fb)&&Ga&&la([...G,fb])},Za=!(!g||!p);return(0,tb.jsx)(QA,hf(pe({},b),{side:Y,align:"start",alignOffset:-6,label:(0,tb.jsx)(dc,{content:"Link",sideOffset:14,children:(0,tb.jsxs)("div",{className:"flex gap-1 relative items-center justify-center px-1",
|
|||
|
children:[(0,tb.jsx)(Bh,{name:0<pa?"link":"add-link"}),0<pa&&(0,tb.jsx)("div",{className:"tl-shape-links-count",children:pa})]})}),children:(0,tb.jsxs)("div",{className:"color-level rounded-lg","data-show-reference-panel":Za,children:[Za&&(0,tb.jsxs)("div",{className:"tl-shape-links-reference-panel",children:[(0,tb.jsxs)("div",{className:"text-base inline-flex gap-1 items-center",children:[(0,tb.jsx)(Bh,{className:"opacity-50",name:"internal-link"}),"References"]}),(0,tb.jsx)(je,{type:p,id:g})]}),
|
|||
|
(0,tb.jsxs)("div",{className:"tl-shape-links-panel color-level",children:[(0,tb.jsxs)("div",{className:"text-base inline-flex gap-1 items-center",children:[(0,tb.jsx)(Bh,{className:"opacity-50",name:"add-link"}),"Link to any page or block"]}),Ga&&(0,tb.jsx)(MB,{style:{width:"calc(100% - 46px)",marginLeft:"46px"},placeholder:"Start typing to search...",onChange:Qa}),0<G.length&&(0,tb.jsx)("div",{className:"flex flex-col items-stretch gap-2",children:G.map((fb,mb)=>(0,tb.jsx)(je,{id:fb,type:dk(fb)?
|
|||
|
"B":"P",onRemove:()=>{la(G.filter((Lb,Tb)=>mb!==Tb))},showContent:!0},fb))})]})]})}))}),jl=sf(W(22)),NB=W(22),OB=(0,NB.forwardRef)((b,g)=>{const {pressed:p,defaultPressed:G=!1,onPressedChange:Y}=b,la=zf(b,["pressed","defaultPressed","onPressedChange"]),[pa=!1,Ga]=Kj({prop:p,onChange:Y,defaultProp:G});return(0,NB.createElement)(il.button,df({type:"button","aria-pressed":pa,"data-state":pa?"on":"off","data-disabled":b.disabled?"":void 0},la,{ref:g,onClick:If(b.onClick,()=>{b.disabled||Ga(!pa)})}))}),
|
|||
|
CJ=OB,[PB]=yj("ToggleGroup",[ru]),QB=ru(),DJ=jl.default.forwardRef((b,g)=>{const {type:p}=b;b=zf(b,["type"]);if("single"===p)return jl.default.createElement(EJ,df({},b,{ref:g}));if("multiple"===p)return jl.default.createElement(FJ,df({},b,{ref:g}));throw Error("Missing prop `type` expected on `ToggleGroup`");}),[RB,SB]=PB("ToggleGroup"),EJ=jl.default.forwardRef((b,g)=>{const {value:p,defaultValue:G,onValueChange:Y=()=>{}}=b,la=zf(b,["value","defaultValue","onValueChange"]),[pa,Ga]=Kj({prop:p,defaultProp:G,
|
|||
|
onChange:Y});return jl.default.createElement(RB,{scope:b.__scopeToggleGroup,type:"single",value:pa?[pa]:[],onItemActivate:Ga,onItemDeactivate:jl.default.useCallback(()=>Ga(""),[Ga])},jl.default.createElement(TB,df({},la,{ref:g})))}),FJ=jl.default.forwardRef((b,g)=>{const {value:p,defaultValue:G,onValueChange:Y=()=>{}}=b,la=zf(b,["value","defaultValue","onValueChange"]),[pa=[],Ga]=Kj({prop:p,defaultProp:G,onChange:Y}),Qa=jl.default.useCallback(fb=>Ga((mb=[])=>[...mb,fb]),[Ga]),Za=jl.default.useCallback(fb=>
|
|||
|
Ga((mb=[])=>mb.filter(Lb=>Lb!==fb)),[Ga]);return jl.default.createElement(RB,{scope:b.__scopeToggleGroup,type:"multiple",value:pa,onItemActivate:Qa,onItemDeactivate:Za},jl.default.createElement(TB,df({},la,{ref:g})))}),[GJ,HJ]=PB("ToggleGroup"),TB=jl.default.forwardRef((b,g)=>{const {__scopeToggleGroup:p,disabled:G=!1,rovingFocus:Y=!0,orientation:la,dir:pa,loop:Ga=!0}=b;var Qa=zf(b,"__scopeToggleGroup disabled rovingFocus orientation dir loop".split(" "));b=QB(p);const Za=Ub(pa);Qa=pe({role:"group",
|
|||
|
dir:Za},Qa);return jl.default.createElement(GJ,{scope:p,rovingFocus:Y,disabled:G},Y?jl.default.createElement(dA,df({asChild:!0},b,{orientation:la,dir:Za,loop:Ga}),jl.default.createElement(il.div,df({},Qa,{ref:g}))):jl.default.createElement(il.div,df({},Qa,{ref:g})))}),IJ=jl.default.forwardRef((b,g)=>{var p=SB("ToggleGroupItem",b.__scopeToggleGroup);const G=HJ("ToggleGroupItem",b.__scopeToggleGroup),Y=QB(b.__scopeToggleGroup);p=p.value.includes(b.value);const la=G.disabled||b.disabled;b=hf(pe({},b),
|
|||
|
{pressed:p,disabled:la});const pa=jl.default.useRef(null);return G.rovingFocus?jl.default.createElement(eA,df({asChild:!0},Y,{focusable:!la,active:p,ref:pa}),jl.default.createElement(UB,df({},b,{ref:g}))):jl.default.createElement(UB,df({},b,{ref:g}))}),UB=jl.default.forwardRef((b,g)=>{const {__scopeToggleGroup:p,value:G}=b,Y=zf(b,["__scopeToggleGroup","value"]),la=SB("ToggleGroupItem",p);b={role:"radio","aria-checked":b.pressed,"aria-pressed":void 0};return jl.default.createElement(OB,df({},"single"===
|
|||
|
la.type?b:void 0,Y,{ref:g,onPressedChange:pa=>{if(pa)la.onItemActivate(G);else la.onItemDeactivate(G)}}))}),VB=DJ,WB=IJ;tb=W(588);tb=W(588);tb=W(588);var XB="LogseqPortalViewMode Geometry AutoResizing Swatch NoFill StrokeType ScaleLevel TextStyle YoutubeLink TwitterLink IFrameSource ArrowMode Links".split(" "),JJ=["YoutubeLink","TwitterLink","IFrameSource","Links"],Sn=new Map,bx={"logseq-portal":["Swatch","LogseqPortalViewMode","ScaleLevel","AutoResizing","Links"],youtube:["YoutubeLink","Links"],
|
|||
|
tweet:["TwitterLink","Links"],iframe:["IFrameSource","Links"],box:"Geometry TextStyle Swatch ScaleLevel NoFill StrokeType Links".split(" "),ellipse:"Geometry TextStyle Swatch ScaleLevel NoFill StrokeType Links".split(" "),polygon:"Geometry TextStyle Swatch ScaleLevel NoFill StrokeType Links".split(" "),line:["TextStyle","Swatch","ScaleLevel","ArrowMode","Links"],pencil:["Swatch","Links","ScaleLevel"],highlighter:["Swatch","Links","ScaleLevel"],text:["TextStyle","Swatch","ScaleLevel","AutoResizing",
|
|||
|
"Links"],html:["ScaleLevel","AutoResizing","Links"],image:["Links"],video:["Links"]},KJ=Object.entries(bx).filter(([,b])=>b.includes("NoFill")&&b.includes("Swatch")).map(([b])=>b),LJ=cf(()=>{const b=Ye(),g=Wa("AutoResizing"),p=g.every(G=>G.props.isAutoResizing);return(0,tb.jsx)(va,{tooltip:"Auto Resize",toggle:g.every(G=>"logseq-portal"===G.props.type),className:"tl-button",pressed:p,onPressedChange:G=>{g.forEach(Y=>{if("logseq-portal"===Y.props.type)Y.update({isAutoResizing:G});else Y.onResetBounds({zoom:b.viewport.camera.zoom})});
|
|||
|
b.persist()},children:(0,tb.jsx)(Bh,{name:"dimensions"})})}),MJ=cf(()=>{const b=Ye(),g=Wa("LogseqPortalViewMode"),p=g.every(Y=>Y.collapsed);if(!p&&!g.every(Y=>!Y.collapsed))return null;const G=(0,tb.jsxs)("div",{className:"flex",children:[p?"Expand":"Collapse",(0,tb.jsx)(bn,{action:p?"editor/expand-block-children":"editor/collapse-block-children"})]});return(0,tb.jsx)(va,{tooltip:G,toggle:g.every(Y=>"logseq-portal"===Y.props.type),className:"tl-button",pressed:p,onPressedChange:()=>b.api.setCollapsed(!p),
|
|||
|
children:(0,tb.jsx)(Bh,{name:p?"object-expanded":"object-compact"})})}),NJ=cf(()=>{const {handlers:{isMobile:b}}=Gp.default.useContext(an);var g=Wa("ScaleLevel");g=1<(new Set(g.map(p=>p.scaleLevel))).size?"":g[0].scaleLevel;return(0,tb.jsx)(Jh,{scaleLevel:g,compact:b()})}),OJ=cf(()=>{const b=Ye(),g=Wa("IFrameSource")[0],p=Gp.default.useCallback(Y=>{g.onIFrameSourceChange(Y.target.value.trim().toLowerCase());b.persist()},[]),G=Gp.default.useCallback(()=>{g.reload()},[]);return(0,tb.jsxs)("span",{className:"flex gap-3",
|
|||
|
children:[(0,tb.jsx)(ka,{tooltip:"Reload",type:"button",onClick:G,children:(0,tb.jsx)(Bh,{name:"refresh"})}),(0,tb.jsx)(Qu,{title:"Website Url",className:"tl-iframe-src",value:`${g.props.url}`,onChange:p}),(0,tb.jsx)(ka,{tooltip:"Open website url",type:"button",onClick:()=>window.open(g.props.url),children:(0,tb.jsx)(Bh,{name:"external-link"})})]})}),PJ=cf(()=>{const b=Ye(),g=Wa("YoutubeLink")[0],p=Gp.default.useCallback(G=>{g.onYoutubeLinkChange(G.target.value);b.persist()},[]);return(0,tb.jsxs)("span",
|
|||
|
{className:"flex gap-3",children:[(0,tb.jsx)(Qu,{title:"YouTube Link",className:"tl-youtube-link",value:`${g.props.url}`,onChange:p}),(0,tb.jsx)(ka,{tooltip:"Open YouTube Link",type:"button",onClick:()=>{var G,Y,la;return null==(la=null==(Y=null==(G=window.logseq)?void 0:G.api)?void 0:Y.open_external_link)?void 0:la.call(Y,g.props.url)},children:(0,tb.jsx)(Bh,{name:"external-link"})})]})}),QJ=cf(()=>{const b=Ye(),g=Wa("TwitterLink")[0],p=Gp.default.useCallback(G=>{g.onTwitterLinkChange(G.target.value);
|
|||
|
b.persist()},[]);return(0,tb.jsxs)("span",{className:"flex gap-3",children:[(0,tb.jsx)(Qu,{title:"Twitter Link",className:"tl-twitter-link",value:`${g.props.url}`,onChange:p}),(0,tb.jsx)(ka,{tooltip:"Open Twitter Link",type:"button",onClick:()=>{var G,Y,la;return null==(la=null==(Y=null==(G=window.logseq)?void 0:G.api)?void 0:Y.open_external_link)?void 0:la.call(Y,g.props.url)},children:(0,tb.jsx)(Bh,{name:"external-link"})})]})}),RJ=cf(()=>{const b=Ye();var g=Wa("NoFill");const p=Gp.default.useCallback(G=>
|
|||
|
{b.selectedShapesArray.forEach(Y=>Y.update({noFill:G}));b.persist()},[]);g=g.every(G=>G.props.noFill);return(0,tb.jsx)(va,{tooltip:"Fill",className:"tl-button",pressed:g,onPressedChange:p,children:(0,tb.jsx)(Bh,{name:g?"droplet-off":"droplet"})})}),SJ=cf(()=>{const b=Ye(),g=Wa("Swatch"),p=Gp.default.useCallback(Y=>{b.selectedShapesArray.forEach(la=>{la.update({fill:Y,stroke:Y})});b.persist()},[]),G=Gp.default.useCallback(Y=>{b.selectedShapesArray.forEach(la=>{la.update({opacity:Y})});b.persist()},
|
|||
|
[]);return(0,tb.jsx)(pg,{popoverSide:"top",color:g[0].props.noFill?g[0].props.stroke:g[0].props.fill,opacity:g[0].props.opacity,setOpacity:G,setColor:p})}),TJ=cf(()=>{const b=Ye(),g=Gp.default.useCallback(p=>{b.api.convertShapes(p.currentTarget.dataset.tool)},[]);return(0,tb.jsx)(HA,{popoverSide:"top",chevron:!1,setGeometry:g})}),UJ=cf(()=>{const b=Ye(),g=Wa("StrokeType"),p=g.every(G=>"dashed"===G.props.strokeType)?"dashed":g.every(G=>"line"===G.props.strokeType)?"line":"mixed";return(0,tb.jsx)(Ee,
|
|||
|
{title:"Stroke Type",options:[{value:"line",icon:"circle",tooltip:"Solid"},{value:"dashed",icon:"circle-dashed",tooltip:"Dashed"}],value:p,onValueChange:G=>{g.forEach(Y=>{Y.update({strokeType:G})});b.persist()}})}),VJ=cf(()=>{const b=Ye(),g=Wa("ArrowMode");var p=g.every(Y=>{var la;return"arrow"===(null==(la=Y.props.decorations)?void 0:la.start)});const G=g.every(Y=>{var la;return"arrow"===(null==(la=Y.props.decorations)?void 0:la.end)});p=[p?"start":null,G?"end":null].filter(si);return(0,tb.jsx)(fa,
|
|||
|
{title:"Arrow Head",options:[{value:"start",icon:"arrow-narrow-left"},{value:"end",icon:"arrow-narrow-right"}],value:p,onValueChange:Y=>{g.forEach(la=>{var pa=la.update;var Ga={start:Y.includes("start")?"arrow":null,end:Y.includes("end")?"arrow":null};pa.call(la,{decorations:Ga})});b.persist()}})}),WJ=cf(()=>{const b=Ye(),g=Wa("TextStyle"),p=g.every(Y=>500<Y.props.fontWeight),G=g.every(Y=>Y.props.italic);return(0,tb.jsxs)("span",{className:"flex gap-1",children:[(0,tb.jsx)(va,{tooltip:"Bold",className:"tl-button",
|
|||
|
pressed:p,onPressedChange:Y=>{g.forEach(la=>{la.update({fontWeight:Y?700:400});la.onResetBounds()});b.persist()},children:(0,tb.jsx)(Bh,{name:"bold"})}),(0,tb.jsx)(va,{tooltip:"Italic",className:"tl-button",pressed:G,onPressedChange:Y=>{g.forEach(la=>{la.update({italic:Y});la.onResetBounds()});b.persist()},children:(0,tb.jsx)(Bh,{name:"italic"})})]})}),XJ=cf(()=>{var b;const g=Ye(),p=g.selectedShapesArray[0];return(0,tb.jsx)(BJ,{onRefsChange:G=>{p.update({refs:G});g.persist()},refs:null!=(b=p.props.refs)?
|
|||
|
b:[],shapeType:p.props.type,side:"right",pageId:"logseq-portal"===p.props.type?p.props.pageId:void 0,portalType:"logseq-portal"===p.props.type?p.props.blockType:void 0})});Sn.set("Geometry",TJ);Sn.set("AutoResizing",LJ);Sn.set("LogseqPortalViewMode",MJ);Sn.set("ScaleLevel",NJ);Sn.set("YoutubeLink",PJ);Sn.set("TwitterLink",QJ);Sn.set("IFrameSource",OJ);Sn.set("NoFill",RJ);Sn.set("Swatch",SJ);Sn.set("StrokeType",UJ);Sn.set("ArrowMode",VJ);Sn.set("TextStyle",WJ);Sn.set("Links",XJ);var YB=b=>{var g;return(null!=
|
|||
|
(g=bx[b])?g:[]).filter(si)},YJ=b=>{const g=b.map(G=>G.props.type),p=new Set(0<b.length?YB(g[0]):[]);for(let G=1;G<g.length&&0<p.size;G++){const Y=YB(g[G]);p.forEach(la=>{Y.includes(la)||p.delete(la)})}1<b.length&&JJ.forEach(G=>{p.has(G)&&p.delete(G)});return Array.from(p).sort((G,Y)=>XB.indexOf(G)-XB.indexOf(Y)).map(G=>Sn.get(G))};tb=W(588);var ZJ=cf(({shapes:b,offsets:g,hidden:p})=>{const G=Ye(),Y=mt.useRef(null),la=mt.useRef(null);mt.useLayoutEffect(()=>{setTimeout(()=>{const Ga=la.current;if(Ga){var {offsetWidth:Qa,
|
|||
|
offsetHeight:Za}=Ga;Y.current=[Qa,Za]}})});mt.useLayoutEffect(()=>{var Ga;const Qa=la.current;if(Qa){var Za=null!=(Ga=Y.current)?Ga:[0,0];Ga=0;if(116>g.top){var fb=g.height/2+40;140>g.bottom&&(fb+=g.bottom-140)}else fb=-(g.height/2+40);16>g.left+g.width/2-Za[0]/2?Ga+=-(g.left+g.width/2-Za[0]/2-16):16>g.right+g.width/2-Za[0]/2&&(Ga+=g.right+g.width/2-Za[0]/2-16);var [mb,Lb]=[Ga,fb];Qa.style.transform=`translateX(${mb}px) translateY(${Lb}px)`}},[g]);if(!G)return null;const pa=YJ(b);return(0,tb.jsx)(so,
|
|||
|
{centered:!0,children:0<pa.length&&(0,tb.jsx)("div",{ref:la,className:"tl-toolbar tl-context-bar",style:{visibility:p?"hidden":"visible",pointerEvents:p?"none":"all"},children:pa.map((Ga,Qa)=>(0,tb.jsxs)(mt.Fragment,{children:[(0,tb.jsx)(Ga,{}),Qa<pa.length-1&&(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"vertical"})]},Qa))})})}),cx=sf(W(22)),Ml=W(22),[$J]=yj("ContextMenu",[yu]),tt=yu(),[aK,ZB]=$J("ContextMenu"),bK=(0,Ml.forwardRef)((b,g)=>{const {__scopeContextMenu:p,disabled:G=!1}=
|
|||
|
b,Y=zf(b,["__scopeContextMenu","disabled"]),la=ZB("ContextMenuTrigger",p),pa=tt(p),Ga=(0,Ml.useRef)({x:0,y:0}),Qa=(0,Ml.useRef)({getBoundingClientRect:()=>DOMRect.fromRect(pe({width:0,height:0},Ga.current))}),Za=(0,Ml.useRef)(0),fb=(0,Ml.useCallback)(()=>window.clearTimeout(Za.current),[]);(0,Ml.useEffect)(()=>fb,[fb]);(0,Ml.useEffect)(()=>void(G&&fb()),[G,fb]);return(0,Ml.createElement)(Ml.Fragment,null,(0,Ml.createElement)(rA,df({},pa,{virtualRef:Qa})),(0,Ml.createElement)(il.span,df({"data-state":la.open?
|
|||
|
"open":"closed","data-disabled":G?"":void 0},Y,{ref:g,style:pe({WebkitTouchCallout:"none"},b.style),onContextMenu:G?b.onContextMenu:If(b.onContextMenu,mb=>{fb();Ga.current={x:mb.clientX,y:mb.clientY};la.onOpenChange(!0);mb.preventDefault()}),onPointerDown:G?b.onPointerDown:If(b.onPointerDown,xb(mb=>{fb();Za.current=window.setTimeout(()=>{Ga.current={x:mb.clientX,y:mb.clientY};la.onOpenChange(!0)},700)})),onPointerMove:G?b.onPointerMove:If(b.onPointerMove,xb(fb)),onPointerCancel:G?b.onPointerCancel:
|
|||
|
If(b.onPointerCancel,xb(fb)),onPointerUp:G?b.onPointerUp:If(b.onPointerUp,xb(fb))})))}),cK=(0,Ml.forwardRef)((b,g)=>{var {__scopeContextMenu:p}=b;const G=zf(b,["__scopeContextMenu"]),Y=ZB("ContextMenuContent",p);p=tt(p);const la=(0,Ml.useRef)(!1);return(0,Ml.createElement)(tA,df({},p,G,{ref:g,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:pa=>{var Ga;null===(Ga=b.onCloseAutoFocus)||void 0===Ga||Ga.call(b,pa);!pa.defaultPrevented&&la.current&&pa.preventDefault();la.current=!1},onInteractOutside:pa=>
|
|||
|
{var Ga;null===(Ga=b.onInteractOutside)||void 0===Ga||Ga.call(b,pa);pa.defaultPrevented||Y.modal||(la.current=!0)},style:hf(pe({},b.style),{["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"})}))}),nm=(0,Ml.forwardRef)((b,g)=>{var {__scopeContextMenu:p}=b;b=zf(b,["__scopeContextMenu"]);p=tt(p);return(0,Ml.createElement)(vA,df({},p,b,{ref:g}))}),pq=(0,Ml.forwardRef)((b,g)=>{var {__scopeContextMenu:p}=b;b=zf(b,["__scopeContextMenu"]);p=tt(p);return(0,Ml.createElement)(xG,
|
|||
|
df({},p,b,{ref:g}))}),dK=b=>{const {__scopeContextMenu:g,children:p,onOpenChange:G,dir:Y,modal:la=!0}=b,[pa,Ga]=(0,Ml.useState)(!1);b=tt(g);const Qa=pf(G),Za=(0,Ml.useCallback)(fb=>{Ga(fb);Qa(fb)},[Qa]);return(0,Ml.createElement)(aK,{scope:g,open:pa,onOpenChange:Za,modal:la},(0,Ml.createElement)(wA,df({},b,{dir:Y,open:pa,onOpenChange:Za,modal:la}),p))};tb=W(588);var eK=cf(function({children:b,collisionRef:g}){var p,G,Y,la,pa,Ga,Qa,Za,fb,mb,Lb,Tb,Pb,lc,xc,$b,sc;const oc=Ye(),{handlers:Mc}=cx.useContext(an),
|
|||
|
Tc=cx.useRef(null),vd=ne=>{ne();oc.transition("select")},de=cx.useMemo(()=>wh(),[]);return(0,tb.jsxs)(dK,{onOpenChange:ne=>{ne&&!oc.isIn("select.contextMenu")?oc.transition("select").selectedTool.transition("contextMenu"):!ne&&oc.isIn("select.contextMenu")&&oc.selectedTool.transition("idle")},children:[(0,tb.jsx)(bK,{disabled:oc.editingShape&&0!==Object.keys(oc.editingShape).length,children:b}),(0,tb.jsx)(cK,{className:"tl-menu tl-context-menu",ref:Tc,onEscapeKeyDown:()=>oc.transition("select"),collisionBoundary:g.current,
|
|||
|
asChild:!0,tabIndex:-1,children:(0,tb.jsxs)("div",{children:[1<(null==(p=oc.selectedShapes)?void 0:p.size)&&!oc.readOnly&&(null==(G=oc.selectedShapesArray)?void 0:G.some(ne=>!ne.props.isLocked))&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsxs)(nm,{children:[(0,tb.jsxs)("div",{className:"tl-menu-button-row pb-0",children:[(0,tb.jsx)(ka,{tooltip:"Align left",onClick:()=>vd(()=>oc.align("left")),children:(0,tb.jsx)(Bh,{name:"layout-align-left"})}),(0,tb.jsx)(ka,{tooltip:"Align center horizontally",onClick:()=>
|
|||
|
vd(()=>oc.align("centerHorizontal")),children:(0,tb.jsx)(Bh,{name:"layout-align-center"})}),(0,tb.jsx)(ka,{tooltip:"Align right",onClick:()=>vd(()=>oc.align("right")),children:(0,tb.jsx)(Bh,{name:"layout-align-right"})}),(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"vertical"}),(0,tb.jsx)(ka,{tooltip:"Distribute horizontally",onClick:()=>vd(()=>oc.distribute("horizontal")),children:(0,tb.jsx)(Bh,{name:"layout-distribute-vertical"})})]}),(0,tb.jsxs)("div",{className:"tl-menu-button-row pt-0",
|
|||
|
children:[(0,tb.jsx)(ka,{tooltip:"Align top",onClick:()=>vd(()=>oc.align("top")),children:(0,tb.jsx)(Bh,{name:"layout-align-top"})}),(0,tb.jsx)(ka,{tooltip:"Align center vertically",onClick:()=>vd(()=>oc.align("centerVertical")),children:(0,tb.jsx)(Bh,{name:"layout-align-middle"})}),(0,tb.jsx)(ka,{tooltip:"Align bottom",onClick:()=>vd(()=>oc.align("bottom")),children:(0,tb.jsx)(Bh,{name:"layout-align-bottom"})}),(0,tb.jsx)(hr,{className:"tl-toolbar-separator",orientation:"vertical"}),(0,tb.jsx)(ka,
|
|||
|
{tooltip:"Distribute vertically",onClick:()=>vd(()=>oc.distribute("vertical")),children:(0,tb.jsx)(Bh,{name:"layout-distribute-horizontal"})})]})]}),(0,tb.jsx)(pq,{className:"menu-separator"}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.packIntoRectangle),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"layout-grid"}),"Pack into rectangle"]}),(0,tb.jsx)(pq,{className:"menu-separator"})]}),0<(null==(Y=oc.selectedShapes)?void 0:Y.size)&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsxs)(nm,
|
|||
|
{className:"tl-menu-item",onClick:()=>vd(oc.api.zoomToSelection),children:["Zoom to fit",(0,tb.jsx)(bn,{action:"whiteboard/zoom-to-fit"})]}),(0,tb.jsx)(pq,{className:"menu-separator"})]}),(oc.selectedShapesArray.some(ne=>"group"===ne.type||oc.getParentGroup(ne))||1<oc.selectedShapesArray.length)&&(null==(la=oc.selectedShapesArray)?void 0:la.some(ne=>!ne.props.isLocked))&&!oc.readOnly&&(0,tb.jsxs)(tb.Fragment,{children:[oc.selectedShapesArray.some(ne=>"group"===ne.type||oc.getParentGroup(ne))&&(0,tb.jsxs)(nm,
|
|||
|
{className:"tl-menu-item",onClick:()=>vd(oc.api.unGroup),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"ungroup"}),"Ungroup",(0,tb.jsx)(bn,{action:"whiteboard/ungroup"})]}),1<oc.selectedShapesArray.length&&(null==(pa=oc.selectedShapesArray)?void 0:pa.some(ne=>!ne.props.isLocked))&&(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.api.doGroup),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"group"}),"Group",(0,tb.jsx)(bn,{action:"whiteboard/group"})]}),(0,tb.jsx)(pq,{className:"menu-separator"})]}),
|
|||
|
0<(null==(Ga=oc.selectedShapes)?void 0:Ga.size)&&(null==(Qa=oc.selectedShapesArray)?void 0:Qa.some(ne=>!ne.props.isLocked))&&(0,tb.jsxs)(tb.Fragment,{children:[!oc.readOnly&&(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.cut),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"cut"}),"Cut"]}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.copy),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"copy"}),"Copy",(0,tb.jsx)(bn,{action:"editor/copy"})]})]}),!oc.readOnly&&
|
|||
|
(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.paste),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"clipboard"}),"Paste",(0,tb.jsx)("div",{className:"tl-menu-right-slot",children:(0,tb.jsxs)("span",{className:"keyboard-shortcut",children:[(0,tb.jsx)("code",{children:$y})," ",(0,tb.jsx)("code",{children:"v"})]})})]}),1===(null==(Za=oc.selectedShapes)?void 0:Za.size)&&!oc.readOnly&&(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(()=>oc.paste(void 0,!0)),children:["Paste as link",
|
|||
|
(0,tb.jsx)("div",{className:"tl-menu-right-slot",children:(0,tb.jsxs)("span",{className:"keyboard-shortcut",children:[(0,tb.jsx)("code",{children:$y})," ",(0,tb.jsx)("code",{children:"⇧"})," ",(0,tb.jsx)("code",{children:"v"})]})})]}),0<(null==(fb=oc.selectedShapes)?void 0:fb.size)&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)(pq,{className:"menu-separator"}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(()=>{var ne,De;return Mc.exportToImage(oc.currentPageId,{x:oc.selectionBounds.minX+
|
|||
|
oc.viewport.camera.point[0]-8,y:oc.selectionBounds.minY+oc.viewport.camera.point[1]-8,width:(null==(ne=oc.selectionBounds)?void 0:ne.width)+16,height:(null==(De=oc.selectionBounds)?void 0:De.height)+16,zoom:oc.viewport.camera.zoom})}),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"file-export"}),"Export",(0,tb.jsx)("div",{className:"tl-menu-right-slot",children:(0,tb.jsx)("span",{className:"keyboard-shortcut"})})]})]}),(0,tb.jsx)(pq,{className:"menu-separator"}),(0,tb.jsxs)(nm,{className:"tl-menu-item",
|
|||
|
onClick:()=>vd(oc.api.selectAll),children:["Select all",(0,tb.jsx)(bn,{action:"editor/select-parent"})]}),1<(null==(mb=oc.selectedShapes)?void 0:mb.size)&&(0,tb.jsx)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.api.deselectAll),children:"Deselect all"}),!oc.readOnly&&0<(null==(Lb=oc.selectedShapes)?void 0:Lb.size)&&(null==(Tb=oc.selectedShapesArray)?void 0:Tb.some(ne=>!ne.props.isLocked))&&(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(()=>oc.setLocked(!0)),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",
|
|||
|
name:"lock"}),"Lock",(0,tb.jsx)(bn,{action:"whiteboard/lock"})]}),!oc.readOnly&&0<(null==(Pb=oc.selectedShapes)?void 0:Pb.size)&&(null==(lc=oc.selectedShapesArray)?void 0:lc.some(ne=>ne.props.isLocked))&&(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(()=>oc.setLocked(!1)),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"lock-open"}),"Unlock",(0,tb.jsx)(bn,{action:"whiteboard/unlock"})]}),0<(null==(xc=oc.selectedShapes)?void 0:xc.size)&&!oc.readOnly&&(null==($b=oc.selectedShapesArray)?
|
|||
|
void 0:$b.some(ne=>!ne.props.isLocked))&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.api.deleteShapes),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"backspace"}),"Delete",(0,tb.jsx)(bn,{action:"editor/delete"})]}),1<(null==(sc=oc.selectedShapes)?void 0:sc.size)&&!oc.readOnly&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)(pq,{className:"menu-separator"}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.flipHorizontal),children:[(0,tb.jsx)(Bh,
|
|||
|
{className:"tl-menu-icon",name:"flip-horizontal"}),"Flip horizontally"]}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.flipVertical),children:[(0,tb.jsx)(Bh,{className:"tl-menu-icon",name:"flip-vertical"}),"Flip vertically"]})]}),!oc.readOnly&&(0,tb.jsxs)(tb.Fragment,{children:[(0,tb.jsx)(pq,{className:"menu-separator"}),(0,tb.jsxs)(nm,{className:"tl-menu-item",onClick:()=>vd(oc.bringToFront),children:["Move to front",(0,tb.jsx)(bn,{action:"whiteboard/bring-to-front"})]}),(0,tb.jsxs)(nm,
|
|||
|
{className:"tl-menu-item",onClick:()=>vd(oc.sendToBack),children:["Move to back",(0,tb.jsx)(bn,{action:"whiteboard/send-to-back"})]})]}),de&&(0,tb.jsx)(nm,{className:"tl-menu-item",onClick:()=>{1===oc.selectedShapesArray.length?console.log(Ec(oc.selectedShapesArray[0].serialized)):console.log(oc.selectedShapesArray.map(ne=>Ec(ne.serialized)))},children:"(Dev) Print shape props"})]})]})})]})}),$B=sf(W(22));tb=W(588);var fK=cf(({shape:b})=>{const g=Ye(),{handlers:p}=$B.default.useContext(an),G=$B.default.useMemo(()=>
|
|||
|
{var Y;const la=[...(null!=(Y=b.props.refs)?Y:[])].map(pa=>[pa,!0]);"logseq-portal"===b.props.type&&b.props.pageId&&la.unshift([b.props.pageId,!1]);return la.filter(pa=>pa[0].toLowerCase()!==g.currentPage.name&&p.getBlockPageName(pa[0])!==g.currentPage.name)},[b.props.type,b.props.parentId,b.props.refs]);return 0===G.length?null:(0,tb.jsx)("div",{className:"tl-quick-links",title:"Shape Quick Links",children:G.map(([Y,la])=>(0,tb.jsx)("div",{className:"tl-quick-links-row",children:(0,tb.jsx)(dB,{id:Y,
|
|||
|
showReferenceContent:la})},Y))})}),gK=sf(W(22)),aC=sf(W(22)),hK=[".png",".svg",".jpg",".jpeg",".gif"],iK=[".mp4",".webm",".ogg"],jK=(b,g,p)=>Zh(void 0,[b,g,p],function*(G,{point:Y,shiftKey:la,dataTransfer:pa,fromDrop:Ga},Qa){function Za(sd,ud){return Zh(this,null,function*(){const ie=Object.values(G.assets).find(jf=>jf.src===sd);return ie?ie:{id:Gk(),type:ud?"video":"image",src:sd,size:yield Gj(Qa.makeAssetUrl(sd),ud)}})}function fb(sd){return Zh(this,null,function*(){const ud=sd.filter(ie=>"unknown"!==
|
|||
|
bc(ie.name)).map(ie=>Zh(this,null,function*(){try{const jf=yield Qa.saveAsset(ie);return yield Za(jf,"video"===bc(ie.name))}catch(jf){console.error(jf)}return null}));return(yield Promise.all(ud)).filter(si)})}function mb(sd){return[hf(pe({},nq.defaultProps),{html:sd,point:[Y[0],Y[1]]})]}function Lb(sd){return Zh(this,null,function*(){return wc(Pb,$b,xc,sc,lc,de)(sd)})}function Tb(){return Zh(this,null,function*(){const sd=yield navigator.clipboard.read(),ud=wc(sc,lc,de);return(yield Promise.all(sd.map(ie=>
|
|||
|
ud(ie)))).flat().filter(si)})}function Pb(sd){return Zh(this,null,function*(){var ud=Array.from(sd.files);return 0<ud.length?($e=ud=yield fb(ud),ud.map((ie,jf)=>{const tf=hf(pe({},"video"===ie.type?Pu.defaultProps:Ou.defaultProps),{id:Gk(),assetId:ie.id,opacity:1});ie.size&&Object.assign(tf,{point:[Y[0]-ie.size[0]/4+16*jf,Y[1]-ie.size[1]/4+16*jf],size:ke.div(ie.size,2)});return tf})):null})}function lc(sd){return Zh(this,null,function*(){if(sd.types.includes("text/plain")&&(la||Ga))return null;const ud=
|
|||
|
yield Wc(sd,"text/html");return ud?wc(oc,mb)(ud):null})}function xc(sd){return Zh(this,null,function*(){var ud,ie,jf,tf,gg,Bf,Sf=sd.getData("block-uuid");if(Sf){Sf=Sf.trim();const hh=null==(jf=null==(ie=null==(ud=window.logseq)?void 0:ud.api)?void 0:ie.get_selected_blocks)?void 0:jf.call(ie);ud=hh&&1<(null==hh?void 0:hh.length)?hh.map(Ff=>Ff.uuid):[Sf];null==(Bf=null==(gg=null==(tf=window.logseq)?void 0:tf.api)?void 0:gg.set_blocks_id)?void 0:Bf.call(gg,ud);tf=ud.map(Ff=>vd(`((${Ff}))`));return(yield Promise.all(tf)).flat().filter(si).map((Ff,
|
|||
|
jh)=>hf(pe({},Ff),{point:[Y[0]+(Ll.defaultProps.size[0]+16)*jh,Y[1]]}))}return null})}function $b(sd){return Zh(this,null,function*(){var ud=sd.getData("page-name");return ud?(ud=ud.trim(),vd(`[[${ud}]]`)):null})}function sc(sd){return Zh(this,null,function*(){var ud=yield Wc(sd,"text/plain");return ud?(ud=ud.trim(),wc(Mc,Tc)(ud)):null})}function oc(sd){if(sd=G.api.getClonedShapesFromTldrString(decodeURIComponent(sd),Y)){const {shapes:ud,assets:ie,bindings:jf}=sd;mf.push(...ie);Te.push(...jf);return ud}return null}
|
|||
|
function Mc(sd){return Zh(this,null,function*(){try{const ie=new URL(sd);var ud=ie.host&&["http:","https:"].includes(ie.protocol)}catch(ie){ud=!1}return ud&&!la?AB.test(sd)?[hf(pe({},or.defaultProps),{url:sd,point:[Y[0],Y[1]]})]:CB.test(sd)?[hf(pe({},ns.defaultProps),{url:sd,point:[Y[0],Y[1]]})]:[hf(pe({},mr.defaultProps),{url:sd,point:[Y[0],Y[1]]})]:null})}function Tc(sd){return sd.startsWith("\x3ciframe")?[hf(pe({},nq.defaultProps),{html:sd,point:[Y[0],Y[1]]})]:null}function vd(sd){return Zh(this,
|
|||
|
null,function*(){if(/^\(\(.*\)\)$/.test(sd)&&40===sd.length){var ud=sd.slice(2,-2);if(dk(ud))return[hf(pe({},Ll.defaultProps),{point:[Y[0],Y[1]],size:[400,0],pageId:ud,fill:G.settings.color,stroke:G.settings.color,scaleLevel:G.settings.scaleLevel,blockType:"B"})]}else if(/^\[\[.*\]\]$/.test(sd))return ud=sd.slice(2,-2),[hf(pe({},Ll.defaultProps),{point:[Y[0],Y[1]],size:[400,0],pageId:ud,fill:G.settings.color,stroke:G.settings.color,scaleLevel:G.settings.scaleLevel,blockType:"P"})];return null})}function de(sd){return Zh(this,
|
|||
|
null,function*(){var ud=yield Wc(sd,"text/plain");return ud&&(ud=ud.trim(),ud=null==Qa?void 0:Qa.addNewBlock(ud))?[hf(pe({},Ll.defaultProps),{size:[400,0],point:[Y[0],Y[1]],pageId:ud,fill:G.settings.color,stroke:G.settings.color,scaleLevel:G.settings.scaleLevel,blockType:"B",compact:!0})]:null})}var ne,De;let $e=[],mf=[];const Te=[];G.cursors.setCursor("progress");let rf=[];try{pa?rf.push(...(null!=(ne=yield Lb(pa))?ne:[])):rf.push(...(null!=(De=yield Tb())?De:[]))}catch(sd){console.error(sd)}const Vd=
|
|||
|
rf.map(sd=>hf(pe({},sd),{parentId:G.currentPageId,isLocked:!1,id:dk(sd.id)?sd.id:Gk()})),rd=null==pa?void 0:pa.types.every(sd=>"Files"===sd);G.wrapUpdate(()=>{var sd=[...$e,...mf];0<sd.length&&G.createAssets(sd);0<Vd.length&&G.createShapes(Vd);G.currentPage.updateBindings(Object.fromEntries(Te.map(ud=>[ud.id,ud])));if(1===G.selectedShapesArray.length&&1===Vd.length&&Ga){sd=G.selectedShapesArray[0];const ud=G.getShapeById(Vd[0].id);G.createNewLineBinding(sd,ud)}G.setSelectedShapes(Vd.map(ud=>ud.id));
|
|||
|
G.selectedTool.transition("idle");G.cursors.setCursor("default");(Ga||rd)&&G.packIntoRectangle()})}),bC=sf(W(22)),kK=sf(W(22));tb=W(588);var lK=[Uw,Vw,FB,Ww,Xw,Yw,Zw,$w,GB,KB,JB,st],mK=b=>{const {renderers:g}=Yr.useContext(an);return(0,tb.jsx)(g.BacklinksCount,hf(pe({},b),{options:{"portal?":!1}}))},nK=()=>{const b=Yr.useRef(null),g=Ye(),p=Yr.useMemo(()=>({ContextBar:ZJ,BacklinksCount:mK,QuickLinks:fK}),[]);return(0,tb.jsx)(eK,{collisionRef:b,children:(0,tb.jsx)("div",{ref:b,className:"logseq-tldraw logseq-tldraw-wrapper",
|
|||
|
"data-tlapp":g.uuid,children:(0,tb.jsx)(ZE,{components:p,children:(0,tb.jsx)(YH,{})})})})},oK=b=>{var {onPersist:g,readOnly:p,model:G}=b;b=zf(b,["onPersist","readOnly","model"]);const Y=Ad(),la=md(),pa=Ud(),Ga=p?null:Ae(),Qa=Yr.useCallback((Za,fb)=>{null==g?void 0:g(Za,fb)},[G]);return(0,tb.jsx)(XE,hf(pe({Shapes:EB,Tools:lK,onDrop:Y,onPaste:la,onCopy:pa,readOnly:p,onCanvasDBClick:Ga,onPersist:Qa,model:G},b),{children:(0,tb.jsx)(nK,{})}))},pK=function(b){var {renderers:g,handlers:p}=b;b=zf(b,["renderers",
|
|||
|
"handlers"]);const G={renderers:Yr.useMemo(()=>Object.fromEntries(Object.entries(g).map(([Y,la])=>[Y,Yr.memo(la)])),[]),handlers:p};return(0,tb.jsx)(an.Provider,{value:G,children:(0,tb.jsx)(oK,pe({},b))})}};
|
|||
|
'use strict';var Lmd=function(a){return a},Mmd=function(a,b){return $APP.vh.j(function(c){var d=$APP.kf(c);c=$APP.G.j(d,$APP.wD);d=$APP.G.j(d,$APP.SG);return new $APP.m(null,2,[$APP.tl,$APP.u.C(c),$APP.KGb,$APP.Xy.j(d,new $APP.O(null,2,5,$APP.R,[$APP.eF,$APP.KGb],null))],null)},$APP.Pf.j(function(c){return $APP.eF.C($APP.SG.C(c))},$APP.OH(a,b,new $APP.m(null,1,[$APP.Ft,new $APP.O(null,2,5,$APP.R,[$APP.wD,$APP.SG],null)],null))))},Nmd=function(a){return $APP.Hq.G(a,$APP.F([$APP.Iq,!0]))},Omd=function(a,
|
|||
|
b,c,d){var e=$APP.UH(a);b=new $APP.m(null,2,[$APP.fF,$APP.Vib,$APP.hF,new $APP.m(null,6,[$APP.tl,$APP.wa(b,"id"),$APP.W,$APP.wa(b,"name"),$APP.SI,Nmd($APP.wa(b,"bindings")),$APP.KGb,$APP.wa(b,"nonce"),$APP.LGb,Nmd(c),$APP.HGb,d],null)],null);c=$APP.qx();e=$APP.sI.C(e);e=$APP.n(e)?e:$APP.qx();return new $APP.m(null,5,[$APP.Br,a,$APP.uH,"whiteboard",$APP.SG,b,$APP.tI,c,$APP.sI,e],null)},Pmd=function(a,b,c,d,e,f){a=Nmd(a.getCleanUpAssets());var g=b.shapes,h=$APP.vh.j(function(E){return $APP.wa(E,"id")},
|
|||
|
g),l=$APP.bh(h,$APP.qj.C(g.length));g=$APP.Zg($APP.vh.j(function(E){E=$APP.kf(E);E=$APP.G.j(E,$APP.tl);return $APP.T.F(Nmd(b.getShapeById(E).serialized),$APP.my,$APP.G.j(l,E))},$APP.VA.j(c,d)));d=$APP.Zg($APP.vh.j($APP.tl,d));var p=$APP.Zg($APP.vh.j($APP.tl,c)),q=$APP.Zg($APP.Gm.j($APP.Uj,$APP.VA.j(p,d)));c=$APP.Zg($APP.Pf.j(function(E){E=$APP.tl.C(E);return q.C?q.C(E):q.call(null,E)},g));var r=$APP.Gm.j($APP.Uj,$APP.VA.j(d,p)),t=$APP.sC();d=$APP.x(r)?$APP.vh.j(function(E){return $APP.Xy.j(E,new $APP.O(null,
|
|||
|
2,5,$APP.R,[$APP.SG,$APP.eF],null))},function(){var E=new $APP.O(null,1,5,$APP.R,[$APP.Gz],null),H=$APP.pj.j(function(K){return new $APP.O(null,2,5,$APP.R,[$APP.wD,$APP.Wh(K)],null)},r);return $APP.RF?$APP.RF(t,E,H):$APP.SF.call(null,t,E,H)}()):null;p=$APP.pj.j(function(E){return new $APP.O(null,2,5,$APP.R,[$APP.fLa,new $APP.O(null,2,5,$APP.R,[$APP.wD,$APP.Wh(E)],null)],null)},r);var y=$APP.VA.j(g,c),z=$APP.x(y)?function(){var E=new $APP.O(null,1,5,$APP.R,[$APP.Gz],null),H=$APP.pj.j(function(K){return new $APP.O(null,
|
|||
|
2,5,$APP.R,[$APP.wD,$APP.Wh($APP.tl.C(K))],null)},y);return $APP.RF?$APP.RF(t,E,H):$APP.SF.call(null,t,E,H)}():null;return new $APP.m(null,4,[$APP.ftc,Omd(e,b,a,h),$APP.zIc,$APP.vh.j(function(E){return $APP.Wd(q,$APP.u.C($APP.wD.C(E)))?$APP.T.F(E,$APP.tI,$APP.qx()):$APP.Etb(E)},$APP.vh.j(function(E){E=new $APP.m(null,2,[$APP.fF,$APP.$N,$APP.eF,E],null);E=new $APP.m(null,3,[$APP.PF,new $APP.m(null,1,[$APP.Br,$APP.Ar.C?$APP.Ar.C(e):$APP.Ar.call(null,e)],null),$APP.bG,new $APP.m(null,1,[$APP.Br,e],null),
|
|||
|
$APP.SG,E],null);var H=$APP.ajb(E,e);return $APP.Nl.G($APP.F([E,H]))},g)),$APP.qG,p,$APP.gYb,new $APP.m(null,3,[$APP.wDb,$APP.Hb(f),$APP.Tsb,f,$APP.tw,new $APP.m(null,5,[$APP.bO,e,$APP.aHb,d,$APP.bHb,c,$APP.cHb,y,$APP.dHb,z],null)],null)],null)},Qmd=function(a,b,c){var d=$APP.$c($APP.A(b.pages)),e=d.shapes,f=$APP.UH(a);f=$APP.Xy.j(f,new $APP.O(null,3,5,$APP.R,[$APP.SG,$APP.hF,$APP.HGb],null));var g=$APP.bh(f,$APP.qj.C($APP.Vc(f)));e=$APP.Zg($APP.Sn.j(function(p,q){var r=q.id;return new $APP.m(null,
|
|||
|
2,[$APP.tl,r,$APP.KGb,$APP.B.j(p,$APP.G.j(g,r))?q.nonce:Date.now()],null)},e));var h=$APP.sC();f=function(){var p=$APP.Xy.j($APP.v($APP.T8c),new $APP.O(null,2,5,$APP.R,[h,a],null));return $APP.n(p)?p:$APP.Zg($APP.vh.j(function(q){return $APP.Kr.F(q,$APP.tl,$APP.u)},Mmd(h,a)))}();b=Pmd(b,d,e,f,a,c);f=$APP.kf(b);d=$APP.G.j(f,$APP.ftc);b=$APP.G.j(f,$APP.zIc);c=$APP.G.j(f,$APP.qG);f=$APP.G.j(f,$APP.gYb);d=$APP.Vk.G(c,new $APP.O(null,1,5,$APP.R,[d],null),$APP.F([b]));var l=$APP.Xy.j(f,new $APP.O(null,
|
|||
|
2,5,$APP.R,[$APP.tw,$APP.bHb],null));l=$APP.n($APP.xf(function(p){return $APP.B.j("group",$APP.Jm.C(p))},l))?$APP.T.F(f,$APP.eHb,$APP.jw):$APP.n($APP.xf(function(p){return $APP.B.j("group",$APP.Jm.C(p))},$APP.Xy.j(f,new $APP.O(null,2,5,$APP.R,[$APP.tw,$APP.aHb],null))))?$APP.T.F(f,$APP.eHb,$APP.kuc):$APP.n($APP.xf(function(p){return $APP.B.j("line",$APP.Jm.C(p))&&$APP.B.j("arrow ",$APP.To.C($APP.csc.C(p)))},l))?$APP.T.F(f,$APP.eHb,$APP.NEc):f;b=$APP.x($APP.Vk.j(b,c))?l:$APP.T.F(f,$APP.lYa,!0);$APP.Ih.R($APP.T8c,
|
|||
|
$APP.Iv,new $APP.O(null,2,5,$APP.R,[h,a],null),e);if($APP.Wd(new $APP.Vg(null,new $APP.m(null,1,[$APP.NEc,null],null),null),$APP.eHb.C(b)))return $APP.vC($APP.fVc,new $APP.m(null,2,[$APP.dz,d,$APP.gYb,b],null));e=$APP.fVc.C($APP.v($APP.tC));$APP.Vk.j($APP.dz.C(e),d);$APP.Nl.G($APP.F([b,$APP.gYb.C(e)]));$APP.vC($APP.fVc,$APP.jf);return null},Rmd=function(a){a=$APP.NH(a);return $APP.Gm.j($APP.Tib,a)},Smd=function(a){var b=$APP.ez.C($APP.UH(a));a=Rmd(a);a=$APP.Pf.j(function(d){return $APP.B.j(b,$APP.ez.C($APP.bG.C(d)))},
|
|||
|
a);var c=$APP.Zg($APP.Gm.j($APP.Db,$APP.vh.j(function(d){return $APP.Xy.F(d,new $APP.O(null,2,5,$APP.R,[$APP.cG,$APP.ez],null),null)},a)));a=$APP.Gm.j(function(d){d=$APP.ez.C(d);return c.C?c.C(d):c.call(null,d)},a);return $APP.x(a)?$APP.A(a):null},Tmd=function(){return $APP.em(null,function(){return $APP.em(fetch("./whiteboard/onboarding.edn"),function(a){return $APP.em(a.text(),function(b){return $APP.em($APP.Hr($APP.jf,b),function(c){return $APP.Xl(c)})})})})},Umd=function(a){var b=$APP.R0a();return($APP.od(b)||
|
|||
|
$APP.B.j(1,$APP.Vc(b))&&$APP.B.j(a,$APP.Br.C($APP.A(b))))&&$APP.Hb($APP.Xy.j($APP.v($APP.tC),new $APP.O(null,1,5,$APP.R,[$APP.Nec],null)))},Vmd=function(a){return null!=a?$APP.hm($APP.em(null,function(){return $APP.em(Tmd(),function(b){var c=$APP.kf(b);b=$APP.G.j(c,$APP.qI);c=$APP.G.j(c,$APP.nx);var d=$APP.A(b);b=$APP.IGb(d,c);d=$APP.Sib(d);c=$APP.LGb.C(d);d=$APP.SI.C(d);a.cloneShapesIntoCurrentPage($APP.Gi(new $APP.m(null,3,[$APP.TGb,b,$APP.LGb,c,$APP.SI,d],null)));$APP.vC($APP.Nec,!0);b=$APP.cC($APP.sjc,
|
|||
|
!0);return $APP.Xl(b)})}),function(b){return console.warn("Failed to populate onboarding whiteboard",b)}):null},Ymd=function(a,b){b=$APP.Hq.G(b,$APP.F([new $APP.m(null,1,[$APP.Iq,!0],null)]));b=$APP.kf(b);var c=$APP.G.j(b,Wmd),d=$APP.G.j(b,$APP.FK),e=$APP.G.j(b,Xmd),f=$APP.sC();return $APP.em(null,function(){return $APP.em($APP.n(d)?$APP.vdb(f,a,new $APP.m(null,1,[$APP.Ox,100],null)):null,function(g){return $APP.em($APP.n(c)?$APP.Adb(a,10):null,function(h){return $APP.em($APP.n(e)?$APP.Bdb(a,100):
|
|||
|
null,function(l){return $APP.Xl($APP.Gi(new $APP.m(null,3,[$APP.qI,h,$APP.nx,g,$APP.pL,l],null)))})})})})},Zmd=function(a){return $APP.dm($APP.DAb($APP.sC(),new $APP.O(null,1,5,$APP.R,[$APP.Hq.C(a)],null)),function(b){var c=(c=$APP.x(b))?$APP.A(b):c;return $APP.n(c)?(b=$APP.C.F(c,0,null),$APP.C.F(c,1,null),c=$APP.C.F(c,2,null),$APP.FAb($APP.n(c)?c:b)):null})},$md=function(){return $APP.BDb(null)},and=function(){return $APP.EDb(null)},pnd=function(a){return $APP.Ig([bnd,cnd,dnd,end,fnd,gnd,$APP.WD,
|
|||
|
hnd,ind,jnd,knd,lnd,mnd,nnd,ond],[function(b){return $APP.Br.C($APP.i_a($APP.sC(),$APP.xi(b)))},function(b){return $APP.VH(b,!1)},function(b){return $APP.MGb(b)},$APP.Kx,function(b){return $APP.Gzb(b,new $APP.m(null,1,[$APP.gT,!1],null))},$APP.oI,Ymd,Zmd,Lmd,function(b,c){return $APP.kx(b,$APP.F([$APP.mx,c]))},function(b){var c=$APP.u,d=c.C,e=$APP.AB(),f=$APP.UH(a),g=Smd(a);b=new $APP.m(null,6,[$APP.cG,$APP.Ug($APP.n(g)?g:f,new $APP.O(null,1,5,$APP.R,[$APP.ez],null)),$APP.wD,e,$APP.tD,$APP.n(b)?b:
|
|||
|
"",$APP.uG,$APP.Cr,$APP.PF,new $APP.m(null,2,[$APP.Br,$APP.Ar.C?$APP.Ar.C(a):$APP.Ar.call(null,a),$APP.ux,a],null),$APP.bG,new $APP.m(null,1,[$APP.Br,a],null)],null);$APP.TF(new $APP.O(null,1,5,$APP.R,[b],null));return d.call(c,e)},function(b,c){return $APP.QD(function(){return(0,$APP.sSb)(b,$APP.Nl.G($APP.F([$APP.Hq.G(c,$APP.F([$APP.Iq,!0])),new $APP.m(null,1,[$APP.hT,!0],null)])))})},function(b,c){return $APP.rD($APP.sC(),$APP.ez.C($APP.UH(b)),$APP.wh.C(c))},function(b){var c=$APP.Kw(b)?$APP.Br.C($APP.i_a($APP.sC(),
|
|||
|
$APP.xi(b))):null;c=$APP.n(c)?c:b;var d=$APP.PH(c),e=$APP.oI(c);return $APP.n(d)?$APP.n(e)?$APP.BN(c,new $APP.m(null,1,[$APP.AN,b],null)):$APP.yN($APP.VH(b,!1)):null},function(b){return $APP.Gi($APP.jH($APP.xi(b)))}])},ond=new $APP.N(null,"queryBlockByUUID","queryBlockByUUID",2091812895),lnd=new $APP.N(null,"exportToImage","exportToImage",-154356643),knd=new $APP.N(null,"addNewBlock","addNewBlock",1426762680),qnd=new $APP.N(null,"KeyboardShortcut","KeyboardShortcut",1250004264),Xmd=new $APP.N(null,
|
|||
|
"files?","files?",-1267491104),bnd=new $APP.N(null,"getBlockPageName","getBlockPageName",-1656908032),rnd=new $APP.N(null,"renderers","renderers",-1460292282),snd=new $APP.N(null,"model","model",331153215),cnd=new $APP.N(null,"getRedirectPageName","getRedirectPageName",-1858136925),end=new $APP.N(null,"isMobile","isMobile",-2043133877),tnd=new $APP.N(null,"onMount","onMount",-876858467),fnd=new $APP.N(null,"insertFirstPageBlock","insertFirstPageBlock",-1676658548),ind=new $APP.N(null,"makeAssetUrl",
|
|||
|
"makeAssetUrl",217779988),und=new $APP.N(null,"onPersist","onPersist",-1848738852),vnd=new $APP.N(null,"Breadcrumb","Breadcrumb",-1351298906),jnd=new $APP.N(null,"copyToClipboard","copyToClipboard",1092115063),nnd=new $APP.N(null,"redirectToPage","redirectToPage",87147838),dnd=new $APP.N(null,"addNewWhiteboard","addNewWhiteboard",554297706),hnd=new $APP.N(null,"saveAsset","saveAsset",-668047853),wnd=new $APP.N(null,"BacklinksCount","BacklinksCount",364670631),xnd=new $APP.N(null,"Block","Block",-1959785792),
|
|||
|
mnd=new $APP.N(null,"sidebarAddBlock","sidebarAddBlock",-1204903203),ynd=new $APP.N(null,"Page","Page",-1267059506),Wmd=new $APP.N(null,"pages?","pages?",-2065014049),znd=new $APP.N(null,"PageName","PageName",-164991013),And=new $APP.N(null,"Tweet","Tweet",-452258680),gnd=new $APP.N(null,"isWhiteboardPage","isWhiteboardPage",-134150579),Bnd=new $APP.N(null,"BlockReference","BlockReference",-120254741);$APP.bda("tldraw");var Cnd=$APP.om(592);var Dnd,End;$APP.Ldd={};Dnd=$APP.DT($APP.wa(Cnd,"App"));$APP.Odd=$APP.wa(Cnd,"generateJSXFromModel");
|
|||
|
End=new $APP.m(null,8,[ynd,$APP.gs($APP.ks,function(a){return(0,$APP.Vcd)(new $APP.m(null,2,[$APP.bO,$APP.VH($APP.wa(a,"pageName"),!1),$APP.hT,!0],null))},null,"frontend.extensions.tldraw/page-cp"),xnd,$APP.gs($APP.ks,function(a){a=$APP.Wh($APP.wa(a,"blockId"));var b=$APP.KTa($APP.v9b);a=b.C?b.C(a):b.call(null,a);return $APP.Qr(a)},null,"frontend.extensions.tldraw/block-cp"),vnd,$APP.gs($APP.ks,function(a){return $APP.Qr($APP.sW(new $APP.m(null,1,[$APP.$Z,!0],null),$APP.sC(),$APP.Wh($APP.wa(a,"blockId")),
|
|||
|
new $APP.m(null,2,[$APP.d_b,$APP.wa(a,"endSeparator"),$APP.e_b,$APP.wa(a,"levelLimit",3)],null)))},null,"frontend.extensions.tldraw/breadcrumb"),And,$APP.gs($APP.ks,function(a){return(0,$APP.UYb)($APP.wa(a,"tweetId"))},null,"frontend.extensions.tldraw/tweet"),znd,$APP.gs($APP.ks,function(a){return(0,$APP.fW)(new $APP.m(null,1,[$APP.$Z,!0],null),new $APP.m(null,1,[$APP.Br,$APP.wa(a,"pageName")],null))},null,"frontend.extensions.tldraw/page-name-link"),wnd,function(a){return $APP.zf.j($APP.Rdd,$APP.vh.j(function(b){return $APP.Hq.G($APP.wa(a,
|
|||
|
b),$APP.F([new $APP.m(null,1,[$APP.Iq,!0],null)]))},new $APP.O(null,3,5,$APP.R,["id","className","options"],null)))},Bnd,$APP.gs($APP.ks,function(a){return(0,$APP.cYb)($APP.jf,$APP.wa(a,"blockId"),null)},null,"frontend.extensions.tldraw/block-reference"),qnd,$APP.gs($APP.ks,function(a){a=$APP.mIb($APP.wh.C($APP.wa(a,"action")));return $APP.Qr($APP.GT(a))},null,"frontend.extensions.tldraw/keyboard-shortcut")],null);
|
|||
|
$APP.Mdd=$APP.gs($APP.ks,function(a,b){function c(l){if($APP.n(l)){l.appUndo=$md;l.appRedo=and;var p=$APP.wa(l,"api");return $APP.n(p)?$APP.dm(d?Vmd(p):null,function(){$APP.EUa(l,b);return h.C?h.C(l):h.call(null,l)}):null}return null}var d=Umd(a),e=$APP.UGb(a),f=$APP.ts(null),g=$APP.C.F(f,0,null),h=$APP.C.F(f,1,null);$APP.us(function(){$APP.n($APP.n(g)?b:g)&&$APP.EUa(g,b);return function(){return $APP.Ec}},new $APP.O(null,2,5,$APP.R,[b,g],null));return $APP.n(e)?$APP.X("div",{style:{overscrollBehavior:"none"},
|
|||
|
onBlur:function(l){l=$APP.wa(l,"target").tagName;var p=new $APP.Vg(null,new $APP.m(null,2,["INPUT",null,"TEXTAREA",null],null),null);l=p.C?p.C(l):p.call(null,l);return $APP.n(l)?$APP.vD():null},onWheel:$APP.ex,className:"draw tldraw whiteboard relative w-full h-full"},[d&&$APP.Hb(g)?$APP.X("div",{style:{zIndex:200},className:"absolute inset-0 flex items-center justify-center"},[$APP.Qr($APP.NT("Loading onboarding whiteboard ..."))]):null,$APP.Qr(function(){var l=new $APP.m(null,6,[rnd,End,$APP.UB,
|
|||
|
pnd(a),tnd,c,$APP.UJc,!0,und,function(p,q){$APP.vC(new $APP.O(null,2,5,$APP.R,[$APP.WLc,$APP.sC()],null),$APP.qx());return $APP.n(!1)?(console.time("tldraw persist"),p=Qmd(a,p,q.replace),console.timeEnd("tldraw persist"),p):Qmd(a,p,q.replace)},snd,e],null);return Dnd.C?Dnd.C(l):Dnd.call(null,l)}())]):null},null,"frontend.extensions.tldraw/tldraw-app");$APP.Ya.Yi();
|
|||
|
}).call(this);
|