(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[47485],{36787:function(Ao,lr,At){"use strict";At.d(lr,{Z:function(){return jt}});var Z=At(28991),Kt=At(67294),nr={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M697.8 481.4c33.6-35 54.2-82.3 54.2-134.3v-10.2C752 229.3 663.9 142 555.3 142H259.4c-15.1 0-27.4 12.3-27.4 27.4v679.1c0 16.3 13.2 29.5 29.5 29.5h318.7c117 0 211.8-94.2 211.8-210.5v-11c0-73-37.4-137.3-94.2-175.1zM328 238h224.7c57.1 0 103.3 44.4 103.3 99.3v9.5c0 54.8-46.3 99.3-103.3 99.3H328V238zm366.6 429.4c0 62.9-51.7 113.9-115.5 113.9H328V542.7h251.1c63.8 0 115.5 51 115.5 113.9v10.8z"}}]},name:"bold",theme:"outlined"},nt=nr,hr=At(27029),ir=function(Wt,Ut){return Kt.createElement(hr.Z,(0,Z.Z)((0,Z.Z)({},Wt),{},{ref:Ut,icon:nt}))};ir.displayName="BoldOutlined";var jt=Kt.forwardRef(ir)},32091:function(Ao,lr,At){"use strict";At.d(lr,{Z:function(){return jt}});var Z=At(28991),Kt=At(67294),nr={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M798 160H366c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h181.2l-156 544H229c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8H474.4l156-544H798c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"italic",theme:"outlined"},nt=nr,hr=At(27029),ir=function(Wt,Ut){return Kt.createElement(hr.Z,(0,Z.Z)((0,Z.Z)({},Wt),{},{ref:Ut,icon:nt}))};ir.displayName="ItalicOutlined";var jt=Kt.forwardRef(ir)},46655:function(Ao,lr,At){"use strict";At.d(lr,{Z:function(){return jt}});var Z=At(28991),Kt=At(67294),nr={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824 804H200c-4.4 0-8 3.4-8 7.6v60.8c0 4.2 3.6 7.6 8 7.6h624c4.4 0 8-3.4 8-7.6v-60.8c0-4.2-3.6-7.6-8-7.6zm-312-76c69.4 0 134.6-27.1 183.8-76.2C745 602.7 772 537.4 772 468V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 97-79 176-176 176s-176-79-176-176V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 69.4 27.1 134.6 76.2 183.8C377.3 701 442.6 728 512 728z"}}]},name:"underline",theme:"outlined"},nt=nr,hr=At(27029),ir=function(Wt,Ut){return Kt.createElement(hr.Z,(0,Z.Z)((0,Z.Z)({},Wt),{},{ref:Ut,icon:nt}))};ir.displayName="UnderlineOutlined";var jt=Kt.forwardRef(ir)},53835:function(Ao,lr,At){"use strict";At.d(lr,{T:function(){return sa},Z:function(){return na}});var Z=At(67294);function Kt(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function nr(g){return nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},nr(g)}function nt(g,m){if(nr(g)!=="object"||g===null)return g;var d=g[Symbol.toPrimitive];if(d!==void 0){var t=d.call(g,m||"default");if(nr(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(g)}function hr(g){var m=nt(g,"string");return nr(m)==="symbol"?m:String(m)}function ir(g,m){for(var d=0;d=0&&p===c&&S())}function Ei(g,m){if(g==null)return{};var d={},t=Object.keys(g),i,s;for(s=0;s=0)&&(d[i]=g[i]);return d}function xn(g,m){if(g==null)return{};var d=Ei(g,m),t,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(g);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(g,t)||(d[t]=g[t]))}return d}var fa=null,da=null,zs=null,It=null,Te=null,rs=null,ns=null,oi=null,Mi=null,Oi=null,wn=null,Cn=null,Rt=null,is=null,Lo=null,As=null,ks=null,va=null,ha=function(){function g(m){var d=m.cellCount,t=m.cellSizeGetter,i=m.estimatedCellSize;Kt(this,g),Q(this,"_cellSizeAndPositionData",{}),Q(this,"_lastMeasuredIndex",-1),Q(this,"_lastBatchedIndex",-1),Q(this,"_cellCount",void 0),Q(this,"_cellSizeGetter",void 0),Q(this,"_estimatedCellSize",void 0),this._cellSizeGetter=t,this._cellCount=d,this._estimatedCellSize=i}return jt(g,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(d){var t=d.cellCount,i=d.estimatedCellSize,s=d.cellSizeGetter;this._cellCount=t,this._estimatedCellSize=i,this._cellSizeGetter=s}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(d){if(d<0||d>=this._cellCount)throw Error("Requested index ".concat(d," is outside of range 0..").concat(this._cellCount));if(d>this._lastMeasuredIndex)for(var t=this.getSizeAndPositionOfLastMeasuredCell(),i=t.offset+t.size,s=this._lastMeasuredIndex+1;s<=d;s++){var l=this._cellSizeGetter({index:s});if(l===void 0||isNaN(l))throw Error("Invalid size returned for cell ".concat(s," of value ").concat(l));l===null?(this._cellSizeAndPositionData[s]={offset:i,size:0},this._lastBatchedIndex=d):(this._cellSizeAndPositionData[s]={offset:i,size:l},i+=l,this._lastMeasuredIndex=d)}return this._cellSizeAndPositionData[d]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var d=this.getSizeAndPositionOfLastMeasuredCell(),t=d.offset+d.size,i=this._cellCount-this._lastMeasuredIndex-1,s=i*this._estimatedCellSize;return t+s}},{key:"getUpdatedOffsetForIndex",value:function(d){var t=d.align,i=t===void 0?"auto":t,s=d.containerSize,l=d.currentOffset,c=d.targetIndex;if(s<=0)return 0;var p=this.getSizeAndPositionOfCell(c),S=p.offset,y=S-s+p.size,x;switch(i){case"start":x=S;break;case"end":x=y;break;case"center":x=S-(s-p.size)/2;break;default:x=Math.max(y,Math.min(S,l));break}var E=this.getTotalSize();return Math.max(0,Math.min(E-s,x))}},{key:"getVisibleCellRange",value:function(d){var t=d.containerSize,i=d.offset,s=this.getTotalSize();if(s===0)return{};var l=i+t,c=this._findNearestCell(i),p=this.getSizeAndPositionOfCell(c);i=p.offset+p.size;for(var S=c;ii&&(d=s-1)}return t>0?t-1:0}},{key:"_exponentialSearch",value:function(d,t){for(var i=1;d=d?this._binarySearch(i,0,d):this._exponentialSearch(i,d)}}]),g}(),me=15e5,Ls=16777100,Ii=function(){return typeof window!="undefined"},pa=function(){return!!window.chrome},re=function(){return Ii()&&pa()?Ls:me},Pi=function(){function g(m){var d=m.maxScrollSize,t=d===void 0?re():d,i=xn(m,["maxScrollSize"]);Kt(this,g),Q(this,"_cellSizeAndPositionManager",void 0),Q(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new ha(i),this._maxScrollSize=t}return jt(g,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(d){this._cellSizeAndPositionManager.configure(d)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(d){var t=d.containerSize,i=d.offset,s=this._cellSizeAndPositionManager.getTotalSize(),l=this.getTotalSize(),c=this._getOffsetPercentage({containerSize:t,offset:i,totalSize:l});return Math.round(c*(l-s))}},{key:"getSizeAndPositionOfCell",value:function(d){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(d)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(d){var t=d.align,i=t===void 0?"auto":t,s=d.containerSize,l=d.currentOffset,c=d.targetIndex;l=this._safeOffsetToOffset({containerSize:s,offset:l});var p=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:s,currentOffset:l,targetIndex:c});return this._offsetToSafeOffset({containerSize:s,offset:p})}},{key:"getVisibleCellRange",value:function(d){var t=d.containerSize,i=d.offset;return i=this._safeOffsetToOffset({containerSize:t,offset:i}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:t,offset:i})}},{key:"resetCell",value:function(d){this._cellSizeAndPositionManager.resetCell(d)}},{key:"_getOffsetPercentage",value:function(d){var t=d.containerSize,i=d.offset,s=d.totalSize;return s<=t?0:i/(s-t)}},{key:"_offsetToSafeOffset",value:function(d){var t=d.containerSize,i=d.offset,s=this._cellSizeAndPositionManager.getTotalSize(),l=this.getTotalSize();if(s===l)return i;var c=this._getOffsetPercentage({containerSize:t,offset:i,totalSize:s});return Math.round(c*(l-t))}},{key:"_safeOffsetToOffset",value:function(d){var t=d.containerSize,i=d.offset,s=this._cellSizeAndPositionManager.getTotalSize(),l=this.getTotalSize();if(s===l)return i;var c=this._getOffsetPercentage({containerSize:t,offset:i,totalSize:l});return Math.round(c*(s-t))}}]),g}();function pr(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,m={};return function(d){var t=d.callback,i=d.indices,s=Object.keys(i),l=!g||s.every(function(p){var S=i[p];return Array.isArray(S)?S.length>0:S>=0}),c=s.length!==Object.keys(m).length||s.some(function(p){var S=m[p],y=i[p];return Array.isArray(y)?S.join(",")!==y.join(","):S!==y});m=i,l&&c&&t(i)}}var le=-1,Le=1,Go="horizontal",no="vertical";function os(g){var m=g.cellCount,d=g.overscanCellsCount,t=g.scrollDirection,i=g.startIndex,s=g.stopIndex;return t===Le?{overscanStartIndex:Math.max(0,i),overscanStopIndex:Math.min(m-1,s+d)}:{overscanStartIndex:Math.max(0,i-d),overscanStopIndex:Math.min(m-1,s)}}function an(g){var m=g.cellSize,d=g.cellSizeAndPositionManager,t=g.previousCellsCount,i=g.previousCellSize,s=g.previousScrollToAlignment,l=g.previousScrollToIndex,c=g.previousSize,p=g.scrollOffset,S=g.scrollToAlignment,y=g.scrollToIndex,x=g.size,E=g.sizeJustIncreasedFromZero,O=g.updateScrollIndexCallback,P=d.getCellCount(),A=y>=0&&y0&&(xd.getTotalSize()-x&&O(P-1)}function ai(g){for(var m=g.cellCache,d=g.cellRenderer,t=g.columnSizeAndPositionManager,i=g.columnStartIndex,s=g.columnStopIndex,l=g.deferredMeasurementCache,c=g.horizontalOffsetAdjustment,p=g.isScrolling,S=g.isScrollingOptOut,y=g.parent,x=g.rowSizeAndPositionManager,E=g.rowStartIndex,O=g.rowStopIndex,P=g.styleCache,A=g.verticalOffsetAdjustment,B=g.visibleColumnIndices,G=g.visibleRowIndices,V=[],$=t.areOffsetsAdjusted()||x.areOffsetsAdjusted(),X=!p&&!$,rt=E;rt<=O;rt++)for(var st=x.getSizeAndPositionOfCell(rt),it=i;it<=s;it++){var tt=t.getSizeAndPositionOfCell(it),ht=it>=B.start&&it<=B.stop&&rt>=G.start&&rt<=G.stop,lt="".concat(rt,"-").concat(it),gt=void 0;X&&P[lt]?gt=P[lt]:l&&!l.has(rt,it)?gt={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(gt={height:st.size,left:tt.offset+c,position:"absolute",top:st.offset+A,width:tt.size},P[lt]=gt);var ct={columnIndex:it,isScrolling:p,isVisible:ht,key:lt,parent:y,rowIndex:rt,style:gt},mt=void 0;(S||p)&&!c&&!A?(m[lt]||(m[lt]=d(ct)),mt=m[lt]):mt=d(ct),!(mt==null||mt===!1)&&V.push(mt)}return V}function Di(g,m){}var Wo=!!(typeof window!="undefined"&&window.document&&window.document.createElement),gr;function Gr(g){if((!gr&&gr!==0||g)&&Wo){var m=document.createElement("div");m.style.position="absolute",m.style.top="-9999px",m.style.width="50px",m.style.height="50px",m.style.overflow="scroll",document.body.appendChild(m),gr=m.offsetWidth-m.clientWidth,document.body.removeChild(m)}return gr}var Ne;typeof window!="undefined"?Ne=window:typeof self!="undefined"?Ne=self:Ne={};var si=Ne.requestAnimationFrame||Ne.webkitRequestAnimationFrame||Ne.mozRequestAnimationFrame||Ne.oRequestAnimationFrame||Ne.msRequestAnimationFrame||function(g){return Ne.setTimeout(g,1e3/60)},ga=Ne.cancelAnimationFrame||Ne.webkitCancelAnimationFrame||Ne.mozCancelAnimationFrame||Ne.oCancelAnimationFrame||Ne.msCancelAnimationFrame||function(g){Ne.clearTimeout(g)},io=si,as=ga,zi=null,mr=function(m){return as(m.id)},li=function(m,d){var t;Promise.resolve().then(function(){t=Date.now()});var i=function l(){Date.now()-t>=d?m.call():s.id=io(l)},s={id:io(i)};return s},Fo,wr;function Bo(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function Vr(g){for(var m=1;m0&&(t._initialScrollTop=t._getCalculatedScrollTop(d,t.state)),d.scrollToColumn>0&&(t._initialScrollLeft=t._getCalculatedScrollLeft(d,t.state)),t}return jt(m,[{key:"getOffsetForCell",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t.alignment,s=i===void 0?this.props.scrollToAlignment:i,l=t.columnIndex,c=l===void 0?this.props.scrollToColumn:l,p=t.rowIndex,S=p===void 0?this.props.scrollToRow:p,y=Vr({},this.props,{scrollToAlignment:s,scrollToColumn:c,scrollToRow:S});return{scrollLeft:this._getCalculatedScrollLeft(y),scrollTop:this._getCalculatedScrollTop(y)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(t){var i=t.scrollLeft,s=i===void 0?0:i,l=t.scrollTop,c=l===void 0?0:l;if(!(c<0)){this._debounceScrollEnded();var p=this.props,S=p.autoHeight,y=p.autoWidth,x=p.height,E=p.width,O=this.state.instanceProps,P=O.scrollbarSize,A=O.rowSizeAndPositionManager.getTotalSize(),B=O.columnSizeAndPositionManager.getTotalSize(),G=Math.min(Math.max(0,B-E+P),s),V=Math.min(Math.max(0,A-x+P),c);if(this.state.scrollLeft!==G||this.state.scrollTop!==V){var $=G!==this.state.scrollLeft?G>this.state.scrollLeft?Le:le:this.state.scrollDirectionHorizontal,X=V!==this.state.scrollTop?V>this.state.scrollTop?Le:le:this.state.scrollDirectionVertical,rt={isScrolling:!0,scrollDirectionHorizontal:$,scrollDirectionVertical:X,scrollPositionChangeReason:Ho.OBSERVED};S||(rt.scrollTop=V),y||(rt.scrollLeft=G),rt.needToResetStyleCache=!1,this.setState(rt)}this._invokeOnScrollMemoizer({scrollLeft:G,scrollTop:V,totalColumnsWidth:B,totalRowsHeight:A})}}},{key:"invalidateCellSizeAfterRender",value:function(t){var i=t.columnIndex,s=t.rowIndex;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,i):i,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,s):s}},{key:"measureAllCells",value:function(){var t=this.props,i=t.columnCount,s=t.rowCount,l=this.state.instanceProps;l.columnSizeAndPositionManager.getSizeAndPositionOfCell(i-1),l.rowSizeAndPositionManager.getSizeAndPositionOfCell(s-1)}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t.columnIndex,s=i===void 0?0:i,l=t.rowIndex,c=l===void 0?0:l,p=this.props,S=p.scrollToColumn,y=p.scrollToRow,x=this.state.instanceProps;x.columnSizeAndPositionManager.resetCell(s),x.rowSizeAndPositionManager.resetCell(c),this._recomputeScrollLeftFlag=S>=0&&(this.state.scrollDirectionHorizontal===Le?s<=S:s>=S),this._recomputeScrollTopFlag=y>=0&&(this.state.scrollDirectionVertical===Le?c<=y:c>=y),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(t){var i=t.columnIndex,s=t.rowIndex,l=this.props.columnCount,c=this.props;l>1&&i!==void 0&&this._updateScrollLeftForScrollToColumn(Vr({},c,{scrollToColumn:i})),s!==void 0&&this._updateScrollTopForScrollToRow(Vr({},c,{scrollToRow:s}))}},{key:"componentDidMount",value:function(){var t=this.props,i=t.getScrollbarSize,s=t.height,l=t.scrollLeft,c=t.scrollToColumn,p=t.scrollTop,S=t.scrollToRow,y=t.width,x=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),x.scrollbarSizeMeasured||this.setState(function(P){var A=Vr({},P,{needToResetStyleCache:!1});return A.instanceProps.scrollbarSize=i(),A.instanceProps.scrollbarSizeMeasured=!0,A}),typeof l=="number"&&l>=0||typeof p=="number"&&p>=0){var E=m._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:l,scrollTop:p});E&&(E.needToResetStyleCache=!1,this.setState(E))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var O=s>0&&y>0;c>=0&&O&&this._updateScrollLeftForScrollToColumn(),S>=0&&O&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:l||0,scrollTop:p||0,totalColumnsWidth:x.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:x.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(t,i){var s=this,l=this.props,c=l.autoHeight,p=l.autoWidth,S=l.columnCount,y=l.height,x=l.rowCount,E=l.scrollToAlignment,O=l.scrollToColumn,P=l.scrollToRow,A=l.width,B=this.state,G=B.scrollLeft,V=B.scrollPositionChangeReason,$=B.scrollTop,X=B.instanceProps;this._handleInvalidatedGridSize();var rt=S>0&&t.columnCount===0||x>0&&t.rowCount===0;V===Ho.REQUESTED&&(!p&&G>=0&&(G!==this._scrollingContainer.scrollLeft||rt)&&(this._scrollingContainer.scrollLeft=G),!c&&$>=0&&($!==this._scrollingContainer.scrollTop||rt)&&(this._scrollingContainer.scrollTop=$));var st=(t.width===0||t.height===0)&&y>0&&A>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):an({cellSizeAndPositionManager:X.columnSizeAndPositionManager,previousCellsCount:t.columnCount,previousCellSize:t.columnWidth,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToColumn,previousSize:t.width,scrollOffset:G,scrollToAlignment:E,scrollToIndex:O,size:A,sizeJustIncreasedFromZero:st,updateScrollIndexCallback:function(){return s._updateScrollLeftForScrollToColumn(s.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):an({cellSizeAndPositionManager:X.rowSizeAndPositionManager,previousCellsCount:t.rowCount,previousCellSize:t.rowHeight,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToRow,previousSize:t.height,scrollOffset:$,scrollToAlignment:E,scrollToIndex:P,size:y,sizeJustIncreasedFromZero:st,updateScrollIndexCallback:function(){return s._updateScrollTopForScrollToRow(s.props)}}),this._invokeOnGridRenderedHelper(),G!==i.scrollLeft||$!==i.scrollTop){var it=X.rowSizeAndPositionManager.getTotalSize(),tt=X.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:G,scrollTop:$,totalColumnsWidth:tt,totalRowsHeight:it})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&mr(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,i=t.autoContainerWidth,s=t.autoHeight,l=t.autoWidth,c=t.className,p=t.containerProps,S=t.containerRole,y=t.containerStyle,x=t.height,E=t.id,O=t.noContentRenderer,P=t.role,A=t.style,B=t.tabIndex,G=t.width,V=this.state,$=V.instanceProps,X=V.needToResetStyleCache,rt=this._isScrolling(),st={boxSizing:"border-box",direction:"ltr",height:s?"auto":x,position:"relative",width:l?"auto":G,WebkitOverflowScrolling:"touch",willChange:"transform"};X&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var it=$.columnSizeAndPositionManager.getTotalSize(),tt=$.rowSizeAndPositionManager.getTotalSize(),ht=tt>x?$.scrollbarSize:0,lt=it>G?$.scrollbarSize:0;(lt!==this._horizontalScrollBarSize||ht!==this._verticalScrollBarSize)&&(this._horizontalScrollBarSize=lt,this._verticalScrollBarSize=ht,this._scrollbarPresenceChanged=!0),st.overflowX=it+ht<=G?"hidden":"auto",st.overflowY=tt+lt<=x?"hidden":"auto";var gt=this._childrenToDisplay,ct=gt.length===0&&x>0&&G>0;return Z.createElement("div",ge({ref:this._setScrollingContainerRef},p,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:Tt("ReactVirtualized__Grid",c),id:E,onScroll:this._onScroll,role:P,style:Vr({},st,{},A),tabIndex:B}),gt.length>0&&Z.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:S,style:Vr({width:i?"auto":it,height:tt,maxWidth:it,maxHeight:tt,overflow:"hidden",pointerEvents:rt?"none":"",position:"relative"},y)},gt),ct&&O())}},{key:"_calculateChildrenToRender",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,s=t.cellRenderer,l=t.cellRangeRenderer,c=t.columnCount,p=t.deferredMeasurementCache,S=t.height,y=t.overscanColumnCount,x=t.overscanIndicesGetter,E=t.overscanRowCount,O=t.rowCount,P=t.width,A=t.isScrollingOptOut,B=i.scrollDirectionHorizontal,G=i.scrollDirectionVertical,V=i.instanceProps,$=this._initialScrollTop>0?this._initialScrollTop:i.scrollTop,X=this._initialScrollLeft>0?this._initialScrollLeft:i.scrollLeft,rt=this._isScrolling(t,i);if(this._childrenToDisplay=[],S>0&&P>0){var st=V.columnSizeAndPositionManager.getVisibleCellRange({containerSize:P,offset:X}),it=V.rowSizeAndPositionManager.getVisibleCellRange({containerSize:S,offset:$}),tt=V.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:P,offset:X}),ht=V.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:S,offset:$});this._renderedColumnStartIndex=st.start,this._renderedColumnStopIndex=st.stop,this._renderedRowStartIndex=it.start,this._renderedRowStopIndex=it.stop;var lt=x({direction:"horizontal",cellCount:c,overscanCellsCount:y,scrollDirection:B,startIndex:typeof st.start=="number"?st.start:0,stopIndex:typeof st.stop=="number"?st.stop:-1}),gt=x({direction:"vertical",cellCount:O,overscanCellsCount:E,scrollDirection:G,startIndex:typeof it.start=="number"?it.start:0,stopIndex:typeof it.stop=="number"?it.stop:-1}),ct=lt.overscanStartIndex,mt=lt.overscanStopIndex,Gt=gt.overscanStartIndex,pt=gt.overscanStopIndex;if(p){if(!p.hasFixedHeight()){for(var $e=Gt;$e<=pt;$e++)if(!p.has($e,0)){ct=0,mt=c-1;break}}if(!p.hasFixedWidth()){for(var _e=ct;_e<=mt;_e++)if(!p.has(0,_e)){Gt=0,pt=O-1;break}}}this._childrenToDisplay=l({cellCache:this._cellCache,cellRenderer:s,columnSizeAndPositionManager:V.columnSizeAndPositionManager,columnStartIndex:ct,columnStopIndex:mt,deferredMeasurementCache:p,horizontalOffsetAdjustment:tt,isScrolling:rt,isScrollingOptOut:A,parent:this,rowSizeAndPositionManager:V.rowSizeAndPositionManager,rowStartIndex:Gt,rowStopIndex:pt,scrollLeft:X,scrollTop:$,styleCache:this._styleCache,verticalOffsetAdjustment:ht,visibleColumnIndices:st,visibleRowIndices:it}),this._columnStartIndex=ct,this._columnStopIndex=mt,this._rowStartIndex=Gt,this._rowStopIndex=pt}}},{key:"_debounceScrollEnded",value:function(){var t=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&mr(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=li(this._debounceScrollEndedCallback,t)}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"&&typeof this._deferredInvalidateRowIndex=="number"){var t=this._deferredInvalidateColumnIndex,i=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:i})}}},{key:"_invokeOnScrollMemoizer",value:function(t){var i=this,s=t.scrollLeft,l=t.scrollTop,c=t.totalColumnsWidth,p=t.totalRowsHeight;this._onScrollMemoizer({callback:function(y){var x=y.scrollLeft,E=y.scrollTop,O=i.props,P=O.height,A=O.onScroll,B=O.width;A({clientHeight:P,clientWidth:B,scrollHeight:p,scrollLeft:x,scrollTop:E,scrollWidth:c})},indices:{scrollLeft:s,scrollTop:l}})}},{key:"_isScrolling",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return Object.hasOwnProperty.call(t,"isScrolling")?Boolean(t.isScrolling):Boolean(i.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var t=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,t({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(t){var i=t.scrollLeft,s=t.scrollTop,l=m._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:i,scrollTop:s});l&&(l.needToResetStyleCache=!1,this.setState(l))}},{key:"_getCalculatedScrollLeft",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return m._getCalculatedScrollLeft(t,i)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,s=m._getScrollLeftForScrollToColumnStateUpdate(t,i);s&&(s.needToResetStyleCache=!1,this.setState(s))}},{key:"_getCalculatedScrollTop",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return m._getCalculatedScrollTop(t,i)}},{key:"_resetStyleCache",value:function(){var t=this._styleCache,i=this._cellCache,s=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var l=this._rowStartIndex;l<=this._rowStopIndex;l++)for(var c=this._columnStartIndex;c<=this._columnStopIndex;c++){var p="".concat(l,"-").concat(c);this._styleCache[p]=t[p],s&&(this._cellCache[p]=i[p])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,s=m._getScrollTopForScrollToRowStateUpdate(t,i);s&&(s.needToResetStyleCache=!1,this.setState(s))}}],[{key:"getDerivedStateFromProps",value:function(t,i){var s={};t.columnCount===0&&i.scrollLeft!==0||t.rowCount===0&&i.scrollTop!==0?(s.scrollLeft=0,s.scrollTop=0):(t.scrollLeft!==i.scrollLeft&&t.scrollToColumn<0||t.scrollTop!==i.scrollTop&&t.scrollToRow<0)&&Object.assign(s,m._getScrollToPositionStateUpdate({prevState:i,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}));var l=i.instanceProps;s.needToResetStyleCache=!1,(t.columnWidth!==l.prevColumnWidth||t.rowHeight!==l.prevRowHeight)&&(s.needToResetStyleCache=!0),l.columnSizeAndPositionManager.configure({cellCount:t.columnCount,estimatedCellSize:m._getEstimatedColumnSize(t),cellSizeGetter:m._wrapSizeGetter(t.columnWidth)}),l.rowSizeAndPositionManager.configure({cellCount:t.rowCount,estimatedCellSize:m._getEstimatedRowSize(t),cellSizeGetter:m._wrapSizeGetter(t.rowHeight)}),(l.prevColumnCount===0||l.prevRowCount===0)&&(l.prevColumnCount=0,l.prevRowCount=0),t.autoHeight&&t.isScrolling===!1&&l.prevIsScrolling===!0&&Object.assign(s,{isScrolling:!1});var c,p;return Ze({cellCount:l.prevColumnCount,cellSize:typeof l.prevColumnWidth=="number"?l.prevColumnWidth:null,computeMetadataCallback:function(){return l.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.columnCount,nextCellSize:typeof t.columnWidth=="number"?t.columnWidth:null,nextScrollToIndex:t.scrollToColumn,scrollToIndex:l.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){c=m._getScrollLeftForScrollToColumnStateUpdate(t,i)}}),Ze({cellCount:l.prevRowCount,cellSize:typeof l.prevRowHeight=="number"?l.prevRowHeight:null,computeMetadataCallback:function(){return l.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.rowCount,nextCellSize:typeof t.rowHeight=="number"?t.rowHeight:null,nextScrollToIndex:t.scrollToRow,scrollToIndex:l.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){p=m._getScrollTopForScrollToRowStateUpdate(t,i)}}),l.prevColumnCount=t.columnCount,l.prevColumnWidth=t.columnWidth,l.prevIsScrolling=t.isScrolling===!0,l.prevRowCount=t.rowCount,l.prevRowHeight=t.rowHeight,l.prevScrollToColumn=t.scrollToColumn,l.prevScrollToRow=t.scrollToRow,l.scrollbarSize=t.getScrollbarSize(),l.scrollbarSize===void 0?(l.scrollbarSizeMeasured=!1,l.scrollbarSize=0):l.scrollbarSizeMeasured=!0,s.instanceProps=l,Vr({},s,{},c,{},p)}},{key:"_getEstimatedColumnSize",value:function(t){return typeof t.columnWidth=="number"?t.columnWidth:t.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(t){return typeof t.rowHeight=="number"?t.rowHeight:t.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(t){var i=t.prevState,s=t.scrollLeft,l=t.scrollTop,c={scrollPositionChangeReason:Ho.REQUESTED};return typeof s=="number"&&s>=0&&(c.scrollDirectionHorizontal=s>i.scrollLeft?Le:le,c.scrollLeft=s),typeof l=="number"&&l>=0&&(c.scrollDirectionVertical=l>i.scrollTop?Le:le,c.scrollTop=l),typeof s=="number"&&s>=0&&s!==i.scrollLeft||typeof l=="number"&&l>=0&&l!==i.scrollTop?c:{}}},{key:"_wrapSizeGetter",value:function(t){return typeof t=="function"?t:function(){return t}}},{key:"_getCalculatedScrollLeft",value:function(t,i){var s=t.columnCount,l=t.height,c=t.scrollToAlignment,p=t.scrollToColumn,S=t.width,y=i.scrollLeft,x=i.instanceProps;if(s>0){var E=s-1,O=p<0?E:Math.min(E,p),P=x.rowSizeAndPositionManager.getTotalSize(),A=x.scrollbarSizeMeasured&&P>l?x.scrollbarSize:0;return x.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:c,containerSize:S-A,currentOffset:y,targetIndex:O})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(t,i){var s=i.scrollLeft,l=m._getCalculatedScrollLeft(t,i);return typeof l=="number"&&l>=0&&s!==l?m._getScrollToPositionStateUpdate({prevState:i,scrollLeft:l,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(t,i){var s=t.height,l=t.rowCount,c=t.scrollToAlignment,p=t.scrollToRow,S=t.width,y=i.scrollTop,x=i.instanceProps;if(l>0){var E=l-1,O=p<0?E:Math.min(E,p),P=x.columnSizeAndPositionManager.getTotalSize(),A=x.scrollbarSizeMeasured&&P>S?x.scrollbarSize:0;return x.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:c,containerSize:s-A,currentOffset:y,targetIndex:O})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(t,i){var s=i.scrollTop,l=m._getCalculatedScrollTop(t,i);return typeof l=="number"&&l>=0&&s!==l?m._getScrollToPositionStateUpdate({prevState:i,scrollLeft:-1,scrollTop:l}):{}}}]),m}(Z.PureComponent),Q(Fo,"propTypes",null),wr);Q(ma,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:ai,containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:Gr,noContentRenderer:Tn,onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:os,overscanRowCount:10,role:"grid",scrollingResetTimeInterval:Rn,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1}),Ti(ma);var Xt=ma,ya=null,Ir=1,En="horizontal",ui="vertical";function Ai(g){var m=g.cellCount,d=g.overscanCellsCount,t=g.scrollDirection,i=g.startIndex,s=g.stopIndex;return d=Math.max(1,d),t===Ir?{overscanStartIndex:Math.max(0,i-1),overscanStopIndex:Math.min(m-1,s+d)}:{overscanStartIndex:Math.max(0,i-d),overscanStopIndex:Math.min(m-1,s+1)}}var Ge=null,Ur,kt;function cr(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function Lt(g){for(var m=1;m div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',lt=tt.head||tt.getElementsByTagName("head")[0],gt=tt.createElement("style");gt.id="detectElementResize",gt.type="text/css",g!=null&>.setAttribute("nonce",g),gt.styleSheet?gt.styleSheet.cssText=ht:gt.appendChild(tt.createTextNode(ht)),lt.appendChild(gt)}},rt=function(tt,ht){if(t)tt.attachEvent("onresize",ht);else{if(!tt.__resizeTriggers__){var lt=tt.ownerDocument,gt=d.getComputedStyle(tt);gt&>.position=="static"&&(tt.style.position="relative"),X(lt),tt.__resizeLast__={},tt.__resizeListeners__=[],(tt.__resizeTriggers__=lt.createElement("div")).className="resize-triggers";var ct='
';if(window.trustedTypes){var mt=trustedTypes.createPolicy("react-virtualized-auto-sizer",{createHTML:function(){return ct}});tt.__resizeTriggers__.innerHTML=mt.createHTML("")}else tt.__resizeTriggers__.innerHTML=ct;tt.appendChild(tt.__resizeTriggers__),l(tt),tt.addEventListener("scroll",p,!0),x&&(tt.__resizeTriggers__.__animationListener__=function(pt){pt.animationName==G&&l(tt)},tt.__resizeTriggers__.addEventListener(x,tt.__resizeTriggers__.__animationListener__))}tt.__resizeListeners__.push(ht)}},st=function(tt,ht){if(t)tt.detachEvent("onresize",ht);else if(tt.__resizeListeners__.splice(tt.__resizeListeners__.indexOf(ht),1),!tt.__resizeListeners__.length){tt.removeEventListener("scroll",p,!0),tt.__resizeTriggers__.__animationListener__&&(tt.__resizeTriggers__.removeEventListener(x,tt.__resizeTriggers__.__animationListener__),tt.__resizeTriggers__.__animationListener__=null);try{tt.__resizeTriggers__=!tt.removeChild(tt.__resizeTriggers__)}catch(lt){}}};return{addResizeListener:rt,removeResizeListener:st}}var oo,Sa;function ss(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function ls(g){for(var m=1;m=0){var B=p.getScrollPositionForCell({align:y,cellIndex:x,height:S,scrollLeft:P,scrollTop:A,width:E});(B.scrollLeft!==P||B.scrollTop!==A)&&t._setScrollPosition(B)}}),Q(et(t),"_onScroll",function(c){if(c.target===t._scrollingContainer){t._enablePointerEventsAfterDelay();var p=t.props,S=p.cellLayoutManager,y=p.height,x=p.isScrollingChange,E=p.width,O=t._scrollbarSize,P=S.getTotalSize(),A=P.height,B=P.width,G=Math.max(0,Math.min(B-E+O,c.target.scrollLeft)),V=Math.max(0,Math.min(A-y+O,c.target.scrollTop));if(t.state.scrollLeft!==G||t.state.scrollTop!==V){var $=c.cancelable?ln.OBSERVED:ln.REQUESTED;t.state.isScrolling||x(!0),t.setState({isScrolling:!0,scrollLeft:G,scrollPositionChangeReason:$,scrollTop:V})}t._invokeOnScrollMemoizer({scrollLeft:G,scrollTop:V,totalWidth:B,totalHeight:A})}}),t._scrollbarSize=Gr(),t._scrollbarSize===void 0?(t._scrollbarSizeMeasured=!1,t._scrollbarSize=0):t._scrollbarSizeMeasured=!0,t}return jt(m,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var t=this.props,i=t.cellLayoutManager,s=t.scrollLeft,l=t.scrollToCell,c=t.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=Gr(),this._scrollbarSizeMeasured=!0,this.setState({})),l>=0?this._updateScrollPositionForScrollToCell():(s>=0||c>=0)&&this._setScrollPosition({scrollLeft:s,scrollTop:c}),this._invokeOnSectionRenderedHelper();var p=i.getTotalSize(),S=p.height,y=p.width;this._invokeOnScrollMemoizer({scrollLeft:s||0,scrollTop:c||0,totalHeight:S,totalWidth:y})}},{key:"componentDidUpdate",value:function(t,i){var s=this.props,l=s.height,c=s.scrollToAlignment,p=s.scrollToCell,S=s.width,y=this.state,x=y.scrollLeft,E=y.scrollPositionChangeReason,O=y.scrollTop;E===ln.REQUESTED&&(x>=0&&x!==i.scrollLeft&&x!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=x),O>=0&&O!==i.scrollTop&&O!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=O)),(l!==t.height||c!==t.scrollToAlignment||p!==t.scrollToCell||S!==t.width)&&this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,i=t.autoHeight,s=t.cellCount,l=t.cellLayoutManager,c=t.className,p=t.height,S=t.horizontalOverscanSize,y=t.id,x=t.noContentRenderer,E=t.style,O=t.verticalOverscanSize,P=t.width,A=this.state,B=A.isScrolling,G=A.scrollLeft,V=A.scrollTop;(this._lastRenderedCellCount!==s||this._lastRenderedCellLayoutManager!==l||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=s,this._lastRenderedCellLayoutManager=l,this._calculateSizeAndPositionDataOnNextUpdate=!1,l.calculateSizeAndPositionData());var $=l.getTotalSize(),X=$.height,rt=$.width,st=Math.max(0,G-S),it=Math.max(0,V-O),tt=Math.min(rt,G+P+S),ht=Math.min(X,V+p+O),lt=p>0&&P>0?l.cellRenderers({height:ht-it,isScrolling:B,width:tt-st,x:st,y:it}):[],gt={boxSizing:"border-box",direction:"ltr",height:i?"auto":p,position:"relative",WebkitOverflowScrolling:"touch",width:P,willChange:"transform"},ct=X>p?this._scrollbarSize:0,mt=rt>P?this._scrollbarSize:0;return gt.overflowX=rt+ct<=P?"hidden":"auto",gt.overflowY=X+mt<=p?"hidden":"auto",Z.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Tt("ReactVirtualized__Collection",c),id:y,onScroll:this._onScroll,role:"grid",style:us({},gt,{},E),tabIndex:0},s>0&&Z.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:X,maxHeight:X,maxWidth:rt,overflow:"hidden",pointerEvents:B?"none":"",width:rt}},lt),s===0&&x())}},{key:"_enablePointerEventsAfterDelay",value:function(){var t=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){var i=t.props.isScrollingChange;i(!1),t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1})},so)}},{key:"_invokeOnScrollMemoizer",value:function(t){var i=this,s=t.scrollLeft,l=t.scrollTop,c=t.totalHeight,p=t.totalWidth;this._onScrollMemoizer({callback:function(y){var x=y.scrollLeft,E=y.scrollTop,O=i.props,P=O.height,A=O.onScroll,B=O.width;A({clientHeight:P,clientWidth:B,scrollHeight:c,scrollLeft:x,scrollTop:E,scrollWidth:p})},indices:{scrollLeft:s,scrollTop:l}})}},{key:"_setScrollPosition",value:function(t){var i=t.scrollLeft,s=t.scrollTop,l={scrollPositionChangeReason:ln.REQUESTED};i>=0&&(l.scrollLeft=i),s>=0&&(l.scrollTop=s),(i>=0&&i!==this.state.scrollLeft||s>=0&&s!==this.state.scrollTop)&&this.setState(l)}}],[{key:"getDerivedStateFromProps",value:function(t,i){return t.cellCount===0&&(i.scrollLeft!==0||i.scrollTop!==0)?{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:ln.REQUESTED}:t.scrollLeft!==i.scrollLeft||t.scrollTop!==i.scrollTop?{scrollLeft:t.scrollLeft!=null?t.scrollLeft:i.scrollLeft,scrollTop:t.scrollTop!=null?t.scrollTop:i.scrollTop,scrollPositionChangeReason:ln.REQUESTED}:null}}]),m}(Z.PureComponent);Q(Rr,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0}),Rr.propTypes={},Ti(Rr);var cs=Rr,Li=null,Fs=null,Pr=null,un=null,wa=null,ce=function(){function g(m){var d=m.height,t=m.width,i=m.x,s=m.y;Kt(this,g),this.height=d,this.width=t,this.x=i,this.y=s,this._indexMap={},this._indices=[]}return jt(g,[{key:"addCellIndex",value:function(d){var t=d.index;this._indexMap[t]||(this._indexMap[t]=!0,this._indices.push(t))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}]),g}(),Yt=100,Et=function(){function g(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yt;Kt(this,g),this._sectionSize=m,this._cellMetadata=[],this._sections={}}return jt(g,[{key:"getCellIndices",value:function(d){var t=d.height,i=d.width,s=d.x,l=d.y,c={};return this.getSections({height:t,width:i,x:s,y:l}).forEach(function(p){return p.getCellIndices().forEach(function(S){c[S]=S})}),Object.keys(c).map(function(p){return c[p]})}},{key:"getCellMetadata",value:function(d){var t=d.index;return this._cellMetadata[t]}},{key:"getSections",value:function(d){for(var t=d.height,i=d.width,s=d.x,l=d.y,c=Math.floor(s/this._sectionSize),p=Math.floor((s+i-1)/this._sectionSize),S=Math.floor(l/this._sectionSize),y=Math.floor((l+t-1)/this._sectionSize),x=[],E=c;E<=p;E++)for(var O=S;O<=y;O++){var P="".concat(E,".").concat(O);this._sections[P]||(this._sections[P]=new ce({height:this._sectionSize,width:this._sectionSize,x:E*this._sectionSize,y:O*this._sectionSize})),x.push(this._sections[P])}return x}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var d=this;return Object.keys(this._sections).map(function(t){return d._sections[t].toString()})}},{key:"registerCell",value:function(d){var t=d.cellMetadatum,i=d.index;this._cellMetadata[i]=t,this.getSections(t).forEach(function(s){return s.addCellIndex({index:i})})}}]),g}();function Gi(g){for(var m=g.cellCount,d=g.cellSizeAndPositionGetter,t=g.sectionSize,i=[],s=new Et(t),l=0,c=0,p=0;p=0&&sg.length)&&(m=g.length);for(var d=0,t=new Array(m);dd||i0;){var P=O.startIndex-1;if(!m({index:P}))O.startIndex=P;else break}return l}function di(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=typeof g.recomputeGridSize=="function"?g.recomputeGridSize:g.recomputeRowHeights;d?d.call(g,m):g.forceUpdate()}var Mn=null,fs=null,Hs=null,ds=null,Wi=null,ee,Fi,Se=(Fi=ee=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l0&&arguments[0]!==void 0?arguments[0]:{},i=t.columnIndex,s=i===void 0?0:i,l=t.rowIndex,c=l===void 0?0:l;this.Grid&&this.Grid.recomputeGridSize({rowIndex:c,columnIndex:s})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t,columnIndex:0})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"render",value:function(){var t=this.props,i=t.className,s=t.noRowsRenderer,l=t.scrollToIndex,c=t.width,p=Tt("ReactVirtualized__List",i);return Z.createElement(Xt,ge({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:p,columnWidth:c,columnCount:1,noContentRenderer:s,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:l}))}}]),m}(Z.PureComponent),Q(ee,"propTypes",null),Fi);Q(Se,"defaultProps",{autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:Ai,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}});function Ta(g){if(Array.isArray(g))return g}function Bi(g,m){var d=g==null?null:typeof Symbol!="undefined"&&g[Symbol.iterator]||g["@@iterator"];if(d!=null){var t,i,s,l,c=[],p=!0,S=!1;try{if(s=(d=d.call(g)).next,m===0){if(Object(d)!==d)return;p=!1}else for(;!(p=(t=s.call(d)).done)&&(c.push(t.value),c.length!==m);p=!0);}catch(y){S=!0,i=y}finally{try{if(!p&&d.return!=null&&(l=d.return(),Object(l)!==l))return}finally{if(S)throw i}}return c}}function Ea(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vs(g,m){return Ta(g)||Bi(g,m)||fn(g,m)||Ea()}function Un(g,m,d,t){for(var i=d+1;m<=d;){var s=m+d>>>1,l=g[s];l>=t?(i=s,d=s-1):m=s+1}return i}function hs(g,m,d,t,i){for(var s=d+1;m<=d;){var l=m+d>>>1,c=g[l];i(c,t)>=0?(s=l,d=l-1):m=l+1}return s}function uo(g,m,d,t,i){return typeof d=="function"?hs(g,t===void 0?0:t|0,i===void 0?g.length-1:i|0,m,d):Un(g,d===void 0?0:d|0,t===void 0?g.length-1:t|0,m)}function vi(g,m,d,t){for(var i=d+1;m<=d;){var s=m+d>>>1,l=g[s];l>t?(i=s,d=s-1):m=s+1}return i}function Sr(g,m,d,t,i){for(var s=d+1;m<=d;){var l=m+d>>>1,c=g[l];i(c,t)>0?(s=l,d=l-1):m=l+1}return s}function Ma(g,m,d,t,i){return typeof d=="function"?Sr(g,t===void 0?0:t|0,i===void 0?g.length-1:i|0,m,d):vi(g,d===void 0?0:d|0,t===void 0?g.length-1:t|0,m)}function Ee(g,m,d,t){for(var i=m-1;m<=d;){var s=m+d>>>1,l=g[s];l>>1,c=g[l];i(c,t)<0?(s=l,m=l+1):d=l-1}return s}function Uo(g,m,d,t,i){return typeof d=="function"?ps(g,t===void 0?0:t|0,i===void 0?g.length-1:i|0,m,d):Ee(g,d===void 0?0:d|0,t===void 0?g.length-1:t|0,m)}function Xo(g,m,d,t){for(var i=m-1;m<=d;){var s=m+d>>>1,l=g[s];l<=t?(i=s,m=s+1):d=s-1}return i}function On(g,m,d,t,i){for(var s=m-1;m<=d;){var l=m+d>>>1,c=g[l];i(c,t)<=0?(s=l,m=l+1):d=l-1}return s}function Oa(g,m,d,t,i){return typeof d=="function"?On(g,t===void 0?0:t|0,i===void 0?g.length-1:i|0,m,d):Xo(g,d===void 0?0:d|0,t===void 0?g.length-1:t|0,m)}function co(g,m,d,t){for(m-1;m<=d;){var i=m+d>>>1,s=g[i];if(s===t)return i;s<=t?m=i+1:d=i-1}return-1}function Hi(g,m,d,t,i){for(m-1;m<=d;){var s=m+d>>>1,l=g[s],c=i(l,t);if(c===0)return s;c<=0?m=s+1:d=s-1}return-1}function gs(g,m,d,t,i){return typeof d=="function"?Hi(g,t===void 0?0:t|0,i===void 0?g.length-1:i|0,m,d):co(g,d===void 0?0:d|0,t===void 0?g.length-1:t|0,m)}var Wr={ge:uo,gt:Ma,lt:Uo,le:Oa,eq:gs},hi=0,In=1,Tr=2;function Yo(g,m,d,t,i){this.mid=g,this.left=m,this.right=d,this.leftPoints=t,this.rightPoints=i,this.count=(m?m.count:0)+(d?d.count:0)+t.length}var Pe=Yo.prototype;function Xr(g,m){g.mid=m.mid,g.left=m.left,g.right=m.right,g.leftPoints=m.leftPoints,g.rightPoints=m.rightPoints,g.count=m.count}function Ve(g,m){var d=Dr(m);g.mid=d.mid,g.left=d.left,g.right=d.right,g.leftPoints=d.leftPoints,g.rightPoints=d.rightPoints,g.count=d.count}function Ia(g,m){var d=g.intervals([]);d.push(m),Ve(g,d)}function qo(g,m){var d=g.intervals([]),t=d.indexOf(m);return t<0?hi:(d.splice(t,1),Ve(g,d),In)}Pe.intervals=function(g){return g.push.apply(g,this.leftPoints),this.left&&this.left.intervals(g),this.right&&this.right.intervals(g),g},Pe.insert=function(g){var m=this.count-this.leftPoints.length;if(this.count+=1,g[1]3*(m+1)?Ia(this,g):this.left.insert(g):this.left=Dr([g]);else if(g[0]>this.mid)this.right?4*(this.right.count+1)>3*(m+1)?Ia(this,g):this.right.insert(g):this.right=Dr([g]);else{var d=Wr.ge(this.leftPoints,g,vn),t=Wr.ge(this.rightPoints,g,fo);this.leftPoints.splice(d,0,g),this.rightPoints.splice(t,0,g)}},Pe.remove=function(g){var m=this.count-this.leftPoints;if(g[1]3*(m-1))return qo(this,g);var t=this.left.remove(g);return t===Tr?(this.left=null,this.count-=1,In):(t===In&&(this.count-=1),t)}else if(g[0]>this.mid){if(!this.right)return hi;var i=this.left?this.left.count:0;if(4*i>3*(m-1))return qo(this,g);var t=this.right.remove(g);return t===Tr?(this.right=null,this.count-=1,In):(t===In&&(this.count-=1),t)}else{if(this.count===1)return this.leftPoints[0]===g?Tr:hi;if(this.leftPoints.length===1&&this.leftPoints[0]===g){if(this.left&&this.right){for(var s=this,l=this.left;l.right;)s=l,l=l.right;if(s===this)l.right=this.right;else{var c=this.left,t=this.right;s.count-=l.count,s.right=l.left,l.left=c,l.right=t}Xr(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?Xr(this,this.left):Xr(this,this.right);return In}for(var c=Wr.ge(this.leftPoints,g,vn);c=0&&g[t][1]>=m;--t){var i=d(g[t]);if(i)return i}}function Xn(g,m){for(var d=0;dthis.mid){if(this.right){var d=this.right.queryPoint(g,m);if(d)return d}return Ko(this.rightPoints,g,m)}else return Xn(this.leftPoints,m)},Pe.queryInterval=function(g,m,d){if(gthis.mid&&this.right){var t=this.right.queryInterval(g,m,d);if(t)return t}return mthis.mid?Ko(this.rightPoints,g,d):Xn(this.leftPoints,d)};function Yn(g,m){return g-m}function vn(g,m){var d=g[0]-m[0];return d||g[1]-m[1]}function fo(g,m){var d=g[1]-m[1];return d||g[0]-m[0]}function Dr(g){if(g.length===0)return null;for(var m=[],d=0;d>1],i=[],s=[],l=[],d=0;d0&&arguments[0]!==void 0?arguments[0]:{};Kt(this,g),Q(this,"_cellMeasurerCache",void 0),Q(this,"_columnIndexOffset",void 0),Q(this,"_rowIndexOffset",void 0),Q(this,"columnWidth",function(p){var S=p.index;m._cellMeasurerCache.columnWidth({index:S+m._columnIndexOffset})}),Q(this,"rowHeight",function(p){var S=p.index;m._cellMeasurerCache.rowHeight({index:S+m._rowIndexOffset})});var t=d.cellMeasurerCache,i=d.columnIndexOffset,s=i===void 0?0:i,l=d.rowIndexOffset,c=l===void 0?0:l;this._cellMeasurerCache=t,this._columnIndexOffset=s,this._rowIndexOffset=c}return jt(g,[{key:"clear",value:function(d,t){this._cellMeasurerCache.clear(d+this._rowIndexOffset,t+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getHeight(d+this._rowIndexOffset,t+this._columnIndexOffset)}},{key:"getWidth",value:function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getWidth(d+this._rowIndexOffset,t+this._columnIndexOffset)}},{key:"has",value:function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.has(d+this._rowIndexOffset,t+this._columnIndexOffset)}},{key:"set",value:function(d,t,i,s){this._cellMeasurerCache.set(d+this._rowIndexOffset,t+this._columnIndexOffset,i,s)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),g}();function Vi(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function Fe(g){for(var m=1;m0?new Pn({cellMeasurerCache:s,columnIndexOffset:0,rowIndexOffset:c}):s,i._deferredMeasurementCacheBottomRightGrid=l>0||c>0?new Pn({cellMeasurerCache:s,columnIndexOffset:l,rowIndexOffset:c}):s,i._deferredMeasurementCacheTopRightGrid=l>0?new Pn({cellMeasurerCache:s,columnIndexOffset:l,rowIndexOffset:0}):s),i}return jt(m,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t.columnIndex,s=i===void 0?0:i,l=t.rowIndex,c=l===void 0?0:l;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,s):s,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,c):c}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t.columnIndex,s=i===void 0?0:i,l=t.rowIndex,c=l===void 0?0:l,p=this.props,S=p.fixedColumnCount,y=p.fixedRowCount,x=Math.max(0,s-S),E=Math.max(0,c-y);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:s,rowIndex:E}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:x,rowIndex:E}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:s,rowIndex:c}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:x,rowIndex:c}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var t=this.props,i=t.scrollLeft,s=t.scrollTop;if(i>0||s>0){var l={};i>0&&(l.scrollLeft=i),s>0&&(l.scrollTop=s),this.setState(l)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var t=this.props,i=t.onScroll,s=t.onSectionRendered,l=t.onScrollbarPresenceChange,c=t.scrollLeft,p=t.scrollToColumn,S=t.scrollTop,y=t.scrollToRow,x=xn(t,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(this._prepareForRender(),this.props.width===0||this.props.height===0)return null;var E=this.state,O=E.scrollLeft,P=E.scrollTop;return Z.createElement("div",{style:this._containerOuterStyle},Z.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(x),this._renderTopRightGrid(Fe({},x,{onScroll:i,scrollLeft:O}))),Z.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(Fe({},x,{onScroll:i,scrollTop:P})),this._renderBottomRightGrid(Fe({},x,{onScroll:i,onSectionRendered:s,scrollLeft:O,scrollToColumn:p,scrollToRow:y,scrollTop:P}))))}},{key:"_getBottomGridHeight",value:function(t){var i=t.height,s=this._getTopGridHeight(t);return i-s}},{key:"_getLeftGridWidth",value:function(t){var i=t.fixedColumnCount,s=t.columnWidth;if(this._leftGridWidth==null)if(typeof s=="function"){for(var l=0,c=0;c=0?t.scrollLeft:i.scrollLeft,scrollTop:t.scrollTop!=null&&t.scrollTop>=0?t.scrollTop:i.scrollTop}:null}}]),m}(Z.PureComponent);Q($n,"defaultProps",{classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1}),$n.propTypes={},Ti($n);var yo=null,ys=null,So=function(g){Oe(m,g);function m(d,t){var i;return Kt(this,m),i=Wt(this,Ut(m).call(this,d,t)),i.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},i._onScroll=i._onScroll.bind(et(i)),i}return jt(m,[{key:"render",value:function(){var t=this.props.children,i=this.state,s=i.clientHeight,l=i.clientWidth,c=i.scrollHeight,p=i.scrollLeft,S=i.scrollTop,y=i.scrollWidth;return t({clientHeight:s,clientWidth:l,onScroll:this._onScroll,scrollHeight:c,scrollLeft:p,scrollTop:S,scrollWidth:y})}},{key:"_onScroll",value:function(t){var i=t.clientHeight,s=t.clientWidth,l=t.scrollHeight,c=t.scrollLeft,p=t.scrollTop,S=t.scrollWidth;this.setState({clientHeight:i,clientWidth:s,scrollHeight:l,scrollLeft:c,scrollTop:p,scrollWidth:S})}}]),m}(Z.PureComponent);So.propTypes={};var bo=null,Da=null,Jo=null,Us=null,ta=null,za=null;function Aa(g){var m=g.dataKey,d=g.rowData;return typeof d.get=="function"?d.get(m):d[m]}function ka(g){var m=g.cellData;return m==null?"":String(m)}function _o(g){var m=g.className,d=g.columns,t=g.style;return Z.createElement("div",{className:m,role:"row",style:t},d)}_o.propTypes=null;var Ss={ASC:"ASC",DESC:"DESC"},Dn=Ss;function pi(g){var m=g.sortDirection,d=Tt("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":m===Dn.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":m===Dn.DESC});return Z.createElement("svg",{className:d,width:18,height:18,viewBox:"0 0 24 24"},m===Dn.ASC?Z.createElement("path",{d:"M7 14l5-5 5 5z"}):Z.createElement("path",{d:"M7 10l5 5 5-5z"}),Z.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}pi.propTypes={};function gi(g){var m=g.dataKey,d=g.label,t=g.sortBy,i=g.sortDirection,s=t===m,l=[Z.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:typeof d=="string"?d:null},d)];return s&&l.push(Z.createElement(pi,{key:"SortIndicator",sortDirection:i})),l}gi.propTypes=null;function Kn(g){var m=g.className,d=g.columns,t=g.index,i=g.key,s=g.onRowClick,l=g.onRowDoubleClick,c=g.onRowMouseOut,p=g.onRowMouseOver,S=g.onRowRightClick,y=g.rowData,x=g.style,E={"aria-rowindex":t+1};return(s||l||c||p||S)&&(E["aria-label"]="row",E.tabIndex=0,s&&(E.onClick=function(O){return s({event:O,index:t,rowData:y})}),l&&(E.onDoubleClick=function(O){return l({event:O,index:t,rowData:y})}),c&&(E.onMouseOut=function(O){return c({event:O,index:t,rowData:y})}),p&&(E.onMouseOver=function(O){return p({event:O,index:t,rowData:y})}),S&&(E.onContextMenu=function(O){return S({event:O,index:t,rowData:y})})),Z.createElement("div",ge({},E,{className:m,key:i,role:"row",style:x}),d)}Kn.propTypes=null;var mi=function(g){Oe(m,g);function m(){return Kt(this,m),Wt(this,Ut(m).apply(this,arguments))}return m}(Z.Component);Q(mi,"defaultProps",{cellDataGetter:Aa,cellRenderer:ka,defaultSortDirection:Dn.ASC,flexGrow:0,flexShrink:1,headerRenderer:gi,style:{}}),mi.propTypes={};function Ui(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function yi(g){for(var m=1;m0&&arguments[0]!==void 0?arguments[0]:{},i=t.columnIndex,s=i===void 0?0:i,l=t.rowIndex,c=l===void 0?0:l;this.Grid&&this.Grid.recomputeGridSize({rowIndex:c,columnIndex:s})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"getScrollbarWidth",value:function(){if(this.Grid){var t=(0,ao.findDOMNode)(this.Grid),i=t.clientWidth||0,s=t.offsetWidth||0;return s-i}return 0}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var t=this,i=this.props,s=i.children,l=i.className,c=i.disableHeader,p=i.gridClassName,S=i.gridStyle,y=i.headerHeight,x=i.headerRowRenderer,E=i.height,O=i.id,P=i.noRowsRenderer,A=i.rowClassName,B=i.rowStyle,G=i.scrollToIndex,V=i.style,$=i.width,X=this.state.scrollbarWidth,rt=c?E:E-y,st=typeof A=="function"?A({index:-1}):A,it=typeof B=="function"?B({index:-1}):B;return this._cachedColumnStyles=[],Z.Children.toArray(s).forEach(function(tt,ht){var lt=t._getFlexStyleForColumn(tt,tt.props.style);t._cachedColumnStyles[ht]=yi({overflow:"hidden"},lt)}),Z.createElement("div",{"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-colcount":Z.Children.toArray(s).length,"aria-rowcount":this.props.rowCount,className:Tt("ReactVirtualized__Table",l),id:O,role:"grid",style:V},!c&&x({className:Tt("ReactVirtualized__Table__headerRow",st),columns:this._getHeaderColumns(),style:yi({height:y,overflow:"hidden",paddingRight:X,width:$},it)}),Z.createElement(Xt,ge({},this.props,{"aria-readonly":null,autoContainerWidth:!0,className:Tt("ReactVirtualized__Table__Grid",p),cellRenderer:this._createRow,columnWidth:$,columnCount:1,height:rt,id:void 0,noContentRenderer:P,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:X,scrollToRow:G,style:yi({},S,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(t){var i=t.column,s=t.columnIndex,l=t.isScrolling,c=t.parent,p=t.rowData,S=t.rowIndex,y=this.props.onColumnClick,x=i.props,E=x.cellDataGetter,O=x.cellRenderer,P=x.className,A=x.columnData,B=x.dataKey,G=x.id,V=E({columnData:A,dataKey:B,rowData:p}),$=O({cellData:V,columnData:A,columnIndex:s,dataKey:B,isScrolling:l,parent:c,rowData:p,rowIndex:S}),X=function(tt){y&&y({columnData:A,dataKey:B,event:tt})},rt=this._cachedColumnStyles[s],st=typeof $=="string"?$:null;return Z.createElement("div",{"aria-colindex":s+1,"aria-describedby":G,className:Tt("ReactVirtualized__Table__rowColumn",P),key:"Row"+S+"-Col"+s,onClick:X,role:"gridcell",style:rt,title:st},$)}},{key:"_createHeader",value:function(t){var i=t.column,s=t.index,l=this.props,c=l.headerClassName,p=l.headerStyle,S=l.onHeaderClick,y=l.sort,x=l.sortBy,E=l.sortDirection,O=i.props,P=O.columnData,A=O.dataKey,B=O.defaultSortDirection,G=O.disableSort,V=O.headerRenderer,$=O.id,X=O.label,rt=!G&&y,st=Tt("ReactVirtualized__Table__headerColumn",c,i.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:rt}),it=this._getFlexStyleForColumn(i,yi({},p,{},i.props.headerStyle)),tt=V({columnData:P,dataKey:A,disableSort:G,label:X,sortBy:x,sortDirection:E}),ht,lt,gt,ct,mt;if(rt||S){var Gt=x!==A,pt=Gt?B:E===Dn.DESC?Dn.ASC:Dn.DESC,$e=function(xe){rt&&y({defaultSortDirection:B,event:xe,sortBy:A,sortDirection:pt}),S&&S({columnData:P,dataKey:A,event:xe})},_e=function(xe){(xe.key==="Enter"||xe.key===" ")&&$e(xe)};mt=i.props["aria-label"]||X||A,ct="none",gt=0,ht=$e,lt=_e}return x===A&&(ct=E===Dn.ASC?"ascending":"descending"),Z.createElement("div",{"aria-label":mt,"aria-sort":ct,className:st,id:$,key:"Header-Col"+s,onClick:ht,onKeyDown:lt,role:"columnheader",style:it,tabIndex:gt},tt)}},{key:"_createRow",value:function(t){var i=this,s=t.rowIndex,l=t.isScrolling,c=t.key,p=t.parent,S=t.style,y=this.props,x=y.children,E=y.onRowClick,O=y.onRowDoubleClick,P=y.onRowRightClick,A=y.onRowMouseOver,B=y.onRowMouseOut,G=y.rowClassName,V=y.rowGetter,$=y.rowRenderer,X=y.rowStyle,rt=this.state.scrollbarWidth,st=typeof G=="function"?G({index:s}):G,it=typeof X=="function"?X({index:s}):X,tt=V({index:s}),ht=Z.Children.toArray(x).map(function(ct,mt){return i._createColumn({column:ct,columnIndex:mt,isScrolling:l,parent:p,rowData:tt,rowIndex:s,scrollbarWidth:rt})}),lt=Tt("ReactVirtualized__Table__row",st),gt=yi({},S,{height:this._getRowHeight(s),overflow:"hidden",paddingRight:rt},it);return $({className:lt,columns:ht,index:s,isScrolling:l,key:c,onRowClick:E,onRowDoubleClick:O,onRowRightClick:P,onRowMouseOver:A,onRowMouseOut:B,rowData:tt,style:gt})}},{key:"_getFlexStyleForColumn",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s="".concat(t.props.flexGrow," ").concat(t.props.flexShrink," ").concat(t.props.width,"px"),l=yi({},i,{flex:s,msFlex:s,WebkitFlex:s});return t.props.maxWidth&&(l.maxWidth=t.props.maxWidth),t.props.minWidth&&(l.minWidth=t.props.minWidth),l}},{key:"_getHeaderColumns",value:function(){var t=this,i=this.props,s=i.children,l=i.disableHeader,c=l?[]:Z.Children.toArray(s);return c.map(function(p,S){return t._createHeader({column:p,index:S})})}},{key:"_getRowHeight",value:function(t){var i=this.props.rowHeight;return typeof i=="function"?i({index:t}):i}},{key:"_onScroll",value:function(t){var i=t.clientHeight,s=t.scrollHeight,l=t.scrollTop,c=this.props.onScroll;c({clientHeight:i,scrollHeight:s,scrollTop:l})}},{key:"_onSectionRendered",value:function(t){var i=t.rowOverscanStartIndex,s=t.rowOverscanStopIndex,l=t.rowStartIndex,c=t.rowStopIndex,p=this.props.onRowsRendered;p({overscanStartIndex:i,overscanStopIndex:s,startIndex:l,stopIndex:c})}},{key:"_setRef",value:function(t){this.Grid=t}},{key:"_setScrollbarWidth",value:function(){var t=this.getScrollbarWidth();this.setState({scrollbarWidth:t})}}]),m}(Z.PureComponent);Q(zn,"defaultProps",{disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:Ai,overscanRowCount:10,rowRenderer:Kn,headerRowRenderer:_o,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}}),zn.propTypes={};var La=null,An=[],kn=null,de=null;function N(){de&&(de=null,document.body&&kn!=null&&(document.body.style.pointerEvents=kn),kn=null)}function Ga(){N(),An.forEach(function(g){return g.__resetIsScrolling()})}function Wa(){de&&mr(de);var g=0;An.forEach(function(m){g=Math.max(g,m.props.scrollingResetTimeInterval)}),de=li(Ga,g)}function bt(g){g.currentTarget===window&&kn==null&&document.body&&(kn=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),Wa(),An.forEach(function(m){m.props.scrollElement===g.currentTarget&&m.__handleWindowScrollEvent()})}function Zn(g,m){An.some(function(d){return d.props.scrollElement===m})||m.addEventListener("scroll",bt),An.push(g)}function Fa(g,m){An=An.filter(function(d){return d!==g}),An.length||(m.removeEventListener("scroll",bt),de&&(mr(de),N()))}var Xi=function(m){return m===window},Ln=function(m){return m.getBoundingClientRect()};function Yi(g,m){if(g)if(Xi(g)){var d=window,t=d.innerHeight,i=d.innerWidth;return{height:typeof t=="number"?t:0,width:typeof i=="number"?i:0}}else return Ln(g);else return{height:m.serverHeight,width:m.serverWidth}}function hn(g,m){if(Xi(m)&&document.documentElement){var d=document.documentElement,t=Ln(g),i=Ln(d);return{top:t.top-i.top,left:t.left-i.left}}else{var s=xo(m),l=Ln(g),c=Ln(m);return{top:l.top+s.top-c.top,left:l.left+s.left-c.left}}}function xo(g){return Xi(g)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:g.scrollTop,left:g.scrollLeft}}var wo,Qn;function Si(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function bs(g){for(var m=1;m0&&arguments[0]!==void 0?arguments[0]:this.props.scrollElement,i=this.props.onResize,s=this.state,l=s.height,c=s.width,p=this._child||ao.findDOMNode(this);if(p instanceof Element&&t){var S=hn(p,t);this._positionFromTop=S.top,this._positionFromLeft=S.left}var y=Yi(t,this.props);(l!==y.height||c!==y.width)&&(this.setState({height:y.height,width:y.width}),i({height:y.height,width:y.width}))}},{key:"componentDidMount",value:function(){var t=this.props.scrollElement;this._detectElementResize=Cr(),this.updatePosition(t),t&&(Zn(this,t),this._registerResizeListener(t)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(t,i){var s=this.props.scrollElement,l=t.scrollElement;l!==s&&l!=null&&s!=null&&(this.updatePosition(s),Fa(this,l),Zn(this,s),this._unregisterResizeListener(l),this._registerResizeListener(s))}},{key:"componentWillUnmount",value:function(){var t=this.props.scrollElement;t&&(Fa(this,t),this._unregisterResizeListener(t)),this._isMounted=!1}},{key:"render",value:function(){var t=this.props.children,i=this.state,s=i.isScrolling,l=i.scrollTop,c=i.scrollLeft,p=i.height,S=i.width;return t({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:p,isScrolling:s,scrollLeft:c,scrollTop:l,width:S})}}]),m}(Z.PureComponent),Q(wo,"propTypes",null),Qn);Q(Ba,"defaultProps",{onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:_s,scrollElement:Jn(),serverHeight:0,serverWidth:0});var Ha=null,xs=At(12397),Co=At(68496),ws=At.n(Co);function ja(g,m){var d=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);m&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),d.push.apply(d,t)}return d}function qt(g){for(var m=1;mg.length)&&(m=g.length);for(var d=0,t=new Array(m);d0&&arguments[0]!==void 0?arguments[0]:{};Ar(this,g),this.handlers={},this.handlers=qt({beforeSetTime:[],afterSetTime:[],setTimeByTick:[],beforeSetPlayRate:[],afterSetPlayRate:[],setActiveActionIds:[],play:[],paused:[],ended:[]},m)}),ra="playing",pe="paused",na=function(g){or(d,g);var m=ei(d);function d(){var t;return Ar(this,d),t=m.call(this,new Xa),t._timerId=void 0,t._playRate=1,t._currentTime=0,t._playState="paused",t._prev=void 0,t._effectMap={},t._actionMap={},t._actionSortIds=[],t._next=0,t._activeActionIds=[],t}return ti(d,[{key:"isPlaying",get:function(){return this._playState==="playing"}},{key:"isPaused",get:function(){return this._playState==="paused"}},{key:"effects",set:function(i){this._effectMap=i}},{key:"data",set:function(i){this.isPlaying&&this.pause(),this._dealData(i),this._dealClear(),this._dealEnter(this._currentTime)}},{key:"setPlayRate",value:function(i){if(i<=0){console.error("Error: rate cannot be less than 0!");return}var s=this.trigger("beforeSetPlayRate",{rate:i,engine:this});return s?(this._playRate=i,this.trigger("afterSetPlayRate",{rate:i,engine:this}),!0):!1}},{key:"getPlayRate",value:function(){return this._playRate}},{key:"reRender",value:function(){this.isPlaying||this._tickAction(this._currentTime)}},{key:"setTime",value:function(i,s){var l=s||this.trigger("beforeSetTime",{time:i,engine:this});return l?(this._currentTime=i,this._next=0,this._dealLeave(i),this._dealEnter(i),s?this.trigger("setTimeByTick",{time:i,engine:this}):this.trigger("afterSetTime",{time:i,engine:this}),!0):!1}},{key:"getTime",value:function(){return this._currentTime}},{key:"play",value:function(i){var s=this,l=i.toTime,c=i.autoEnd,p=this.getTime();return this.isPlaying||l&&l<=p?!1:(this._playState=ra,this._startOrStop("start"),this.trigger("play",{engine:this}),this._timerId=requestAnimationFrame(function(S){s._prev=S,s._tick({now:S,autoEnd:c,to:l})}),!0)}},{key:"pause",value:function(){this.isPlaying&&(this._playState=pe,this._startOrStop("stop"),this.trigger("paused",{engine:this})),cancelAnimationFrame(this._timerId)}},{key:"_end",value:function(){this.pause(),this.trigger("ended",{engine:this})}},{key:"_startOrStop",value:function(i){for(var s=0;s=this._actionSortIds.length&&this._activeActionIds.length===0){this._end();return}p&&p<=S&&this._end(),!this.isPaused&&(this._timerId=requestAnimationFrame(function(y){s._tick({now:y,autoEnd:c,to:p})}))}}},{key:"_tickAction",value:function(i){this._dealEnter(i),this._dealLeave(i);for(var s=this._activeActionIds.length,l=0;li)break;if(l.end>i&&!this._activeActionIds.includes(s)){var c,p=this._effectMap[l.effectId];p&&((c=p.source)===null||c===void 0?void 0:c.enter)&&p.source.enter({action:l,effect:p,isPlaying:this.isPlaying,time:i,engine:this}),this._activeActionIds.push(s)}}this._next++}}},{key:"_dealLeave",value:function(i){for(var s=0;this._activeActionIds[s];){var l=this._activeActionIds[s],c=this._actionMap[l];if(c.start>i||c.end0&&arguments[0]!==void 0?arguments[0]:this.level;this.level=d,this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"setLevel",value:function(d){this.level=d}},{key:"trace",value:function(d){if(!(!this.enabled||this.level>qe.VERBOSE)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.VERBOSE)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.LOG)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.INFO)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.WARN)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.ERROR)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;sqe.FATAL)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s=d.current||y.clientX<=m.current){cancelAnimationFrame(i.current);var E=Math.abs(y.clientX>=d.current?y.clientX-d.current:y.clientX-m.current);t.current=Math.min(Number((E/Eo).toFixed(0))*ar,Bn);var O=y.clientX>=d.current?1:-1,P=O*t.current,A=function B(){x&&x(P),i.current=requestAnimationFrame(B)};return i.current=requestAnimationFrame(A),!1}else cancelAnimationFrame(i.current);return!0},c=function(y,x,E){if(y.clientX>=d.current||y.clientX=d.current?y.clientX-d.current:y.clientX-m.current);t.current=Math.min(Number((O/Eo).toFixed(0))*ar,Bn);var P=y.clientX>=d.current?1:-1,A=P*t.current,B=function G(){E&&E(A),i.current=requestAnimationFrame(G)};return i.current=requestAnimationFrame(B),!1}else cancelAnimationFrame(i.current);return!0},p=function(){m.current=Number.MIN_SAFE_INTEGER,d.current=Number.MAX_SAFE_INTEGER,t.current=ar,cancelAnimationFrame(i.current)};return{initAutoScroll:s,dealDragAutoScroll:l,dealResizeAutoScroll:c,stopAutoScroll:p}}var sr=function(m){var d=m.children,t=m.interactRef,i=m.draggable,s=m.resizable,l=m.draggableOptions,c=m.resizableOptions,p=(0,Z.useRef)(),S=(0,Z.useRef)(),y=(0,Z.useRef)(),x=(0,Z.useRef)();(0,Z.useEffect)(function(){y.current=qt({},l),x.current=qt({},c)},[l,c]),(0,Z.useEffect)(function(){S.current&&S.current.unset(),S.current=ws()(p.current),t.current=S.current,E()},[i,s]);var E=function(){i&&S.current.draggable(qt(qt({},y.current),{},{onstart:function(A){return y.current.onstart&&y.current.onstart(A)},onmove:function(A){return y.current.onmove&&y.current.onmove(A)},onend:function(A){return y.current.onend&&y.current.onend(A)}})),s&&S.current.resizable(qt(qt({},x.current),{},{onstart:function(A){return x.current.onstart&&x.current.onstart(A)},onmove:function(A){return x.current.onmove&&x.current.onmove(A)},onend:function(A){return x.current.onend&&x.current.onend(A)}}))};return(0,Z.cloneElement)(d,{ref:p,draggable:!1})},qa=Z.forwardRef(function(g,m){var d=g.children,t=g.edges,i=g.left,s=g.width,l=g.start,c=l===void 0?Sn:l,p=g.grid,S=p===void 0?wi:p,y=g.bounds,x=y===void 0?{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}:y,E=g.enableResizing,O=E===void 0?!0:E,P=g.enableDragging,A=P===void 0?!0:P,B=g.adsorptionDistance,G=B===void 0?Gn:B,V=g.adsorptionPositions,$=V===void 0?[]:V,X=g.onResizeStart,rt=g.onResize,st=g.onResizeEnd,it=g.onDragStart,tt=g.onDragEnd,ht=g.onDrag,lt=g.parentRef,gt=g.deltaScrollLeft,ct=(0,Z.useRef)(),mt=(0,Z.useRef)(0),Gt=(0,Z.useRef)(!1),pt=Ts(lt),$e=pt.initAutoScroll,_e=pt.dealDragAutoScroll,Be=pt.dealResizeAutoScroll,xe=pt.stopAutoScroll;(0,Z.useEffect)(function(){return function(){ct.current&&ct.current.unset()}},[]),(0,Z.useImperativeHandle)(m,function(){return{updateLeft:function(yt){return Xe(yt||0,!1)},updateWidth:function(yt){return tr(yt,!1)},getLeft:er,getWidth:De}}),(0,Z.useEffect)(function(){var Zt=ct.current.target;tr(typeof s=="undefined"?Zt.offsetWidth:s,!1)},[s]),(0,Z.useEffect)(function(){Xe(i||0,!1)},[i]);var Xe=function(yt){var Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!(!ct.current||!ct.current.target)){Pt&&(mt.current=0);var Ht=ct.current.target;Ht.style.left="".concat(yt,"px"),Object.assign(Ht.dataset,{left:yt})}},tr=function(yt){var Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!(!ct.current||!ct.current.target)){Pt&&(mt.current=0);var Ht=ct.current.target;Ht.style.width="".concat(yt,"px"),Object.assign(Ht.dataset,{width:yt})}},er=function(){var yt,Pt=ct.current.target;return parseFloat((Pt==null||(yt=Pt.dataset)===null||yt===void 0?void 0:yt.left)||"0")},De=function(){var yt,Pt=ct.current.target;return parseFloat((Pt==null||(yt=Pt.dataset)===null||yt===void 0?void 0:yt.width)||"0")},ze=function(yt){mt.current=0,Gt.current=!1,$e(),it&&it()},fe=function(yt){var Pt=yt.preLeft,Ht=yt.preWidth,Vt=yt.scrollDelta,ie=Gt.current?G:S;if(Math.abs(mt.current)>=ie){var dr=parseInt(mt.current/ie+""),Qt=Pt+dr*ie,xr=Qt,rn=Number.MAX_SAFE_INTEGER;if($.forEach(function(Er){var nn=Math.abs(Er-Qt);nnx.right&&(Qt=x.right-Ht),ht){var _n=ht({lastLeft:Pt,left:Qt,lastWidth:Ht,width:Ht},Vt);if(_n===!1)return}Xe(Qt,!1)}},tn=function(yt){var Pt=yt.target;if(gt&&(lt==null?void 0:lt.current)){var Ht=_e(yt,function(rn){gt(rn);var _n=Pt.dataset,Er=_n.left,nn=_n.width,Ye=parseFloat(Er),we=parseFloat(nn);mt.current+=rn,fe({preLeft:Ye,preWidth:we,scrollDelta:rn})});if(!Ht)return}var Vt=Pt.dataset,ie=Vt.left,dr=Vt.width,Qt=parseFloat(ie),xr=parseFloat(dr);mt.current+=yt.dx,fe({preLeft:Qt,preWidth:xr})},_r=function(yt){mt.current=0,Gt.current=!1,xe();var Pt=yt.target,Ht=Pt.dataset,Vt=Ht.left,ie=Ht.width;tt&&tt({left:parseFloat(Vt),width:parseFloat(ie)})},en=function(yt){var Pt;mt.current=0,Gt.current=!1,$e();var Ht=((Pt=yt.edges)===null||Pt===void 0?void 0:Pt.right)?"right":"left";X&&X(Ht)},Ri=function(yt){var Pt=yt.dir,Ht=yt.preWidth,Vt=yt.preLeft,ie=Gt.current?G:S;if(Pt==="left"){if(Math.abs(mt.current)>=ie){var dr=parseInt(mt.current/ie+""),Qt=Vt+dr*ie,xr=Qt,rn=Number.MAX_SAFE_INTEGER;$.forEach(function(ke){var He=Math.abs(ke-Qt);He=ie){var Ye=parseInt(mt.current/S+""),we=Ht+Ye*S,$t=Vt+we,ve=Number.MAX_SAFE_INTEGER;if($.forEach(function(ke){var He=Math.abs(ke-(Vt+we));Hex.right&&(we=x.right-Vt),rt){var Br=rt("right",{lastLeft:Vt,lastWidth:Ht,left:Vt,width:we});if(Br===!1)return}tr(we,!1)}},jn=function(yt){var Pt,Ht=yt.target,Vt=((Pt=yt.edges)===null||Pt===void 0?void 0:Pt.left)?"left":"right";if(gt&&(lt==null?void 0:lt.current)){var ie=Be(yt,Vt,function(Er){gt(Er);var nn=Ht.dataset,Ye=nn.left,we=nn.width,$t=parseFloat(Ye),ve=parseFloat(we);mt.current+=Er,Ri({preLeft:$t,preWidth:ve,dir:Vt})});if(!ie)return}var dr=Ht.dataset,Qt=dr.left,xr=dr.width,rn=parseFloat(Qt),_n=parseFloat(xr);mt.current+=Vt==="left"?yt.deltaRect.left:yt.deltaRect.right,Ri({preLeft:rn,preWidth:_n,dir:Vt})},Oo=function(yt){var Pt;mt.current=0,Gt.current=!1,xe();var Ht=yt.target,Vt=Ht.dataset,ie=Vt.left,dr=Vt.width,Qt=((Pt=yt.edges)===null||Pt===void 0?void 0:Pt.right)?"right":"left";st&&st(Qt,{left:parseFloat(ie),width:parseFloat(dr)})};return Z.createElement(sr,{interactRef:ct,draggable:A,resizable:O,draggableOptions:{lockAxis:"x",onmove:tn,onstart:ze,onend:_r,cursorChecker:function(){return null}},resizableOptions:{axis:"x",invert:"none",edges:qt({left:!0,right:!0,top:!1,bottom:!1},t||{}),onmove:jn,onstart:en,onend:Oo}},Z.cloneElement(d,{style:qt(qt({},d.props.style||{}),{},{left:i,width:s})}))});function Ct(g,m){m===void 0&&(m={});var d=m.insertAt;if(!(!g||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",d==="top"&&t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i),i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g))}}var $a=`.timeline-editor-cursor { cursor: ew-resize; position: absolute; top: 32px; height: calc(100% - 32px); box-sizing: border-box; border-left: 1px solid #5297FF; border-right: 1px solid #5297FF; transform: translateX(-25%) scaleX(0.5); } .timeline-editor-cursor-top { position: absolute; top: 0; left: 50%; transform: translate(-50%, 0) scaleX(2); margin: auto; } .timeline-editor-cursor-area { width: 16px; height: 100%; cursor: ew-resize; position: absolute; top: 0; left: 50%; transform: translateX(-50%); } `;Ct($a);var Mo=function(m){var d=m.disableDrag,t=m.cursorTime,i=m.setCursor,s=m.startLeft,l=m.timelineWidth,c=m.scaleWidth,p=m.scale,S=m.scrollLeft,y=m.scrollSync,x=m.areaRef,E=m.maxScaleCount,O=m.deltaScrollLeft,P=m.onCursorDragStart,A=m.onCursorDrag,B=m.onCursorDragEnd,G=(0,Z.useRef)(),V=(0,Z.useRef)();return(0,Z.useEffect)(function(){typeof V.current=="undefined"&&G.current.updateLeft(Qr(t,{startLeft:s,scaleWidth:c,scale:p})-S)},[t,s,c,p,S]),Z.createElement(qa,{start:s,ref:G,parentRef:x,bounds:{left:0,right:Math.min(l,E*c+s-S)},deltaScrollLeft:O,enableDragging:!d,enableResizing:!1,onDragStart:function(){P&&P(t),V.current=Qr(t,{startLeft:s,scaleWidth:c,scale:p})-S,G.current.updateLeft(V.current)},onDragEnd:function(){var X=bn(V.current+S,{startLeft:s,scale:p,scaleWidth:c});i({time:X}),B&&B(X),V.current=void 0},onDrag:function(X){var rt=X.left,st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,it=y.current.state.scrollLeft;!st||it===0?rt=0&&setTimeout(function(){var De;return(De=mt.current)===null||De===void 0?void 0:De.recomputeGridSize({rowIndex:er.length-1})})),Gt.current=Xe,Z.createElement(Xt,{columnCount:1,rowCount:er.length,ref:mt,cellRenderer:_e,columnWidth:Math.max(s*i+l,xe),width:xe,height:Xe,rowHeight:function(ze){var fe=ze.index;return er[fe]||t},overscanRowCount:10,overscanColumnCount:0,onScroll:function(ze){E(ze)}})}),O&&Z.createElement(Es,qt({scrollLeft:c},st)))}),aa=`.timeline-editor { height: 600px; width: 600px; min-height: 32px; position: relative; font-size: 12px; font-family: "PingFang SC"; background-color: #191b1d; display: flex; flex-direction: column; overflow: hidden; } `;Ct(aa);var kr=`.timeline-editor-time-area { position: relative; height: 32px; flex: 0 0 auto; } .timeline-editor-time-area .ReactVirtualized__Grid { outline: none; } .timeline-editor-time-area .ReactVirtualized__Grid::-webkit-scrollbar { display: none; } .timeline-editor-time-area-interact { position: absolute; cursor: pointer; left: 0; top: 0; } .timeline-editor-time-unit { border-right: 1px solid rgba(255, 255, 255, 0.2); position: relative; box-sizing: content-box; height: 4px !important; bottom: 0 !important; top: auto !important; } .timeline-editor-time-unit-big { height: 8px !important; } .timeline-editor-time-unit-scale { color: rgba(255, 255, 255, 0.6); position: absolute; right: 0; top: 0; transform: translate(50%, -100%); } `;Ct(kr);var Ci=function(m){var d=m.setCursor,t=m.maxScaleCount,i=m.hideCursor,s=m.scale,l=m.scaleWidth,c=m.scaleCount,p=m.scaleSplitCount,S=m.startLeft,y=m.scrollLeft,x=m.onClickTimeArea,E=m.getScaleRender,O=(0,Z.useRef)(),P=p>0,A=function(V){var $=V.columnIndex,X=V.key,rt=V.style,st=P?$%p==0:!0,it=["time-unit"];st&&it.push("time-unit-big");var tt=(P?$/p:$)*s;return Z.createElement("div",{key:X,style:rt,className:be.apply(void 0,it)},st&&Z.createElement("div",{className:be("time-unit-scale")},E?E(tt):tt))};(0,Z.useEffect)(function(){var G;(G=O.current)===null||G===void 0||G.recomputeGridSize()},[l,S]);var B=function(V){switch(V.index){case 0:return S;default:return P?l/p:l}};return Z.createElement("div",{className:be("time-area")},Z.createElement(sn,null,function(G){var V=G.width,$=G.height;return Z.createElement(Z.Fragment,null,Z.createElement(Xt,{ref:O,columnCount:P?c*p+1:c,columnWidth:B,rowCount:1,rowHeight:$,width:V,height:$,overscanRowCount:0,overscanColumnCount:10,cellRenderer:A,scrollLeft:y}),Z.createElement("div",{style:{width:V,height:$},onClick:function(rt){if(!i){var st=rt.currentTarget.getBoundingClientRect(),it=rt.clientX-st.x,tt=Math.max(it+y,S);if(!(tt>t*l+S-y)){var ht=bn(tt,{startLeft:S,scale:s,scaleWidth:l}),lt=x&&x(ht,rt);lt!==!1&&d({time:ht})}}},className:be("time-area-interact")}))}))},sa=Z.forwardRef(function(g,m){var d=oa(g),t=g.style,i=d.effects,s=d.editorData,l=d.scrollTop,c=d.autoScroll,p=d.hideCursor,S=d.disableDrag,y=d.scale,x=d.scaleWidth,E=d.startLeft,O=d.minScaleCount,P=d.maxScaleCount,A=d.onChange,B=d.engine,G=d.autoReRender,V=G===void 0?!0:G,$=d.onScroll,X=(0,Z.useRef)(B||new na),rt=(0,Z.useRef)(),st=(0,Z.useRef)(),it=(0,Z.useRef)(),tt=(0,Z.useState)(s),ht=pn(tt,2),lt=ht[0],gt=ht[1],ct=(0,Z.useState)(Wn),mt=pn(ct,2),Gt=mt[0],pt=mt[1],$e=(0,Z.useState)(yn),_e=pn($e,2),Be=_e[0],xe=_e[1],Xe=(0,Z.useState)(!1),tr=pn(Xe,2),er=tr[0],De=tr[1],ze=(0,Z.useState)(Number.MAX_SAFE_INTEGER),fe=pn(ze,2),tn=fe[0],_r=fe[1];(0,Z.useLayoutEffect)(function(){en(To(s,{scale:y})),gt(s)},[s,O,P,y]),(0,Z.useEffect)(function(){X.current.effects=i},[i]),(0,Z.useEffect)(function(){X.current.data=lt},[lt]),(0,Z.useEffect)(function(){V&&X.current.reRender()},[lt]),(0,Z.useEffect)(function(){it.current&&it.current.setState({scrollTop:l})},[l]);var en=function(yt){var Pt=Math.min(P,Math.max(O,yt));pt(Pt)},Ri=function(yt){var Pt=A(yt);Pt!==!1&&(X.current.data=yt,V&&X.current.reRender())},jn=function(yt){var Pt=yt.left,Ht=yt.time,Vt=yt.updateTime,ie=Vt===void 0?!0:Vt;if(!(typeof Pt=="undefined"&&typeof Ht=="undefined")){typeof Ht=="undefined"&&(typeof Pt=="undefined"&&(Pt=Qr(Ht,{startLeft:E,scale:y,scaleWidth:x})),Ht=bn(Pt,{startLeft:E,scale:y,scaleWidth:x}));var dr=!0;return ie&&(dr=X.current.setTime(Ht),V&&X.current.reRender()),dr&&xe(Ht),dr}},Oo=function(yt){var Pt=it.current.state.scrollLeft+yt;Pt>Gt*(x-1)+E-tn||it.current&&it.current.setState({scrollLeft:Math.max(it.current.state.scrollLeft+yt,0)})};return(0,Z.useEffect)(function(){var Zt=function(Vt){var ie=Vt.time;jn({time:ie,updateTime:!1})},yt=function(){return De(!0)},Pt=function(){return De(!1)};X.current.on("setTimeByTick",Zt),X.current.on("play",yt),X.current.on("paused",Pt)},[]),(0,Z.useImperativeHandle)(m,function(){return{get target(){return rt.current},get listener(){return X.current},get isPlaying(){return X.current.isPlaying},get isPaused(){return X.current.isPaused},setPlayRate:X.current.setPlayRate.bind(X.current),getPlayRate:X.current.getPlayRate.bind(X.current),setTime:function(yt){return jn({time:yt})},getTime:X.current.getTime.bind(X.current),reRender:X.current.reRender.bind(X.current),play:function(yt){return X.current.play(qt({},yt))},pause:X.current.pause.bind(X.current),setScrollLeft:function(yt){it.current&&it.current.setState({scrollLeft:Math.max(yt,0)})},setScrollTop:function(yt){it.current&&it.current.setState({scrollTop:Math.max(yt,0)})}}}),(0,Z.useEffect)(function(){if(st.current){var Zt=new ResizeObserver(function(){!st.current||_r(st.current.getBoundingClientRect().width)});return Zt.observe(st.current),function(){Zt&&Zt.disconnect()}}},[]),Z.createElement("div",{ref:rt,style:t,className:"".concat(ri," ").concat(S?ri+"-disable":"")},Z.createElement(So,{ref:it},function(Zt){var yt=Zt.scrollLeft,Pt=Zt.scrollTop,Ht=Zt.onScroll;return Z.createElement(Z.Fragment,null,Z.createElement(Ci,qt(qt({},d),{},{timelineWidth:tn,disableDrag:S||er,setCursor:jn,cursorTime:Be,editorData:lt,scaleCount:Gt,setScaleCount:en,onScroll:Ht,scrollLeft:yt})),Z.createElement(Qa,qt(qt({},d),{},{timelineWidth:tn,ref:function(ie){return st.current=ie==null?void 0:ie.domRef.current},disableDrag:S||er,editorData:lt,cursorTime:Be,scaleCount:Gt,setScaleCount:en,scrollTop:Pt,scrollLeft:yt,setEditorData:Ri,deltaScrollLeft:c&&Oo,onScroll:function(ie){Ht(ie),$&&$(ie)}})),!p&&Z.createElement(Mo,qt(qt({},d),{},{timelineWidth:tn,disableDrag:er,scrollLeft:yt,scaleCount:Gt,setScaleCount:en,setCursor:jn,cursorTime:Be,editorData:lt,areaRef:st,scrollSync:it,deltaScrollLeft:c&&Oo})))}))})},12397:function(Ao,lr,At){"use strict";At.d(lr,{$i:function(){return Kt},tI:function(){return Z},iH:function(){return nr},xL:function(){return nt},qE:function(){return ir}});function Z(jt){for(var et=[],Wt=1;Wt=(parseInt(At.getWindow(G).getComputedStyle(G).zIndex,10)||0)&&(i=l);else i=l}else i=l}var B,G;return i},Tt.matchesSelector=Ei,Tt.matchesUpTo=function(t,i,s){for(;nt.default.element(t);){if(Ei(t,i))return!0;if((t=Ze(t))===s)return Ei(t,i)}return!1},Tt.nodeContains=function(t,i){if(t.contains)return t.contains(i);for(;i;){if(i===t)return!0;i=i.parentNode}return!1},Tt.parentNode=Ze,Tt.trySelector=function(t){return!!nt.default.string(t)&&(Ce.default.document.querySelector(t),!0)};var xn=function(t){return t.parentNode||t.host};function fa(t,i){for(var s,l=[],c=t;(s=xn(c))&&c!==i&&s!==c.ownerDocument;)l.unshift(c),c=s;return l}function da(t){return{x:(t=t||At.window).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop}}function zs(t){var i=t instanceof Ce.default.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return i&&{left:i.left,right:i.right,top:i.top,bottom:i.bottom,width:i.width||i.right-i.left,height:i.height||i.bottom-i.top}}var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.default=function(t,i){for(var s in i)t[s]=i[s];return t};var Te={};function rs(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s1?ha(i):i[0];As(l,t.page),ks(l,t.client),t.timeStamp=s},Rt.setZeroCoords=function(t){t.page.x=0,t.page.y=0,t.client.x=0,t.client.y=0},Rt.touchAngle=function(t,i){var s=i+"X",l=i+"Y",c=va(t),p=c[1][s]-c[0][s],S=c[1][l]-c[0][l];return 180*Math.atan2(S,p)/Math.PI},Rt.touchBBox=function(t){if(!t.length)return null;var i=va(t),s=Math.min(i[0].pageX,i[1].pageX),l=Math.min(i[0].pageY,i[1].pageY),c=Math.max(i[0].pageX,i[1].pageX),p=Math.max(i[0].pageY,i[1].pageY);return{x:s,y:l,left:s,top:l,right:c,bottom:p,width:c-s,height:p-l}},Rt.touchDistance=function(t,i){var s=i+"X",l=i+"Y",c=va(t),p=c[0][s]-c[1][s],S=c[0][l]-c[1][l];return(0,wn.default)(p,S)};var me={};function Ls(t,i){for(var s=0;sX.left&&tt.xX.top&&tt.y=X.left&&ct<=X.right&&mt>=X.top&&mt<=X.bottom}return gt&&nt.default.number(st)&&(rt=Math.max(0,Math.min(X.right,gt.right)-Math.max(X.left,gt.left))*Math.max(0,Math.min(X.bottom,gt.bottom)-Math.max(X.top,gt.top))/(gt.width*gt.height)>=st),P.options.drop.checker&&(rt=P.options.drop.checker(A,B,rt,P,$,G,V)),rt}(this,p,S,y,x,E,O)},s.dynamicDrop=function(p){return nt.default.bool(p)?(t.dynamicDrop=p,s):t.dynamicDrop},(0,It.default)(i.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),i.methodDict.drop="dropzone",t.dynamicDrop=!1,c.actions.drop=zi.defaults},listeners:{"interactions:before-action-start":function(t){var i=t.interaction;i.prepared.name==="drag"&&(i.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(t,i){var s=t.interaction,l=(t.event,t.iEvent);if(s.prepared.name==="drag"){var c=s.dropState;c.activeDrops=null,c.events=null,c.activeDrops=Ne(i,s.element),c.events=ga(s,0,l),c.events.activate&&(Gr(c.activeDrops,c.events.activate),i.fire("actions/drop:start",{interaction:s,dragEvent:l}))}},"interactions:action-move":as,"interactions:after-action-move":function(t,i){var s=t.interaction,l=t.iEvent;s.prepared.name==="drag"&&(io(s,s.dropState.events),i.fire("actions/drop:move",{interaction:s,dragEvent:l}),s.dropState.events={})},"interactions:action-end":function(t,i){if(t.interaction.prepared.name==="drag"){var s=t.interaction,l=t.iEvent;as(t,i),io(s,s.dropState.events),i.fire("actions/drop:end",{interaction:s,dragEvent:l})}},"interactions:stop":function(t){var i=t.interaction;if(i.prepared.name==="drag"){var s=i.dropState;s&&(s.activeDrops=null,s.events=null,s.cur.dropzone=null,s.cur.element=null,s.prev.dropzone=null,s.prev.element=null,s.rejected=!1)}}},getActiveDrops:Ne,getDrop:si,getDropEvents:ga,fireDropEvents:io,defaults:{enabled:!1,accept:null,overlap:"pointer"}},mr=zi;gr.default=mr;var li={};function Fo(t){var i=t.interaction,s=t.iEvent,l=t.phase;if(i.prepared.name==="gesture"){var c=i.pointers.map(function(E){return E.pointer}),p=l==="start",S=l==="end",y=i.interactable.options.deltaSource;if(s.touches=[c[0],c[1]],p)s.distance=Rt.touchDistance(c,y),s.box=Rt.touchBBox(c),s.scale=1,s.ds=0,s.angle=Rt.touchAngle(c,y),s.da=0,i.gesture.startDistance=s.distance,i.gesture.startAngle=s.angle;else if(S){var x=i.prevEvent;s.distance=x.distance,s.box=x.box,s.scale=x.scale,s.ds=0,s.angle=x.angle,s.da=0}else s.distance=Rt.touchDistance(c,y),s.box=Rt.touchBBox(c),s.scale=s.distance/i.gesture.startDistance,s.angle=Rt.touchAngle(c,y),s.ds=s.scale-i.gesture.scale,s.da=s.angle-i.gesture.angle;i.gesture.distance=s.distance,i.gesture.angle=s.angle,nt.default.number(s.scale)&&s.scale!==1/0&&!isNaN(s.scale)&&(i.gesture.scale=s.scale)}}Object.defineProperty(li,"__esModule",{value:!0}),li.default=void 0;var wr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(t){var i=t.actions,s=t.Interactable,l=t.defaults;s.prototype.gesturable=function(c){return nt.default.object(c)?(this.options.gesture.enabled=c.enabled!==!1,this.setPerAction("gesture",c),this.setOnEvents("gesture",c),this):nt.default.bool(c)?(this.options.gesture.enabled=c,this):this.options.gesture},i.map.gesture=wr,i.methodDict.gesture="gesturable",l.actions.gesture=wr.defaults},listeners:{"interactions:action-start":Fo,"interactions:action-move":Fo,"interactions:action-end":Fo,"interactions:new":function(t){t.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(t){if(!(t.interaction.pointers.length<2)){var i=t.interactable.options.gesture;if(i&&i.enabled)return t.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""}},Bo=wr;li.default=Bo;var Vr={};function Rn(t,i,s,l,c,p,S){if(!i)return!1;if(i===!0){var y=nt.default.number(p.width)?p.width:p.right-p.left,x=nt.default.number(p.height)?p.height:p.bottom-p.top;if(S=Math.min(S,Math.abs((t==="left"||t==="right"?y:x)/2)),y<0&&(t==="left"?t="right":t==="right"&&(t="left")),x<0&&(t==="top"?t="bottom":t==="bottom"&&(t="top")),t==="left"){var E=y>=0?p.left:p.right;return s.x=0?p.top:p.bottom;return s.y(y>=0?p.right:p.left)-S;if(t==="bottom")return s.y>(x>=0?p.bottom:p.top)-S}return!!nt.default.element(l)&&(nt.default.element(i)?i===l:Tt.matchesUpTo(l,i,c))}function Ho(t){var i=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.resizeAxes){var l=i;s.interactable.options.resize.square?(s.resizeAxes==="y"?l.delta.x=l.delta.y:l.delta.y=l.delta.x,l.axes="xy"):(l.axes=s.resizeAxes,s.resizeAxes==="x"?l.delta.y=0:s.resizeAxes==="y"&&(l.delta.x=0))}}Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.default=void 0;var Tn={id:"actions/resize",before:["actions/drag"],install:function(t){var i=t.actions,s=t.browser,l=t.Interactable,c=t.defaults;Tn.cursors=function(p){return p.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(s),Tn.defaultMargin=s.supportsTouch||s.supportsPointerEvent?20:10,l.prototype.resizable=function(p){return function(S,y,x){return nt.default.object(y)?(S.options.resize.enabled=y.enabled!==!1,S.setPerAction("resize",y),S.setOnEvents("resize",y),nt.default.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?S.options.resize.axis=y.axis:y.axis===null&&(S.options.resize.axis=x.defaults.actions.resize.axis),nt.default.bool(y.preserveAspectRatio)?S.options.resize.preserveAspectRatio=y.preserveAspectRatio:nt.default.bool(y.square)&&(S.options.resize.square=y.square),S):nt.default.bool(y)?(S.options.resize.enabled=y,S):S.options.resize}(this,p,t)},i.map.resize=Tn,i.methodDict.resize="resizable",c.actions.resize=Tn.defaults},listeners:{"interactions:new":function(t){t.interaction.resizeAxes="xy"},"interactions:action-start":function(t){(function(i){var s=i.iEvent,l=i.interaction;if(l.prepared.name==="resize"&&l.prepared.edges){var c=s,p=l.rect;l._rects={start:(0,It.default)({},p),corrected:(0,It.default)({},p),previous:(0,It.default)({},p),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},c.edges=l.prepared.edges,c.rect=l._rects.corrected,c.deltaRect=l._rects.delta}})(t),Ho(t)},"interactions:action-move":function(t){(function(i){var s=i.iEvent,l=i.interaction;if(l.prepared.name==="resize"&&l.prepared.edges){var c=s,p=l.interactable.options.resize.invert,S=p==="reposition"||p==="negate",y=l.rect,x=l._rects,E=x.start,O=x.corrected,P=x.delta,A=x.previous;if((0,It.default)(A,O),S){if((0,It.default)(O,y),p==="reposition"){if(O.top>O.bottom){var B=O.top;O.top=O.bottom,O.bottom=B}if(O.left>O.right){var G=O.left;O.left=O.right,O.right=G}}}else O.top=Math.min(y.top,E.bottom),O.bottom=Math.max(y.bottom,E.top),O.left=Math.min(y.left,E.right),O.right=Math.max(y.right,E.left);for(var V in O.width=O.right-O.left,O.height=O.bottom-O.top,O)P[V]=O[V]-A[V];c.edges=l.prepared.edges,c.rect=O,c.deltaRect=P}})(t),Ho(t)},"interactions:action-end":function(t){var i=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=i;l.edges=s.prepared.edges,l.rect=s._rects.corrected,l.deltaRect=s._rects.delta}},"auto-start:check":function(t){var i=t.interaction,s=t.interactable,l=t.element,c=t.rect,p=t.buttons;if(c){var S=(0,It.default)({},i.coords.cur.page),y=s.options.resize;if(y&&y.enabled&&(!i.pointerIsDown||!/mouse|pointer/.test(i.pointerType)||(p&y.mouseButtons)!=0)){if(nt.default.object(y.edges)){var x={left:!1,right:!1,top:!1,bottom:!1};for(var E in x)x[E]=Rn(E,y.edges[E],S,i._latestPointer.eventTarget,l,c,y.margin||Tn.defaultMargin);x.left=x.left&&!x.right,x.top=x.top&&!x.bottom,(x.left||x.right||x.top||x.bottom)&&(t.action={name:"resize",edges:x})}else{var O=y.axis!=="y"&&S.x>c.right-Tn.defaultMargin,P=y.axis!=="x"&&S.y>c.bottom-Tn.defaultMargin;(O||P)&&(t.action={name:"resize",axes:(O?"x":"")+(P?"y":"")})}return!t.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(t){var i=t.edges,s=t.axis,l=t.name,c=Tn.cursors,p=null;if(s)p=c[l+s];else if(i){for(var S="",y=["top","bottom","left","right"],x=0;x=1){var E={x:kt.x*x,y:kt.y*x};if(E.x||E.y){var O=Lt(p);nt.default.window(p)?p.scrollBy(E.x,E.y):p&&(p.scrollLeft+=E.x,p.scrollTop+=E.y);var P=Lt(p),A={x:P.x-O.x,y:P.y-O.y};(A.x||A.y)&&i.fire({type:"autoscroll",target:s,interactable:i,delta:A,interaction:t,container:p})}kt.prevTime=S}kt.isScrolling&&(Ir.default.cancel(kt.i),kt.i=Ir.default.request(kt.scroll))},check:function(t,i){var s;return(s=t.options[i].autoScroll)==null?void 0:s.enabled},onInteractionMove:function(t){var i=t.interaction,s=t.pointer;if(i.interacting()&&kt.check(i.interactable,i.prepared.name))if(i.simulation)kt.x=kt.y=0;else{var l,c,p,S,y=i.interactable,x=i.element,E=i.prepared.name,O=y.options[E].autoScroll,P=cr(O.container,y,x);if(nt.default.window(P))S=s.clientXP.innerWidth-kt.margin,p=s.clientY>P.innerHeight-kt.margin;else{var A=Tt.getElementClientRect(P);S=s.clientXA.right-kt.margin,p=s.clientY>A.bottom-kt.margin}kt.x=c?1:S?-1:0,kt.y=p?1:l?-1:0,kt.isScrolling||(kt.margin=O.margin,kt.speed=O.speed,kt.start(i))}}};function cr(t,i,s){return(nt.default.string(t)?(0,Te.getStringOptionResult)(t,i,s):t)||(0,At.getWindow)(s)}function Lt(t){return nt.default.window(t)&&(t=window.document.body),{x:t.scrollLeft,y:t.scrollTop}}var jo={id:"auto-scroll",install:function(t){var i=t.defaults,s=t.actions;t.autoScroll=kt,kt.now=function(){return t.now()},s.phaselessTypes.autoscroll=!0,i.perAction.autoScroll=kt.defaults},listeners:{"interactions:new":function(t){t.interaction.autoScroll=null},"interactions:destroy":function(t){t.interaction.autoScroll=null,kt.stop(),kt.interaction&&(kt.interaction=null)},"interactions:stop":kt.stop,"interactions:action-move":function(t){return kt.onInteractionMove(t)}}},il=jo;Ur.default=il;var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.copyAction=function(t,i){return t.name=i.name,t.axis=i.axis,t.edges=i.edges,t},Cr.sign=void 0,Cr.warnOnce=function(t,i){var s=!1;return function(){return s||(At.window.console.warn(i),s=!0),t.apply(this,arguments)}},Cr.sign=function(t){return t>=0?1:-1};var oo={};function Sa(t){return nt.default.bool(t)?(this.options.styleCursor=t,this):t===null?(delete this.options.styleCursor,this):this.options.styleCursor}function ss(t){return nt.default.func(t)?(this.options.actionChecker=t,this):t===null?(delete this.options.actionChecker,this):this.options.actionChecker}Object.defineProperty(oo,"__esModule",{value:!0}),oo.default=void 0;var ls={id:"auto-start/interactableMethods",install:function(t){var i=t.Interactable;i.prototype.getAction=function(s,l,c,p){var S=function(y,x,E,O,P){var A=y.getRect(O),B={action:null,interactable:y,interaction:E,element:O,rect:A,buttons:x.buttons||{0:1,1:4,3:8,4:16}[x.button]};return P.fire("auto-start:check",B),B.action}(this,l,c,p,t);return this.options.actionChecker?this.options.actionChecker(s,l,S,this,p,c):S},i.prototype.ignoreFrom=(0,Cr.warnOnce)(function(s){return this._backCompatOption("ignoreFrom",s)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),i.prototype.allowFrom=(0,Cr.warnOnce)(function(s){return this._backCompatOption("allowFrom",s)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),i.prototype.actionChecker=ss,i.prototype.styleCursor=Sa}};oo.default=ls;var sn={};function ao(t,i,s,l,c){return i.testIgnoreAllow(i.options[t.name],s,l)&&i.options[t.name].enabled&&Ie(i,s,t,c)?t:null}function Gs(t,i,s,l,c,p,S){for(var y=0,x=l.length;y=y||A.interactable===t&&((E+=B===s.name?1:0)>=p||A.element===i&&(O++,B===s.name&&O>=S))))return!1}return y>0}function xa(t,i){return nt.default.number(t)?(i.autoStart.maxInteractions=t,this):i.autoStart.maxInteractions}function No(t,i,s){var l=s.autoStart.cursorElement;l&&l!==t&&(l.style.cursor=""),t.ownerDocument.documentElement.style.cursor=i,t.style.cursor=i,s.autoStart.cursorElement=i?t:null}function Ws(t,i){var s=t.interactable,l=t.element,c=t.prepared;if(t.pointerType==="mouse"&&s&&s.options.styleCursor){var p="";if(c.name){var S=s.options[c.name].cursorChecker;p=nt.default.func(S)?S(c,s,l,t._interacting):i.actions.map[c.name].getCursor(c)}No(t.element,p||"",i)}else i.autoStart.cursorElement&&No(i.autoStart.cursorElement,"",i)}Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=void 0;var yr={id:"auto-start/base",before:["actions"],install:function(t){var i=t.interactStatic,s=t.defaults;t.usePlugin(oo.default),s.base.actionChecker=null,s.base.styleCursor=!0,(0,It.default)(s.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),i.maxInteractions=function(l){return xa(l,t)},t.autoStart={maxInteractions:1/0,withinInteractionLimit:Ie,cursorElement:null}},listeners:{"interactions:down":function(t,i){var s=t.interaction,l=t.pointer,c=t.event,p=t.eventTarget;s.interacting()||_a(s,ba(s,l,c,p,i),i)},"interactions:move":function(t,i){(function(s,l){var c=s.interaction,p=s.pointer,S=s.event,y=s.eventTarget;c.pointerType!=="mouse"||c.pointerIsDown||c.interacting()||_a(c,ba(c,p,S,y,l),l)})(t,i),function(s,l){var c=s.interaction;if(c.pointerIsDown&&!c.interacting()&&c.pointerWasMoved&&c.prepared.name){l.fire("autoStart:before-start",s);var p=c.interactable,S=c.prepared.name;S&&p&&(p.options[S].manualStart||!Ie(p,c.element,c.prepared,l)?c.stop():(c.start(c.prepared,p,c.element),Ws(c,l)))}}(t,i)},"interactions:stop":function(t,i){var s=t.interaction,l=s.interactable;l&&l.options.styleCursor&&No(s.element,"",i)}},maxInteractions:xa,withinInteractionLimit:Ie,validateAction:ao},fr=yr;sn.default=fr;var ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.default=void 0;var us={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(t,i){var s=t.interaction,l=t.eventTarget,c=t.dx,p=t.dy;if(s.prepared.name==="drag"){var S=Math.abs(c),y=Math.abs(p),x=s.interactable.options.drag,E=x.startAxis,O=S>y?"x":S0&&(i.autoStartHoldTimer=setTimeout(function(){i.start(i.prepared,i.interactable,i.element)},s))},"interactions:move":function(t){var i=t.interaction,s=t.duplicate;i.autoStartHoldTimer&&i.pointerWasMoved&&!s&&(clearTimeout(i.autoStartHoldTimer),i.autoStartHoldTimer=null)},"autoStart:before-start":function(t){var i=t.interaction;ln(i)>0&&(i.prepared.name=null)}},getHoldDuration:ln},cs=Rr;so.default=cs;var Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var Fs={id:"auto-start",install:function(t){t.usePlugin(sn.default),t.usePlugin(so.default),t.usePlugin(ki.default)}};Li.default=Fs;var Pr={};function un(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):nt.default.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function wa(t){var i=t.interaction,s=t.event;i.interactable&&i.interactable.checkAndPreventDefault(s)}function ce(t){var i=t.Interactable;i.prototype.preventDefault=un,i.prototype.checkAndPreventDefault=function(s){return function(l,c,p){var S=l.options.preventDefault;if(S!=="never")if(S!=="always"){if(c.events.supportsPassive&&/^touch(start|move)$/.test(p.type)){var y=(0,At.getWindow)(p.target).document,x=c.getDocOptions(y);if(!x||!x.events||x.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(p.type)||nt.default.element(p.target)&&(0,Tt.matchesSelector)(p.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||p.preventDefault()}else p.preventDefault()}(this,t,s)},t.interactions.docEvents.push({type:"dragstart",listener:function(s){for(var l=0;lt.length)&&(i=t.length);for(var s=0,l=Array(i);s150)return null;var x=180*Math.atan2(y.prevEvent.velocityY,y.prevEvent.velocityX)/Math.PI;x<0&&(x+=360);var E=112.5<=x&&x<247.5,O=202.5<=x&&x<337.5;return{up:O,down:!O&&22.5<=x&&x<157.5,left:E,right:!E&&(292.5<=x||x<67.5),angle:x,speed:y.prevEvent.speed,velocity:{x:y.prevEvent.velocityX,y:y.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}])&&Hs(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),S}(me.BaseEvent);Mn.InteractEvent=Ta,Object.defineProperties(Ta.prototype,{pageX:{get:function(){return this.page.x},set:function(t){this.page.x=t}},pageY:{get:function(){return this.page.y},set:function(t){this.page.y=t}},clientX:{get:function(){return this.client.x},set:function(t){this.client.x=t}},clientY:{get:function(){return this.client.y},set:function(t){this.client.y=t}},dx:{get:function(){return this.delta.x},set:function(t){this.delta.x=t}},dy:{get:function(){return this.delta.y},set:function(t){this.delta.y=t}},velocityX:{get:function(){return this.velocity.x},set:function(t){this.velocity.x=t}},velocityY:{get:function(){return this.velocity.y},set:function(t){this.velocity.y=t}}});var Bi={};function Ea(t,i){for(var s=0;sthis.pointerMoveTolerance);var E=this.getPointerIndex(l),O={pointer:l,pointerIndex:E,pointerInfo:this.pointers[E],event:c,type:"move",eventTarget:p,dx:S,dy:y,duplicate:x,interaction:this};x||Rt.setCoordVelocity(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",O),x||this.simulation||(this.interacting()&&(O.type=null,this.move(O)),this.pointerWasMoved&&Rt.copyCoords(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||Rt.setZeroCoords(this.coords.delta),(l=(0,It.default)({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,c,p,S){var y=this.getPointerIndex(l);y===-1&&(y=this.updatePointer(l,c,p,!1));var x=/cancel$/i.test(c.type)?"cancel":"up";this._scopeFire("interactions:".concat(x),{pointer:l,pointerIndex:y,pointerInfo:this.pointers[y],event:c,eventTarget:p,type:x,curEventTarget:S,interaction:this}),this.simulation||this.end(c),this.removePointer(l,c)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var c;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(c=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,c===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var c=Rt.getPointerId(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:re.findIndex(this.pointers,function(p){return p.id===c})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,c,p,S){var y=Rt.getPointerId(l),x=this.getPointerIndex(l),E=this.pointers[x];return S=S!==!1&&(S||/(down|start)$/i.test(c.type)),E?E.pointer=l:(E=new Bi.PointerInfo(y,l,c,null,null),x=this.pointers.length,this.pointers.push(E)),Rt.setCoords(this.coords.cur,this.pointers.map(function(O){return O.pointer}),this._now()),Rt.setCoordDeltas(this.coords.delta,this.coords.prev,this.coords.cur),S&&(this.pointerIsDown=!0,E.downTime=this.coords.cur.timeStamp,E.downTarget=p,Rt.pointerExtend(this.downPointer,l),this.interacting()||(Rt.copyCoords(this.coords.start,this.coords.cur),Rt.copyCoords(this.coords.prev,this.coords.cur),this.downEvent=c,this.pointerWasMoved=!1)),this._updateLatestPointer(l,c,p),this._scopeFire("interactions:update-pointer",{pointer:l,event:c,eventTarget:p,down:S,pointerInfo:E,pointerIndex:x,interaction:this}),x}},{key:"removePointer",value:function(l,c){var p=this.getPointerIndex(l);if(p!==-1){var S=this.pointers[p];this._scopeFire("interactions:remove-pointer",{pointer:l,event:c,eventTarget:null,pointerIndex:p,pointerInfo:S,interaction:this}),this.pointers.splice(p,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,c,p){this._latestPointer.pointer=l,this._latestPointer.event=c,this._latestPointer.eventTarget=p}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,c,p,S){return new Mn.InteractEvent(this,l,this.prepared.name,c,this.element,p,S)}},{key:"_fireEvent",value:function(l){var c;(c=this.interactable)==null||c.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var c=l.event,p=l.phase,S=l.preEnd,y=l.type,x=this.rect;if(x&&p==="move"&&(Te.addEdges(this.edges,x,this.coords.delta[this.interactable.options.deltaSource]),x.width=x.right-x.left,x.height=x.bottom-x.top),this._scopeFire("interactions:before-action-".concat(p),l)===!1)return!1;var E=l.iEvent=this._createPreparedEvent(c,p,S,y);return this._scopeFire("interactions:action-".concat(p),l),p==="start"&&(this.prevEvent=E),this._fireEvent(E),this._scopeFire("interactions:after-action-".concat(p),l),!0}},{key:"_now",value:function(){return Date.now()}}],s&&Ma(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();Sr.Interaction=Uo;var Xo=Uo;Sr.default=Xo;var On={};function Oa(t){t.pointerIsDown&&(Wr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}function co(t){Hi(t.interaction)}function Hi(t){if(!function(s){return!(!s.offset.pending.x&&!s.offset.pending.y)}(t))return!1;var i=t.offset.pending;return Wr(t.coords.cur,i),Wr(t.coords.delta,i),Te.addEdges(t.edges,t.rect,i),i.x=0,i.y=0,!0}function gs(t){var i=t.x,s=t.y;this.offset.pending.x+=i,this.offset.pending.y+=s,this.offset.total.x+=i,this.offset.total.y+=s}function Wr(t,i){var s=t.page,l=t.client,c=i.x,p=i.y;s.x+=c,s.y+=p,l.x+=c,l.y+=p}Object.defineProperty(On,"__esModule",{value:!0}),On.addTotal=Oa,On.applyPending=Hi,On.default=void 0,Sr._ProxyMethods.offsetBy="";var hi={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(t){t.Interaction.prototype.offsetBy=gs},listeners:{"interactions:new":function(t){t.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(t){return Oa(t.interaction)},"interactions:before-action-start":co,"interactions:before-action-move":co,"interactions:before-action-end":function(t){var i=t.interaction;if(Hi(i))return i.move({offset:!0}),i.end(),!1},"interactions:stop":function(t){var i=t.interaction;i.offset.total.x=0,i.offset.total.y=0,i.offset.pending.x=0,i.offset.pending.y=0}}},In=hi;On.default=In;var Tr={};function Yo(t,i){for(var s=0;sp.minSpeed&&y>p.endSpeed)this.startInertia();else{if(x.result=x.setAll(this.modifierArg),!x.result.changed)return!1;this.startSmoothEnd()}return c.modification.result.rect=null,c.offsetBy(this.targetOffset),c._doPhase({interaction:c,event:l,phase:"inertiastart"}),c.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),c.modification.result.rect=null,this.active=!0,c.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,c=this.interaction.coords.velocity.client,p=Ve(this.interaction),S=p.resistance,y=-Math.log(p.endSpeed/this.v0)/S;this.targetOffset={x:(c.x-y)/S,y:(c.y-y)/S},this.te=y,this.lambda_v0=S/this.v0,this.one_ve_v0=1-p.endSpeed/this.v0;var x=this.modification,E=this.modifierArg;E.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},x.result=x.setAll(E),x.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+x.result.delta.x,y:this.targetOffset.y+x.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var c=this;this.timeout=Ir.default.request(function(){c.active&&l()})}},{key:"inertiaTick",value:function(){var l,c,p,S,y,x=this,E=this.interaction,O=Ve(E).resistance,P=(E._now()-this.t0)/1e3;if(P=0;p--){var S=c[p],y=S.selector,x=S.context,E=S.listeners;y===this.target&&x===this._context&&c.splice(p,1);for(var O=E.length-1;O>=0;O--)this._scopeEvents.removeDelegate(this.target,this._context,l,E[O][0],E[O][1])}else this._scopeEvents.remove(this.target,"all")}}])&&ji(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();vo.Interactable=ho;var Ni={};function ms(t,i){for(var s=0;st.length)&&(i=t.length);for(var s=0,l=Array(i);s=0;V--){var st=X[V];if(st.selector===O&&st.context===P){for(var it=st.listeners,tt=it.length-1;tt>=0;tt--){var ht=Ue(it[tt],2),lt=ht[0],gt=ht[1],ct=gt.capture,mt=gt.passive;if(lt===B&&ct===$.capture&&mt===$.passive){it.splice(tt,1),it.length||(X.splice(V,1),y(P,A,x),y(P,A,E,!0)),rt=!0;break}}if(rt)break}}},delegateListener:x,delegateUseCapture:E,delegatedEvents:l,documents:c,targets:s,supportsOptions:!1,supportsPassive:!1};function S(O,P,A,B){var G=Me(B),V=re.find(s,function($){return $.eventTarget===O});V||(V={eventTarget:O,events:{}},s.push(V)),V.events[P]||(V.events[P]=[]),O.addEventListener&&!re.contains(V.events[P],A)&&(O.addEventListener(P,A,p.supportsOptions?G:G.capture),V.events[P].push(A))}function y(O,P,A,B){var G=Me(B),V=re.findIndex(s,function(tt){return tt.eventTarget===O}),$=s[V];if($&&$.events)if(P!=="all"){var X=!1,rt=$.events[P];if(rt){if(A==="all"){for(var st=rt.length-1;st>=0;st--)y(O,P,rt[st],G);return}for(var it=0;it=2)continue;if(!c.interacting()&&i===c.pointerType)return c}return null}};function Fe(t,i){return t.pointers.some(function(s){return s.id===i})}var Pa=Vi;Pn.default=Pa;var $n={};function yo(t){return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},yo(t)}function ys(t,i){return function(s){if(Array.isArray(s))return s}(t)||function(s,l){var c=s==null?null:typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(c!=null){var p,S,y=[],x=!0,E=!1;try{for(c=c.call(s);!(x=(p=c.next()).done)&&(y.push(p.value),!l||y.length!==l);x=!0);}catch(O){E=!0,S=O}finally{try{x||c.return==null||c.return()}finally{if(E)throw S}}return y}}(t,i)||function(s,l){if(s){if(typeof s=="string")return So(s,l);var c=Object.prototype.toString.call(s).slice(8,-1);return c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set"?Array.from(s):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?So(s,l):void 0}}(t,i)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function So(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s=0;l--){var c=i.interactions.list[l];c.interactable===s&&(c.stop(),i.fire("interactions:destroy",{interaction:c}),c.destroy(),i.interactions.list.length>2&&i.interactions.list.splice(l,1))}}},onDocSignal:_o,doOnInteractions:Aa,methodNames:za},Dn=Ss;$n.default=Dn;var pi={};function gi(t){return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},gi(t)}function Kn(){return Kn=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(t,i,s){var l=mi(t,i);if(l){var c=Object.getOwnPropertyDescriptor(l,i);return c.get?c.get.call(arguments.length<3?t:s):c.value}},Kn.apply(this,arguments)}function mi(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=zn(t))!==null;);return t}function Ui(t,i){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,l){return s.__proto__=l,s},Ui(t,i)}function yi(t,i){if(i&&(gi(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},zn(t)}function La(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function An(t,i){for(var s=0;st.length)&&(i=t.length);for(var s=0,l=Array(i);sMath.abs(x.y),y.coords,y.rect),(0,It.default)(l,y.coords)),y.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ws(t,i,s){var l=t.startCoords,c=t.edgeSign;i?s.y=l.y+(s.x-l.x)*c.y:s.x=l.x+(s.y-l.y)*c.x}function ja(t,i,s,l){var c=t.startRect,p=t.startCoords,S=t.ratio,y=t.edgeSign;if(i){var x=l.width/S;s.y=p.y+(x-c.height)*y.y}else{var E=l.height*S;s.x=p.x+(E-c.width)*y.x}}Jn.aspectRatio=Co;var qt=(0,We.makeModifier)(Co,"aspectRatio");Jn.default=qt;var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.default=void 0;var Je=function(){};Je._defaults={};var ti=Je;Ar.default=ti;var qi={};Object.defineProperty(qi,"__esModule",{value:!0}),Object.defineProperty(qi,"default",{enumerable:!0,get:function(){return Ar.default}});var or={};function bi(t,i,s){return nt.default.func(t)?Te.resolveRectLike(t,i.interactable,i.element,[s.x,s.y,i]):Te.resolveRectLike(t,i.interactable,i.element)}Object.defineProperty(or,"__esModule",{value:!0}),or.default=void 0,or.getRestrictionRect=bi,or.restrict=void 0;var _i={start:function(t){var i=t.rect,s=t.startOffset,l=t.state,c=t.interaction,p=t.pageCoords,S=l.options,y=S.elementRect,x=(0,It.default)({left:0,top:0,right:0,bottom:0},S.offset||{});if(i&&y){var E=bi(S.restriction,c,p);if(E){var O=E.right-E.left-i.width,P=E.bottom-E.top-i.height;O<0&&(x.left+=O,x.right+=O),P<0&&(x.top+=P,x.bottom+=P)}x.left+=s.left-i.width*y.left,x.top+=s.top-i.height*y.top,x.right+=s.right-i.width*(1-y.right),x.bottom+=s.bottom-i.height*(1-y.bottom)}l.offset=x},set:function(t){var i=t.coords,s=t.interaction,l=t.state,c=l.options,p=l.offset,S=bi(c.restriction,s,i);if(S){var y=Te.xywhToTlbr(S);i.x=Math.max(Math.min(y.right-p.right,i.x),y.left+p.left),i.y=Math.max(Math.min(y.bottom-p.bottom,i.y),y.top+p.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}};or.restrict=_i;var Na=(0,We.makeModifier)(_i,"restrict");or.default=Na;var qr={};Object.defineProperty(qr,"__esModule",{value:!0}),qr.restrictEdges=qr.default=void 0;var xi={top:1/0,left:1/0,bottom:-1/0,right:-1/0},ei={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function pn(t,i){for(var s=["top","left","bottom","right"],l=0;lt.length)&&(i=t.length);for(var s=0,l=Array(i);s=0;--a)if(r(e[a],a,e))return a;return n}function Fo(e,r,n){var o=li(e,r);return o>-1?e[o]:n}function wr(e,r,n){var o=mr(e,r);return o>-1?e[o]:n}var Bo=function(){var e=zi(),r=wn&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return r?r.bind(window):function(n){var o=zi(),a=setTimeout(function(){n(o-e)},1e3/60);return a}}(),Vr=function(){var e=wn&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(r){clearTimeout(r)}}();function Rn(e){return Object.keys(e)}function Ho(e){var r=Rn(e);return r.map(function(n){return e[n]})}function Tn(e){var r=Rn(e);return r.map(function(n){return[n,e[n]]})}function ma(e,r){r===void 0&&(r=[]),e.sort(function(n,o){var a=r.indexOf(n),u=r.indexOf(o);return u===-1&&a===-1?0:a===-1?1:u===-1?-1:a-u})}function Xt(e,r){var n=si(e),o=n.value,a=n.unit;if(pr(r)){var u=r[a];if(u){if(no(u))return u(o);if(Ii[a])return Ii[a](o,u)}}else if(a==="%")return o*r/100;return Ii[a]?Ii[a](o):o}function ya(e,r,n){return Math.max(r,Math.min(e,n))}function Ir(e,r,n,o){return o===void 0&&(o=e[0]/e[1]),[[Lt(r[0],me),Lt(r[0]/o,me)],[Lt(r[1]*o,me),Lt(r[1],me)]].filter(function(a){return a.every(function(u,f){var v=r[f],h=Lt(v,me);return n?u<=v||u<=h:u>=v||u>=h})})[0]||e}function En(e,r,n,o){if(!o)return e.map(function(R,T){return ya(R,r[T],n[T])});var a=e[0],u=e[1],f=o===!0?a/u:o,v=Ir(e,r,!1,f),h=v[0],b=v[1],C=Ir(e,n,!0,f),_=C[0],w=C[1];return a_||u>w)&&(a=_,u=w),[a,u]}function ui(e){for(var r=e.length,n=0,o=r-1;o>=0;--o)n+=e[o];return n}function Ai(e){for(var r=e.length,n=0,o=r-1;o>=0;--o)n+=e[o];return r?n/r:0}function Ge(e,r){var n=r[0]-e[0],o=r[1]-e[1],a=Math.atan2(o,n);return a>=0?a:a+Math.PI*2}function Ur(e){return[0,1].map(function(r){return Ai(e.map(function(n){return n[r]}))})}function kt(e){var r=Ur(e),n=Ge(r,e[0]),o=Ge(r,e[1]);return no&&o-n<-Math.PI?1:-1}function cr(e,r){return Math.sqrt(Math.pow((r?r[0]:0)-e[0],2)+Math.pow((r?r[1]:0)-e[1],2))}function Lt(e,r){if(!r)return e;var n=1/r;return Math.round(e/r)/n}function jo(e,r){return e.forEach(function(n,o){e[o]=Lt(e[o],r)}),e}function il(e){for(var r=[],n=0;n-1&&u.splice(f,1)}}return this},r.once=function(n,o){var a=this;return o&&this._addEvent(n,o,{once:!0}),new Promise(function(u){a._addEvent(n,u,{once:!0})})},r.emit=function(n,o){var a=this;o===void 0&&(o={});var u=this._events[n];if(!n||!u)return!0;var f=!1;return o.eventType=n,o.stop=function(){f=!0},o.currentTarget=this,On(u).forEach(function(v){v.listener(o),v.once&&a.off(n,v.listener)}),!f},r.trigger=function(n,o){return o===void 0&&(o={}),this.emit(n,o)},r._addEvent=function(n,o,a){var u=this._events;u[n]=u[n]||[];var f=u[n];f.push(Xo({listener:o},a))},e}(),co=Oa;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Hi=function(e,r){return Hi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},Hi(e,r)};function gs(e,r){Hi(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Wr=function(){return Wr=Object.assign||function(r){for(var n,o=1,a=arguments.length;of-h?(_[1]>C.top||f<_[1])&&(w[1]=-1):C.top+C.height_[1])&&(w[1]=1),C.left>u-h?(_[0]>C.left||u<_[0])&&(w[0]=-1):C.left+C.width_[0])&&(w[0]=1),!w[0]&&!w[1]?!1:this._continueDrag(Wr(Wr({},a),{direction:w,inputEvent:o,isDrag:!0}))}},n.checkScroll=function(o){var a=this;if(this._isWait)return!1;var u=o.prevScrollPos,f=u===void 0?this._prevScrollPos:u,v=o.direction,h=o.throttleTime,b=h===void 0?0:h,C=o.inputEvent,_=o.isDrag,w=this._getScrollPosition(v||[0,0],o),R=w[0]-f[0],T=w[1]-f[1],M=v||[R?Math.abs(R)/R:0,T?Math.abs(T)/T:0];return this._prevScrollPos=w,this._lock=!1,!R&&!T?!1:(this.emit("move",{offsetX:M[0]?R:0,offsetY:M[1]?T:0,inputEvent:C}),b&&_&&(clearTimeout(this._timer),this._timer=window.setTimeout(function(){a._continueDrag(o)},b)),!0)},n.dragEnd=function(){this._flag=!1,this._lock=!1,clearTimeout(this._timer),this._unregisterScrollEvent()},n._getScrollPosition=function(o,a){var u=a.container,f=a.getScrollPosition,v=f===void 0?hi:f;return v({container:Tr(u),direction:o})},n._continueDrag=function(o){var a=this,u,f=o.container,v=o.direction,h=o.throttleTime,b=o.useScroll,C=o.isDrag,_=o.inputEvent;if(!(!this._flag||C&&this._isWait)){var w=zi(),R=Math.max(h+this._prevTime-w,0);if(R>0)return clearTimeout(this._timer),this._timer=window.setTimeout(function(){a._continueDrag(o)},R),!1;this._prevTime=w;var T=this._getScrollPosition(v,o);this._prevScrollPos=T,C&&(this._isWait=!0),b||(this._lock=!0);var M={container:Tr(f),direction:v,inputEvent:_};return(u=o.requestScroll)===null||u===void 0||u.call(o,M),this.emit("scroll",M),this._isWait=!1,b||this.checkScroll(Wr(Wr({},o),{prevScrollPos:T,direction:v,inputEvent:_}))}},n._registerScrollEvent=function(o){this._unregisterScrollEvent();var a=o.checkScrollEvent;if(!!a){var u=a===!0?In:a,f=Tr(o.container);a===!0&&(f===document.body||f===document.documentElement)?this._unregister=In(window,this._onScroll):this._unregister=u(f,this._onScroll)}},n._unregisterScrollEvent=function(){var o;(o=this._unregister)===null||o===void 0||o.call(this),this._unregister=null},r}(co),Pe=Yo;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function Xr(){for(var e=0,r=0,n=arguments.length;ro))if(I==="intersection")++w;else{if(I==="line")return;if(I==="point"){var z=wr(D,function(H){return H[1]!==a}),W=R[M[0]],k=z[1]>a?1:-1;W?W!==k&&++w:R[M[0]]=k}}}),w%2==1}function fo(e,r){var n=e[0],o=e[1],a=e[2];return(n*r[0]+o*r[1]+a)/(n*n+o*o)}function Dr(e,r){var n=e[0],o=e[1],a=r[0],u=r[1],f=a-n,v=u-o;Math.abs(f)0)return[];o=[[b,f],[C,f]]}}else{var v=Math.max.apply(Math,n.map(function(_){return _[1][0]})),h=Math.min.apply(Math,n.map(function(_){return _[1][1]}));if(Ve(v-h)>0)return[];o=[[u,v],[u,h]]}}return o.length||(o=e.filter(function(_){var w=_[0],R=_[1];return n.every(function(T){return 0<=Ve(w-T[0][0])&&0<=Ve(T[0][1]-w)&&0<=Ve(R-T[1][0])&&0<=Ve(T[1][1]-R)})})),o.map(function(_){return[Ve(_[0]),Ve(_[1])]})}function zr(e){return Xr(e.slice(1),[e[0]]).map(function(r,n){return[e[n],r]})}function ho(e,r){var n=e.slice(),o=r.slice();kt(n)===-1&&n.reverse(),kt(o)===-1&&o.reverse();var a=zr(n),u=zr(o),f=a.map(function(C){return Dr(C[0],C[1])}),v=u.map(function(C){return Dr(C[0],C[1])}),h=[];f.forEach(function(C,_){var w=a[_],R=[];v.forEach(function(T,M){var I=Yr(C,T),D=ji(I,[w,u[M]]);R.push.apply(R,D.map(function(z){return{index1:_,index2:M,pos:z,type:"intersection"}}))}),R.sort(function(T,M){return cr(w[0],T.pos)-cr(w[0],M.pos)}),h.push.apply(h,R),vn(w[1],o)&&h.push({index1:_,index2:-1,pos:w[1],type:"inside"})}),u.forEach(function(C,_){if(!!vn(C[1],n)){var w=!1,R=mr(h,function(T){var M=T.index2;return M===_?(w=!0,!1):!!w});R===-1&&(w=!1,R=mr(h,function(T){var M=T.index1,I=T.index2;return M===-1&&I+1===_?(w=!0,!1):!!w})),R===-1?h.push({index1:-1,index2:_,pos:C[1],type:"inside"}):h.splice(R,0,{index1:-1,index2:_,pos:C[1],type:"inside"})}});var b={};return h.filter(function(C){var _=C.pos,w=_[0]+"x"+_[1];return b[w]?!1:(b[w]=!0,!0)})}function Ni(e,r){var n=ho(e,r);return n.map(function(o){var a=o.pos;return a})}function ms(e){var r=e[0],n=r.index1,o=r.index2,a=e[1],u=a.index1,f=a.index2;return n!==-1&&(n===u||n+1===u)||o!==-1&&(o===f||o+1===f)}function Zo(e,r){var n=ho(e,r),o=[],a;return ho(e,r).forEach(function(u,f,v){f===0||!ms([v[f-1],u])?(a=[u],o.push(a)):a.push(u)}),o.map(function(u){return u.map(function(f){var v=f.pos;return v})})}function po(e,r,n,o){n===void 0&&(n=0),o===void 0&&(o=[]);for(var a=o.length===0,u=e.length,f=e[n]?n:0,v=Xr(e.slice(f),e.slice(0,f)),h=function(_){var w=v[_];if(find(r,function(D){return D[0]===w[0]&&D[1]===w[1]}))return"continue";if(o.some(function(D){return find(D,function(z){return z[0]===w[0]&&z[1]===w[1]})}))return a?"continue":"break";var R=void 0;a?(R=[],o.push(R)):R=o[o.length-1],R.push(w);var T=[w,e[n+1]||e[0]],M=r.filter(function(D){return vo(D,T)}).sort(function(D,z){return getDist(w,D)-getDist(w,z)})[0];if(M){var I=r.indexOf(M);if(po(r,e,I,o),!a)return"break"}else return po(v,r,_+1,o),"break"},b=0;b=0?a:a+Math.PI*2}function Pn(e){return Vs([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function Vi(e){return e.touches&&e.touches.length>=2}function Fe(e){return e?e.touches?ys(e.touches):[So(e)]:[]}function Pa(e){return e&&(e.type.indexOf("mouse")>-1||"button"in e)}function $n(e,r,n){var o=n.length,a=bo(e,o),u=a.clientX,f=a.clientY,v=a.originalClientX,h=a.originalClientY,b=bo(r,o),C=b.clientX,_=b.clientY,w=bo(n,o),R=w.clientX,T=w.clientY,M=u-C,I=f-_,D=u-R,z=f-T;return{clientX:v,clientY:h,deltaX:M,deltaY:I,distX:D,distY:z}}function yo(e){return Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2))}function ys(e){for(var r=Math.min(e.length,2),n=[],o=0;o=-1;if(!(a.flag&&R)){a._isDragAPI=!0;var T=a.options,M=T.container,I=T.pinchOutside,D=T.preventWheelClick,z=T.preventRightClick,W=T.preventDefault,k=T.checkInput,H=T.dragFocusedInput,L=T.preventClickEventOnDragStart,F=T.preventClickEventOnDrag,U=T.preventClickEventByCondition,j=a.isTouch,q=!a.flag;if(a._isSecondaryButton=_.which===3||_.button===2,D&&(_.which===2||_.button===1)||z&&(_.which===3||_.button===2))return a.stop(),!1;if(q){var Y=document.activeElement,K=_.target;if(K){var J=K.tagName.toLowerCase(),ot=Jo.indexOf(J)>-1,ut=K.isContentEditable;if(ot||ut){if(k||!H&&Y===K)return!1;if(Y&&(Y===K||ut&&Y.isContentEditable&&Y.contains(K)))if(H)K.blur();else return!1}else if((W||_.type==="touchstart")&&Y){var vt=Y.tagName.toLowerCase();(Y.isContentEditable||Jo.indexOf(vt)>-1)&&Y.blur()}(L||F||U)&&yr(window,"click",a._onClick,!0)}a.clientStores=[new Da(Fe(_))],a._isIdle=!1,a.flag=!0,a.isDrag=!1,a._isTrusted=w,a._dragFlag=!0,a._prevInputEvent=_,a.data={},a.doubleFlag=zi()-a.prevTime<200,a._isMouseEvent=Pa(_),!a._isMouseEvent&&a._preventMouseEvent&&(a._preventMouseEvent=!1);var St=a._preventMouseEvent||a.emit("dragStart",Me(Me({data:a.data,datas:a.data,inputEvent:_,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,isTrusted:w,isDouble:a.doubleFlag},a.getCurrentStore().getPosition()),{preventDefault:function(){_.preventDefault()},preventDrag:function(){a._dragFlag=!1}}));St===!1&&a.stop(),a._isMouseEvent&&a.flag&&W&&_.preventDefault()}if(!a.flag)return!1;var dt=0;if(q?(a._attchDragEvent(),j&&I&&(dt=setTimeout(function(){yr(M,"touchstart",a.onDragStart,{passive:!1})}))):j&&I&&fr(M,"touchstart",a.onDragStart),a.flag&&Vi(_)){if(clearTimeout(dt),q&&_.touches.length!==_.changedTouches.length)return;a.pinchFlag||a.onPinchStart(_)}}}},a.onDrag=function(_,w){if(!!a.flag){var R=a.options.preventDefault;!a._isMouseEvent&&R&&_.preventDefault(),a._prevInputEvent=_;var T=Fe(_),M=a.moveClients(T,_,!1);if(a._dragFlag){if(a.pinchFlag||M.deltaX||M.deltaY){var I=a._preventMouseEvent||a.emit("drag",Me(Me({},M),{isScroll:!!w,inputEvent:_}));if(I===!1){a.stop();return}}a.pinchFlag&&a.onPinch(_,T)}a.getCurrentStore().getPosition(T,!0)}},a.onDragEnd=function(_){if(!!a.flag){var w=a.options,R=w.pinchOutside,T=w.container,M=w.preventClickEventOnDrag,I=w.preventClickEventOnDragStart,D=w.preventClickEventByCondition,z=a.isDrag;(M||I||D)&&requestAnimationFrame(function(){a._allowClickEvent()}),!D&&!I&&M&&!z&&a._allowClickEvent(),a.isTouch&&R&&fr(T,"touchstart",a.onDragStart),a.pinchFlag&&a.onPinchEnd(_);var W=(_==null?void 0:_.touches)?Fe(_):[],k=W.length;k===0||!a.options.keepDragging?a.flag=!1:a._addStore(new Da(W));var H=a._getPosition(),L=zi(),F=!z&&a.doubleFlag;a._prevInputEvent=null,a.prevTime=z||F?0:L,a.flag||(a._dettachDragEvent(),a._preventMouseEvent||a.emit("dragEnd",Me({data:a.data,datas:a.data,isDouble:F,isDrag:z,isClick:!z,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,inputEvent:_,isTrusted:a._isTrusted},H)),a.clientStores=[],a._isMouseEvent||(a._preventMouseEvent=!0,requestAnimationFrame(function(){requestAnimationFrame(function(){a._preventMouseEvent=!1})})),a._isIdle=!0)}},a.onBlur=function(){a.onDragEnd()},a._allowClickEvent=function(){fr(window,"click",a._onClick,!0)},a._onClick=function(_){a._allowClickEvent(),a._preventMouseEvent=!1;var w=a.options.preventClickEventByCondition;(w==null?void 0:w(_))||(_.stopPropagation(),_.preventDefault())},a._onContextMenu=function(_){var w=a.options;w.preventRightClick?a.onDragEnd(_):_.preventDefault()},a._passCallback=function(){};var u=[].concat(n);a.options=Me({checkInput:!1,container:u.length>1?window:u[0],preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},o);var f=a.options,v=f.container,h=f.events,b=f.checkWindowBlur;if(a.isTouch=h.indexOf("touch")>-1,a.isMouse=h.indexOf("mouse")>-1,a.targets=u,a.isMouse&&(u.forEach(function(_){yr(_,"mousedown",a.onDragStart),yr(_,"mousemove",a._passCallback)}),yr(v,"contextmenu",a._onContextMenu)),b&&yr(window,"blur",a.onBlur),a.isTouch){var C={passive:!1};u.forEach(function(_){yr(_,"touchstart",a.onDragStart,C),yr(_,"touchmove",a._passCallback,C)})}return a}return r.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},r.prototype.getMovement=function(n){return this.getCurrentStore().getMovement(n)+this.clientStores.slice(1).reduce(function(o,a){return o+a.movement},0)},r.prototype.isDragging=function(){return this.isDrag},r.prototype.isIdle=function(){return this._isIdle},r.prototype.isFlag=function(){return this.flag},r.prototype.isPinchFlag=function(){return this.pinchFlag},r.prototype.isDoubleFlag=function(){return this.doubleFlag},r.prototype.isPinching=function(){return this.isPinch},r.prototype.scrollBy=function(n,o,a,u){u===void 0&&(u=!0),!!this.flag&&(this.clientStores[0].move(n,o),u&&this.onDrag(a,!0))},r.prototype.move=function(n,o){var a=n[0],u=n[1],f=this.getCurrentStore(),v=f.prevClients;return this.moveClients(v.map(function(h){var b=h.clientX,C=h.clientY;return{clientX:b+a,clientY:C+u,originalClientX:b,originalClientY:C}}),o,!0)},r.prototype.triggerDragStart=function(n){this.onDragStart(n,!1)},r.prototype.setEventData=function(n){var o=this.data;for(var a in n)o[a]=n[a];return this},r.prototype.setEventDatas=function(n){return this.setEventData(n)},r.prototype.getCurrentEvent=function(n){return n===void 0&&(n=this._prevInputEvent),Me(Me({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:n})},r.prototype.getEventData=function(){return this.data},r.prototype.getEventDatas=function(){return this.data},r.prototype.unset=function(){var n=this,o=this.targets,a=this.options.container;this.off(),fr(window,"blur",this.onBlur),this.isMouse&&(o.forEach(function(u){fr(u,"mousedown",n.onDragStart)}),fr(a,"contextmenu",this._onContextMenu)),this.isTouch&&(o.forEach(function(u){fr(u,"touchstart",n.onDragStart)}),fr(a,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},r.prototype.onPinchStart=function(n){var o=this,a=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>a)){var u=new Da(Fe(n));this.pinchFlag=!0,this._addStore(u);var f=this.emit("pinchStart",Me(Me({data:this.data,datas:this.data,angle:u.getAngle(),touches:this.getCurrentStore().getPositions()},u.getPosition()),{inputEvent:n,isTrusted:this._isTrusted,preventDefault:function(){n.preventDefault()},preventDrag:function(){o._dragFlag=!1}}));f===!1&&(this.pinchFlag=!1)}},r.prototype.onPinch=function(n,o){if(!(!this.flag||!this.pinchFlag||o.length<2)){var a=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",Me(Me({data:this.data,datas:this.data,movement:this.getMovement(o),angle:a.getAngle(o),rotation:a.getRotation(o),touches:a.getPositions(o),scale:a.getScale(o),distance:a.getDistance(o)},a.getPosition(o)),{inputEvent:n,isTrusted:this._isTrusted}))}},r.prototype.onPinchEnd=function(n){if(!!this.pinchFlag){var o=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var a=this.getCurrentStore();this.emit("pinchEnd",Me(Me({data:this.data,datas:this.data,isPinch:o,touches:a.getPositions()},a.getPosition()),{inputEvent:n}))}},r.prototype.getCurrentStore=function(){return this.clientStores[0]},r.prototype.moveClients=function(n,o,a){var u=this._getPosition(n,a),f=this.isDrag;(u.deltaX||u.deltaY)&&(this.isDrag=!0);var v=!1;return!f&&this.isDrag&&(v=!0),Me(Me({data:this.data,datas:this.data},u),{movement:this.getMovement(n),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:o,isTrusted:this._isTrusted,isFirstDrag:v})},r.prototype._addStore=function(n){this.clientStores.splice(0,0,n)},r.prototype._getPosition=function(n,o){var a=this.getCurrentStore(),u=a.getPosition(n,o),f=this.clientStores.slice(1).reduce(function(b,C){var _=C.getPosition();return b.distX+=_.distX,b.distY+=_.distY,b},u),v=f.distX,h=f.distY;return Me(Me({},u),{distX:v,distY:h})},r.prototype._attchDragEvent=function(){var n=this.options.container,o={passive:!1};this._isDragAPI&&(yr(n,"dragover",this.onDrag),yr(n,"dragend",this.onDragEnd)),this.isMouse&&(yr(n,"mousemove",this.onDrag),yr(n,"mouseup",this.onDragEnd)),this.isTouch&&(yr(n,"touchmove",this.onDrag,o),yr(n,"touchend",this.onDragEnd,o),yr(n,"touchcancel",this.onDragEnd,o))},r.prototype._dettachDragEvent=function(){var n=this.options.container;this._isDragAPI&&(fr(n,"dragover",this.onDrag),fr(n,"dragend",this.onDragEnd)),this.isMouse&&(fr(n,"mousemove",this.onDrag),fr(n,"mouseup",this.onDragEnd)),this.isTouch&&(fr(n,"touchstart",this.onDragStart),fr(n,"touchmove",this.onDrag),fr(n,"touchend",this.onDragEnd),fr(n,"touchcancel",this.onDragEnd))},r}(co);function ta(e){for(var r=5381,n=e.length;n;)r=r*33^e.charCodeAt(--n);return r>>>0}var za=ta;function Aa(e){return za(e).toString(36)}function ka(e){if(e&&e.getRootNode){var r=e.getRootNode();if(r.nodeType===11)return r}}function _o(e,r,n){return n.original?r:r.replace(/([^};{\s}][^};{]*|^\s*){/mg,function(o,a){var u=a.trim();return(u?Gr(u):[""]).map(function(f){var v=f.trim();return v.indexOf("@")===0?v:v.indexOf(":global")>-1?v.replace(/\:global/g,""):v.indexOf(":host")>-1?"".concat(v.replace(/\:host/g,".".concat(e))):v?".".concat(e," ").concat(v):".".concat(e)}).join(", ")+" {"})}function Ss(e,r,n,o){var a=document.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",e),a.setAttribute("data-styled-count","1"),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=_o(e,r,n),(o||document.head||document.body).appendChild(a),a}function Dn(e){var r="rCS"+Aa(e);return{className:r,inject:function(n,o){o===void 0&&(o={});var a=ka(n),u=(a||document).querySelector('style[data-styled-id="'.concat(r,'"]'));if(!u)u=Ss(r,e,o,a);else{var f=parseFloat(u.getAttribute("data-styled-count"))||0;u.setAttribute("data-styled-count","".concat(f+1))}return{destroy:function(){var v,h=parseFloat(u.getAttribute("data-styled-count"))||0;h<=1?(u.remove?u.remove():(v=u.parentNode)===null||v===void 0||v.removeChild(u),u=null):u.setAttribute("data-styled-count","".concat(h-1))}}}}}var pi=Dn,gi=function(e,r){return gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},gi(e,r)};function Kn(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");gi(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var mi=function(){return mi=Object.assign||function(r){for(var n,o=1,a=arguments.length;o-1&&v&&(_={portalContainer:v}),(0,Ue.createElement)(C,mi(mi({ref:(0,Ze.iH)(this,"element"),"data-styled-id":b,className:"".concat(u," ").concat(b)},_),h))},n.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},n.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},n.getElement=function(){return this.element},r}(Ue.Component);function zn(e,r){var n=cssStyled(r);return function(o){Kn(a,o);function a(){var u=o!==null&&o.apply(this,arguments)||this;return u.injector=n,u.tag=e,u}return a}(yi)}function La(e,r){var n=pi(r),o=n.className;return(0,Ue.forwardRef)(function(a,u){var f=a.className,v=f===void 0?"":f,h=a.cspNonce,b=Ui(a,["className","cspNonce"]),C=(0,Ue.useRef)();return(0,Ue.useImperativeHandle)(u,function(){return C.current},[]),(0,Ue.useEffect)(function(){var _=n.inject(C.current,{nonce:a.cspNonce});return function(){_.destroy()}},[]),(0,Ue.createElement)(e,mi({ref:C,"data-styled-id":o,className:"".concat(v," ").concat(o)},b))})}var An=null,kn=function(e,r){return kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},kn(e,r)};function de(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");kn(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var N=function(){return N=Object.assign||function(r){for(var n,o=1,a=arguments.length;o=0;v--)(f=e[v])&&(u=(a<3?f(u):a>3?f(r,n,u):f(r,n))||u);return a>3&&u&&Object.defineProperty(r,n,u),u}function bt(e,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,u;o')}function Yi(e){var r=Ln(1,e),n=Math.round(e/45)*45%180,o="ns-resize";return n===135?o="nwse-resize":n===45?o="nesw-resize":n===90&&(o="ew-resize"),"cursor:".concat(o,";cursor: url('").concat(r,"') 16 16, ").concat(o,";")}var hn=Tt(),xo=hn.browser.webkit,wo=xo&&function(){var e=typeof window=="undefined"?{userAgent:""}:window.navigator,r=/applewebkit\/([^\s]+)/g.exec(e.userAgent.toLowerCase());return r?parseFloat(r[1])<605:!1}(),Qn=hn.browser.name,Si=parseInt(hn.browser.version,10),bs=Qn==="chrome",_s=hn.browser.chromium,Jn=parseInt(hn.browser.chromiumVersion,10)||0,Ba=bs&&Si>=109||_s&&Jn>=109,Ha=Qn==="firefox",xs=parseInt(hn.browser.webkitVersion,10)>=612||Si>=15,Co="moveable-",ws=Xi.map(function(e){var r="",n="",o="center",a="center",u="calc(var(--moveable-control-padding, 20) * -1px)";return e.indexOf("n")>-1&&(r="top: ".concat(u,";"),a="bottom"),e.indexOf("s")>-1&&(r="top: 0px;",a="top"),e.indexOf("w")>-1&&(n="left: ".concat(u,";"),o="right"),e.indexOf("e")>-1&&(n="left: 0px;",o="left"),'.around-control[data-direction*="'.concat(e,`"] { `).concat(n).concat(r,` transform-origin: `).concat(o," ").concat(a,`; }`)}).join(` `),ja=` { position: absolute; width: 1px; height: 1px; left: 0; top: 0; z-index: 3000; --moveable-color: #4af; --zoom: 1; --zoompx: 1px; --moveable-line-padding: 0; --moveable-control-padding: 0; will-change: transform; outline: 1px solid transparent; } .control-box { z-index: 0; } .line, .control { position: absolute; left: 0; top: 0; will-change: transform; } .control { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; background: #4af; background: var(--moveable-color); margin-top: -7px; margin-left: -7px; border: 2px solid #fff; z-index: 10; } .around-control { position: absolute; will-change: transform; width: calc(var(--moveable-control-padding, 20) * 1px); height: calc(var(--moveable-control-padding, 20) * 1px); left: calc(var(--moveable-control-padding, 20) * -0.5px); top: calc(var(--moveable-control-padding, 20) * -0.5px); box-sizing: border-box; background: transparent; z-index: 8; cursor: alias; transform-origin: center center; } `.concat(ws,` .padding { position: absolute; top: 0px; left: 0px; width: 100px; height: 100px; transform-origin: 0 0; } .line { width: 1px; height: 1px; background: #4af; background: var(--moveable-color); transform-origin: 0px 50%; } .line.edge { z-index: 1; background: transparent; } .line.dashed { box-sizing: border-box; background: transparent; } .line.dashed.horizontal { border-top: 1px dashed #4af; border-top-color: #4af; border-top-color: var(--moveable-color); } .line.dashed.vertical { border-left: 1px dashed #4af; border-left-color: #4af; border-left-color: var(--moveable-color); } .line.vertical { transform: translateX(-50%); } .line.horizontal { transform: translateY(-50%); } .line.vertical.bold { width: 2px; } .line.horizontal.bold { height: 2px; } .control.origin { border-color: #f55; background: #fff; width: 12px; height: 12px; margin-top: -6px; margin-left: -6px; pointer-events: none; } `).concat([0,15,30,45,60,75,90,105,120,135,150,165].map(function(e){return` .direction[data-rotation="`.concat(e,'"], :global .view-control-rotation').concat(e,` { `).concat(Yi(e),` } `)}).join(` `),` .line.direction:before { content: ""; position: absolute; width: 100%; height: calc(var(--moveable-line-padding, 0) * 1px); bottom: 0; left: 0; } .group { z-index: -1; } .area { position: absolute; } .area-pieces { position: absolute; top: 0; left: 0; display: none; } .area.avoid, .area.pass { pointer-events: none; } .area.avoid+.area-pieces { display: block; } .area-piece { position: absolute; } `).concat(wo?`:global svg *:before { content:""; transform-origin: inherit; }`:"",` `),qt=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Ar=1e-4,Je=1e-7,ti=1e-9,qi=Math.pow(10,10),or=-qi,bi={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},_i={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},Na={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},qr=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag"];function xi(e,r,n,o,a,u){var f,v;u===void 0&&(u="draggable");var h=(v=(f=r.gestos[u])===null||f===void 0?void 0:f.move(n,e.inputEvent))!==null&&v!==void 0?v:{},b=h.originalDatas||h.datas,C=b[u]||(b[u]={});return N(N({},a?fe(r,h):h),{isPinch:!!o,parentEvent:!0,datas:C,originalDatas:e.originalDatas})}var ei=function(){function e(n){var o;n===void 0&&(n="draggable"),this.ableName=n,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=(o={},o[n]={},o)}var r=e.prototype;return r.dragStart=function(n,o){this.isDrag=!1,this.isFlag=!1;var a=o.originalDatas;return this.datas=a,a[this.ableName]||(a[this.ableName]={}),N(N({},this.move(n,o.inputEvent)),{type:"dragstart"})},r.drag=function(n,o){return this.move([n[0]-this.prevX,n[1]-this.prevY],o)},r.move=function(n,o){var a,u,f=!1;if(!this.isFlag)this.prevX=n[0],this.prevY=n[1],this.startX=n[0],this.startY=n[1],a=n[0],u=n[1],this.isFlag=!0;else{var v=this.isDrag;a=this.prevX+n[0],u=this.prevY+n[1],(n[0]||n[1])&&(this.isDrag=!0),!v&&this.isDrag&&(f=!0)}return this.prevX=a,this.prevY=u,{type:"drag",clientX:a,clientY:u,inputEvent:o,isFirstDrag:f,isDrag:this.isDrag,distX:a-this.startX,distY:u-this.startY,deltaX:n[0],deltaY:n[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function pn(e,r){var n=r.clientX,o=r.clientY,a=r.datas,u=e.state,f=u.moveableClientRect,v=u.rootMatrix,h=u.is3d,b=u.pos1,C=f.left,_=f.top,w=h?4:3,R=Et(ze(v,[n-C,o-_],w),b),T=R[0],M=R[1],I=Kr({datas:a,distX:T,distY:M}),D=I[0],z=I[1];return[D,z]}function $r(e,r){var n=r.datas,o=e.state,a=o.allMatrix,u=o.beforeMatrix,f=o.is3d,v=o.left,h=o.top,b=o.origin,C=o.offsetMatrix,_=o.targetMatrix,w=o.transformOrigin,R=f?4:3;n.is3d=f,n.matrix=a,n.targetMatrix=_,n.beforeMatrix=u,n.offsetMatrix=C,n.transformOrigin=w,n.inverseMatrix=Rr(a,R),n.inverseBeforeMatrix=Rr(u,R),n.absoluteOrigin=Pr(Yt([v,h],b),R),n.startDragBeforeDist=Qe(n.inverseBeforeMatrix,n.absoluteOrigin,R),n.startDragDist=Qe(n.inverseMatrix,n.absoluteOrigin,R)}function Cs(e){return p(e.datas.beforeTransform,[50,50],100,100).direction}function gn(e,r){var n=e.datas,o=e.originalDatas.beforeRenderable,a=n.transformIndex,u=o.nextTransforms,f=u.length,v=o.nextTransformAppendedIndexes,h=-1;a===-1?(r==="translate"?h=0:r==="rotate"&&(h=mr(u,function(w){return w.match(/scale\(/g)})),h===-1&&(h=u.length),n.transformIndex=h):wr(v,function(w){return w.index===a&&w.functionName===r})?h=a:h=a+v.filter(function(w){return w.indexh&&(n.isAppendTransform=!0,o.nextTransformAppendedIndexes=bt(bt([],v,!0),[{functionName:r,index:h,isAppend:!0}],!1))}function Ro(e,r,n){return"".concat(e.beforeFunctionTexts.join(" ")," ").concat(e.isAppendTransform?n:r," ").concat(e.afterFunctionTexts.join(" "))}function Va(e){var r=e.datas,n=e.distX,o=e.distY,a=mn({datas:r,distX:n,distY:o}),u=a[0],f=a[1],v=ea(r,Fs([u,f],4));return Qe(v,Pr([0,0,0],4),4)}function ea(e,r,n){var o=e.beforeTransform,a=e.afterTransform,u=e.beforeTransform2,f=e.afterTransform2,v=e.targetAllTransform,h=n?ce(v,r,4):ce(r,v,4),b=ce(Rr(n?u:o,4),h,4),C=ce(b,Rr(n?f:a,4),4);return C}function mn(e){var r=e.datas,n=e.distX,o=e.distY,a=r.inverseBeforeMatrix,u=r.is3d,f=r.startDragBeforeDist,v=r.absoluteOrigin,h=u?4:3;return Et(Qe(a,Yt(v,[n,o]),h),f)}function Kr(e,r){var n=e.datas,o=e.distX,a=e.distY,u=n.inverseBeforeMatrix,f=n.inverseMatrix,v=n.is3d,h=n.startDragBeforeDist,b=n.startDragDist,C=n.absoluteOrigin,_=v?4:3;return Et(Qe(r?u:f,Yt(C,[o,a]),_),r?h:b)}function Rs(e,r){var n=e.datas,o=e.distX,a=e.distY,u=n.beforeMatrix,f=n.matrix,v=n.is3d,h=n.startDragBeforeDist,b=n.startDragDist,C=n.absoluteOrigin,_=v?4:3;return Et(Qe(r?u:f,Yt(r?h:b,[o,a]),_),C)}function Ua(e,r,n,o,a,u){return o===void 0&&(o=r),a===void 0&&(a=n),u===void 0&&(u=[0,0]),e?e.map(function(f,v){var h=si(f),b=h.value,C=h.unit,_=v?a:o,w=v?n:r;if(f==="%"||isNaN(b)){var R=_?u[v]/_:0;return w*R}else if(C!=="%")return b;return w*b/100}):u}function Xa(e){var r=[];return e[1]>=0&&(e[0]>=0&&r.push(3),e[0]<=0&&r.push(2)),e[1]<=0&&(e[0]>=0&&r.push(1),e[0]<=0&&r.push(0)),r}function ra(e,r){return Xa(r).map(function(n){return e[n]})}function pe(e,r){var n=(r[0]+1)/2,o=(r[1]+1)/2,a=[re(e[0][0],e[1][0],n,1-n),re(e[0][1],e[1][1],n,1-n)],u=[re(e[2][0],e[3][0],n,1-n),re(e[2][1],e[3][1],n,1-n)];return[re(a[0],u[0],o,1-o),re(a[1],u[1],o,1-o)]}function na(e,r,n,o,a,u){var f=t(r,n,o,a),v=pe(f,u),h=e[0]-v[0],b=e[1]-v[1];return[h,b]}function ri(e,r,n,o){return ce(e,eo(r,o,n),o)}function yn(e,r,n){var o=e.transformOrigin,a=e.offsetMatrix,u=e.is3d,f=u?4:3,v;if(Le(n)){var h=r.beforeTransform,b=r.afterTransform;v=un(ce(ce(h,Mn([n]),4),b,4),4,f)}else v=n;return ri(a,v,o,f)}function ia(e,r){var n=e.transformOrigin,o=e.offsetMatrix,a=e.is3d,u=e.targetMatrix,f=e.targetAllTransform,v=a?4:3;return ri(o,ce(f||u,We(r,v),v),n,v)}function $i(e){var r=Gn(e);return{setTransform:function(n,o){o===void 0&&(o=-1),r.startTransforms=le(n)?n:gr(n),Sn(e,o)},setTransformIndex:function(n){Sn(e,n)}}}function Ki(e,r){var n=Gn(e),o=n.startTransforms;Sn(e,mr(o,function(a){return a.indexOf("".concat(r,"("))===0}))}function Sn(e,r){var n=Gn(e),o=e.datas;if(o.transformIndex=r,r!==-1){var a=n.startTransforms[r];if(!!a){var u=ee([a]);o.startValue=u[0].functionValue}}}function wi(e,r){var n=Gn(e);n.nextTransforms=gr(r)}function Gn(e){return e.originalDatas.beforeRenderable}function Zi(e){var r=e.originalDatas.beforeRenderable;return r.nextTransforms}function Wn(e){return(Zi(e)||[]).join(" ")}function Zr(e){return Gn(e).nextStyle}function qe(e,r,n,o,a){wi(a,r);var u=jr.drag(e,xi(a,e.state,n,o,!1)),f=u?u.transform:r;return N(N({transform:r,drag:u},lt({transform:f},a)),{afterTransform:f})}function Fn(e,r,n,o,a){var u=yn(e.state,a,r),f=oa(e,n,o,u);return f}function ni(e,r,n,o,a,u){var f=Fn(e,r,n,a,u),v=e.state,h=v.left,b=v.top,C=e.props.groupable,_=C?h:0,w=C?b:0,R=Et(o,f);return Et(R,[_,w])}function Qi(e,r,n,o,a,u){var f=ni(e,"scale(".concat(r.join(", "),")"),n,o,a,u);return f}function br(e,r,n){return[r?-1+e[0]/(r/2):0,n?-1+e[1]/(n/2):0]}function oa(e,r,n,o){o===void 0&&(o=e.state.allMatrix);var a=e.state,u=a.width,f=a.height,v=a.is3d,h=v?4:3,b=[u/2*(1+r[0])+n[0],f/2*(1+r[1])+n[1]];return d(o,b,h)}function Qr(e,r,n){var o=n.fixedDirection,a=n.fixedPosition,u=n.fixedOffset;return ni(e,"rotate(".concat(r,"deg)"),o,a,u,n)}function bn(e,r,n,o,a,u){var f=e.props.groupable,v=e.state,h=v.transformOrigin,b=v.offsetMatrix,C=v.is3d,_=v.width,w=v.height,R=v.left,T=v.top,M=u.fixedDirection,I=u.nextTargetMatrix||v.targetMatrix,D=C?4:3,z=Ua(a,r,n,_,w,h),W=f?R:0,k=f?T:0,H=ri(b,I,z,D),L=na(o,H,r,n,D,M);return Et(L,[W,k])}function Ji(e,r){return pe(tt(e.state),r)}function to(e,r){var n=e.targetGesto,o=e.controlGesto,a;return(n==null?void 0:n.isFlag())&&(a=n.getEventData()[r]),!a&&(o==null?void 0:o.isFlag())&&(a=o.getEventData()[r]),a||{}}function To(e){if(e&&e.getRootNode){var r=e.getRootNode();if(r.nodeType===11)return r}}function Ya(e,r,n){for(var o=e,a=[],u=document.documentElement||document.body,f=!n&&e===r||e===u,v=f,h=!1,b=3,C,_,w,R=!1,T=Jr(r,r,!0).offsetParent,M=1;o&&!v;){v=f;var I=sr(o),D=I("position"),z=I("scale"),W=Ka(o),k=D==="fixed",H=Gi(Mo(W)),L=void 0,F=!1,U=!1,j=0,q=0,Y=0,K=0,J={hasTransform:!1,fixedContainer:null};k&&(R=!0,J=kr(o),T=J.fixedContainer);var ot=H.length;!h&&ot===16&&(h=!0,b=4,aa(a),w&&(w=un(w,3,4))),h&&ot===9&&(H=un(H,3,4));var ut=Za(o,e),vt=ut.tagName,St=ut.hasOffset,dt=ut.isSVG,ft=ut.origin,at=ut.targetOrigin,_t=ut.offset,Mt=_t[0],Ot=_t[1];vt==="svg"&&w&&(a.push({type:"target",target:o,matrix:g(o,b)}),a.push({type:"offset",target:o,matrix:ye(b)}));var Ft=parseFloat(I("zoom"))||1;if(k)L=J.fixedContainer,F=!0;else{var wt=Jr(o,r,!1,!0,I),xt=wt.offsetZoom;if(L=wt.offsetParent,F=wt.isEnd,U=wt.isStatic,M*=xt,(wt.isCustomElement||xt!==1)&&U)Mt-=L.offsetLeft,Ot-=L.offsetTop;else if(Ha||Ba){var Bt=wt.parentSlotElement;if(Bt){for(var Nt=L,he=0,Dt=0;Nt&&To(Nt);)he+=Nt.offsetLeft,Dt+=Nt.offsetTop,Nt=Nt.offsetParent;Mt-=he,Ot-=Dt}}}if(xo&&!xs&&St&&!dt&&U&&(D==="relative"||D==="static")&&(Mt-=L.offsetLeft,Ot-=L.offsetTop,f=f||F),k)St&&J.hasTransform&&(Y=L.clientLeft,K=L.clientTop);else if(St&&T!==L&&(j=L.clientLeft,q=L.clientTop),St&&L===u){var zt=Qa(o,!1);Mt+=zt[0],Ot+=zt[1]}if(a.push({type:"target",target:o,matrix:eo(H,b,ft)}),z&&z!=="1"&&z!=="none"){var ne=z.split(" ").map(function(se){return parseFloat(se)}),Jt=ne[0],Ke=ne[1],ue=Ke===void 0?Jt:Ke,oe=We([Jt,ue],b);a.push({type:"offset",target:o,matrix:ye(b)}),a.push({type:"target",target:o,matrix:eo(oe,b,ft)})}if(St){var Re=o===e,te=Re?0:o.scrollLeft,ae=Re?0:o.scrollTop;a.push({type:"offset",target:o,matrix:dn([Mt-te+j-Y,Ot-ae+q-K],b)})}else a.push({type:"offset",target:o,origin:ft});if(Ft!==1&&a.push({type:"zoom",target:o,matrix:eo(We([Ft,Ft],b),b,[0,0])}),w||(w=H),C||(C=ft),_||(_=at),v||k)break;o=L,f=F,(!n||o===u)&&(v=f)}return w||(w=ye(b)),C||(C=[0,0]),_||(_=[0,0]),{zoom:M,offsetContainer:T,matrixes:a,targetMatrix:w,transformOrigin:C,targetOrigin:_,is3d:h,hasFixed:R}}var Fr=null,be=null,ar=null;function Bn(e){e?(window.Map&&(Fr=new Map,be=new Map),ar=[]):(Fr=null,ar=null,be=null)}function Eo(e){var r=be==null?void 0:be.get(e);if(r)return r;var n=$(e,!0);return be&&be.set(e,n),n}function Ts(e,r){if(ar){var n=wr(ar,function(a){return a[0][0]==e&&a[0][1]==r});if(n)return n[1]}var o=Ya(e,r,!0);return ar&&ar.push([[e,r],o]),o}function sr(e){var r=Fr==null?void 0:Fr.get(e);if(!r){var n=window.getComputedStyle(e);if(!Fr)return function(u){return n[u]};r={style:n,cached:{}},Fr.set(e,r)}var o=r.cached,a=r.style;return function(u){return u in o||(o[u]=a[u]),o[u]}}function qa(e,r){return[e[0]*r[0],e[1]*r[1]]}function Ct(){for(var e=[],r=0;r9),"".concat(r?"matrix3d":"matrix","(").concat(ci(e,!r).join(","),")")}function sa(e){var r=e.clientWidth,n=e.clientHeight;if(!e)return{x:0,y:0,width:0,height:0,clientWidth:r,clientHeight:n};var o=e.viewBox,a=o&&o.baseVal||{x:0,y:0,width:0,height:0};return{x:a.x,y:a.y,width:a.width||r,height:a.height||n,clientWidth:r,clientHeight:n}}function g(e,r){var n=sa(e),o=n.width,a=n.height,u=n.clientWidth,f=n.clientHeight,v=u/o,h=f/a,b=e.preserveAspectRatio.baseVal,C=b.align,_=b.meetOrSlice,w=[0,0],R=[v,h],T=[0,0];if(C!==1){var M=(C-2)%3,I=Math.floor((C-2)/3);w[0]=o*M/2,w[1]=a*I/2;var D=_===2?Math.max(h,v):Math.min(v,h);R[0]=D,R[1]=D,T[0]=(u-o)/2*M,T[1]=(f-a)/2*I}var z=We(R,r);return z[r*(r-1)]=T[0],z[r*(r-1)+1]=T[1],eo(z,r,w)}function m(e,r,n){if(!e.getBBox||!n&&e.tagName.toLowerCase()==="g")return[0,0,0,0];var o=e.getBBox(),a=sa(e.ownerSVGElement),u=o.x-a.x,f=o.y-a.y;return[u,f,r[0]-u,r[1]-f]}function d(e,r,n){return Qe(e,Pr(r,n),n)}function t(e,r,n,o){return[[0,0],[r,0],[0,n],[r,n]].map(function(a){return d(e,a,o)})}function i(e){var r=e.map(function(b){return b[0]}),n=e.map(function(b){return b[1]}),o=Math.min.apply(Math,r),a=Math.min.apply(Math,n),u=Math.max.apply(Math,r),f=Math.max.apply(Math,n),v=u-o,h=f-a;return{left:o,top:a,right:u,bottom:f,width:v,height:h}}function s(e,r,n,o){var a=t(e,r,n,o);return i(a)}function l(e,r,n,o,a){var u,f=e.target,v=e.origin,h=r.matrix,b=P(f),C=b.offsetWidth,_=b.offsetHeight,w=n.getBoundingClientRect(),R=[0,0];n===document.body&&(R=Qa(f,!0));for(var T=f.getBoundingClientRect(),M=T.left-w.left+n.scrollLeft-(n.clientLeft||0)+R[0],I=T.top-w.top+n.scrollTop-(n.clientTop||0)+R[1],D=T.width,z=T.height,W=wa(o,a,h),k=s(W,C,_,o),H=k.left,L=k.top,F=k.width,U=k.height,j=d(W,v,o),q=Et(j,[H,L]),Y=[M+q[0]*D/F,I+q[1]*z/U],K=[0,0],J=0;++J<10;){var ot=Rr(a,o);u=Et(d(ot,Y,o),d(ot,j,o)),K[0]=u[0],K[1]=u[1];var ut=wa(o,a,dn(K,o),h),vt=s(ut,C,_,o),St=vt.left,dt=vt.top,ft=St-M,at=dt-I;if(Math.abs(ft)<2&&Math.abs(at)<2)break;Y[0]-=ft,Y[1]-=at}return K.map(function(_t){return Math.round(_t)})}function c(e,r,n){var o=e.length===16,a=o?4:3,u=r.map(function(h){return d(e,h,a)}),f=n.left,v=n.top;return u.map(function(h){return[h[0]+f,h[1]+v]})}function p(e,r,n,o){var a=e.length===16,u=a?4:3,f=t(e,n,o,u),v=f[0],h=v[0],b=v[1],C=f[1],_=C[0],w=C[1],R=f[2],T=R[0],M=R[1],I=f[3],D=I[0],z=I[1],W=d(e,r,u),k=W[0],H=W[1],L=Math.min(h,_,T,D),F=Math.min(b,w,M,z),U=Math.max(h,_,T,D),j=Math.max(b,w,M,z);h=h-L||0,_=_-L||0,T=T-L||0,D=D-L||0,b=b-F||0,w=w-F||0,M=M-F||0,z=z-F||0,k=k-L||0,H=H-F||0;var q=kt(t(e,100,100,u));return{left:L,top:F,right:U,bottom:j,origin:[k,H],pos1:[h,b],pos2:[_,w],pos3:[T,M],pos4:[D,z],direction:q}}function S(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function y(e,r){return S([r[0]-e[0],r[1]-e[1]])}function x(e,r,n,o){n===void 0&&(n=1),o===void 0&&(o=Ge(e,r));var a=y(e,r);return{transform:"translateY(-50%) translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(o,"rad) scaleY(").concat(n,")"),width:"".concat(a,"px")}}function E(e,r){for(var n=[],o=2;o0?e[0]:e[1],r>0?e[1]:e[0])}function B(){return{left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0}}function G(e,r){var n=e===document.body||e===document.documentElement,o={clientLeft:e.clientLeft,clientTop:e.clientTop,clientWidth:e.clientWidth,clientHeight:e.clientHeight,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,overflow:!1};return n&&(o.clientHeight=Math.max(r.height,o.clientHeight),o.scrollHeight=Math.max(r.height,o.scrollHeight)),o.overflow=sr(e)("overflow")!=="visible",N(N({},r),o)}function V(e,r,n,o){var a=e.left,u=e.right,f=e.top,v=e.bottom,h=r.top,b=r.left,C={left:b+a,top:h+f,right:b+u,bottom:h+v,width:u-a,height:v-f};return n&&o?G(n,C):C}function $(e,r){var n=0,o=0,a=0,u=0;if(e){var f=e.getBoundingClientRect();n=f.left,o=f.top,a=f.width,u=f.height}var v={left:n,top:o,width:a,height:u,right:n+a,bottom:o+u};return e&&r?G(e,v):v}function X(e){var r=e.props,n=r.groupable,o=r.svgOrigin,a=e.getState(),u=a.offsetWidth,f=a.offsetHeight,v=a.svg,h=a.transformOrigin;return!n&&v&&o?xr(o,u,f):h}function rt(e,r,n,o){var a;if(e)a=e;else if(r)a=[0,0];else{var u=n.target;a=st(u,o)}return a}function st(e,r){if(!!e){var n=e.getAttribute("data-rotation")||"",o=e.getAttribute("data-direction");if(r.deg=n,!!o){var a=[0,0];return o.indexOf("w")>-1&&(a[0]=-1),o.indexOf("e")>-1&&(a[0]=1),o.indexOf("n")>-1&&(a[1]=-1),o.indexOf("s")>-1&&(a[1]=1),a}}}function it(e,r){return[Yt(r,e[0]),Yt(r,e[1]),Yt(r,e[2]),Yt(r,e[3])]}function tt(e){var r=e.left,n=e.top,o=e.pos1,a=e.pos2,u=e.pos3,f=e.pos4;return it([o,a,u,f],[r,n])}function ht(e,r){var n=r?"controlGesto":"targetGesto",o=e[n];(o==null?void 0:o.isIdle())===!1&&e[r?"controlAbles":"targetAbles"].forEach(function(a){a.unset&&a.unset(e)}),o==null||o.unset(),e[n]=null}function lt(e,r){if(r){var n=Gn(r);n.nextStyle=N(N({},n.nextStyle),e)}return{style:e,cssText:Rn(e).map(function(o){return"".concat(io(o,"-"),": ").concat(e[o],";")}).join("")}}function gt(e,r,n){var o=r.afterTransform||r.transform;return N(N({},lt(N(N(N({},e.style),r.style),{transform:o}),n)),{afterTransform:o,transform:e.transform})}function ct(e,r,n,o){var a=r.datas;a.datas||(a.datas={});var u=N(N({},n),{target:e.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:e,moveable:e,datas:a.datas,isFirstDrag:!!r.isFirstDrag,isTrusted:r.isTrusted!==!1,stopAble:function(){a.isEventStart=!1},stopDrag:function(){var f;(f=r.stop)===null||f===void 0||f.call(r)}});return a.isStartEvent?o||(a.lastEvent=u):a.isStartEvent=!0,u}function mt(e,r,n){var o=r.datas,a="isDrag"in n?n.isDrag:r.isDrag;return o.datas||(o.datas={}),N(N({isDrag:a},n),{moveable:e,target:e.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:e,lastEvent:o.lastEvent,isDouble:r.isDouble,datas:o.datas,isFirstDrag:!!r.isFirstDrag})}function Gt(e,r,n){e._emitter.on(r,n)}function pt(e,r,n,o){return e.triggerEvent(r,n,o)}function $e(e,r){return window.getComputedStyle(e,r)}function _e(e,r,n){var o={},a={};return e.filter(function(u){var f=u.name;if(o[f]||!r.some(function(v){return u[v]}))return!1;if(!n&&u.ableGroup){if(a[u.ableGroup])return!1;a[u.ableGroup]=!0}return o[f]=!0,!0})}function Be(e,r){return e===r||e==null&&r==null}function xe(){for(var e=[],r=0;r=0?o:180-o,o=o>=0?o:360+o,o}function Vt(e,r){var n=e.rootMatrix,o=e.is3d,a=o?4:3,u=Rr(n,a);return o||(u=un(u,3,4)),u[12]=0,u[13]=0,u[14]=0,Hs(u,r)}function ie(e,r,n,o,a){var u=e[0],f=e[1],v=0,h=0;if(a&&u&&f){var b=Ge([0,0],r),C=Ge([0,0],o),_=S(r),w=Math.cos(b-C)*_;if(!o[0])h=w,v=h*n;else if(!o[1])v=w,h=v/n;else{var R=o[0]*u,T=o[1]*f,M=Math.atan2(R+r[0],T+r[1]),I=Math.atan2(R,T);M<0&&(M+=Math.PI*2),I<0&&(I+=Math.PI*2);var D=0;Math.abs(M-I)Math.PI/2*3||(I+=Math.PI),D=M-I,D>Math.PI*2?D-=Math.PI*2:D>Math.PI?D=2*Math.PI-D:D<-Math.PI&&(D=-2*Math.PI-D);var z=S([R+r[0],T+r[1]])*Math.cos(D);v=z*Math.sin(I)-R,h=z*Math.cos(I)-T,o[0]<0&&(v*=-1),o[1]<0&&(h*=-1)}}else v=o[0]*r[0],h=o[1]*r[1];return[v,h]}function dr(e,r,n,o){var a,u=n.ratio,f=n.startOffsetWidth,v=n.startOffsetHeight,h=0,b=0,C=o.distX,_=o.distY,w=o.pinchScale,R=o.parentDistance,T=o.parentDist,M=o.parentScale,I=n.fixedDirection,D=[0,1].map(function(F){return Math.abs(e[F]-I[F])}),z=[0,1].map(function(F){var U=D[F];return U!==0&&(U=2/U),U});if(T)h=T[0],b=T[1],r&&(h?b||(b=h/u):h=b*u);else if(Go(w))h=(w-1)*f,b=(w-1)*v;else if(M)h=(M[0]-1)*f,b=(M[1]-1)*v;else if(R){var W=f*D[0],k=v*D[1],H=S([W,k]);h=R/H*W*z[0],b=R/H*k*z[1]}else{var L=Kr({datas:n,distX:C,distY:_});L=z.map(function(F,U){return L[U]*F}),a=ie([f,v],L,u,e,r),h=a[0],b=a[1]}return{distWidth:h,distHeight:b}}function Qt(e,r){if(r){if(e==="left")return{x:"0%",y:"50%"};if(e==="top")return{x:"50%",y:"50%"};if(e==="center")return{x:"50%",y:"50%"};if(e==="right")return{x:"100%",y:"50%"};if(e==="bottom")return{x:"50%",y:"100%"};var n=e.split(" "),o=n[0],a=n[1],u=Qt(o||""),f=Qt(a||""),v=N(N({},u),f),h={x:"50%",y:"50%"};return v.x&&(h.x=v.x),v.y&&(h.y=v.y),v.value&&(v.x&&!v.y&&(h.y=v.value),!v.x&&v.y&&(h.x=v.value)),h}return e==="left"?{x:"0%"}:e==="right"?{x:"100%"}:e==="top"?{y:"0%"}:e==="bottom"?{y:"100%"}:e?e==="center"?{value:"50%"}:{value:e}:{}}function xr(e,r,n){var o=Qt(e,!0),a=o.x,u=o.y;return[Xt(a,r)||0,Xt(u,n)||0]}function rn(e,r,n){var o=e.map(function(u){return Et(u,r)}),a=o.map(function(u){return Vn(u,n)});return{prev:o,next:a,result:a.map(function(u){return Yt(u,r)})}}function _n(e,r){return e.length===r.length&&e.every(function(n,o){var a=r[o],u=le(n),f=le(a);return u&&f?_n(n,a):!u&&!f?n===a:!1})}function Er(e,r,n,o){var a=e[r];return r in e&&(a===n||o(a)===o(n))?a:(e[r]=n,n)}var nn=Zn("pinchable",{props:["pinchable"],events:["pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd"],dragStart:function(){return!0},pinchStart:function(e,r){var n=r.datas,o=r.targets,a=r.angle,u=r.originalDatas,f=e.props,v=f.pinchable,h=f.ables;if(!v)return!1;var b="onPinch".concat(o?"Group":"","Start"),C="drag".concat(o?"Group":"","ControlStart"),_=(v===!0?e.controlAbles:h.filter(function(M){return v.indexOf(M.name)>-1})).filter(function(M){return M.canPinch&&M[C]}),w=ct(e,r,{});o&&(w.targets=o);var R=pt(e,b,w);n.isPinch=R!==!1,n.ables=_;var T=n.isPinch;return T?(_.forEach(function(M){if(u[M.name]=u[M.name]||{},!!M[C]){var I=N(N({},r),{datas:u[M.name],parentRotate:a,isPinch:!0});M[C](e,I)}}),e.state.snapRenderInfo={request:r.isRequest,direction:[0,0]},T):!1},pinch:function(e,r){var n=r.datas,o=r.scale,a=r.distance,u=r.originalDatas,f=r.inputEvent,v=r.targets,h=r.angle;if(!!n.isPinch){var b=a*(1-1/o),C=ct(e,r,{});v&&(C.targets=v);var _="onPinch".concat(v?"Group":"");pt(e,_,C);var w=n.ables,R="drag".concat(v?"Group":"","Control");return w.forEach(function(T){!T[R]||T[R](e,N(N({},r),{datas:u[T.name],inputEvent:f,resolveMatrix:!0,pinchScale:o,parentDistance:b,parentRotate:h,isPinch:!0}))}),C}},pinchEnd:function(e,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,u=r.targets,f=r.originalDatas;if(!!n.isPinch){var v="onPinch".concat(u?"Group":"","End"),h=mt(e,r,{isDrag:o});u&&(h.targets=u),pt(e,v,h);var b=n.ables,C="drag".concat(u?"Group":"","ControlEnd");return b.forEach(function(_){!_[C]||_[C](e,N(N({},r),{isDrag:o,datas:f[_.name],inputEvent:a,isPinch:!0}))}),o}},pinchGroupStart:function(e,r){return this.pinchStart(e,N(N({},r),{targets:e.props.targets}))},pinchGroup:function(e,r){return this.pinch(e,N(N({},r),{targets:e.props.targets}))},pinchGroupEnd:function(e,r){return this.pinchEnd(e,N(N({},r),{targets:e.props.targets}))}});function Ye(e,r,n){var o=n.originalDatas;o.groupable=o.groupable||{};var a=o.groupable;a.childDatas=a.childDatas||[];var u=a.childDatas;return e.moveables.map(function(f,v){return u[v]=u[v]||{},u[v][r]=u[v][r]||{},N(N({},n),{datas:u[v][r],originalDatas:u[v]})})}function we(e,r,n,o,a,u,f){var v=!!n.match(/Start$/g),h=!!n.match(/End$/g),b=a.isPinch,C=a.datas,_=Ye(e,r.name,a),w=e.moveables,R=_.map(function(T,M){var I=w[M],D=I.state,z=D.gestos,W=T;if(v)W=new ei(f).dragStart(o,T);else{if(z[f]||(z[f]=C.childGestos[M]),!z[f])return;W=xi(T,D,o,b,u,f)}var k=r[n](I,N(N({},W),{parentFlag:!0}));return h&&(z[f]=null),k});return v&&(C.childGestos=w.map(function(T){return T.state.gestos[f]})),R}function $t(e,r,n,o,a,u){a===void 0&&(a=function(C,_){return _});var f=!!n.match(/End$/g),v=Ye(e,r.name,o),h=e.moveables,b=v.map(function(C,_){var w=h[_],R=C;R=a(w,C);var T=r[n](w,N(N({},R),{parentFlag:!0}));return T&&u&&u(w,C,T,_),f&&(w.state.gestos={}),T});return b}function ve(e,r,n,o){var a=n.fixedDirection,u=n.fixedPosition,f=o.datas.startPositions||tt(r.state),v=pe(f,a),h=Qe(fn(-e.rotation/180*Math.PI,3),[v[0]-u[0],v[1]-u[1],1],3),b=h[0],C=h[1];return o.datas.originalX=b,o.datas.originalY=C,o}var rr=["left","right","center"],Br=["top","bottom","middle"],ke={start:"left",end:"right",center:"center"},He={start:"top",end:"bottom",center:"middle"};function Hr(e,r){var n=e.props,o=n.snappable,a=n.bounds,u=n.innerBounds,f=n.verticalGuidelines,v=n.horizontalGuidelines,h=n.snapGridWidth,b=n.snapGridHeight,C=e.state,_=C.guidelines,w=C.enableSnap;return!o||!w||r&&o!==!0&&o.indexOf(r)<0?!1:!!(h||b||a||u||_&&_.length||f&&f.length||v&&v.length)}function ii(e){return e===!1?{}:e===!0||!e?{left:!0,right:!0,top:!0,bottom:!0}:e}function ro(e,r){var n=ii(e),o={};for(var a in n)a in r&&n[a]&&(o[a]=r[a]);return o}function la(e,r){var n=ro(e,r),o=Br.filter(function(u){return u in n}),a=rr.filter(function(u){return u in n});return{horizontal:o.map(function(u){return n[u]}),vertical:a.map(function(u){return n[u]})}}function Fu(e,r,n){var o=d(e,[r.clientLeft,r.clientTop],n);return[r.left+o[0],r.top+o[1]]}function Bu(e){var r=e[0],n=e[1],o=n[0]-r[0],a=n[1]-r[1];Math.abs(o)0,_=h>0;h=en(h),b=en(b);var w={isSnap:!1,offset:0,pos:0},R={isSnap:!1,offset:0,pos:0};if(h===0&&b===0)return{vertical:w,horizontal:R};var T=Xs(e,h?[o]:[],b?[a]:[]),M=T.vertical,I=T.horizontal;M.posInfos.filter(function(ot){var ut=ot.pos;return _?ut>=u:ut<=u}),I.posInfos.filter(function(ot){var ut=ot.pos;return C?ut>=f:ut<=f}),M.isSnap=M.posInfos.length>0,I.isSnap=I.posInfos.length>0;var D=ol(M),z=D.isSnap,W=D.guideline,k=ol(I),H=k.isSnap,L=k.guideline,F=H?L.pos[1]:0,U=z?W.pos[0]:0;if(h===0)H&&(R.isSnap=!0,R.pos=L.pos[1],R.offset=a-R.pos);else if(b===0)z&&(w.isSnap=!0,w.pos=U,w.offset=o-U);else{var j=b/h,q=n[1]-j*o,Y=0,K=0,J=!1;z?(K=U,Y=j*K+q,J=!0):H&&(Y=F,K=(Y-q)/j,J=!0),J&&(w.isSnap=!0,w.pos=K,w.offset=o-K,R.isSnap=!0,R.pos=Y,R.offset=a-Y)}return{vertical:w,horizontal:R}}function Ol(e,r,n){var o=la(e.props.snapDirections,r);return Xs(e,o.vertical,o.horizontal,n)}function ol(e){var r=e.isSnap;if(!r)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var n=e.posInfos[0],o=n.guidelineInfos[0],a=o.offset,u=o.dist,f=o.guideline;return{isSnap:r,offset:a,dist:u,pos:n.pos,guideline:f}}function Il(e,r,n,o){if(!e||!e.length)return{isSnap:!1,index:-1,posInfos:[]};var a=r==="vertical",u=a?0:1,f=n.map(function(h,b){var C=e.map(function(_){var w=_.pos,R=h-w[u];return{offset:R,dist:Math.abs(R),guideline:_}}).filter(function(_){var w=_.guideline,R=_.dist,T=w.type;return!(T!==r||R>o)}).sort(function(_,w){return _.dist-w.dist});return{pos:h,index:b,guidelineInfos:C}}).filter(function(h){return h.guidelineInfos.length>0}).sort(function(h,b){return h.guidelineInfos[0].dist-b.guidelineInfos[0].dist}),v=f.length>0;return{isSnap:v,index:v?f[0].index:-1,posInfos:f}}function ju(e,r,n,o){o===void 0&&(o=1);var a=[];if(n[0]&&n[1])a=[n,[-n[0],n[1]],[n[0],-n[1]]].map(function(v){return pe(r,v)});else if(!n[0]&&!n[1])for(var u=[r[0],r[1],r[3],r[2],r[0]],f=0;f<4;++f)a.push(u[f]),a.push([(u[f][0]+u[f+1][0])/2,(u[f][1]+u[f+1][1])/2]);else e.props.keepRatio?a=[[-1,-1],[-1,1],[1,-1],[1,1],n].map(function(v){return pe(r,v)}):(a=ra(r,n),a.length>1&&a.push([(a[0][0]+a[1][0])/2,(a[0][1]+a[1][1])/2]));return Xs(e,a.map(function(v){return v[0]}),a.map(function(v){return v[1]}),o)}function Pl(e,r){var n=Math.abs(e.offset),o=Math.abs(r.offset);return e.isBound&&r.isBound?o-n:e.isBound?-1:r.isBound?1:e.isSnap&&r.isSnap?o-n:e.isSnap?-1:r.isSnap||n0,T=_>0,M={isBound:!1,offset:0,pos:0},I={isBound:!1,offset:0,pos:0};if(_===0&&w===0)return{vertical:M,horizontal:I};if(_===0)R?vb&&(I.pos=u,I.offset=b-u);else if(w===0)T?fh&&(M.pos=a,M.offset=h-a);else{var D=w/_,z=n[1]-D*h,W=0,k=0,H=!1;T&&f<=h?(W=D*f+z,k=f,H=!0):!T&&h<=a&&(W=D*a+z,k=a,H=!0),H&&(Wv)&&(H=!1),H||(R&&v<=b?(W=v,k=(W-z)/D,H=!0):!R&&b<=u&&(W=u,k=(W-z)/D,H=!0)),H&&(M.isBound=!0,M.pos=k,M.offset=h-k,I.isBound=!0,I.pos=W,I.offset=b-W)}return{vertical:M,horizontal:I}}function Gl(e,r,n){var o=e[n?"left":"top"],a=e[n?"right":"bottom"],u=Math.min.apply(Math,r),f=Math.max.apply(Math,r),v=[];return o+1>u&&v.push({isBound:!0,offset:u-o,pos:o}),a-1.1||a[0]>r.right&&Math.abs(a[0]-r.right)>.1||a[1].1||a[1]>r.bottom&&Math.abs(a[1]-r.bottom)>.1})}function Qu(e,r,n){var o=S(e),a=Math.sqrt(o*o-r*r)||0;return[a,-a].sort(function(u,f){return Math.abs(u-e[n?0:1])-Math.abs(f-e[n?0:1])}).map(function(u){return Ge([0,0],n?[u,r]:[r,u])})}function Ju(e,r,n,o,a){if(!e.props.bounds)return[];var u=a*Math.PI/180,f=qs(e),v=f.left,h=f.top,b=f.right,C=f.bottom,_=v-o[0],w=b-o[0],R=h-o[1],T=C-o[1],M={left:_,top:R,right:w,bottom:T};if(!Wl(n,M,0))return[];var I=[];return[[_,0],[w,0],[R,1],[T,1]].forEach(function(D){var z=D[0],W=D[1];n.forEach(function(k){var H=Ge([0,0],k);I.push.apply(I,Qu(k,z,W).map(function(L){return u+L-H}).filter(function(L){return!Wl(r,M,L)}).map(function(L){return Lt(L*180/Math.PI,Je)}))})}),I}function tc(e,r){var n,o=e.direction,a=e.classNames,u=e.size,f=e.pos,v=e.zoom,h=e.key,b=o==="horizontal",C=b?"Y":"X";return r.createElement("div",{key:h,className:a.join(" "),style:(n={},n[b?"width":"height"]="".concat(u),n.transform="translate(".concat(f[0],", ").concat(f[1],") translate").concat(C,"(-50%) scale").concat(C,"(").concat(v,")"),n)})}function ul(e,r){return tc(N(N({},e),{classNames:bt([Ct("line","guideline",e.direction)],e.classNames,!0).filter(function(n){return n}),size:e.size||"".concat(e.sizeValue,"px"),pos:e.pos||e.posValue.map(function(n){return"".concat(Lt(n,.1),"px")})}),r)}function Fl(e,r,n,o,a,u,f,v){var h=e.props.zoom;return n.map(function(b,C){var _=b.type,w=b.pos,R=[0,0];return R[f]=o,R[f?0:1]=-a+w,ul({key:"".concat(r,"TargetGuideline").concat(C),classNames:[Ct("target","bold",_)],posValue:R,sizeValue:u,zoom:h,direction:r},v)})}function Bl(e,r,n,o,a,u){var f=e.props,v=f.zoom,h=f.isDisplayInnerSnapDigit,b=r==="horizontal"?ke:He,C=a[b.start],_=a[b.end];return n.filter(function(w){var R=w.hide,T=w.elementRect;if(R)return!1;if(h&&T){var M=T.rect;if(M[b.start]<=C&&_<=M[b.end])return!1}return!0}).map(function(w,R){var T=w.pos,M=w.size,I=w.element,D=w.className,z=[-o[0]+T[0],-o[1]+T[1]];return ul({key:"".concat(r,"-default-guideline-").concat(R),classNames:I?[Ct("bold"),D]:[Ct("normal"),D],direction:r,posValue:z,sizeValue:M,zoom:v},u)})}function Is(e,r,n,o,a,u,f,v){var h,b=e.props,C=b.snapDigit,_=C===void 0?0:C,w=b.isDisplaySnapDigit,R=w===void 0?!0:w,T=b.snapDistFormat,M=T===void 0?function(H,L){return H}:T,I=b.zoom,D=r==="horizontal"?"X":"Y",z=r==="vertical"?"height":"width",W=Math.abs(a),k=R?parseFloat(W.toFixed(_)):0;return v.createElement("div",{key:"".concat(r,"-").concat(n,"-guideline-").concat(o),className:Ct("guideline-group",r),style:(h={left:"".concat(u[0],"px"),top:"".concat(u[1],"px")},h[z]="".concat(W,"px"),h)},ul({direction:r,classNames:[Ct(n),f],size:"100%",posValue:[0,0],sizeValue:W,zoom:I},v),v.createElement("div",{className:Ct("size-value","gap"),style:{transform:"translate".concat(D,"(-50%) scale(").concat(I,")")}},k>0?M(k,r):""))}function ec(e,r,n,o){var a=e==="vertical"?0:1,u=e==="vertical"?1:0,f=a?ke:He,v=n[f.start],h=n[f.end];return Xe(r,function(b){return b.pos[a]}).map(function(b){var C=[],_=[],w=[];return b.forEach(function(R){var T,M,I=R.element,D=R.elementRect.rect;if(D[f.end]0){var q=[0,0];q[b]=n[b]+L[w.start]-T-j,q[C]=H,f.push(Is(e,v,"dashed",f.length,j,q,F.className,a))}L=U}),L=o,W.forEach(function(F){var U=F.elementRect.rect,j=U[w.start]-L[w.end];if(j>0){var q=[0,0];q[b]=n[b]+L[w.end]-T,q[C]=H,f.push(Is(e,v,"dashed",f.length,j,q,F.className,a))}L=U}),k.forEach(function(F){var U=F.elementRect.rect,j=T-U[w.start],q=U[w.end]-M,Y=[0,0],K=[0,0];Y[b]=n[b]-j,Y[C]=H,K[b]=n[b]+M-T,K[C]=H,f.push(Is(e,v,"dashed",f.length,j,Y,F.className,a)),f.push(Is(e,v,"dashed",f.length,q,K,F.className,a))})})}),f}function nc(e,r,n,o,a){var u=[];return["horizontal","vertical"].forEach(function(f){var v=r.filter(function(I){return I.type===f}).slice(0,1),h=f==="vertical"?0:1,b=h?0:1,C=h?He:ke,_=h?ke:He,w=o[C.start],R=o[C.end],T=o[_.start],M=o[_.end];v.forEach(function(I){var D=I.gap,z=I.gapRects,W=Math.max.apply(Math,bt([T],z.map(function(L){var F=L.rect;return F[_.start]}),!1)),k=Math.min.apply(Math,bt([M],z.map(function(L){var F=L.rect;return F[_.end]}),!1)),H=(W+k)/2;W===k||H===(T+M)/2||z.forEach(function(L){var F=L.rect,U=L.className,j=[n[0],n[1]];if(F[C.end]f||h>f,C=Kr({datas:a,distX:u[0],distY:u[1]}),_=C[0],w=C[1];return{offset:[_,w],isOutside:b}}function $s(e,r){return e.isBound?e.offset:r.isSnap?ol(r).offset:0}function oc(e,r,n,o,a){var u=r[0],f=r[1],v=n[0],h=n[1],b=o[0],C=o[1],_=a[0],w=a[1],R=-_,T=-w;if(e&&u&&f){R=0,T=0;var M=[];if(v&&h?M.push([0,w],[_,0]):v?M.push([_,0]):h?M.push([0,w]):b&&C?M.push([0,w],[_,0]):b?M.push([_,0]):C&&M.push([0,w]),M.length){M.sort(function(W,k){return S(Et([u,f],W))-S(Et([u,f],k))});var I=M[0];if(I[0]&&Math.abs(u)>me)R=-I[0],T=f*Math.abs(u+R)/Math.abs(u)-f;else if(I[1]&&Math.abs(f)>me){var D=f;T=-I[1],R=u*Math.abs(f+T)/Math.abs(D)-u}if(e&&h&&v)if(Math.abs(R)>me&&Math.abs(R)me&&Math.abs(T)177,M=R>87&&R<93;return wz||F[R.end]0}).sort(function(L,F){return W(L)-W(F)}),H=[];k.forEach(function(L){k.forEach(function(F){if(L!==F){var U=L.rect,j=F.rect,q=U[R.start],Y=U[R.end],K=j[R.start],J=j[R.end];q>J||K>Y||H.push([L,F])}})}),H.forEach(function(L){var F=L[0],U=L[1],j=F.rect,q=U.rect,Y=j[w.start],K=j[w.end],J=q[w.start],ot=q[w.end],ut=0,vt=0,St=!1,dt=!1,ft=!1;if(K<=T&&M<=J){if(dt=!0,ut=(J-K-(M-T))/2,vt=K+ut+(M-T)/2,Math.abs(vt-I)>n)return}else if(Kn)return}else if(Kn)return}else return;!ut||!Nl(r,q,_,u)||ut>v||b.push({type:_,pos:_==="vertical"?[vt,0]:[0,vt],element:U.element,size:0,className:U.className,isStart:St,isCenter:dt,isEnd:ft,gap:ut,hide:!0,gapRects:[F,U]})})}),b}function dc(e,r,n,o,a,u,f){a===void 0&&(a=0),u===void 0&&(u=0);var v=[],h=f.left,b=f.top;if(r)for(var C=0;C<=o;C+=r)v.push({type:"horizontal",pos:[h,Lt(C-u+b,.1)],size:n,hide:!0});if(e)for(var C=0;C<=n;C+=e)v.push({type:"vertical",pos:[Lt(C-a+h,.1),b],size:o,hide:!0});return v}function Nl(e,r,n,o){return n==="horizontal"?Math.abs(e.right-r.left)<=o||Math.abs(e.left-r.right)<=o||e.left<=r.right&&r.left<=e.right:n==="vertical"?Math.abs(e.bottom-r.top)<=o||Math.abs(e.top-r.bottom)<=o||e.top<=r.bottom&&r.top<=e.bottom:!0}function vc(e){var r=e.state,n=e.props.elementGuidelines,o=n===void 0?[]:n;if(!o.length)return r.elementRects=[],[];var a=(r.elementRects||[]).filter(function(w){return!w.refresh}),u=o.map(function(w){return pr(w)&&"element"in w?N(N({},w),{element:yt(w.element,!0)}):{element:yt(w,!0)}}).filter(function(w){return w.element}),f=ps(a.map(function(w){return w.element}),u.map(function(w){return w.element})),v=f.maintained,h=f.added,b=[];v.forEach(function(w){var R=w[0],T=w[1];b[T]=a[R]}),hc(e,h.map(function(w){return u[w]})).map(function(w,R){b[h[R]]=w}),r.elementRects=b;var C=ii(e.props.elementSnapDirections),_=[];return b.forEach(function(w){var R=w.element,T=w.top,M=T===void 0?C.top:T,I=w.left,D=I===void 0?C.left:I,z=w.right,W=z===void 0?C.right:z,k=w.bottom,H=k===void 0?C.bottom:k,L=w.center,F=L===void 0?C.center:L,U=w.middle,j=U===void 0?C.middle:U,q=w.className,Y=w.rect,K=la({top:M,right:W,left:D,bottom:H,center:F,middle:j},Y),J=K.horizontal,ot=K.vertical,ut=Y.top,vt=Y.left,St=Y.right-vt,dt=Y.bottom-ut,ft=[St,dt];ot.forEach(function(at){_.push({type:"vertical",element:R,pos:[Lt(at,.1),ut],size:dt,sizes:ft,className:q,elementRect:w})}),J.forEach(function(at){_.push({type:"horizontal",element:R,pos:[vt,Lt(at,.1)],size:St,sizes:ft,className:q,elementRect:w})})}),_}function Vl(e,r){return e?e.map(function(n){var o=pr(n)?n:{pos:n},a=o.pos;return Go(a)?o:N(N({},o),{pos:Xt(a,r)})}):[]}function Ul(e,r,n,o,a,u,f){a===void 0&&(a=0),u===void 0&&(u=0),f===void 0&&(f={left:0,top:0,right:0,bottom:0});var v=[],h=f.left,b=f.top,C=f.bottom,_=f.right,w=n+_-h,R=o+C-b;return Vl(e,R).forEach(function(T){v.push({type:"horizontal",pos:[h,Lt(T.pos-u+b,.1)],size:w,className:T.className})}),Vl(r,w).forEach(function(T){v.push({type:"vertical",pos:[Lt(T.pos-a+h,.1),b],size:R,className:T.className})}),v}function hc(e,r){if(!r.length)return[];var n=e.props.groupable,o=e.state,a=o.containerClientRect,u=o.rootMatrix,f=o.is3d,v=o.offsetDelta,h=f?4:3,b=Fu(u,a,h),C=b[0],_=b[1],w=n?0:v[0],R=n?0:v[1];return r.map(function(T){var M=T.element.getBoundingClientRect(),I=M.left-C-w,D=M.top-_-R,z=D+M.height,W=I+M.width,k=ze(u,[I,D],h),H=k[0],L=k[1],F=ze(u,[W,z],h),U=F[0],j=F[1];return N(N({},T),{rect:{left:H,right:U,top:L,bottom:j,center:(H+U)/2,middle:(L+j)/2}})})}function Zs(e){var r=e.state,n=r.container,o=e.props.snapContainer||n;if(r.snapContainer===o&&r.guidelines&&r.guidelines.length)return!1;var a=r.containerClientRect,u={left:0,top:0,bottom:0,right:0};if(n!==o){var f=yt(o,!0);if(f){var v=$(f),h=Vt(r,[v.left-a.left,v.top-a.top]),b=Vt(r,[v.right-a.right,v.bottom-a.bottom]);u.left=Lt(h[0],1e-5),u.top=Lt(h[1],1e-5),u.right=Lt(b[0],1e-5),u.bottom=Lt(b[1],1e-5)}}return r.snapContainer=o,r.snapOffset=u,r.guidelines=fl(e),r.enableSnap=!0,!0}function Xl(e,r,n,o,a,u){var f=t(e,r,n,u?4:3),v=pe(f,o);return it(f,Et(a,v))}function pc(e,r,n,o,a,u){var f=u.fixedDirection,v=Nu(n,f,o),h=sl(e,r,n,o),b=bt(bt([],lc(e,r,v,o,a,u),!0),kl(e,h,u),!0),C=Ys(b,0),_=Ys(b,1);return{width:{isBound:C.isBound,offset:C.offset[0]},height:{isBound:_.isBound,offset:_.offset[1]}}}function gc(e,r,n,o,a,u,f,v,h){var b=pe(r,f),C=Ks(e,v,{vertical:[b[0]],horizontal:[b[1]]}),_=C.horizontal.offset,w=C.vertical.offset;if(Lt(w,Ar)||Lt(_,Ar)){var R=Kr({datas:h,distX:-w,distY:-_}),T=R[0],M=R[1],I=Math.min(a||Infinity,n+f[0]*T),D=Math.min(u||Infinity,o+f[1]*M);return[I-n,D-o]}return[0,0]}function Yl(e,r,n,o,a,u,f,v){for(var h=tt(e.state),b=e.props.keepRatio,C=0,_=0,w=0;w<2;++w){var R=r(C,_),T=pc(e,R,a,b,f,v),M=T.width,I=T.height,D=M.isBound,z=I.isBound,W=M.offset,k=I.offset;if(w===1&&(D||(W=0),z||(k=0)),w===0&&f&&!D&&!z)return[0,0];if(b){var H=Math.abs(W)*(n?1/n:1),L=Math.abs(k)*(o?1/o:1),F=D&&z?H0;return{isSnap:w,rotation:w?_[0]:n}}function yc(e,r,n,o,a,u,f){if(!Hr(e,"resizable"))return[0,0];var v=f.fixedDirection,h=f.nextAllMatrix,b=e.state,C=b.allMatrix,_=b.is3d;return Yl(e,function(w,R){return Xl(h||C,r+w,n+R,v,a,_)},r,n,o,a,u,f)}function Sc(e,r,n,o,a){if(!Hr(e,"scalable"))return[0,0];var u=a.startOffsetWidth,f=a.startOffsetHeight,v=a.fixedPosition,h=a.fixedDirection,b=a.is3d,C=Yl(e,function(_,w){return Xl(ia(a,Yt(r,[_/u,w/f])),u,f,h,v,b)},u,f,n,v,o,a);return[C[0]/u,C[1]/f]}function bc(e,r){r.absolutePoses=tt(e.state)}function ql(e){var r=[];return e.forEach(function(n){n.guidelineInfos.forEach(function(o){var a=o.guideline;r.indexOf(a)>-1||r.push(a)})}),r}function $l(e,r,n,o,a,u){var f=ll(qs(e,u),r,n),v=f.vertical,h=f.horizontal;v.forEach(function(w){w.isBound&&o.push({type:"bounds",pos:w.pos})}),h.forEach(function(w){w.isBound&&a.push({type:"bounds",pos:w.pos})});var b=Ku(e),C=b.vertical,_=b.horizontal;C.forEach(function(w){mr(o,function(R){var T=R.type,M=R.pos;return T==="bounds"&&M===w})>=0||o.push({type:"bounds",pos:w})}),_.forEach(function(w){mr(a,function(R){var T=R.type,M=R.pos;return T==="bounds"&&M===w})>=0||a.push({type:"bounds",pos:w})})}var _c=jn("",["resizable","scalable"]),xc={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","snapDigit","snapThreshold","snapRenderThreshold","horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap"],css:[`:host { --bounds-color: #d66; } .guideline { pointer-events: none; z-index: 2; } .guideline.bounds { background: #d66; background: var(--bounds-color); } .guideline-group { position: absolute; top: 0; left: 0; } .guideline-group .size-value { position: absolute; color: #f55; font-size: 12px; font-size: calc(12px * var(--zoom)); font-weight: bold; } .guideline-group.horizontal .size-value { transform-origin: 50% 100%; transform: translateX(-50%); left: 50%; bottom: 5px; bottom: calc(2px + 3px * var(--zoom)); } .guideline-group.vertical .size-value { transform-origin: 0% 50%; top: 50%; transform: translateY(-50%); left: 5px; left: calc(2px + 3px * var(--zoom)); } .guideline.gap { background: #f55; } .size-value.gap { color: #f55; } `],render:function(e,r){var n=e.state,o=n.top,a=n.left,u=n.pos1,f=n.pos2,v=n.pos3,h=n.pos4,b=n.snapRenderInfo,C=e.props.snapRenderThreshold,_=C===void 0?1:C;if(!b||!b.render||!Hr(e,""))return[];n.guidelines=fl(e);var w=Math.min(u[0],f[0],v[0],h[0]),R=Math.min(u[1],f[1],v[1],h[1]),T=b.externalPoses||[],M=tt(e.state),I=[],D=[],z=[],W=[],k=[],H=i(M),L=H.width,F=H.height,U=H.top,j=H.left,q=H.bottom,Y=H.right,K={left:j,right:Y,top:U,bottom:q,center:(j+Y)/2,middle:(U+q)/2},J=T.length>0,ot=J?i(T):{};if(!b.request){if(b.direction&&k.push(ju(e,M,b.direction,_)),b.snap){var ut=i(M);b.center&&(ut.middle=(ut.top+ut.bottom)/2,ut.center=(ut.left+ut.right)/2),k.push(Ol(e,ut,_))}J&&(b.center&&(ot.middle=(ot.top+ot.bottom)/2,ot.center=(ot.left+ot.right)/2),k.push(Ol(e,ot,_))),k.forEach(function(ft){var at=ft.vertical.posInfos,_t=ft.horizontal.posInfos;I.push.apply(I,at.filter(function(Mt){var Ot=Mt.guidelineInfos;return Ot.some(function(Ft){var wt=Ft.guideline;return!wt.hide})}).map(function(Mt){return{type:"snap",pos:Mt.pos}})),D.push.apply(D,_t.filter(function(Mt){var Ot=Mt.guidelineInfos;return Ot.some(function(Ft){var wt=Ft.guideline;return!wt.hide})}).map(function(Mt){return{type:"snap",pos:Mt.pos}})),z.push.apply(z,ql(at)),W.push.apply(W,ql(_t))})}$l(e,[j,Y],[U,q],I,D),J&&$l(e,[ot.left,ot.right],[ot.top,ot.bottom],I,D,b.externalBounds);var vt=bt(bt([],z,!0),W,!0),St=vt.filter(function(ft){return ft.element&&!ft.gapRects}),dt=vt.filter(function(ft){return ft.gapRects}).sort(function(ft,at){return ft.gap-at.gap});return pt(e,"onSnap",{guidelines:vt.filter(function(ft){var at=ft.element;return!at}),elements:St,gaps:dt},!0),bt(bt(bt(bt(bt(bt([],rc(e,St,[w,R],K,r),!0),nc(e,dt,[w,R],K,r),!0),Bl(e,"horizontal",W,[a,o],K,r),!0),Bl(e,"vertical",z,[a,o],K,r),!0),Fl(e,"horizontal",D,w,o,L,0,r),!0),Fl(e,"vertical",I,R,a,F,1,r),!0)},dragStart:function(e,r){e.state.snapRenderInfo={request:r.isRequest,snap:!0,center:!0},Zs(e)},drag:function(e){var r=e.state;Zs(e)||(r.guidelines=fl(e)),r.snapRenderInfo&&(r.snapRenderInfo.render=!0)},pinchStart:function(e){this.unset(e)},dragEnd:function(e){this.unset(e)},dragControlCondition:function(e,r){if(_c(e,r)||gl(e,r))return!0;if(!r.isRequest&&r.inputEvent)return Ie(r.inputEvent.target,Ct("snap-control"))},dragControlStart:function(e){e.state.snapRenderInfo=null,Zs(e)},dragControl:function(e){this.drag(e)},dragControlEnd:function(e){this.unset(e)},dragGroupStart:function(e,r){this.dragStart(e,r)},dragGroup:function(e){this.drag(e)},dragGroupEnd:function(e){this.unset(e)},dragGroupControlStart:function(e){e.state.snapRenderInfo=null,Zs(e)},dragGroupControl:function(e){this.drag(e)},dragGroupControlEnd:function(e){this.unset(e)},unset:function(e){var r=e.state;r.enableSnap=!1,r.guidelines=[],r.snapRenderInfo=null,r.elementRects=[]}};function Kl(e,r,n,o){var a=e.getState(),u=a.renderPoses,f=a.rotation,v=a.direction,h=O(e.props,r).zoom,b=v>0?1:-1,C=f/Math.PI*180,_={},w=e.renderState;w.renderDirectionMap||(w.renderDirectionMap={});var R=w.renderDirectionMap;return n.forEach(function(T){var M=T.dir;_[M]=!0}),n.map(function(T){var M=T.data,I=T.classNames,D=T.dir,z=_i[D];if(!z||!_[D])return null;R[D]=!0;var W=(Lt(C,15)+b*Na[D]+720)%180,k={};return Rn(M).forEach(function(H){k["data-".concat(H)]=M[H]}),o.createElement("div",N({className:Ct.apply(void 0,bt(["control","direction",D,r],I,!1)),"data-rotation":W,"data-direction":D},k,{key:"direction-".concat(D),style:E.apply(void 0,bt([f,h],z.map(function(H){return u[H]}),!1))}))})}function Zl(e,r,n,o){var a=O(e.props,n),u=a.renderDirections,f=u===void 0?r:u,v=a.displayAroundControls;if(!f)return[];var h=f===!0?Xi:f;return bt(bt([],v?eu(e,o,n,h):[],!0),Kl(e,n,h.map(function(b){return{data:{},classNames:[],dir:b}}),o),!0)}function Ps(e,r,n,o,a,u){for(var f=[],v=6;v0?1:-1,w=v/Math.PI*180;return(o||Rn(b)).map(function(R){var T=_i[R];if(!T)return null;var M=(Lt(w,15)+_*Na[R]+720)%180,I=["around-control"];return n&&I.push("direction",n),r.createElement("div",{className:Ct.apply(void 0,I),"data-rotation":M,"data-direction":R,key:"direction-around-".concat(R),style:E.apply(void 0,bt([v,C],T.map(function(D){return f[D]}),!1))})})}var jr={name:"draggable",props:["draggable","throttleDrag","throttleDragRotate","startDragRotate","edgeDraggable"],events:["dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd"],requestStyle:function(){return["left","top","right","bottom"]},requestChildStyle:function(){return["left","top","right","bottom"]},render:function(e,r){var n=e.props,o=n.throttleDragRotate,a=n.zoom,u=e.getState(),f=u.dragInfo,v=u.beforeOrigin;if(!o||!f)return[];var h=f.dist;if(!h[0]&&!h[1])return[];var b=S(h),C=Ge(h,[0,0]);return[r.createElement("div",{className:Ct("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:"".concat(b,"px"),transform:"translate(".concat(v[0],"px, ").concat(v[1],"px) rotate(").concat(C,"rad) scaleY(").concat(a,")")}})]},dragStart:function(e,r){var n=r.datas,o=r.parentEvent,a=r.parentGesto,u=e.state,f=u.gestos,v=u.style;if(f.draggable)return!1;f.draggable=a||e.targetGesto,n.datas={},n.left=parseFloat(v.left||"")||0,n.top=parseFloat(v.top||"")||0,n.bottom=parseFloat(v.bottom||"")||0,n.right=parseFloat(v.right||"")||0,n.startValue=[0,0],$r(e,r),Ki(r,"translate"),bc(e,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1,n.deltaOffset=[0,0];var h=ct(e,r,N({set:function(C){n.startValue=C}},$i(r))),b=o||pt(e,"onDragStart",h);return b!==!1?(n.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(f.draggable=null,n.isPinch=!1),n.isDrag?h:!1},drag:function(e,r){if(!!r){gn(r,"translate");var n=r.datas,o=r.parentEvent,a=r.parentFlag,u=r.isPinch,f=r.isRequest,v=r.deltaOffset,h=r.distX,b=r.distY,C=n.isDrag,_=n.prevDist,w=n.prevBeforeDist,R=n.startValue;if(!!C){v&&(h+=v[0],b+=v[1]);var T=e.props,M=T.parentMoveable,I=o?0:T.throttleDrag||0,D=o?0:T.throttleDragRotate||0,z=0,W=!1,k=!1,H=!1,L=!1;if(!o&&D>0&&(h||b)){var F=T.startDragRotate||0,U=Lt(F+Ge([0,0],[h,b])*180/Math.PI,D)-F,j=b*Math.abs(Math.cos((U-90)/180*Math.PI)),q=h*Math.abs(Math.cos(U/180*Math.PI)),Y=S([q,j]);z=U*Math.PI/180,h=Y*Math.cos(z),b=Y*Math.sin(z)}if(!u&&!o&&!a){var K=ac(e,h,b,D,f||v,n),J=K[0],ot=K[1];W=J.isSnap,k=J.isBound,H=ot.isSnap,L=ot.isBound;var ut=J.offset,vt=ot.offset;h+=ut,b+=vt}var St=Yt(mn({datas:n,distX:h,distY:b}),R),dt=Yt(Va({datas:n,distX:h,distY:b}),R);jo(dt,Je),jo(St,Je),D||(!W&&!k&&(dt[0]=Lt(dt[0],I),St[0]=Lt(St[0],I)),!H&&!L&&(dt[1]=Lt(dt[1],I),St[1]=Lt(St[1],I)));var ft=Et(St,R),at=Et(dt,R),_t=Et(at,_),Mt=Et(ft,w);n.prevDist=at,n.prevBeforeDist=ft,n.passDelta=_t,n.passDist=at;var Ot=n.left+ft[0],Ft=n.top+ft[1],wt=n.right-ft[0],xt=n.bottom-ft[1],Bt=Ro(n,"translate(".concat(dt[0],"px, ").concat(dt[1],"px)"),"translate(".concat(at[0],"px, ").concat(at[1],"px)"));if(wi(r,Bt),e.state.dragInfo.dist=o?[0,0]:at,!(!o&&!M&&_t.every(function(ne){return!ne})&&Mt.some(function(ne){return!ne}))){var Nt=e.state,he=Nt.width,Dt=Nt.height,zt=ct(e,r,N({transform:Bt,dist:at,delta:_t,translate:dt,beforeDist:ft,beforeDelta:Mt,beforeTranslate:St,left:Ot,top:Ft,right:wt,bottom:xt,width:he,height:Dt,isPinch:u},lt({transform:Bt},r)));return!o&&pt(e,"onDrag",zt),zt}}}},dragAfter:function(e,r){var n=r.datas,o=n.deltaOffset;return o[0]||o[1]?(n.deltaOffset=[0,0],this.drag(e,N(N({},r),{deltaOffset:o}))):!1},dragEnd:function(e,r){var n=r.parentEvent,o=r.datas;if(e.state.dragInfo=null,!!o.isDrag){o.isDrag=!1;var a=mt(e,r,{});return!n&&pt(e,"onDragEnd",a),a}},dragGroupStart:function(e,r){var n=r.datas,o=r.clientX,a=r.clientY,u=this.dragStart(e,r);if(!u)return!1;var f=we(e,this,"dragStart",[o||0,a||0],r,!1,"draggable"),v=N(N({},u),{targets:e.props.targets,events:f}),h=pt(e,"onDragGroupStart",v);return n.isDrag=h!==!1,n.isDrag?u:!1},dragGroup:function(e,r){var n=r.datas;if(!!n.isDrag){var o=this.drag(e,r),a=r.datas.passDelta,u=we(e,this,"drag",a,r,!1,"draggable");if(!!o){var f=N({targets:e.props.targets,events:u},o);return pt(e,"onDragGroup",f),f}}},dragGroupEnd:function(e,r){var n=r.isDrag,o=r.datas;if(!!o.isDrag){this.dragEnd(e,r);var a=we(e,this,"dragEnd",[0,0],r,!1,"draggable");return pt(e,"onDragGroupEnd",mt(e,r,{targets:e.props.targets,events:a})),n}},request:function(e){var r={},n=e.getRect(),o=0,a=0;return{isControl:!1,requestStart:function(){return{datas:r}},request:function(u){return"x"in u?o=u.x-n.left:"deltaX"in u&&(o+=u.deltaX),"y"in u?a=u.y-n.top:"deltaY"in u&&(a+=u.deltaY),{datas:r,distX:o,distY:a}},requestEnd:function(){return{datas:r,isDrag:!0}}}},unset:function(e){e.state.gestos.draggable=null,e.state.dragInfo=null}};function ru(e,r){var n=pe(e,r),o=[0,0];return{fixedPosition:n,fixedDirection:r,fixedOffset:o}}function Cc(e,r){var n=e.allMatrix,o=e.is3d,a=e.width,u=e.height,f=o?4:3,v=[a/2*(1+r[0]),u/2*(1+r[1])],h=d(n,v,f),b=[0,0];return{fixedPosition:h,fixedDirection:r,fixedOffset:b}}function nu(e,r){var n=e.allMatrix,o=e.is3d,a=e.width,u=e.height,f=o?4:3,v=br(r,a,u),h=d(n,r,f),b=[a?0:r[0],u?0:r[1]];return{fixedPosition:h,fixedDirection:v,fixedOffset:b}}var iu=jn("resizable"),dl={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Jl("resizable"),dragControlCondition:iu,viewClassName:Ri("resizable"),dragControlStart:function(e,r){var n,o=r.inputEvent,a=r.isPinch,u=r.isGroup,f=r.parentDirection,v=r.parentGesto,h=r.datas,b=r.parentFixedDirection,C=r.parentEvent,_=rt(f,a,o,h),w=e.state,R=w.target,T=w.width,M=w.height,I=w.gestos;if(!_||!R||I.resizable)return!1;I.resizable=v||e.controlGesto,!a&&$r(e,r),h.datas={},h.direction=_,h.startOffsetWidth=T,h.startOffsetHeight=M,h.prevWidth=0,h.prevHeight=0,h.minSize=[0,0],h.startWidth=w.inlineCSSWidth||w.cssWidth,h.startHeight=w.inlineCSSHeight||w.cssHeight,h.maxSize=[Infinity,Infinity],u||(h.minSize=[w.minOffsetWidth,w.minOffsetHeight],h.maxSize=[w.maxOffsetWidth,w.maxOffsetHeight]);var D=e.props.transformOrigin||"% %";h.transformOrigin=D&&Le(D)?D.split(" "):D,h.startOffsetMatrix=w.offsetMatrix,h.startTransformOrigin=w.transformOrigin,h.isWidth=(n=r==null?void 0:r.parentIsWidth)!==null&&n!==void 0?n:!_[0]&&!_[1]||_[0]||!_[1];function z(j){h.ratio=j&&isFinite(j)?j:0}h.startPositions=tt(e.state);function W(j){var q=ru(h.startPositions,j);h.fixedDirection=q.fixedDirection,h.fixedPosition=q.fixedPosition,h.fixedOffset=q.fixedOffset}function k(j){var q=nu(e.state,j);h.fixedDirection=q.fixedDirection,h.fixedPosition=q.fixedPosition,h.fixedOffset=q.fixedOffset}function H(j){h.minSize=[Xt("".concat(j[0]),0)||0,Xt("".concat(j[1]),0)||0]}function L(j){var q=[j[0]||Infinity,j[1]||Infinity];(!Go(q[0])||isFinite(q[0]))&&(q[0]=Xt("".concat(q[0]),0)||Infinity),(!Go(q[1])||isFinite(q[1]))&&(q[1]=Xt("".concat(q[1]),0)||Infinity),h.maxSize=q}z(T/M),W(b||[-_[0],-_[1]]),h.setFixedDirection=W,h.setFixedPosition=k,h.setMin=H,h.setMax=L;var F=ct(e,r,{direction:_,startRatio:h.ratio,set:function(j){var q=j[0],Y=j[1];h.startWidth=q,h.startHeight=Y},setMin:H,setMax:L,setRatio:z,setFixedDirection:W,setFixedPosition:k,setOrigin:function(j){h.transformOrigin=j},dragStart:jr.dragStart(e,new ei().dragStart([0,0],r))}),U=C||pt(e,"onResizeStart",F);return h.startFixedDirection=h.fixedDirection,h.startFixedPosition=h.fixedPosition,U!==!1&&(h.isResize=!0,e.state.snapRenderInfo={request:r.isRequest,direction:_}),h.isResize?F:!1},dragControl:function(e,r){var n,o=r.datas,a=r.parentFlag,u=r.isPinch,f=r.parentKeepRatio,v=r.dragClient,h=r.parentDist,b=r.isRequest,C=r.isGroup,_=r.parentEvent,w=r.resolveMatrix,R=o.isResize,T=o.transformOrigin,M=o.startWidth,I=o.startHeight,D=o.prevWidth,z=o.prevHeight,W=o.minSize,k=o.maxSize,H=o.ratio,L=o.startOffsetWidth,F=o.startOffsetHeight,U=o.isWidth;if(!R)return;if(w){var j=e.state.is3d,q=o.startOffsetMatrix,Y=o.startTransformOrigin,K=j?4:3,J=Mn(Zi(r)),ot=Math.sqrt(J.length);K!==ot&&(J=un(J,ot,K));var ut=ri(q,J,Y,K),vt=t(ut,L,F,K);o.startPositions=vt,o.nextTargetMatrix=J,o.nextAllMatrix=ut}var St=O(e.props,"resizable"),dt=St.resizeFormat,ft=St.throttleResize,at=ft===void 0?a?0:1:ft,_t=St.parentMoveable,Mt=St.keepRatioFinally,Ot=o.direction,Ft=Ot,wt=0,xt=0;!Ot[0]&&!Ot[1]&&(Ft=[1,1]);var Bt=H&&(f!=null?f:St.keepRatio)||!1;function Nt(){var vr=o.fixedDirection,Mr=dr(Ft,Bt,o,r);wt=Mr.distWidth,xt=Mr.distHeight;var zo=Ft[0]-vr[0]||Bt?Math.max(L+wt,Je):L,es=Ft[1]-vr[1]||Bt?Math.max(F+xt,Je):F;return Bt&&L&&F&&(U?es=zo/H:zo=es*H),[zo,es]}var he=Nt(),Dt=he[0],zt=he[1];_||(o.setFixedDirection(o.fixedDirection),pt(e,"onBeforeResize",ct(e,r,{startFixedDirection:o.startFixedDirection,startFixedPosition:o.startFixedPosition,setFixedDirection:function(vr){var Mr;return o.setFixedDirection(vr),Mr=Nt(),Dt=Mr[0],zt=Mr[1],[Dt,zt]},setFixedPosition:function(vr){var Mr;return o.setFixedPosition(vr),Mr=Nt(),Dt=Mr[0],zt=Mr[1],[Dt,zt]},boundingWidth:Dt,boundingHeight:zt,setSize:function(vr){Dt=vr[0],zt=vr[1]}},!0)));var ne=v;v||(!a&&u?ne=Ji(e,[0,0]):ne=o.fixedPosition);var Jt=[0,0];u||(Jt=yc(e,Dt,zt,Ot,ne,b,o)),h&&(!h[0]&&(Jt[0]=0),!h[1]&&(Jt[1]=0));function Ke(){var vr;dt&&(vr=dt([Dt,zt]),Dt=vr[0],zt=vr[1]),Dt=Lt(Dt,at),zt=Lt(zt,at)}if(Bt){Ft[0]&&Ft[1]&&Jt[0]&&Jt[1]&&(Math.abs(Jt[0])>Math.abs(Jt[1])?Jt[1]=0:Jt[0]=0);var ue=!Jt[0]&&!Jt[1];ue&&Ke(),Ft[0]&&!Ft[1]||Jt[0]&&!Jt[1]||ue&&U?(Dt+=Jt[0],zt=Dt/H):(!Ft[0]&&Ft[1]||!Jt[0]&&Jt[1]||ue&&!U)&&(zt+=Jt[1],Dt=zt*H)}else Dt+=Jt[0],zt+=Jt[1],Dt=Math.max(0,Dt),zt=Math.max(0,zt);n=En([Dt,zt],W,k,Bt?H:!1),Dt=n[0],zt=n[1],Ke(),Bt&&(C||Mt)&&(U?zt=Dt/H:Dt=zt*H),wt=Dt-L,xt=zt-F;var oe=[wt-D,xt-z];o.prevWidth=wt,o.prevHeight=xt;var Re=bn(e,Dt,zt,ne,T,o);if(!(!_t&&oe.every(function(vr){return!vr})&&Re.every(function(vr){return!vr}))){var te=jr.drag(e,xi(r,e.state,Re,!!u,!1,"draggable")),ae=te.transform,se=M+wt,on=I+xt,Do=ct(e,r,N({width:se,height:on,offsetWidth:Math.round(Dt),offsetHeight:Math.round(zt),startRatio:H,boundingWidth:Dt,boundingHeight:zt,direction:Ot,dist:[wt,xt],delta:oe,isPinch:!!u,drag:te},gt({style:{width:"".concat(se,"px"),height:"".concat(on,"px")},transform:ae},te,r)));return!_&&pt(e,"onResize",Do),Do}},dragControlAfter:function(e,r){var n=r.datas,o=n.isResize,a=n.startOffsetWidth,u=n.startOffsetHeight,f=n.prevWidth,v=n.prevHeight;if(!(!o||e.props.checkResizableError===!1)){var h=e.state,b=h.width,C=h.height,_=b-(a+f),w=C-(u+v),R=Math.abs(_)>3,T=Math.abs(w)>3;if(R&&(n.startWidth+=_,n.startOffsetWidth+=_,n.prevWidth+=_),T&&(n.startHeight+=w,n.startOffsetHeight+=w,n.prevHeight+=w),R||T)return this.dragControl(e,r)}},dragControlEnd:function(e,r){var n=r.datas,o=r.parentEvent;if(!!n.isResize){n.isResize=!1;var a=mt(e,r,{});return!o&&pt(e,"onResizeEnd",a),a}},dragGroupControlCondition:iu,dragGroupControlStart:function(e,r){var n=r.datas,o=this.dragControlStart(e,N(N({},r),{isGroup:!0}));if(!o)return!1;var a=Ye(e,"resizable",r),u=n.startOffsetWidth,f=n.startOffsetHeight;function v(){var R=n.minSize;a.forEach(function(T){var M=T.datas,I=M.minSize,D=M.startOffsetWidth,z=M.startOffsetHeight,W=u*(D?I[0]/D:0),k=f*(z?I[1]/z:0);R[0]=Math.max(R[0],W),R[1]=Math.max(R[1],k)})}function h(){var R=n.maxSize;a.forEach(function(T){var M=T.datas,I=M.maxSize,D=M.startOffsetWidth,z=M.startOffsetHeight,W=u*(D?I[0]/D:0),k=f*(z?I[1]/z:0);R[0]=Math.min(R[0],W),R[1]=Math.min(R[1],k)})}var b=$t(e,this,"dragControlStart",r,function(R,T){return ve(e,R,n,T)});v(),h();var C=function(R){o.setFixedDirection(R),b.forEach(function(T,M){T.setFixedDirection(R),ve(e,T.moveable,n,a[M])})};n.setFixedDirection=C;var _=N(N({},o),{targets:e.props.targets,events:b.map(function(R){return N(N({},R),{setMin:function(T){R.setMin(T),v()},setMax:function(T){R.setMax(T),h()}})}),setFixedDirection:C,setMin:function(R){o.setMin(R),v()},setMax:function(R){o.setMax(R),h()}}),w=pt(e,"onResizeGroupStart",_);return n.isResize=w!==!1,n.isResize?o:!1},dragGroupControl:function(e,r){var n=r.datas;if(!!n.isResize){var o=O(e.props,"resizable");Gt(e,"onBeforeResize",function(R){pt(e,"onBeforeResizeGroup",ct(e,r,N(N({},R),{targets:o.targets}),!0))});var a=this.dragControl(e,N(N({},r),{isGroup:!0}));if(!!a){var u=a.boundingWidth,f=a.boundingHeight,v=a.dist,h=o.keepRatio,b=[u/(u-v[0]),f/(f-v[1])],C=n.fixedPosition,_=$t(e,this,"dragControl",r,function(R,T){var M=Qe(fn(e.rotation/180*Math.PI,3),[T.datas.originalX*b[0],T.datas.originalY*b[1],1],3),I=M[0],D=M[1];return N(N({},T),{parentDist:null,parentScale:b,dragClient:Yt(C,[I,D]),parentKeepRatio:h})}),w=N({targets:o.targets,events:_},a);return pt(e,"onResizeGroup",w),w}}},dragGroupControlEnd:function(e,r){var n=r.isDrag,o=r.datas;if(!!o.isResize){this.dragControlEnd(e,r);var a=$t(e,this,"dragControlEnd",r),u=mt(e,r,{targets:e.props.targets,events:a});return pt(e,"onResizeGroupEnd",u),n}},request:function(e){var r={},n=0,o=0,a=e.getRect();return{isControl:!0,requestStart:function(u){var f;return{datas:r,parentDirection:u.direction||[1,1],parentIsWidth:(f=u==null?void 0:u.horizontal)!==null&&f!==void 0?f:!0}},request:function(u){return"offsetWidth"in u?n=u.offsetWidth-a.offsetWidth:"deltaWidth"in u&&(n+=u.deltaWidth),"offsetHeight"in u?o=u.offsetHeight-a.offsetHeight:"deltaHeight"in u&&(o+=u.deltaHeight),{datas:r,parentDist:[n,o],parentKeepRatio:u.keepRatio}},requestEnd:function(){return{datas:r,isDrag:!0}}}},unset:function(e){e.state.gestos.resizable=null}};function vl(e,r,n,o,a){var u=e.props.groupable,f=e.state,v=f.is3d?4:3,h=r.origin,b=d(e.state.rootMatrix,Et([h[0],h[1]],u?[0,0]:[f.left,f.top]),v),C=Yt([a.left,a.top],b);r.startAbsoluteOrigin=C,r.prevDeg=Ge(C,[n,o])/Math.PI*180,r.defaultDeg=r.prevDeg,r.prevSnapDeg=0,r.loop=0,r.startDist=cr(C,[n,o])}function Qs(e,r,n){var o=n.defaultDeg,a=n.prevDeg,u=a%360,f=Math.floor(a/360);u<0&&(u+=360),u>e&&u>270&&e<90?++f:u270&&--f;var v=r*(f*360+e-o);return n.prevDeg=o+v,v}function hl(e,r,n,o){return Qs(Ge(o.startAbsoluteOrigin,[e,r])/Math.PI*180,n,o)}function pl(e,r,n,o,a,u){var f=e.props.throttleRotate,v=f===void 0?0:f,h=n.prevSnapDeg,b=0,C=!1;if(u){var _=mc(e,r,o);C=_.isSnap,b=a+_.rotation}C||(b=Lt(a+o,v));var w=b-a;return n.prevSnapDeg=w,[w-h,w,b]}function ou(e,r,n){var o=r[0],a=r[1],u=r[2],f=r[3];if(e==="none")return[];if(le(e))return e.map(function(M){return ou(M,[o,a,u,f],n)[0]});var v=(e||"top").split("-"),h=v[0],b=v[1],C=[o,a];h==="left"?C=[u,o]:h==="right"?C=[a,f]:h==="bottom"&&(C=[f,u]);var _=[(C[0][0]+C[1][0])/2,(C[0][1]+C[1][1])/2],w=A(C,n);if(b){var R=b==="top"||b==="left",T=h==="bottom"||h==="left";_=C[R&&!T||!R&&T?0:1]}return[[_,w]]}function gl(e,r){if(r.isRequest)return r.requestAble==="rotatable";var n=r.inputEvent.target;if(Ie(n,Ct("rotation-control"))||e.props.rotateAroundControls&&Ie(n,Ct("around-control"))||Ie(n,Ct("control"))&&Ie(n,Ct("rotatable")))return!0;var o=e.props.rotationTarget;return o?Pt(o,!0).some(function(a){return a?n===a||n.contains(a):!1}):!1}var Rc=`.rotation { position: absolute; height: 40px; width: 1px; transform-origin: 50% 100%; height: calc(40px * var(--zoom)); top: auto; left: 0; bottom: 100%; will-change: transform; } .rotation .rotation-line { display: block; width: 100%; height: 100%; transform-origin: 50% 50%; } .rotation .rotation-control { border-color: #4af; border-color: var(--moveable-color); background:#fff; cursor: alias; } :global .view-rotation-dragging, .rotatable.direction.control { cursor: alias; } .rotatable.direction.control.move { cursor: move; } `,Tc={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[Rc],viewClassName:function(e){return e.isDragging("rotatable")?Ct("view-rotation-dragging"):""},render:function(e,r){var n=O(e.props,"rotatable"),o=n.rotatable,a=n.rotationPosition,u=n.zoom,f=n.renderDirections,v=n.rotateAroundControls,h=n.resolveAblesWithRotatable,b=e.getState(),C=b.renderPoses,_=b.direction;if(!o)return null;var w=ou(a,C,_),R=[];if(w.forEach(function(D,z){var W=D[0],k=D[1];R.push(r.createElement("div",{key:"rotation".concat(z),className:Ct("rotation"),style:{transform:"translate(-50%) translate(".concat(W[0],"px, ").concat(W[1],"px) rotate(").concat(k,"rad)")}},r.createElement("div",{className:Ct("line rotation-line"),style:{transform:"scaleX(".concat(u,")")}}),r.createElement("div",{className:Ct("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(u,")")}})))}),f){var T=Rn(h||{}),M={};T.forEach(function(D){h[D].forEach(function(z){M[z]=D})});var I=[];le(f)&&(I=f.map(function(D){var z=M[D];return{data:z?{resolve:z}:{},classNames:z?["move"]:[],dir:D}})),R.push.apply(R,Kl(e,"rotatable",I,r))}return v&&R.push.apply(R,eu(e,r)),R},dragControlCondition:gl,dragControlStart:function(e,r){var n,o,a=r.datas,u=r.clientX,f=r.clientY,v=r.parentRotate,h=r.parentFlag,b=r.isPinch,C=r.isRequest,_=e.state,w=_.target,R=_.left,T=_.top,M=_.direction,I=_.beforeDirection,D=_.targetTransform,z=_.moveableClientRect,W=_.offsetMatrix,k=_.targetMatrix,H=_.allMatrix,L=_.width,F=_.height;if(!C&&!w)return!1;var U=e.getRect();a.rect=U,a.transform=D,a.left=R,a.top=T;var j=function(wt){var xt=nu(e.state,wt);a.fixedDirection=xt.fixedDirection,a.fixedOffset=xt.fixedOffset,a.fixedPosition=xt.fixedPosition,_t&&_t.setFixedPosition(wt)},q=function(wt){var xt=Cc(e.state,wt);a.fixedDirection=xt.fixedDirection,a.fixedOffset=xt.fixedOffset,a.fixedPosition=xt.fixedPosition,_t&&_t.setFixedDirection(wt)},Y=u,K=f;if(C||b||h){var J=v||0;a.beforeInfo={origin:U.beforeOrigin,prevDeg:J,defaultDeg:J,prevSnapDeg:0,startDist:0},a.afterInfo=N(N({},a.beforeInfo),{origin:U.origin}),a.absoluteInfo=N(N({},a.beforeInfo),{origin:U.origin,startValue:J})}else{var ot=(o=r.inputEvent)===null||o===void 0?void 0:o.target;if(ot){var ut=ot.getAttribute("data-direction")||"",vt=bi[ut];if(vt){a.isControl=!0,a.isAroundControl=Ie(ot,Ct("around-control")),a.controlDirection=vt;var St=ot.getAttribute("data-resolve");St&&(a.resolveAble=St);var dt=c(_.rootMatrix,_.renderPoses,z);n=pe(dt,vt),Y=n[0],K=n[1]}}a.beforeInfo={origin:U.beforeOrigin},a.afterInfo={origin:U.origin},a.absoluteInfo={origin:U.origin,startValue:U.rotation};var ft=j;j=function(wt){var xt=_.is3d?4:3,Bt=Yt(Li(k,xt),wt),Nt=Bt[0],he=Bt[1],Dt=Qe(W,Pr([Nt,he],xt)),zt=Qe(H,Pr([wt[0],wt[1]],xt));ft(wt);var ne=_.posDelta;a.beforeInfo.origin=Et(Dt,ne),a.afterInfo.origin=Et(zt,ne),a.absoluteInfo.origin=Et(zt,ne),vl(e,a.beforeInfo,Y,K,z),vl(e,a.afterInfo,Y,K,z),vl(e,a.absoluteInfo,Y,K,z)},q=function(wt){var xt=pe([[0,0],[L,0],[0,F],[L,F]],wt);j(xt)}}a.startClientX=Y,a.startClientY=K,a.direction=M,a.beforeDirection=I,a.startValue=0,a.datas={},Ki(r,"rotate");var at=!1,_t=!1;if(a.isControl&&a.resolveAble){var Mt=a.resolveAble;Mt==="resizable"&&(_t=dl.dragControlStart(e,N(N({},new ei("resizable").dragStart([0,0],r)),{parentPosition:a.controlPosition,parentFixedPosition:a.fixedPosition})))}_t||(at=jr.dragStart(e,new ei().dragStart([0,0],r))),j(X(e));var Ot=ct(e,r,N(N({set:function(wt){a.startValue=wt*Math.PI/180},setFixedDirection:q,setFixedPosition:j},$i(r)),{dragStart:at,resizeStart:_t})),Ft=pt(e,"onRotateStart",Ot);return a.isRotate=Ft!==!1,_.snapRenderInfo={request:r.isRequest},a.isRotate?Ot:!1},dragControl:function(e,r){var n,o,a,u=r.datas,f=r.clientDistX,v=r.clientDistY,h=r.parentRotate,b=r.parentFlag,C=r.isPinch,_=r.groupDelta,w=r.resolveMatrix,R=u.beforeDirection,T=u.beforeInfo,M=u.afterInfo,I=u.absoluteInfo,D=u.isRotate,z=u.startValue,W=u.rect,k=u.startClientX,H=u.startClientY;if(!!D){gn(r,"rotate");var L=Cs(r),F=R*L,U=e.props.parentMoveable,j=0,q,Y,K=0,J,ot,ut=0,vt,St,dt=180/Math.PI*z,ft=I.startValue,at=!1,_t=k+f,Mt=H+v;if(!b&&"parentDist"in r){var Ot=r.parentDist;q=Ot,J=Ot,vt=Ot}else C||b?(q=Qs(h,R,T),J=Qs(h,F,M),vt=Qs(h,F,I)):(q=hl(_t,Mt,R,T),J=hl(_t,Mt,F,M),vt=hl(_t,Mt,F,I),at=!0);if(Y=dt+q,ot=dt+J,St=ft+vt,pt(e,"onBeforeRotate",ct(e,r,{beforeRotation:Y,rotation:ot,absoluteRotation:St,setRotation:function(Jt){J=Jt-dt,q=J,vt=J}},!0)),n=pl(e,W,T,q,dt,at),j=n[0],q=n[1],Y=n[2],o=pl(e,W,M,J,dt,at),K=o[0],J=o[1],ot=o[2],a=pl(e,W,I,vt,ft,at),ut=a[0],vt=a[1],St=a[2],!(!ut&&!K&&!j&&!U&&!w)){var Ft=Ro(u,"rotate(".concat(ot,"deg)"),"rotate(".concat(J,"deg)"));w&&(u.fixedPosition=Fn(e,u.targetAllTransform,u.fixedDirection,u.fixedOffset,u));var wt=Qr(e,J,u),xt=Et(Yt(_||[0,0],wt),u.prevInverseDist||[0,0]);u.prevInverseDist=wt,u.requestValue=null;var Bt=qe(e,Ft,xt,C,r),Nt=Bt,he=cr([_t,Mt],I.startAbsoluteOrigin)-I.startDist,Dt=void 0;if(u.resolveAble==="resizable"){var zt=dl.dragControl(e,N(N({},xi(r,e.state,[r.deltaX,r.deltaY],!!C,!1,"resizable")),{resolveMatrix:!0,parentDistance:he}));zt&&(Dt=zt,Nt=gt(Nt,zt,r))}var ne=ct(e,r,N(N({delta:K,dist:J,rotate:ot,rotation:ot,beforeDist:q,beforeDelta:j,beforeRotate:Y,beforeRotation:Y,absoluteDist:vt,absoluteDelta:ut,absoluteRotate:St,absoluteRotation:St,isPinch:!!C,resize:Dt},Bt),Nt));return pt(e,"onRotate",ne),ne}}},dragControlEnd:function(e,r){var n=r.datas;if(!!n.isRotate){n.isRotate=!1;var o=mt(e,r,{});return pt(e,"onRotateEnd",o),o}},dragGroupControlCondition:gl,dragGroupControlStart:function(e,r){var n=r.datas,o=e.state,a=o.left,u=o.top,f=o.beforeOrigin,v=this.dragControlStart(e,r);if(!v)return!1;v.set(n.beforeDirection*e.rotation);var h=$t(e,this,"dragControlStart",r,function(_,w){var R=_.state,T=R.left,M=R.top,I=R.beforeOrigin,D=Yt(Et([T,M],[a,u]),Et(I,f));return w.datas.startGroupClient=D,w.datas.groupClient=D,N(N({},w),{parentRotate:0})}),b=N(N({},v),{targets:e.props.targets,events:h}),C=pt(e,"onRotateGroupStart",b);return n.isRotate=C!==!1,n.isRotate?v:!1},dragGroupControl:function(e,r){var n=r.datas;if(!!n.isRotate){Gt(e,"onBeforeRotate",function(b){pt(e,"onBeforeRotateGroup",ct(e,r,N(N({},b),{targets:e.props.targets}),!0))});var o=this.dragControl(e,r);if(!!o){var a=n.beforeDirection,u=o.beforeDist,f=u/180*Math.PI,v=$t(e,this,"dragControl",r,function(b,C){var _=C.datas.startGroupClient,w=C.datas.groupClient,R=w[0],T=w[1],M=Vn(_,f*a),I=M[0],D=M[1],z=[I-R,D-T];return C.datas.groupClient=[I,D],N(N({},C),{parentRotate:u,groupDelta:z})});e.rotation=a*o.beforeRotation;var h=N({targets:e.props.targets,events:v,set:function(b){e.rotation=b},setGroupRotation:function(b){e.rotation=b}},o);return pt(e,"onRotateGroup",h),h}}},dragGroupControlEnd:function(e,r){var n=r.isDrag,o=r.datas;if(!!o.isRotate){this.dragControlEnd(e,r);var a=$t(e,this,"dragControlEnd",r),u=mt(e,r,{targets:e.props.targets,events:a});return pt(e,"onRotateGroupEnd",u),n}},request:function(e){var r={},n=0,o=e.getRotation();return{isControl:!0,requestStart:function(){return{datas:r}},request:function(a){return"deltaRotate"in a?n+=a.deltaRotate:"rotate"in a&&(n=a.rotate-o),{datas:r,parentDist:n}},requestEnd:function(){return{datas:r,isDrag:!0}}}}},au=jn("scalable"),Ec={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Jl("scalable"),dragControlCondition:au,viewClassName:Ri("scalable"),dragControlStart:function(e,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,u=r.parentDirection,f=rt(u,o,a,n),v=e.state,h=v.width,b=v.height,C=v.targetTransform,_=v.target,w=v.pos1,R=v.pos2,T=v.pos4;if(!f||!_)return!1;o||$r(e,r),n.datas={},n.transform=C,n.prevDist=[1,1],n.direction=f,n.startOffsetWidth=h,n.startOffsetHeight=b,n.startValue=[1,1];var M=cr(w,R),I=cr(R,T),D=!f[0]&&!f[1]||f[0]||!f[1];n.scaleWidth=M,n.scaleHeight=I,n.scaleXRatio=M/h,n.scaleYRatio=I/b,Ki(r,"scale"),n.isWidth=D;function z(L){n.ratio=L&&isFinite(L)?L:0}n.startPositions=tt(e.state);function W(L){var F=ru(n.startPositions,L);n.fixedDirection=F.fixedDirection,n.fixedPosition=F.fixedPosition,n.fixedOffset=F.fixedOffset}n.setFixedDirection=W,z(cr(w,R)/cr(R,T)),W([-f[0],-f[1]]);var k=ct(e,r,N(N({direction:f,set:function(L){n.startValue=L},setRatio:z,setFixedDirection:W},$i(r)),{dragStart:jr.dragStart(e,new ei().dragStart([0,0],r))})),H=pt(e,"onScaleStart",k);return n.startFixedDirection=n.fixedDirection,H!==!1&&(n.isScale=!0,e.state.snapRenderInfo={request:r.isRequest,direction:f}),n.isScale?k:!1},dragControl:function(e,r){gn(r,"scale");var n=r.datas,o=r.parentKeepRatio,a=r.parentFlag,u=r.isPinch,f=r.dragClient,v=r.isRequest,h=r.resolveMatrix,b=n.prevDist,C=n.direction,_=n.startOffsetWidth,w=n.startOffsetHeight,R=n.isScale,T=n.startValue,M=n.isWidth,I=n.ratio;if(!R)return!1;var D=e.props,z=D.throttleScale,W=D.parentMoveable,k=C;!C[0]&&!C[1]&&(k=[1,1]);var H=I&&(o!=null?o:D.keepRatio)||!1,L=e.state;function F(){var Ot=dr(k,H,n,r),Ft=Ot.distWidth,wt=Ot.distHeight,xt=_?(_+Ft)/_:1,Bt=w?(w+wt)/w:1;return xt=k[0]||H?xt*T[0]:T[0],Bt=k[1]||H?Bt*T[1]:T[1],xt===0&&(xt=(b[0]>0?1:-1)*ti),Bt===0&&(Bt=(b[1]>0?1:-1)*ti),[xt,Bt]}var U=F();if(!u&&e.props.groupable){var j=L.snapRenderInfo||{},q=j.direction;le(q)&&(q[0]||q[1])&&(L.snapRenderInfo={direction:C,request:r.isRequest})}pt(e,"onBeforeScale",ct(e,r,{scale:U,setFixedDirection:function(Ot){return n.setFixedDirection(Ot),U=F(),U},startFixedDirection:n.startFixedDirection,setScale:function(Ot){U=Ot}},!0));var Y=[U[0]/T[0],U[1]/T[1]],K=f,J=[0,0],ot=!f&&!a&&u;if(ot||h?K=Fn(e,n.targetAllTransform,[0,0],[0,0],n):f||(K=n.fixedPosition),u||(J=Sc(e,Y,C,v,n)),H){k[0]&&k[1]&&J[0]&&J[1]&&(Math.abs(J[0]*_)>Math.abs(J[1]*w)?J[1]=0:J[0]=0);var ut=!J[0]&&!J[1];if(ut&&(M?Y[0]=Lt(Y[0]*T[0],z)/T[0]:Y[1]=Lt(Y[1]*T[1],z)/T[1]),k[0]&&!k[1]||J[0]&&!J[1]||ut&&M){Y[0]+=J[0];var vt=_*Y[0]*T[0]/I;Y[1]=vt/w/T[1]}else if(!k[0]&&k[1]||!J[0]&&J[1]||ut&&!M){Y[1]+=J[1];var St=w*Y[1]*T[1]*I;Y[0]=St/_/T[0]}}else Y[0]+=J[0],Y[1]+=J[1],J[0]||(Y[0]=Lt(Y[0]*T[0],z)/T[0]),J[1]||(Y[1]=Lt(Y[1]*T[1],z)/T[1]);Y[0]===0&&(Y[0]=(b[0]>0?1:-1)*ti),Y[1]===0&&(Y[1]=(b[1]>0?1:-1)*ti);var dt=[Y[0]/b[0],Y[1]/b[1]];U=qa(Y,T);var ft=Qi(e,Y,n.fixedDirection,K,n.fixedOffset,n),at=ot?ft:Et(ft,n.prevInverseDist||[0,0]);if(n.prevDist=Y,n.prevInverseDist=ft,U[0]===b[0]&&U[1]===b[1]&&at.every(function(Ot){return!Ot})&&!W&&!ot)return!1;var _t=Ro(n,"scale(".concat(U.join(", "),")"),"scale(".concat(Y.join(", "),")")),Mt=ct(e,r,N({offsetWidth:_,offsetHeight:w,direction:C,scale:U,dist:Y,delta:dt,isPinch:!!u},qe(e,_t,at,u,r)));return pt(e,"onScale",Mt),Mt},dragControlEnd:function(e,r){var n=r.datas;if(!n.isScale)return!1;n.isScale=!1;var o=mt(e,r,{});return pt(e,"onScaleEnd",o),o},dragGroupControlCondition:au,dragGroupControlStart:function(e,r){var n=r.datas,o=this.dragControlStart(e,r);if(!o)return!1;var a=Ye(e,"resizable",r);n.moveableScale=e.scale;var u=$t(e,this,"dragControlStart",r,function(b,C){return ve(e,b,n,C)}),f=function(b){o.setFixedDirection(b),u.forEach(function(C,_){C.setFixedDirection(b),ve(e,C.moveable,n,a[_])})};n.setFixedDirection=f;var v=N(N({},o),{targets:e.props.targets,events:u,setFixedDirection:f}),h=pt(e,"onScaleGroupStart",v);return n.isScale=h!==!1,n.isScale?v:!1},dragGroupControl:function(e,r){var n=r.datas;if(!!n.isScale){Gt(e,"onBeforeScale",function(_){pt(e,"onBeforeScaleGroup",ct(e,r,N(N({},_),{targets:e.props.targets}),!0))});var o=this.dragControl(e,r);if(!!o){var a=n.moveableScale;e.scale=[o.scale[0]*a[0],o.scale[1]*a[1]];var u=e.props.keepRatio,f=o.dist,v=o.scale,h=n.fixedPosition,b=$t(e,this,"dragControl",r,function(_,w){var R=Qe(fn(e.rotation/180*Math.PI,3),[w.datas.originalX*f[0],w.datas.originalY*f[1],1],3),T=R[0],M=R[1];return N(N({},w),{parentDist:null,parentScale:v,parentKeepRatio:u,dragClient:Yt(h,[T,M])})}),C=N({targets:e.props.targets,events:b},o);return pt(e,"onScaleGroup",C),C}}},dragGroupControlEnd:function(e,r){var n=r.isDrag,o=r.datas;if(!!o.isScale){this.dragControlEnd(e,r);var a=$t(e,this,"dragControlEnd",r),u=mt(e,r,{targets:e.props.targets,events:a});return pt(e,"onScaleGroupEnd",u),n}},request:function(){var e={},r=0,n=0;return{isControl:!0,requestStart:function(o){return{datas:e,parentDirection:o.direction||[1,1]}},request:function(o){return r+=o.deltaWidth,n+=o.deltaHeight,{datas:e,parentDist:[r,n],parentKeepRatio:o.keepRatio}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Po(e,r){return e.map(function(n,o){return re(n,r[o],1,2)})}function su(e,r,n){var o=Ge(e,r),a=Ge(e,n),u=a-o;return u>=0?u:u+2*Math.PI}function Mc(e,r){var n=su(e[0],e[1],e[2]),o=su(r[0],r[1],r[2]),a=Math.PI;return!(n>=a&&o<=a||n<=a&&o>=a)}var Oc={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:Ri("warpable"),render:function(e,r){var n=e.props,o=n.resizable,a=n.scalable,u=n.warpable,f=n.zoom;if(o||a||!u)return[];var v=e.state,h=v.pos1,b=v.pos2,C=v.pos3,_=v.pos4,w=Po(h,b),R=Po(b,h),T=Po(h,C),M=Po(C,h),I=Po(C,_),D=Po(_,C),z=Po(b,_),W=Po(_,b);return bt([r.createElement("div",{className:Ct("line"),key:"middeLine1",style:x(w,I,f)}),r.createElement("div",{className:Ct("line"),key:"middeLine2",style:x(R,D,f)}),r.createElement("div",{className:Ct("line"),key:"middeLine3",style:x(T,z,f)}),r.createElement("div",{className:Ct("line"),key:"middeLine4",style:x(M,W,f)})],tu(e,"warpable",r),!0)},dragControlCondition:function(e,r){if(r.isRequest)return!1;var n=r.inputEvent.target;return Ie(n,Ct("direction"))&&Ie(n,Ct("warpable"))},dragControlStart:function(e,r){var n=r.datas,o=r.inputEvent,a=e.props.target,u=o.target,f=st(u,n);if(!f||!a)return!1;var v=e.state,h=v.transformOrigin,b=v.is3d,C=v.targetTransform,_=v.targetMatrix,w=v.width,R=v.height,T=v.left,M=v.top;n.datas={},n.targetTransform=C,n.warpTargetMatrix=b?_:un(_,3,4),n.targetInverseMatrix=ln(Rr(n.warpTargetMatrix,4),3,4),n.direction=f,n.left=T,n.top=M,n.poses=[[0,0],[w,0],[0,R],[w,R]].map(function(z){return Et(z,h)}),n.nextPoses=n.poses.map(function(z){var W=z[0],k=z[1];return Qe(n.warpTargetMatrix,[W,k,0,1],4)}),n.startValue=ye(4),n.prevMatrix=ye(4),n.absolutePoses=tt(v),n.posIndexes=Xa(f),$r(e,r),Ki(r,"matrix3d"),v.snapRenderInfo={request:r.isRequest,direction:f};var I=ct(e,r,N({set:function(z){n.startValue=z}},$i(r))),D=pt(e,"onWarpStart",I);return D!==!1&&(n.isWarp=!0),n.isWarp},dragControl:function(e,r){var n=r.datas,o=r.isRequest,a=r.distX,u=r.distY,f=n.targetInverseMatrix,v=n.prevMatrix,h=n.isWarp,b=n.startValue,C=n.poses,_=n.posIndexes,w=n.absolutePoses;if(!h)return!1;if(gn(r,"matrix3d"),Hr(e,"warpable")){var R=_.map(function(j){return w[j]});R.length>1&&R.push([(R[0][0]+R[1][0])/2,(R[0][1]+R[1][1])/2]);var T=Ks(e,o,{horizontal:R.map(function(j){return j[1]+u}),vertical:R.map(function(j){return j[0]+a})}),M=T.horizontal,I=T.vertical;u-=M.offset,a-=I.offset}var D=Kr({datas:n,distX:a,distY:u},!0),z=n.nextPoses.slice();if(_.forEach(function(j){z[j]=Yt(z[j],D)}),!qt.every(function(j){return Mc(j.map(function(q){return C[q]}),j.map(function(q){return z[q]}))}))return!1;var W=Vo(C[0],C[2],C[1],C[3],z[0],z[2],z[1],z[3]);if(!W.length)return!1;var k=ce(f,W,4),H=ea(n,k,!0),L=ce(Rr(v,4),H,4);n.prevMatrix=H;var F=ce(b,H,4),U=Ro(n,"matrix3d(".concat(F.join(", "),")"),"matrix3d(".concat(H.join(", "),")"));return wi(r,U),pt(e,"onWarp",ct(e,r,N({delta:L,matrix:F,dist:H,multiply:ce,transform:U},lt({transform:U},r)))),!0},dragControlEnd:function(e,r){var n=r.datas,o=r.isDrag;return n.isWarp?(n.isWarp=!1,pt(e,"onWarpEnd",mt(e,r,{})),o):!1}},Ic=Ct("area-pieces"),Js=Ct("area-piece"),lu=Ct("avoid"),Pc=Ct("view-dragging");function ml(e){var r=e.areaElement;if(!!r){var n=e.state,o=n.width,a=n.height;No(r,lu),r.style.cssText+="left: 0px; top: 0px; width: ".concat(o,"px; height: ").concat(a,"px")}}function uu(e){return e.createElement("div",{key:"area_pieces",className:Ic},e.createElement("div",{className:Js}),e.createElement("div",{className:Js}),e.createElement("div",{className:Js}),e.createElement("div",{className:Js}))}var cu={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(e,r){var n=e.props,o=n.target,a=n.dragArea,u=n.groupable,f=n.passDragArea,v=e.getState(),h=v.width,b=v.height,C=v.renderPoses,_=f?Ct("area","pass"):Ct("area");if(u)return[r.createElement("div",{key:"area",ref:(0,Ze.iH)(e,"areaElement"),className:_}),uu(r)];if(!o||!a)return[];var w=Vo([0,0],[h,0],[0,b],[h,b],C[0],C[1],C[2],C[3]),R=w.length?Ci(w,!0):"none";return[r.createElement("div",{key:"area",ref:(0,Ze.iH)(e,"areaElement"),className:_,style:{top:"0px",left:"0px",width:"".concat(h,"px"),height:"".concat(b,"px"),transformOrigin:"0 0",transform:R}}),uu(r)]},dragStart:function(e,r){var n=r.datas,o=r.clientX,a=r.clientY,u=r.inputEvent;if(!u)return!1;n.isDragArea=!1;var f=e.areaElement,v=e.state,h=v.moveableClientRect,b=v.renderPoses,C=v.rootMatrix,_=v.is3d,w=h.left,R=h.top,T=i(b),M=T.left,I=T.top,D=T.width,z=T.height,W=_?4:3,k=ze(C,[o-w,a-R],W),H=k[0],L=k[1];H-=M,L-=I;var F=[{left:M,top:I,width:D,height:L-10},{left:M,top:I,width:H-10,height:z},{left:M,top:I+L+10,width:D,height:z-L-10},{left:M+H+10,top:I,width:D-H-10,height:z}],U=[].slice.call(f.nextElementSibling.children);F.forEach(function(j,q){U[q].style.cssText="left: ".concat(j.left,"px;top: ").concat(j.top,"px; width: ").concat(j.width,"px; height: ").concat(j.height,"px;")}),xa(f,lu),v.disableNativeEvent=!0},drag:function(e,r){var n=r.datas,o=r.inputEvent;if(this.enableNativeEvent(e),!o)return!1;n.isDragArea||(n.isDragArea=!0,ml(e))},dragEnd:function(e,r){this.enableNativeEvent(e);var n=r.inputEvent,o=r.datas;if(!n)return!1;o.isDragArea||ml(e)},dragGroupStart:function(e,r){return this.dragStart(e,r)},dragGroup:function(e,r){return this.drag(e,r)},dragGroupEnd:function(e,r){return this.dragEnd(e,r)},unset:function(e){ml(e),e.state.disableNativeEvent=!1},enableNativeEvent:function(e){var r=e.state;r.disableNativeEvent&&Bo(function(){r.disableNativeEvent=!1})}},Dc=Zn("origin",{props:["origin","svgOrigin"],render:function(e,r){var n=e.props,o=n.zoom,a=n.svgOrigin,u=n.groupable,f=e.getState(),v=f.beforeOrigin,h=f.rotation,b=f.svg,C=f.allMatrix,_=f.is3d,w=f.left,R=f.top,T=f.offsetWidth,M=f.offsetHeight,I;if(!u&&b&&a){var D=xr(a,T,M),z=D[0],W=D[1],k=_?4:3,H=d(C,[z,W],k);I=E(h,o,Et(H,[w,R]))}else I=E(h,o,v);return[r.createElement("div",{className:Ct("control","origin"),style:I,key:"beforeOrigin"})]}});function zc(e){var r=e.scrollContainer;return[r.scrollLeft,r.scrollTop]}var Ac={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(e,r){var n=e.props,o=n.scrollContainer,a=o===void 0?e.getContainer():o,u=n.scrollOptions,f=new Pe,v=yt(a,!0);r.datas.dragScroll=f,e.state.dragScroll=f;var h=r.isControl?"controlGesto":"targetGesto",b=r.targets;f.on("scroll",function(C){var _=C.container,w=C.direction,R=ct(e,r,{scrollContainer:_,direction:w}),T=b?"onScrollGroup":"onScroll";b&&(R.targets=b),pt(e,T,R)}).on("move",function(C){var _=C.offsetX,w=C.offsetY,R=C.inputEvent;e[h].scrollBy(_,w,R.inputEvent,!0)}).on("scrollDrag",function(C){var _=C.next;_(e[h].getCurrentEvent())}),f.dragStart(r,N({container:v},u))},checkScroll:function(e,r){var n=r.datas.dragScroll;if(!!n){var o=e.props,a=o.scrollContainer,u=a===void 0?e.getContainer():a,f=o.scrollThreshold,v=f===void 0?0:f,h=o.scrollThrottleTime,b=h===void 0?0:h,C=o.getScrollPosition,_=C===void 0?zc:C,w=o.scrollOptions;return n.drag(r,N({container:u,threshold:v,throttleTime:b,getScrollPosition:function(R){return _({scrollContainer:R.container,direction:R.direction})}},w)),!0}},drag:function(e,r){return this.checkScroll(e,r)},dragEnd:function(e,r){r.datas.dragScroll.dragEnd(),r.datas.dragScroll=null},dragControlStart:function(e,r){return this.dragStart(e,N(N({},r),{isControl:!0}))},dragControl:function(e,r){return this.drag(e,r)},dragControlEnd:function(e,r){return this.dragEnd(e,r)},dragGroupStart:function(e,r){return this.dragStart(e,N(N({},r),{targets:e.props.targets}))},dragGroup:function(e,r){return this.drag(e,N(N({},r),{targets:e.props.targets}))},dragGroupEnd:function(e,r){return this.dragEnd(e,N(N({},r),{targets:e.props.targets}))},dragGroupControlStart:function(e,r){return this.dragStart(e,N(N({},r),{targets:e.props.targets,isControl:!0}))},dragGroupControl:function(e,r){return this.drag(e,N(N({},r),{targets:e.props.targets}))},dragGroupControEnd:function(e,r){return this.dragEnd(e,N(N({},r),{targets:e.props.targets}))},unset:function(e){var r,n=e.state;(r=n.dragScroll)===null||r===void 0||r.dragEnd(),n.dragScroll=null}},fu={name:"",props:["target","dragTarget","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","edge","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","displayAroundControls","controlPadding","preventDefault","requestStyles"],events:["changeTargets"]},kc=Zn("padding",{render:function(e,r){var n=e.props;if(n.dragArea)return[];var o=n.padding||{},a=o.left,u=a===void 0?0:a,f=o.top,v=f===void 0?0:f,h=o.right,b=h===void 0?0:h,C=o.bottom,_=C===void 0?0:C,w=e.getState(),R=w.renderPoses,T=w.pos1,M=w.pos2,I=w.pos3,D=w.pos4,z=[T,M,I,D],W=[];return u>0&&W.push([0,2]),v>0&&W.push([0,1]),b>0&&W.push([1,3]),_>0&&W.push([2,3]),W.map(function(k,H){var L=k[0],F=k[1],U=z[L],j=z[F],q=R[L],Y=R[F],K=Vo([0,0],[100,0],[0,100],[100,100],U,j,q,Y);if(!!K.length)return r.createElement("div",{key:"padding".concat(H),className:Ct("padding"),style:{transform:Ci(K,!0)}})})}}),du=["nw","ne","se","sw"];function tl(e,r){var n=e[0]+e[1],o=n>r?r/n:1;return e[0]*=o,e[1]=r-e[1]*o,e}var Lc=[1,2,5,6],Gc=[0,3,4,7],ua=[1,-1,-1,1],ca=[1,1,-1,-1];function yl(e,r,n,o,a,u,f,v){a===void 0&&(a=0),u===void 0&&(u=0),f===void 0&&(f=n),v===void 0&&(v=o);var h=[],b=!1,C=e.filter(function(w){return!w.virtual}),_=C.map(function(w){var R=w.horizontal,T=w.vertical,M=w.pos;if(T&&!b&&(b=!0,h.push("/")),b){var I=Math.max(0,T===1?M[1]-u:v-M[1]);return h.push(_r(I,o,r)),I}else{var I=Math.max(0,R===1?M[0]-a:f-M[0]);return h.push(_r(I,n,r)),I}});return{radiusPoses:C,styles:h,raws:_}}function vu(e){for(var r=[0,0],n=[0,0],o=e.length,a=0;a-1?e.slice(0,_):e).length,R=e.slice(0,w),T=e.slice(w+1),M=R.length,I=T.length,D=I>0,z=R[0],W=z===void 0?"0px":z,k=R[1],H=k===void 0?W:k,L=R[2],F=L===void 0?W:L,U=R[3],j=U===void 0?H:U,q=T[0],Y=q===void 0?W:q,K=T[1],J=K===void 0?D?Y:H:K,ot=T[2],ut=ot===void 0?D?Y:F:ot,vt=T[3],St=vt===void 0?D?J:j:vt,dt=[W,H,F,j].map(function(Ft){return Xt(Ft,r)}),ft=[Y,J,ut,St].map(function(Ft){return Xt(Ft,n)}),at=dt.slice(),_t=ft.slice();v=tl([at[0],at[1]],r),at[0]=v[0],at[1]=v[1],h=tl([at[3],at[2]],r),at[3]=h[0],at[2]=h[1],b=tl([_t[0],_t[3]],n),_t[0]=b[0],_t[3]=b[1],C=tl([_t[1],_t[2]],n),_t[1]=C[0],_t[2]=C[1];var Mt=f?at:at.slice(0,Math.max(u[0],M)),Ot=f?_t:_t.slice(0,Math.max(u[1],I));return bt(bt([],Mt.map(function(Ft,wt){var xt=du[wt];return{virtual:wt>=M,horizontal:ua[wt],vertical:0,pos:[o+Ft,a+(ca[wt]===-1?n:0)],sub:!0,raw:dt[wt],direction:xt}}),!0),Ot.map(function(Ft,wt){var xt=du[wt];return{virtual:wt>=I,horizontal:0,vertical:ca[wt],pos:[o+(ua[wt]===-1?r:0),a+Ft],sub:!0,raw:ft[wt],direction:xt}}),!0)}function Wc(e,r,n,o,a){a===void 0&&(a=r.length);var u=vu(e.slice(o)),f=u.horizontalRange,v=u.verticalRange,h=n-o,b=0;if(h===0)b=a;else if(h>0&&h=v[0])b=v[0]+v[1]-h;else return;e.splice(n,b),r.splice(n,b)}function Fc(e,r,n,o,a,u,f,v,h,b,C){b===void 0&&(b=0),C===void 0&&(C=0);var _=vu(e.slice(n)),w=_.horizontalRange,R=_.verticalRange;if(o>-1)for(var T=ua[o]===1?u-b:v-u,M=w[1];M<=o;++M){var I=ca[M]===1?C:h,D=0;if(o===M?D=u:M===0?D=b+T:ua[M]===-1&&(D=v-(r[n][0]-b)),e.splice(n+M,0,{horizontal:ua[M],vertical:0,pos:[D,I]}),r.splice(n+M,0,[D,I]),M===0)break}else if(a>-1){var z=ca[a]===1?f-C:h-f;if(w[1]===0&&R[1]===0){var W=[b+z,C];e.push({horizontal:ua[0],vertical:0,pos:W}),r.push(W)}for(var k=R[0],M=R[1];M<=a;++M){var D=ua[M]===1?b:v,I=0;if(a===M?I=f:M===0?I=C+z:ca[M]===1?I=r[n+k][1]:ca[M]===-1&&(I=h-(r[n+k][1]-C)),e.push({horizontal:0,vertical:ca[M],pos:[D,I]}),r.push([D,I]),M===0)break}}}function Bc(e,r){r===void 0&&(r=e.map(function(a){return a.raw}));var n=e.map(function(a,u){return a.horizontal?r[u]:null}).filter(function(a){return a!=null}),o=e.map(function(a,u){return a.vertical?r[u]:null}).filter(function(a){return a!=null});return{horizontals:n,verticals:o}}var Hc=[[0,-1,"n"],[1,0,"e"]],jc=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function Sl(e,r,n){var o=e.props.clipRelative,a=e.state,u=a.width,f=a.height,v=r,h=v.type,b=v.poses,C=h==="rect",_=h==="circle";if(h==="polygon")return n.map(function(L){return"".concat(_r(L[0],u,o)," ").concat(_r(L[1],f,o))});if(C||h==="inset"){var w=n[1][1],R=n[3][0],T=n[7][0],M=n[5][1];if(C)return[w,R,M,T].map(function(L){return"".concat(L,"px")});var I=[w,u-R,f-M,T].map(function(L,F){return _r(L,F%2?u:f,o)});if(n.length>8){var D=Et(n[4],n[0]),z=D[0],W=D[1];I.push.apply(I,bt(["round"],yl(b.slice(8).map(function(L,F){return N(N({},L),{pos:n[F]})}),o,z,W,T,w,R,M).styles,!1))}return I}else if(_||h==="ellipse"){var k=n[0],H=_r(Math.abs(n[1][1]-k[1]),_?Math.sqrt((u*u+f*f)/2):f,o),I=_?[H]:[_r(Math.abs(n[2][0]-k[0]),u,o),H];return I.push("at",_r(k[0],u,o),_r(k[1],f,o)),I}}function el(e,r,n,o){var a=[o,(o+r)/2,r],u=[e,(e+n)/2,n];return jc.map(function(f){var v=f[0],h=f[1],b=f[2],C=a[v+1],_=u[h+1];return{vertical:Math.abs(h),horizontal:Math.abs(v),direction:b,pos:[C,_]}})}function pu(e){var r=[Infinity,-Infinity],n=[Infinity,-Infinity];return e.forEach(function(o){var a=o.pos;r[0]=Math.min(r[0],a[0]),r[1]=Math.max(r[1],a[0]),n[0]=Math.min(n[0],a[1]),n[1]=Math.max(n[1],a[1])}),[Math.abs(r[1]-r[0]),Math.abs(n[1]-n[0])]}function gu(e,r,n,o,a){var u,f,v,h,b,C,_;if(!!e){var w=a;if(!w){var R=sr(e),T=R("clipPath");w=T!=="none"?T:R("clip")}if(!((!w||w==="none"||w==="auto")&&(w=o,!w))){var M=Ne(w),I=M.prefix,D=I===void 0?w:I,z=M.value,W=z===void 0?"":z,k=D==="circle",H=" ";if(D==="polygon"){var L=Gr(W||"0% 0%, 100% 0%, 100% 100%, 0% 100%");H=",";var F=L.map(function(te){var ae=te.split(" "),se=ae[0],on=ae[1];return{vertical:1,horizontal:1,pos:[Xt(se,r),Xt(on,n)]}}),U=Yn(F.map(function(te){return te.pos}));return{type:D,clipText:w,poses:F,splitter:H,left:U.minX,right:U.maxX,top:U.minY,bottom:U.maxY}}else if(k||D==="ellipse"){var j="",q="",Y=0,K=0,L=gr(W);if(k){var J="";u=L[0],J=u===void 0?"50%":u,f=L[2],j=f===void 0?"50%":f,v=L[3],q=v===void 0?"50%":v,Y=Xt(J,Math.sqrt((r*r+n*n)/2)),K=Y}else{var ot="",ut="";h=L[0],ot=h===void 0?"50%":h,b=L[1],ut=b===void 0?"50%":b,C=L[3],j=C===void 0?"50%":C,_=L[4],q=_===void 0?"50%":_,Y=Xt(ot,r),K=Xt(ut,n)}var vt=[Xt(j,r),Xt(q,n)],F=bt([{vertical:1,horizontal:1,pos:vt,direction:"nesw"}],Hc.slice(0,k?1:2).map(function(se){return{vertical:Math.abs(se[1]),horizontal:se[0],direction:se[2],sub:!0,pos:[vt[0]+se[0]*Y,vt[1]+se[1]*K]}}),!0);return{type:D,clipText:w,radiusX:Y,radiusY:K,left:vt[0]-Y,top:vt[1]-K,right:vt[0]+Y,bottom:vt[1]+K,poses:F,splitter:H}}else if(D==="inset"){var L=gr(W||"0 0 0 0"),St=L.indexOf("round"),dt=(St>-1?L.slice(0,St):L).length,ft=L.slice(dt+1),at=L.slice(0,dt),_t=at[0],Mt=at[1],Ot=Mt===void 0?_t:Mt,Ft=at[2],wt=Ft===void 0?_t:Ft,xt=at[3],Bt=xt===void 0?Ot:xt,Nt=[_t,wt].map(function(se){return Xt(se,n)}),he=Nt[0],Dt=Nt[1],zt=[Bt,Ot].map(function(se){return Xt(se,r)}),ne=zt[0],Jt=zt[1],Ke=r-Jt,ue=n-Dt,oe=hu(ft,Ke-ne,ue-he,ne,he),F=bt(bt([],el(he,Ke,ue,ne),!0),oe,!0);return{type:"inset",clipText:w,poses:F,top:he,left:ne,right:Ke,bottom:ue,radius:ft,splitter:H}}else if(D==="rect"){var L=Gr(W||"0px, ".concat(r,"px, ").concat(n,"px, 0px"));H=",";var Re=L.map(function(Mr){var zo=si(Mr).value;return zo}),he=Re[0],Jt=Re[1],Dt=Re[2],ne=Re[3],F=el(he,Jt,Dt,ne);return{type:"rect",clipText:w,poses:F,top:he,right:Jt,bottom:Dt,left:ne,values:L,splitter:H}}}}}function Nc(e,r,n,o,a){var u=e[r],f=u.direction,v=u.sub,h=e.map(function(){return[0,0]}),b=f?f.split(""):[];if(o&&r<8){var C=b.filter(function(J){return J==="w"||J==="e"}),_=b.filter(function(J){return J==="n"||J==="s"}),w=C[0],R=_[0];h[r]=n;var T=pu(e),M=T[0],I=T[1],D=M&&I?M/I:0;if(D&&a){var z=(r+4)%8,W=e[z].pos,k=[0,0];f.indexOf("w")>-1?k[0]=-1:f.indexOf("e")>-1&&(k[0]=1),f.indexOf("n")>-1?k[1]=-1:f.indexOf("s")>-1&&(k[1]=1);var H=ie([M,I],n,D,k,!0),L=M+H[0],F=I+H[1],U=W[1],j=W[1],q=W[0],Y=W[0];k[0]===-1?q=Y-L:k[0]===1?Y=q+L:(q=q-L/2,Y=Y+L/2),k[1]===-1?U=j-F:(k[1]===1||(U=j-F/2),j=U+F);var K=el(U,Y,j,q);e.forEach(function(J,ot){h[ot][0]=K[ot].pos[0]-J.pos[0],h[ot][1]=K[ot].pos[1]-J.pos[1]})}else e.forEach(function(J,ot){var ut=J.direction;!ut||(ut.indexOf(w)>-1&&(h[ot][0]=n[0]),ut.indexOf(R)>-1&&(h[ot][1]=n[1]))}),w&&(h[1][0]=n[0]/2,h[5][0]=n[0]/2),R&&(h[3][1]=n[1]/2,h[7][1]=n[1]/2)}else f&&!v?b.forEach(function(J){var ot=J==="n"||J==="s";e.forEach(function(ut,vt){var St=ut.direction,dt=ut.horizontal,ft=ut.vertical;!St||St.indexOf(J)===-1||(h[vt]=[ot||!dt?0:n[0],!ot||!ft?0:n[1]])})}):h[r]=n;return h}function Vc(e,r){var n=pn(e,r),o=n[0],a=n[1],u=r.datas,f=u.clipPath,v=u.clipIndex,h=f,b=h.type,C=h.poses,_=h.splitter,w=C.map(function(z){return z.pos});if(b==="polygon")w.splice(v,0,[o,a]);else if(b==="inset"){var R=Lc.indexOf(v),T=Gc.indexOf(v),M=C.length;if(Fc(C,w,8,R,T,o,a,w[4][0],w[4][1],w[0][0],w[0][1]),M===C.length)return}else return;var I=Sl(e,f,w),D="".concat(b,"(").concat(I.join(_),")");pt(e,"onClip",ct(e,r,N({clipEventType:"added",clipType:b,poses:w,clipStyles:I,clipStyle:D,distX:0,distY:0},lt({clipPath:D},r))))}function Uc(e,r){var n=r.datas,o=n.clipPath,a=n.clipIndex,u=o,f=u.type,v=u.poses,h=u.splitter,b=v.map(function(R){return R.pos}),C=b.length;if(f==="polygon")v.splice(a,1),b.splice(a,1);else if(f==="inset"){if(a<8||(Wc(v,b,a,8,C),C===v.length))return}else return;var _=Sl(e,o,b),w="".concat(f,"(").concat(_.join(h),")");pt(e,"onClip",ct(e,r,N({clipEventType:"removed",clipType:f,poses:b,clipStyles:_,clipStyle:w,distX:0,distY:0},lt({clipPath:w},r))))}var Xc={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[`.control.clip-control { background: #6d6; cursor: pointer; } .control.clip-control.clip-radius { background: #d66; } .line.clip-line { background: #6e6; cursor: move; z-index: 1; } .clip-area { position: absolute; top: 0; left: 0; } .clip-ellipse { position: absolute; cursor: move; border: 1px solid #6d6; border: var(--zoompx) solid #6d6; border-radius: 50%; transform-origin: 0px 0px; }`,`:host { --bounds-color: #d66; }`,`.guideline { pointer-events: none; z-index: 2; }`,`.line.guideline.bounds { background: #d66; background: var(--bounds-color); }`],render:function(e,r){var n=e.props,o=n.customClipPath,a=n.defaultClipPath,u=n.clipArea,f=n.zoom,v=n.groupable,h=e.getState(),b=h.target,C=h.width,_=h.height,w=h.allMatrix,R=h.is3d,T=h.left,M=h.top,I=h.pos1,D=h.pos2,z=h.pos3,W=h.pos4,k=h.clipPathState,H=h.snapBoundInfos,L=h.rotation;if(!b||v)return[];var F=gu(b,C,_,a||"inset",k||o);if(!F)return[];var U=R?4:3,j=F.type,q=F.poses,Y=q.map(function(ue){var oe=d(w,ue.pos,U);return[oe[0]-T,oe[1]-M]}),K=[],J=[],ot=j==="rect",ut=j==="inset",vt=j==="polygon";if(ot||ut||vt){var St=ut?Y.slice(0,8):Y;J=St.map(function(ue,oe){var Re=oe===0?St[St.length-1]:St[oe-1],te=Ge(Re,ue),ae=y(Re,ue);return r.createElement("div",{key:"clipLine".concat(oe),className:Ct("line","clip-line","snap-control"),"data-clip-index":oe,style:{width:"".concat(ae,"px"),transform:"translate(".concat(Re[0],"px, ").concat(Re[1],"px) rotate(").concat(te,"rad) scaleY(").concat(f,")")}})})}if(K=Y.map(function(ue,oe){return r.createElement("div",{key:"clipControl".concat(oe),className:Ct("control","clip-control","snap-control"),"data-clip-index":oe,style:{transform:"translate(".concat(ue[0],"px, ").concat(ue[1],"px) rotate(").concat(L,"rad) scale(").concat(f,")")}})}),ut&&K.push.apply(K,Y.slice(8).map(function(ue,oe){return r.createElement("div",{key:"clipRadiusControl".concat(oe),className:Ct("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+oe,style:{transform:"translate(".concat(ue[0],"px, ").concat(ue[1],"px) rotate(").concat(L,"rad) scale(").concat(f,")")}})})),j==="circle"||j==="ellipse"){var dt=F.left,ft=F.top,at=F.radiusX,_t=F.radiusY,Mt=Et(d(w,[dt,ft],U),d(w,[0,0],U)),Ot=Mt[0],Ft=Mt[1],wt="none";if(!u){for(var xt=Math.max(10,at/5,_t/5),Bt=[],Nt=0;Nt<=xt;++Nt){var he=Math.PI*2/xt*Nt;Bt.push([at+(at-f)*Math.cos(he),_t+(_t-f)*Math.sin(he)])}Bt.push([at,-2]),Bt.push([-2,-2]),Bt.push([-2,_t*2+2]),Bt.push([at*2+2,_t*2+2]),Bt.push([at*2+2,-2]),Bt.push([at,-2]),wt="polygon(".concat(Bt.map(function(ue){return"".concat(ue[0],"px ").concat(ue[1],"px")}).join(", "),")")}K.push(r.createElement("div",{key:"clipEllipse",className:Ct("clip-ellipse","snap-control"),style:{width:"".concat(at*2,"px"),height:"".concat(_t*2,"px"),clipPath:wt,transform:"translate(".concat(-T+Ot,"px, ").concat(-M+Ft,"px) ").concat(Ci(w))}}))}if(u){var Dt=i(bt([I,D,z,W],Y,!0)),zt=Dt.width,ne=Dt.height,Jt=Dt.left,Ke=Dt.top;if(vt||ot||ut){var Bt=ut?Y.slice(0,8):Y;K.push(r.createElement("div",{key:"clipArea",className:Ct("clip-area","snap-control"),style:{width:"".concat(zt,"px"),height:"".concat(ne,"px"),transform:"translate(".concat(Jt,"px, ").concat(Ke,"px)"),clipPath:"polygon(".concat(Bt.map(function(oe){return"".concat(oe[0]-Jt,"px ").concat(oe[1]-Ke,"px")}).join(", "),")")}}))}}return H&&["vertical","horizontal"].forEach(function(ue){var oe=H[ue],Re=ue==="horizontal";oe.isSnap&&J.push.apply(J,oe.snap.posInfos.map(function(te,ae){var se=te.pos,on=Et(d(w,Re?[0,se]:[se,0],U),[T,M]),Do=Et(d(w,Re?[C,se]:[se,_],U),[T,M]);return Ps(r,"",on,Do,f,"clip".concat(ue,"snap").concat(ae),"guideline")})),oe.isBound&&J.push.apply(J,oe.bounds.map(function(te,ae){var se=te.pos,on=Et(d(w,Re?[0,se]:[se,0],U),[T,M]),Do=Et(d(w,Re?[C,se]:[se,_],U),[T,M]);return Ps(r,"",on,Do,f,"clip".concat(ue,"bounds").concat(ae),"guideline","bounds","bold")}))}),bt(bt([],K,!0),J,!0)},dragControlCondition:function(e,r){return r.inputEvent&&(r.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,r){var n=e.props,o=n.dragWithClip,a=o===void 0?!0:o;return a?!1:this.dragControlStart(e,r)},drag:function(e,r){return this.dragControl(e,N(N({},r),{isDragTarget:!0}))},dragEnd:function(e,r){return this.dragControlEnd(e,r)},dragControlStart:function(e,r){var n=e.state,o=e.props,a=o.defaultClipPath,u=o.customClipPath,f=n.target,v=n.width,h=n.height,b=r.inputEvent?r.inputEvent.target:null,C=b&&b.getAttribute("class")||"",_=r.datas,w=gu(f,v,h,a||"inset",u);if(!w)return!1;var R=w.clipText,T=w.type,M=w.poses,I=pt(e,"onClipStart",ct(e,r,{clipType:T,clipStyle:R,poses:M.map(function(D){return D.pos})}));return I===!1?(_.isClipStart=!1,!1):(_.isControl=C&&C.indexOf("clip-control")>-1,_.isLine=C.indexOf("clip-line")>-1,_.isArea=C.indexOf("clip-area")>-1||C.indexOf("clip-ellipse")>-1,_.clipIndex=b?parseInt(b.getAttribute("data-clip-index"),10):-1,_.clipPath=w,_.isClipStart=!0,n.clipPathState=R,$r(e,r),!0)},dragControl:function(e,r){var n,o,a=r.datas,u=r.originalDatas,f=r.isDragTarget;if(!a.isClipStart)return!1;var v=a,h=v.isControl,b=v.isLine,C=v.isArea,_=v.clipIndex,w=v.clipPath;if(!w)return!1;var R=O(e.props,"clippable"),T=R.keepRatio,M=0,I=0,D=u.draggable,z=Kr(r);f&&D?(n=D.prevBeforeDist,M=n[0],I=n[1]):(M=z[0],I=z[1]);var W=[M,I],k=e.state,H=k.width,L=k.height,F=!C&&!h&&!b,U=w.type,j=w.poses,q=w.splitter,Y=j.map(function(Ae){return Ae.pos});F&&(M=-M,I=-I);var K=!h||j[_].direction==="nesw",J=U==="inset"||U==="rect",ot=j.map(function(){return[0,0]});if(h&&!K){var ut=j[_],vt=ut.horizontal,St=ut.vertical,dt=[M*Math.abs(vt),I*Math.abs(St)];ot=Nc(j,_,dt,J,T)}else K&&(ot=Y.map(function(){return[M,I]}));var ft=Y.map(function(Ae,Nr){return Yt(Ae,ot[Nr])}),at=bt([],ft,!0);k.snapBoundInfos=null;var _t=w.type==="circle",Mt=w.type==="ellipse";if(_t||Mt){var Ot=i(ft),Ft=Math.abs(Ot.bottom-Ot.top),wt=Math.abs(Mt?Ot.right-Ot.left:Ft),xt=ft[0][1]+Ft,Bt=ft[0][0]-wt,Nt=ft[0][0]+wt;_t&&(at.push([Nt,Ot.bottom]),ot.push([1,0])),at.push([Ot.left,xt]),ot.push([0,1]),at.push([Bt,Ot.bottom]),ot.push([1,0])}var he=Ul((R.clipHorizontalGuidelines||[]).map(function(Ae){return Xt("".concat(Ae),L)}),(R.clipVerticalGuidelines||[]).map(function(Ae){return Xt("".concat(Ae),H)}),H,L),Dt=[],zt=[];if(_t||Mt)Dt=[at[4][0],at[2][0]],zt=[at[1][1],at[3][1]];else if(J){var ne=[at[0],at[2],at[4],at[6]],Jt=[ot[0],ot[2],ot[4],ot[6]];Dt=ne.filter(function(Ae,Nr){return Jt[Nr][0]}).map(function(Ae){return Ae[0]}),zt=ne.filter(function(Ae,Nr){return Jt[Nr][1]}).map(function(Ae){return Ae[1]})}else Dt=at.filter(function(Ae,Nr){return ot[Nr][0]}).map(function(Ae){return Ae[0]}),zt=at.filter(function(Ae,Nr){return ot[Nr][1]}).map(function(Ae){return Ae[1]});var Ke=[0,0],ue=Hl(he,R.clipTargetBounds&&{left:0,top:0,right:H,bottom:L},Dt,zt,5),oe=ue.horizontal,Re=ue.vertical,te=oe.offset,ae=Re.offset;if(oe.isBound&&(Ke[1]+=te),Re.isBound&&(Ke[0]+=ae),(Mt||_t)&&ot[0][0]===0&&ot[0][1]===0){var Ot=i(ft),se=Ot.bottom-Ot.top,on=Mt?Ot.right-Ot.left:se,Do=Re.isBound?Math.abs(ae):Re.snapIndex===0?-ae:ae,vr=oe.isBound?Math.abs(te):oe.snapIndex===0?-te:te;on-=Do,se-=vr,_t&&(se=Pl(Re,oe)>0?se:on,on=se);var Mr=at[0];at[1][1]=Mr[1]-se,at[2][0]=Mr[0]+on,at[3][1]=Mr[1]+se,at[4][0]=Mr[0]-on}else if(J&&T&&h){var zo=pu(j),es=zo[0],Au=zo[1],ku=es&&Au?es/Au:0,uf=j[_],nl=uf.direction||"",Cl=at[1][1],xt=at[5][1],Bt=at[7][0],Nt=at[3][0];te<=ae?te=ae/ku:ae=te*ku,nl.indexOf("w")>-1?Bt-=ae:nl.indexOf("e")>-1?Nt-=ae:(Bt+=ae/2,Nt-=ae/2),nl.indexOf("n")>-1?Cl-=te:nl.indexOf("s")>-1?xt-=te:(Cl+=te/2,xt-=te/2);var cf=el(Cl,Nt,xt,Bt);at.forEach(function(Wu,hf){var El;El=cf[hf].pos,Wu[0]=El[0],Wu[1]=El[1]})}else at.forEach(function(Ae,Nr){var Gu=ot[Nr];Gu[0]&&(Ae[0]-=ae),Gu[1]&&(Ae[1]-=te)});var Lu=Sl(e,w,ft),Rl="".concat(U,"(").concat(Lu.join(q),")");if(k.clipPathState=Rl,_t||Mt)Dt=[at[4][0],at[2][0]],zt=[at[1][1],at[3][1]];else if(J){var ne=[at[0],at[2],at[4],at[6]];Dt=ne.map(function(Nr){return Nr[0]}),zt=ne.map(function(Nr){return Nr[1]})}else Dt=at.map(function(Ae){return Ae[0]}),zt=at.map(function(Ae){return Ae[1]});if(k.snapBoundInfos=Hl(he,R.clipTargetBounds&&{left:0,top:0,right:H,bottom:L},Dt,zt,1),D){var ff=k.is3d,df=k.allMatrix,vf=ff?4:3,Tl=Ke;f&&(Tl=[W[0]+Ke[0]-z[0],W[1]+Ke[1]-z[1]]),D.deltaOffset=ce(df,[Tl[0],Tl[1],0,0],vf)}return pt(e,"onClip",ct(e,r,N({clipEventType:"changed",clipType:U,poses:ft,clipStyle:Rl,clipStyles:Lu,distX:M,distY:I},lt((o={},o[U==="rect"?"clip":"clipPath"]=Rl,o),r)))),!0},dragControlEnd:function(e,r){this.unset(e);var n=r.isDrag,o=r.datas,a=r.isDouble,u=o.isLine,f=o.isClipStart,v=o.isControl;return f?(pt(e,"onClipEnd",mt(e,r,{})),a&&(v?Uc(e,r):u&&Vc(e,r)),a||n):!1},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},Yc={name:"originDraggable",props:["originDraggable","originRelative"],events:["dragOriginStart","dragOrigin","dragOriginEnd"],css:[`:host[data-able-origindraggable] .control.origin { pointer-events: auto; }`],dragControlCondition:function(e,r){return r.isRequest?r.requestAble==="originDraggable":Ie(r.inputEvent.target,Ct("origin"))},dragControlStart:function(e,r){var n=r.datas;$r(e,r);var o=ct(e,r,{dragStart:jr.dragStart(e,new ei().dragStart([0,0],r))}),a=pt(e,"onDragOriginStart",o);return n.startOrigin=e.state.transformOrigin,n.startTargetOrigin=e.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,a===!1?(n.isDragOrigin=!1,!1):o},dragControl:function(e,r){var n=r.datas,o=r.isPinch,a=r.isRequest;if(!n.isDragOrigin)return!1;var u=Kr(r),f=u[0],v=u[1],h=e.state,b=h.width,C=h.height,_=h.offsetMatrix,w=h.targetMatrix,R=h.is3d,T=e.props.originRelative,M=T===void 0?!0:T,I=R?4:3,D=[f,v];if(a){var z=r.distOrigin;(z[0]||z[1])&&(D=z)}var W=Yt(n.startOrigin,D),k=Yt(n.startTargetOrigin,D),H=Et(D,n.prevOrigin),L=ri(_,w,W,I),F=e.getRect(),U=i(t(L,b,C,I)),j=[F.left-U.left,F.top-U.top];n.prevOrigin=D;var q=[_r(k[0],b,M),_r(k[1],C,M)].join(" "),Y=jr.drag(e,xi(r,e.state,j,!!o,!1)),K=ct(e,r,N(N({width:b,height:C,origin:W,dist:D,delta:H,transformOrigin:q,drag:Y},lt({transformOrigin:q,transform:Y.transform},r)),{afterTransform:Y.transform}));return pt(e,"onDragOrigin",K),K},dragControlEnd:function(e,r){var n=r.datas;return n.isDragOrigin?(pt(e,"onDragOriginEnd",mt(e,r,{})),!0):!1},dragGroupControlCondition:function(e,r){return this.dragControlCondition(e,r)},dragGroupControlStart:function(e,r){var n=this.dragControlStart(e,r);return!!n},dragGroupControl:function(e,r){var n=this.dragControl(e,r);return n?(e.transformOrigin=n.transformOrigin,!0):!1},request:function(e){var r={},n=e.getRect(),o=0,a=0,u=n.transformOrigin,f=[0,0];return{isControl:!0,requestStart:function(){return{datas:r}},request:function(v){return"deltaOrigin"in v?(f[0]+=v.deltaOrigin[0],f[1]+=v.deltaOrigin[1]):"origin"in v?(f[0]=v.origin[0]-u[0],f[1]=v.origin[1]-u[1]):("x"in v?o=v.x-n.left:"deltaX"in v&&(o+=v.deltaX),"y"in v?a=v.y-n.top:"deltaY"in v&&(a+=v.deltaY)),{datas:r,distX:o,distY:a,distOrigin:f}},requestEnd:function(){return{datas:r,isDrag:!0}}}}};function qc(e,r,n,o){var a=e.filter(function(h){var b=h.virtual,C=h.horizontal;return C&&!b}).length,u=e.filter(function(h){var b=h.virtual,C=h.vertical;return C&&!b}).length,f=-1;if(r===0&&(a===0?f=0:a===1&&(f=1)),r===2&&(a<=2?f=2:a<=3&&(f=3)),r===3&&(u===0?f=4:u<4&&(f=7)),r===1&&(u<=1?f=5:u<=2&&(f=6)),!(f===-1||!e[f].virtual)){var v=e[f];$c(e,f),f<4?v.pos[0]=n:v.pos[1]=o}}function $c(e,r){r<4?e.slice(0,r+1).forEach(function(n){n.virtual=!1}):(e[0].virtual&&(e[0].virtual=!1),e.slice(4,r+1).forEach(function(n){n.virtual=!1}))}function Kc(e,r){r<4?e.slice(r,4).forEach(function(n){n.virtual=!0}):e.slice(r).forEach(function(n){n.virtual=!0})}function mu(e,r,n,o,a){o===void 0&&(o=[0,0]);var u=[];return!e||e==="0px"?u=[]:u=gr(e),hu(u,r,n,0,0,o,a)}function yu(e,r,n,o,a){var u=e.state,f=u.width,v=u.height,h=yl(a,e.props.roundRelative,f,v),b=h.raws,C=h.styles,_=h.radiusPoses,w=Bc(_,b),R=w.horizontals,T=w.verticals,M=C.join(" ");u.borderRadiusState=M;var I=ct(e,r,N({horizontals:R,verticals:T,borderRadius:M,width:f,height:v,delta:o,dist:n},lt({borderRadius:M},r)));return pt(e,"onRound",I),I}function Su(e){var r,n,o=e.getState().style,a=o.borderRadius||"";if(!a&&e.props.groupable){var u=e.moveables[0],f=e.getTargets()[0];f&&((u==null?void 0:u.props.target)===f?(a=(n=(r=e.moveables[0])===null||r===void 0?void 0:r.state.style.borderRadius)!==null&&n!==void 0?n:"",o.borderRadius=a):(a=$e(f).borderRadius,o.borderRadius=a))}return a}var Zc={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[`.control.border-radius { background: #d66; cursor: pointer; z-index: 3; }`,`.control.border-radius.vertical { background: #d6d; z-index: 2; }`,`.control.border-radius.virtual { opacity: 0.5; z-index: 1; }`,`:host.round-line-clickable .line.direction { cursor: pointer; }`],className:function(e){var r=e.props.roundClickable;return r===!0||r==="line"?Ct("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(e,r){var n=e.getState(),o=n.target,a=n.width,u=n.height,f=n.allMatrix,v=n.is3d,h=n.left,b=n.top,C=n.borderRadiusState,_=e.props,w=_.minRoundControls,R=w===void 0?[0,0]:w,T=_.maxRoundControls,M=T===void 0?[4,4]:T,I=_.zoom,D=_.roundPadding,z=D===void 0?0:D,W=_.isDisplayShadowRoundControls,k=_.groupable;if(!o)return null;var H=C||Su(e),L=v?4:3,F=mu(H,a,u,R,!0);if(!F)return null;var U=0,j=0,q=k?[0,0]:[h,b];return F.map(function(Y,K){var J=Y.horizontal,ot=Y.vertical,ut=Y.direction||"",vt=bt([],Y.pos,!0);j+=Math.abs(J),U+=Math.abs(ot),J&&ut.indexOf("n")>-1&&(vt[1]-=z),ot&&ut.indexOf("w")>-1&&(vt[0]-=z),J&&ut.indexOf("s")>-1&&(vt[1]+=z),ot&&ut.indexOf("e")>-1&&(vt[0]+=z);var St=Et(d(f,vt,L),q),dt=Y.vertical?U<=M[1]&&(W||!Y.virtual):j<=M[0]&&(W||!Y.virtual);return r.createElement("div",{key:"borderRadiusControl".concat(K),className:Ct("control","border-radius",Y.vertical?"vertical":"",Y.virtual?"virtual":""),"data-radius-index":K,style:{display:dt?"block":"none",transform:"translate(".concat(St[0],"px, ").concat(St[1],"px) scale(").concat(I,")")}})})},dragControlCondition:function(e,r){if(!r.inputEvent||r.isRequest)return!1;var n=r.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(e,r){return this.dragControlCondition(e,r)},dragControlStart:function(e,r){var n=r.inputEvent,o=r.datas,a=n.target,u=a.getAttribute("class")||"",f=u.indexOf("border-radius")>-1,v=u.indexOf("moveable-line")>-1&&u.indexOf("moveable-direction")>-1,h=f?parseInt(a.getAttribute("data-radius-index"),10):-1,b=-1;if(v){var C=a.getAttribute("data-line-key")||"";C&&(b=parseInt(C.replace(/render-line-/g,""),10),isNaN(b)&&(b=-1))}if(!f&&!v)return!1;var _=ct(e,r,{}),w=pt(e,"onRoundStart",_);if(w===!1)return!1;o.lineIndex=b,o.controlIndex=h,o.isControl=f,o.isLine=v,$r(e,r);var R=e.props,T=R.roundRelative,M=R.minRoundControls,I=M===void 0?[0,0]:M,D=e.state,z=D.width,W=D.height;o.isRound=!0,o.prevDist=[0,0];var k=Su(e),H=mu(k||"",z,W,I,!0)||[];return o.controlPoses=H,D.borderRadiusState=yl(H,T,z,W).styles.join(" "),_},dragControl:function(e,r){var n=r.datas,o=n.controlPoses;if(!n.isRound||!n.isControl||!o.length)return!1;var a=n.controlIndex,u=Kr(r),f=u[0],v=u[1],h=[f,v],b=Et(h,n.prevDist),C=e.props.maxRoundControls,_=C===void 0?[4,4]:C,w=e.state,R=w.width,T=w.height,M=o[a],I=M.vertical,D=M.horizontal,z=o.map(function(k){var H=k.horizontal,L=k.vertical,F=[H*D*h[0],L*I*h[1]];if(H){if(_[0]===1)return F;if(_[0]<4&&H!==D)return F}else{if(_[1]===0)return F[1]=L*D*h[0]/R*T,F;if(I){if(_[1]===1)return F;if(_[1]<4&&L!==I)return F}}return[0,0]});z[a]=h;var W=o.map(function(k,H){return N(N({},k),{pos:Yt(k.pos,z[H])})});return a<4?W.slice(0,a+1).forEach(function(k){k.virtual=!1}):W.slice(4,a+1).forEach(function(k){k.virtual=!1}),n.prevDist=[f,v],yu(e,r,h,b,W)},dragControlEnd:function(e,r){var n=e.state;n.borderRadiusState="";var o=r.datas,a=r.isDouble;if(!o.isRound)return!1;var u=o.isControl,f=o.controlIndex,v=o.isLine,h=o.lineIndex,b=o.controlPoses,C=b.filter(function(D){var z=D.virtual;return z}).length,_=e.props.roundClickable,w=_===void 0?!0:_;if(a&&w){if(u&&(w===!0||w==="control"))Kc(b,f);else if(v&&(w===!0||w==="line")){var R=pn(e,r),T=R[0],M=R[1];qc(b,h,T,M)}C!==b.filter(function(D){var z=D.virtual;return z}).length&&yu(e,r,[0,0],[0,0],b)}var I=mt(e,r,{});return pt(e,"onRoundEnd",I),n.borderRadiusState="",I},dragGroupControlStart:function(e,r){var n=this.dragControlStart(e,r);if(!n)return!1;var o=e.moveables,a=e.props.targets,u=Ye(e,"roundable",r),f=N({targets:e.props.targets,events:u.map(function(v,h){return N(N({},v),{target:a[h],moveable:o[h],currentTarget:o[h]})})},n);return pt(e,"onRoundGroupStart",f),n},dragGroupControl:function(e,r){var n=this.dragControl(e,r);if(!n)return!1;var o=e.moveables,a=e.props.targets,u=Ye(e,"roundable",r),f=N({targets:e.props.targets,events:u.map(function(v,h){return N(N(N({},v),{target:a[h],moveable:o[h],currentTarget:o[h]}),lt({borderRadius:n.borderRadius},v))})},n);return pt(e,"onRoundGroup",f),f},dragGroupControlEnd:function(e,r){var n=e.moveables,o=e.props.targets,a=Ye(e,"roundable",r);Gt(e,"onRound",function(v){var h=N({targets:e.props.targets,events:a.map(function(b,C){return N(N(N({},b),{target:o[C],moveable:n[C],currentTarget:n[C]}),lt({borderRadius:v.borderRadius},b))})},v);pt(e,"onRoundGroup",h)});var u=this.dragControlEnd(e,r);if(!u)return!1;var f=N({targets:e.props.targets,events:a.map(function(v,h){var b;return N(N({},v),{target:o[h],moveable:n[h],currentTarget:n[h],lastEvent:(b=v.datas)===null||b===void 0?void 0:b.lastEvent})})},u);return pt(e,"onRoundGroupEnd",f),f},unset:function(e){e.state.borderRadiusState=""}};function Qc(e,r){var n=r?4:3,o=ye(n),a="matrix".concat(r?"3d":"","(").concat(o.join(","),")");return e===a||e==="matrix(1,0,0,1,0,0)"}var bu={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(e,r){var n=e.state,o=n.is3d,a=n.targetMatrix,u=n.inlineTransform,f=o?"matrix3d(".concat(a.join(","),")"):"matrix(".concat(ci(a,!0),")"),v=!u||u==="none"?f:u;r.datas.startTransforms=Qc(v,o)?[]:gr(v)},resetStyle:function(e){var r=e.datas;r.nextStyle={},r.nextTransforms=e.datas.startTransforms,r.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,r){return ct(e,r,{setTransform:function(n){r.datas.startTransforms=le(n)?n:gr(n)},isPinch:!!r.isPinch})},fillDragParams:function(e,r){return ct(e,r,{isPinch:!!r.isPinch})},dragStart:function(e,r){this.setTransform(e,r),this.resetStyle(r),pt(e,"onBeforeRenderStart",this.fillDragStartParams(e,r))},drag:function(e,r){r.datas.startTransforms||this.setTransform(e,r),this.resetStyle(r),pt(e,"onBeforeRender",ct(e,r,{isPinch:!!r.isPinch}))},dragEnd:function(e,r){r.datas.startTransforms||(this.setTransform(e,r),this.resetStyle(r)),pt(e,"onBeforeRenderEnd",ct(e,r,{isPinch:!!r.isPinch,isDrag:r.isDrag}))},dragGroupStart:function(e,r){var n=this;this.dragStart(e,r);var o=Ye(e,"beforeRenderable",r),a=e.moveables,u=o.map(function(f,v){var h=a[v];return n.setTransform(h,f),n.resetStyle(f),n.fillDragStartParams(h,f)});pt(e,"onBeforeRenderGroupStart",ct(e,r,{isPinch:!!r.isPinch,targets:e.props.targets,setTransform:function(){},events:u}))},dragGroup:function(e,r){var n=this;this.drag(e,r);var o=Ye(e,"beforeRenderable",r),a=e.moveables,u=o.map(function(f,v){var h=a[v];return n.resetStyle(f),n.fillDragParams(h,f)});pt(e,"onBeforeRenderGroup",ct(e,r,{isPinch:!!r.isPinch,targets:e.props.targets,events:u}))},dragGroupEnd:function(e,r){this.dragEnd(e,r),pt(e,"onBeforeRenderGroupEnd",ct(e,r,{isPinch:!!r.isPinch,isDrag:r.isDrag,targets:e.props.targets}))},dragControlStart:function(e,r){return this.dragStart(e,r)},dragControl:function(e,r){return this.drag(e,r)},dragControlEnd:function(e,r){return this.dragEnd(e,r)},dragGroupControlStart:function(e,r){return this.dragGroupStart(e,r)},dragGroupControl:function(e,r){return this.dragGroup(e,r)},dragGroupControlEnd:function(e,r){return this.dragGroupEnd(e,r)}},_u={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(e,r){pt(e,"onRenderStart",ct(e,r,{isPinch:!!r.isPinch}))},drag:function(e,r){pt(e,"onRender",this.fillDragParams(e,r))},dragAfter:function(e,r){return this.drag(e,r)},dragEnd:function(e,r){pt(e,"onRenderEnd",this.fillDragEndParams(e,r))},dragGroupStart:function(e,r){pt(e,"onRenderGroupStart",ct(e,r,{isPinch:!!r.isPinch,targets:e.props.targets}))},dragGroup:function(e,r){var n=this,o=Ye(e,"beforeRenderable",r),a=e.moveables,u=o.map(function(f,v){var h=a[v];return n.fillDragParams(h,f)});pt(e,"onRenderGroup",ct(e,r,N(N({isPinch:!!r.isPinch,targets:e.props.targets,transform:Wn(r)},lt(Zr(r))),{events:u})))},dragGroupEnd:function(e,r){var n=this,o=Ye(e,"beforeRenderable",r),a=e.moveables,u=o.map(function(f,v){var h=a[v];return n.fillDragEndParams(h,f)});pt(e,"onRenderGroupEnd",ct(e,r,N({isPinch:!!r.isPinch,isDrag:r.isDrag,targets:e.props.targets,events:u,transform:Wn(r)},lt(Zr(r)))))},dragControlStart:function(e,r){return this.dragStart(e,r)},dragControl:function(e,r){return this.drag(e,r)},dragControlAfter:function(e,r){return this.dragAfter(e,r)},dragControlEnd:function(e,r){return this.dragEnd(e,r)},dragGroupControlStart:function(e,r){return this.dragGroupStart(e,r)},dragGroupControl:function(e,r){return this.dragGroup(e,r)},dragGroupControlEnd:function(e,r){return this.dragGroupEnd(e,r)},fillDragParams:function(e,r){return ct(e,r,N({isPinch:!!r.isPinch,transform:Wn(r)},lt(Zr(r))))},fillDragEndParams:function(e,r){return ct(e,r,N({isPinch:!!r.isPinch,isDrag:r.isDrag,transform:Wn(r)},lt(Zr(r))))}};function Ds(e,r,n,o,a,u,f){u.clientDistX=u.distX,u.clientDistY=u.distY;var v=a==="Start",h=a==="End",b=a==="After",C=e.state.target,_=u.isRequest,w=o.indexOf("Control")>-1;if(!C||v&&w&&!_&&e.areaElement===u.inputEvent.target)return!1;var R=bt([],e[r],!0);if(_){var T=u.requestAble;R.some(function(K){return K.name===T})||R.push.apply(R,e.props.ables.filter(function(K){return K.name===T}))}if(!R.length||R.every(function(K){return K.dragRelation}))return!1;var M=u.inputEvent,I;h&&M&&(I=document.elementFromPoint(u.clientX,u.clientY)||M.target);var D=!1,z=function(){var K;D=!0,(K=u.stop)===null||K===void 0||K.call(u)},W=v&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());W&&e.updateRect(a,!0,!1);var k=u.datas,H=w?"controlGesto":"targetGesto",L=e[H],F=function(K,J,ot){if(!(J in K)||L!==e[H])return!1;var ut=K.name,vt=k[ut]||(k[ut]={});if(v&&(vt.isEventStart=!ot||!K[ot]||K[ot](e,u)),!vt.isEventStart)return!1;var St=K[J](e,N(N({},u),{stop:z,datas:vt,originalDatas:k,inputTarget:I}));return e._emitter.off(),v&&St===!1&&(vt.isEventStart=!1),St};W&&R.forEach(function(K){K.unset&&K.unset(e)}),F(bu,"drag".concat(o).concat(a));var U=0,j=0;n.forEach(function(K){if(D)return!1;var J="".concat(K).concat(o).concat(a),ot="".concat(K).concat(o,"Condition");a===""&&!_&&fe(e.state,u);var ut=R.filter(function(dt){return dt[J]});ut=ut.filter(function(dt,ft){return dt.name&&ut.indexOf(dt)===ft});var vt=ut.filter(function(dt){return F(dt,J,ot)}),St=vt.length;D&&++U,St&&++j,!D&&v&&ut.length&&!St&&(U+=ut.filter(function(dt){var ft=dt.name,at=k[ft];return at.isEventStart?dt.dragRelation!=="strong":!1}).length?1:0)}),(!b||j)&&F(_u,"drag".concat(o).concat(a));var q=L!==e[H]||U===n.length;if((h||D||q)&&(e.state.gestos={},e.moveables&&e.moveables.forEach(function(K){K.state.gestos={}}),R.forEach(function(K){K.unset&&K.unset(e)})),v&&!q&&!_&&j&&e.props.preventDefault&&(u==null||u.preventDefault()),e.isUnmounted||q)return!1;if(!v&&j&&!f||h){var Y=e.props.flushSync||$a;Y(function(){e.updateRect(h?a:"",!0,!1),e.forceUpdate()})}return!v&&!h&&!b&&j&&!f&&Ds(e,r,n,o,a+"After",u),!0}function bl(e){return function(r){var n,o=e.props.dragTarget,a=r.inputEvent.target,u=e.areaElement;return((n=e.controlGesto)===null||n===void 0?void 0:n.isFlag())?!1:o&&(a===o||o.contains(a))||a===u||!e.isMoveableElement(a)&&!e.controlBox.contains(a)||Ie(a,"moveable-area")||Ie(a,"moveable-padding")||Ie(a,"moveable-edgeDraggable")}}function xu(e,r,n){var o=e.controlBox,a=[],u=e.props.dragTarget;return a.push(o),(!e.props.dragArea||u)&&a.push(r),_l(e,a,"targetAbles",n,{dragStart:bl(e),pinchStart:bl(e)})}function _l(e,r,n,o,a){a===void 0&&(a={});var u=n==="targetAbles",f=e.props,v=f.pinchOutside,h=f.pinchThreshold,b=f.preventClickEventOnDrag,C=f.preventClickDefault,_=f.checkInput,w=f.dragFocusedInput,R=f.preventDefault,T=R===void 0?!0:R,M={preventDefault:T,preventRightClick:!0,preventWheelClick:!0,container:window,pinchThreshold:h,pinchOutside:v,preventClickEventOnDrag:u?b:!1,preventClickEventOnDragStart:u?C:!1,preventClickEventByCondition:u?null:function(z){return e.controlBox.contains(z.target)},checkInput:u?_:!1,dragFocusedInput:w},I=new Us(r,M),D=o==="Control";return["drag","pinch"].forEach(function(z){["Start","","End"].forEach(function(W){I.on("".concat(z).concat(W),function(k){var H,L=k.eventType,F=z==="drag"&&k.isPinch;if(a[L]&&!a[L](k)){k.stop();return}if(!F){var U=z==="drag"?[z]:["drag",z],j=Ds(e,n,U,o,W,k);j?(e.props.stopPropagation||W==="Start"&&D)&&((H=k==null?void 0:k.inputEvent)===null||H===void 0||H.stopPropagation()):k.stop()}})})}),I}var Jc=function(){function e(n,o,a){var u=this;this.target=n,this.moveable=o,this.eventName=a,this.ables=[],this._onEvent=function(f){var v=u.eventName,h=u.moveable;h.state.disableNativeEvent||u.ables.forEach(function(b){b[v](h,{inputEvent:f})})},n.addEventListener(a.toLowerCase(),this._onEvent)}var r=e.prototype;return r.setAbles=function(n){this.ables=n},r.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},e}();function tf(e,r,n,o){var a;n===void 0&&(n=r);var u=Ya(e,r),f=u.matrixes,v=u.is3d,h=u.targetMatrix,b=u.transformOrigin,C=u.targetOrigin,_=u.offsetContainer,w=u.hasFixed,R=u.zoom,T=Ts(_,n),M=T.matrixes,I=T.is3d,D=T.offsetContainer,z=T.zoom,W=o||I||v,k=W?4:3,H=e.tagName.toLowerCase()!=="svg"&&"ownerSVGElement"in e,L=h,F=ye(k),U=ye(k),j=ye(k),q=ye(k),Y=f.length,K=M.map(function(ft){return N(N({},ft),{matrix:ft.matrix?bt([],ft.matrix,!0):void 0})}).reverse();f.reverse(),!v&&W&&(L=un(L,3,4),aa(f)),!I&&W&&aa(K),K.forEach(function(ft){U=ce(U,ft.matrix,k)});var J=n||document.body,ot=((a=K[0])===null||a===void 0?void 0:a.target)||Jr(J,J,!0).offsetParent,ut=K.slice(1).reduce(function(ft,at){return ce(ft,at.matrix,k)},ye(k));f.forEach(function(ft,at){if(Y-2===at&&(j=F.slice()),Y-1===at&&(q=F.slice()),!ft.matrix){var _t=f[at+1],Mt=l(ft,_t,ot,k,ce(ut,F,k));ft.matrix=dn(Mt,k)}F=ce(F,ft.matrix,k)});var vt=!H&&v;L||(L=ye(vt?4:3));var St=Ci(H&&L.length===16?un(L,4,3):L,vt),dt=U;return U=ln(U,k,k),{hasZoom:R!==1||z!==1,hasFixed:w,rootMatrix:U,originalRootMatrix:dt,beforeMatrix:j,offsetMatrix:q,allMatrix:F,targetMatrix:L,targetTransform:St,inlineTransform:e.style.transform,transformOrigin:b,targetOrigin:C,is3d:W,offsetContainer:_,offsetRootContainer:D}}function wu(e,r,n,o){n===void 0&&(n=r);var a=0,u=0,f=0,v={},h=P(e);if(e&&(a=h.offsetWidth,u=h.offsetHeight),e){var b=tf(e,r,n,o),C=p(b.allMatrix,b.transformOrigin,a,u);v=N(N({},b),C);var _=p(b.allMatrix,[50,50],100,100);f=A([_.pos1,_.pos2],_.direction)}var w=o?4:3;return N(N(N({hasZoom:!1,width:a,height:u,rotation:f},h),{originalRootMatrix:ye(w),rootMatrix:ye(w),beforeMatrix:ye(w),offsetMatrix:ye(w),allMatrix:ye(w),targetMatrix:ye(w),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!o,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null}),v)}function pf(e,r,n){return n===void 0&&(n=r),wu(e,r,n,!0)}function xl(e,r,n,o,a,u){u===void 0&&(u=[]);var f=1,v=[0,0],h=B(),b=B(),C=B(),_=B(),w=[0,0],R={},T=wu(r,n,a,!0);if(r){var M=sr(r);u.forEach(function(K){R[K]=M(K)});var I=T.is3d?4:3,D=p(T.offsetMatrix,Yt(T.transformOrigin,Li(T.targetMatrix,I)),T.width,T.height);f=D.direction,v=Yt(D.origin,[D.left-T.left,D.top-T.top]),_=$(T.offsetRootContainer);var z=Jr(o,o,!0).offsetParent||T.offsetRootContainer;if(T.hasZoom){var W=p(ce(T.originalRootMatrix,T.allMatrix),T.transformOrigin,T.width,T.height),k=p(T.originalRootMatrix,Hn(sr(z)("transformOrigin")).map(function(K){return parseFloat(K)}),z.offsetWidth,z.offsetHeight);if(h=V(W,_),C=V(k,_,z,!0),e){var H=W.left,L=W.top;b=V({left:H,top:L,bottom:L,right:L},_)}}else{h=$(r),C=Eo(z),e&&(b=$(e));var F=C.left,U=C.top,j=C.clientLeft,q=C.clientTop,Y=[h.left-F,h.top-U];w=Et(ze(T.rootMatrix,Y,4),[j+T.left,q+T.top])}}return N({targetClientRect:h,containerClientRect:C,moveableClientRect:b,rootContainerClientRect:_,beforeDirection:f,beforeOrigin:v,originalBeforeOrigin:v,target:r,style:R,offsetDelta:w},T)}function Cu(e){var r=e.pos1,n=e.pos2,o=e.pos3,a=e.pos4;if(!r||!n||!o||!a)return null;var u=Yn([r,n,o,a]),f=[u.minX,u.minY],v=Et(e.origin,f);return r=Et(r,f),n=Et(n,f),o=Et(o,f),a=Et(a,f),N(N({},e),{left:e.left,top:e.top,posDelta:f,pos1:r,pos2:n,pos3:o,pos4:a,origin:v,beforeOrigin:v,isPersisted:!0})}var Ja=function(e){de(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o.state=N({container:null,gestos:{},renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},xl(null)),o.renderState={},o.enabledAbles=[],o.targetAbles=[],o.controlAbles=[],o.rotation=0,o.scale=[1,1],o.isMoveableMounted=!1,o.isUnmounted=!1,o.events={mouseEnter:null,mouseLeave:null},o._emitter=new co,o._prevTarget=null,o._prevDragArea=!1,o._isPropTargetChanged=!1,o._hasFirstTarget=!1,o._reiszeObserver=null,o._observerId=0,o._mutationObserver=null,o._rootContainer=null,o._viewContainer=null,o._viewClassNames=[],o._store={},o.checkUpdateRect=function(){if(!o.isDragging()){var a=o.props.parentMoveable;if(a){a.checkUpdateRect();return}Vr(o._observerId),o._observerId=Bo(function(){o.isDragging()||o.updateRect()})}},o._onPreventClick=function(a){a.stopPropagation(),a.preventDefault()},o}var n=r.prototype;return n.render=function(){var o=this.props,a=this.getState(),u=o.parentPosition,f=o.className,v=o.target,h=o.zoom,b=o.cspNonce,C=o.translateZ,_=o.cssStyled,w=o.groupable,R=o.linePadding,T=o.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var M=u||[0,0],I=M[0],D=M[1],z=a.left,W=a.top,k=a.target,H=a.direction,L=a.hasFixed,F=a.offsetDelta,U=o.targets,j=this.isDragging(),q={};this.getEnabledAbles().forEach(function(vt){q["data-able-".concat(vt.name.toLowerCase())]=!0});var Y=this._getAbleClassName(),K=U&&U.length&&(k||w)||v||!this._hasFirstTarget&&this.state.isPersisted,J=this.controlBox||this.props.firstRenderState||this.props.persistData,ot=[z-I,W-D];!w&&o.useAccuratePosition&&(ot[0]+=F[0],ot[1]+=F[1]);var ut={position:L?"fixed":"absolute",display:K?"block":"none",visibility:J?"visible":"hidden",transform:"translate3d(".concat(ot[0],"px, ").concat(ot[1],"px, ").concat(C,")"),"--zoom":h,"--zoompx":"".concat(h,"px")};return R&&(ut["--moveable-line-padding"]=R),T&&(ut["--moveable-control-padding"]=T),Ue.createElement(_,N({cspNonce:b,ref:(0,Ze.iH)(this,"controlBox"),className:"".concat(Ct("control-box",H===-1?"reverse":"",j?"dragging":"")," ").concat(Y," ").concat(f)},q,{onClick:this._onPreventClick,style:ut}),this.renderAbles(),this._renderLines())},n.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var o=this.props,a=o.parentMoveable,u=o.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),!u&&!a&&!this.state.isPersisted&&(this.updateRect("",!1,!1),this.forceUpdate())},n.componentDidUpdate=function(o){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateEvents(),this._updateTargets(),this.updateCheckInput(),this._updateObserver(o)},n.componentWillUnmount=function(){var o,a;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),(o=this._reiszeObserver)===null||o===void 0||o.disconnect(),(a=this._mutationObserver)===null||a===void 0||a.disconnect();var u=this._viewContainer;u&&this._changeAbleViewClassNames([]),ht(this,!1),ht(this,!0);var f=this.events;for(var v in f){var h=f[v];h&&h.destroy()}},n.getTargets=function(){var o=this.props.target;return o?[o]:[]},n.getAble=function(o){var a=this.props.ables||[];return wr(a,function(u){return u.name===o})},n.getContainer=function(){var o=this.props,a=o.parentMoveable,u=o.wrapperMoveable,f=o.container;return f||u&&u.getContainer()||a&&a.getContainer()||this.controlBox.parentElement},n.isMoveableElement=function(o){var a;return o&&(((a=o.getAttribute)===null||a===void 0?void 0:a.call(o,"class"))||"").indexOf(Co)>-1},n.dragStart=function(o){var a=this.targetGesto,u=this.controlGesto;return a&&bl(this)({inputEvent:o})?a.isFlag()||a.triggerDragStart(o):u&&this.isMoveableElement(o.target)&&(u.isFlag()||u.triggerDragStart(o)),this},n.hitTest=function(o){var a=this.state,u=a.target,f=a.pos1,v=a.pos2,h=a.pos3,b=a.pos4,C=a.targetClientRect;if(!u)return 0;var _;if(o instanceof Element){var w=o.getBoundingClientRect();_={left:w.left,top:w.top,width:w.width,height:w.height}}else _=N({width:0,height:0},o);var R=_.left,T=_.top,M=_.width,I=_.height,D=Xn([f,v,b,h],C),z=mo(D,[[R,T],[R+M,T],[R+M,T+I],[R,T+I]]),W=Ko(D);return!z||!W?0:Math.min(100,z/W*100)},n.isInside=function(o,a){var u=this.state,f=u.target,v=u.pos1,h=u.pos2,b=u.pos3,C=u.pos4,_=u.targetClientRect;return f?vn([o,a],Xn([v,h,C,b],_)):!1},n.updateRect=function(o,a,u){u===void 0&&(u=!0);var f=this.props,v=!f.parentPosition&&!f.wrapperMoveable;v&&Bn(!0);var h=f.parentMoveable,b=this.state,C=b.target||f.target,_=this.getContainer(),w=h?h._rootContainer:this._rootContainer,R=xl(this.controlBox,C,_,_,w||_,this._getRequestStyles());if(!C&&this._hasFirstTarget&&f.persistData){var T=Cu(f.persistData);for(var M in T)R[M]=T[M]}v&&Bn(),this.updateState(R,h?!1:u)},n.isDragging=function(o){var a,u,f=this.targetGesto,v=this.controlGesto;if(f==null?void 0:f.isFlag()){if(!o)return!0;var h=f.getEventData();return!!((a=h[o])===null||a===void 0?void 0:a.isEventStart)}if(v==null?void 0:v.isFlag()){if(!o)return!0;var h=v.getEventData();return!!((u=h[o])===null||u===void 0?void 0:u.isEventStart)}return!1},n.updateTarget=function(o){this.updateRect(o,!0)},n.getRect=function(){var o=this.state,a=tt(this.state),u=a[0],f=a[1],v=a[2],h=a[3],b=i(a),C=o.width,_=o.height,w=b.width,R=b.height,T=b.left,M=b.top,I=[o.left,o.top],D=Yt(I,o.origin),z=Yt(I,o.beforeOrigin),W=o.transformOrigin;return{width:w,height:R,left:T,top:M,pos1:u,pos2:f,pos3:v,pos4:h,offsetWidth:C,offsetHeight:_,beforeOrigin:z,origin:D,transformOrigin:W,rotation:this.getRotation()}},n.getManager=function(){return this},n.stopDrag=function(o){var a,u;(!o||o==="target")&&((a=this.targetGesto)===null||a===void 0||a.stop()),(!o||o==="control")&&((u=this.controlGesto)===null||u===void 0||u.stop())},n.getRotation=function(){var o=this.state,a=o.pos1,u=o.pos2,f=o.direction;return Ht(a,u,f)},n.request=function(o,a,u){a===void 0&&(a={});var f=this.props,v=f.ables,h=f.groupable,b=v.filter(function(I){return I.name===o})[0];if(this.isDragging()||!b||!b.request)return{request:function(){return this},requestEnd:function(){return this}};var C=this,_=b.request(this),w=u||a.isInstant,R=_.isControl?"controlAbles":"targetAbles",T="".concat(h?"Group":"").concat(_.isControl?"Control":""),M={request:function(I){return Ds(C,R,["drag"],T,"",N(N({},_.request(I)),{requestAble:o,isRequest:!0}),w),this},requestEnd:function(){return Ds(C,R,["drag"],T,"End",N(N({},_.requestEnd()),{requestAble:o,isRequest:!0}),w),this}};return Ds(C,R,["drag"],T,"Start",N(N({},_.requestStart(a)),{requestAble:o,isRequest:!0}),w),w?M.request(a).requestEnd():M},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var o=this.getState(),a=this.props,u=o.originalBeforeOrigin,f=o.transformOrigin,v=o.allMatrix,h=o.is3d,b=o.pos1,C=o.pos2,_=o.pos3,w=o.pos4,R=o.left,T=o.top,M=o.isPersisted,I=a.padding||{},D=I.left,z=D===void 0?0:D,W=I.top,k=W===void 0?0:W,H=I.bottom,L=H===void 0?0:H,F=I.right,U=F===void 0?0:F,j=h?4:3,q=[];M?q=f:this.controlBox&&a.groupable?q=u:q=Yt(u,[R,T]),o.renderPoses=[Yt(b,tn(v,[-z,-k],f,q,j)),Yt(C,tn(v,[U,-k],f,q,j)),Yt(_,tn(v,[-z,L],f,q,j)),Yt(w,tn(v,[U,L],f,q,j))]},n.checkUpdate=function(){this._isPropTargetChanged=!1;var o=this.props,a=o.target,u=o.container,f=o.parentMoveable,v=this.state,h=v.target,b=v.container;if(!(!h&&!a)){this.updateAbles();var C=!Be(h,a),_=C||!Be(b,u);if(!!_){var w=u||this.controlBox;w&&this.unsetAbles(),this.updateState({target:a,container:u}),!f&&w&&this.updateRect("End",!1,!1),this._isPropTargetChanged=C}}},n.waitToChangeTarget=function(){return new Promise(function(){})},n.triggerEvent=function(o,a){this._emitter.trigger(o,a);var u=this.props[o];return u&&u(a)},n.useCSS=function(o,a){var u=this.props.customStyledMap,f=o+a;return u[f]||(u[f]=La(o,a)),u[f]},n.getState=function(){var o,a=this.props;(a.target||((o=a.targets)===null||o===void 0?void 0:o.length))&&(this._hasFirstTarget=!0);var u=this.controlBox,f=a.persistData,v=a.firstRenderState;if(v&&!u)return v;if(!this._hasFirstTarget&&f){var h=Cu(f);if(h)return this.updateState(h,!1),this.state}return this.state.isPersisted=!1,this.state},n.updateSelectors=function(){},n.unsetAbles=function(){var o=this;this.targetAbles.forEach(function(a){a.unset&&a.unset(o)})},n.updateAbles=function(o,a){o===void 0&&(o=this.props.ables),a===void 0&&(a="");var u=this.props,f=u.triggerAblesSimultaneously,v=this.getEnabledAbles(o),h="drag".concat(a,"Start"),b="pinch".concat(a,"Start"),C="drag".concat(a,"ControlStart"),_=_e(v,[h,b],f),w=_e(v,[C],f);this.enabledAbles=v,this.targetAbles=_,this.controlAbles=w},n.updateState=function(o,a){if(a){if(this.isUnmounted)return;this.setState(o)}else{var u=this.state;for(var f in o)u[f]=o[f]}},n.getEnabledAbles=function(o){o===void 0&&(o=this.props.ables);var a=this.props;return o.filter(function(u){return u&&(u.always&&a[u.name]!==!1||a[u.name])})},n.renderAbles=function(){var o=this,a=this.props,u=a.triggerAblesSimultaneously,f={createElement:Ue.createElement};return this.renderState={},tr(er(_e(this.getEnabledAbles(),["render"],u).map(function(v){var h=v.render;return h(o,f)||[]})).filter(function(v){return v}),function(v){var h=v.key;return h}).map(function(v){return v[0]})},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},n._getRequestStyles=function(){var o=this.getEnabledAbles().reduce(function(a,u){var f,v,h=(v=(f=u.requestStyle)===null||f===void 0?void 0:f.call(u))!==null&&v!==void 0?v:[];return bt(bt([],a,!0),h,!0)},bt([],this.props.requestStyles||[],!0));return o},n._updateObserver=function(o){this._updateResizeObserver(o),this._updateMutationObserver(o)},n._updateEvents=function(){var o=this.controlBox,a=this.targetAbles.length,u=this.controlAbles.length,f=this.props,v=f.dragTarget||f.target,h=!a&&this.targetGesto||this._isTargetChanged(!0);h&&(ht(this,!1),this.updateState({gestos:{}})),u||ht(this,!0),v&&a&&!this.targetGesto&&(this.targetGesto=xu(this,v,"")),!this.controlGesto&&u&&(this.controlGesto=_l(this,o,"controlAbles","Control"))},n._updateTargets=function(){var o=this.props;this._prevTarget=o.dragTarget||o.target,this._prevDragArea=o.dragArea},n._renderLines=function(){var o=this.props,a=o,u=a.zoom,f=a.hideDefaultLines,v=a.hideChildMoveableDefaultLines,h=a.parentMoveable;if(f||h&&v)return[];var b=this.getState().renderPoses,C={createElement:Ue.createElement};return[[0,1],[1,3],[3,2],[2,0]].map(function(_,w){var R=_[0],T=_[1];return Ps(C,"",b[R],b[T],u,"render-line-".concat(w))})},n._isTargetChanged=function(o){var a=this.props,u=a.dragTarget||a.target,f=this._prevTarget,v=this._prevDragArea,h=a.dragArea,b=!h&&f!==u,C=(o||h)&&v!==h;return b||C},n._updateNativeEvents=function(){var o=this,a=this.props,u=a.dragArea?this.areaElement:this.state.target,f=this.events,v=Rn(f);if(this._isTargetChanged())for(var h in f){var b=f[h];b&&b.destroy(),f[h]=null}if(!!u){var C=this.enabledAbles;v.forEach(function(_){var w=_e(C,[_]),R=w.length>0,T=f[_];if(!R){T&&(T.destroy(),f[_]=null);return}T||(T=new Jc(u,o,_),f[_]=T),T.setAbles(w)})}},n._checkUpdateRootContainer=function(){var o=this.props.rootContainer;!this._rootContainer&&o&&(this._rootContainer=yt(o,!0))},n._checkUpdateViewContainer=function(){var o=this.props.viewContainer;!this._viewContainer&&o&&(this._viewContainer=yt(o,!0));var a=this._viewContainer;a&&this._changeAbleViewClassNames(bt(bt([],this._getAbleViewClassNames(),!0),[this.isDragging()?Pc:""],!1))},n._changeAbleViewClassNames=function(o){var a=this._viewContainer,u=Xe(o.filter(Boolean),function(C){return C}).map(function(C){var _=C[0];return _}),f=this._viewClassNames,v=Un(f,u),h=v.removed,b=v.added;h.forEach(function(C){No(a,f[C])}),b.forEach(function(C){xa(a,u[C])}),this._viewClassNames=u},n._getAbleViewClassNames=function(){var o=this;return(this.getEnabledAbles().map(function(a){var u;return((u=a.viewClassName)===null||u===void 0?void 0:u.call(a,o))||""}).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},n._getAbleClassName=function(o){var a=this;o===void 0&&(o="");var u=this.getEnabledAbles(),f=this.targetGesto,v=this.controlGesto,h=(f==null?void 0:f.isFlag())?f.getEventData():{},b=(v==null?void 0:v.isFlag())?v.getEventData():{};return u.map(function(C){var _,w,R,T=C.name,M=((_=C.className)===null||_===void 0?void 0:_.call(C,a))||"";return(((w=h[T])===null||w===void 0?void 0:w.isEventStart)||((R=b[T])===null||R===void 0?void 0:R.isEventStart))&&(M+=" ".concat(Ct("".concat(T).concat(o,"-dragging")))),M.trim()}).filter(Boolean).join(" ")},n._updateResizeObserver=function(o){var a,u=this.props,f=u.target;if(!window.ResizeObserver||!f||!u.useResizeObserver){(a=this._reiszeObserver)===null||a===void 0||a.disconnect();return}if(!(o.target===f&&this._reiszeObserver)){var v=new ResizeObserver(this.checkUpdateRect);v.observe(f,{box:"border-box"}),this._reiszeObserver=v}},n._updateMutationObserver=function(o){var a=this,u,f=this.props,v=f.target;if(!window.MutationObserver||!v||!f.useMutationObserver){(u=this._mutationObserver)===null||u===void 0||u.disconnect();return}if(!(o.target===v&&this._mutationObserver)){var h=new MutationObserver(function(b){for(var C=0,_=b;C<_.length;C++){var w=_[C];w.type==="attributes"&&w.attributeName==="style"&&a.checkUpdateRect()}});h.observe(v,{attributes:!0}),this._mutationObserver=h}},r.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:$a,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},r}(Ue.PureComponent),wl={name:"groupable",props:["defaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(e,r){var n,o=e.props,a=o.targets||[],u=e.getState(),f=u.left,v=u.top,h=u.isPersisted,b=o.zoom||1,C=e.renderGroupRects,_=((n=o.persistData)===null||n===void 0?void 0:n.children)||[];h?a=_.map(function(){return null}):_=[];var w=e._store,R=Er(w,"parentPosition",[f,v],function(M){return M.join(",")}),T=Er(w,"requestStyles",e.getRequestChildStyles(),function(M){return M.join(",")});return e.moveables=e.moveables.slice(0,a.length),bt(bt([],a.map(function(M,I){return r.createElement(Ja,{key:"moveable"+I,ref:(0,Ze.xL)(e,"moveables",I),target:M,origin:!1,requestStyles:T,cssStyled:o.cssStyled,customStyledMap:o.customStyledMap,useResizeObserver:o.useResizeObserver,hideChildMoveableDefaultLines:o.hideChildMoveableDefaultLines,parentMoveable:e,parentPosition:[f,v],persistData:_[I],zoom:b})}),!0),er(C.map(function(M,I){var D=M.pos1,z=M.pos2,W=M.pos3,k=M.pos4,H=[D,z,W,k];return[[0,1],[1,3],[3,2],[2,0]].map(function(L,F){var U=L[0],j=L[1];return Ps(r,"",Et(H[U],R),Et(H[j],R),b,"group-rect-".concat(I,"-").concat(F))})})),!0)}},ef=Zn("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(e,r){r.datas.inputTarget=r.inputEvent&&r.inputEvent.target},dragEnd:function(e,r){var n=e.props.target,o=r.inputEvent,a=r.inputTarget,u=e.isMoveableElement(a),f=!u&&e.controlBox.contains(a);if(!(!o||!a||r.isDrag||e.isMoveableElement(a)||f)){var v=n.contains(a);pt(e,"onClick",ct(e,r,{isDouble:r.isDouble,inputTarget:a,isTarget:n===a,moveableTarget:e.props.target,containsTarget:v}))}},dragGroupEnd:function(e,r){var n=r.inputEvent,o=r.inputTarget;if(!(!n||!o||r.isDrag||e.isMoveableElement(o)||r.datas.inputTarget===o)){var a=e.props.targets,u=a.indexOf(o),f=u>-1,v=!1;u===-1&&(u=mr(a,function(h){return h.contains(o)}),v=u>-1),pt(e,"onClickGroup",ct(e,r,{isDouble:r.isDouble,targets:a,inputTarget:o,targetIndex:u,isTarget:f,containsTarget:v,moveableTarget:a[u]}))}},dragControlEnd:function(e,r){this.dragEnd(e,r)},dragGroupControlEnd:function(e,r){this.dragEnd(e,r)}});function ts(e){var r=e.originalDatas.draggable;return r||(e.originalDatas.draggable={},r=e.originalDatas.draggable),N(N({},e),{datas:r})}var rf=Zn("edgeDraggable",{css:[`.edge.edgeDraggable.line { cursor: move; }`],render:function(e,r){var n=e.props,o=n.edgeDraggable;return o?Ql(r,"edgeDraggable",o,e.getState().renderPoses,n.zoom):[]},dragCondition:function(e,r){var n,o=e.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Ie(a,Ct("direction"))&&Ie(a,Ct("edge"))&&Ie(a,Ct("edgeDraggable"))},dragStart:function(e,r){return jr.dragStart(e,ts(r))},drag:function(e,r){return jr.drag(e,ts(r))},dragEnd:function(e,r){return jr.dragEnd(e,ts(r))},dragGroupCondition:function(e,r){var n,o=e.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Ie(a,Ct("direction"))&&Ie(a,Ct("line"))},dragGroupStart:function(e,r){return jr.dragGroupStart(e,ts(r))},dragGroup:function(e,r){return jr.dragGroup(e,ts(r))},dragGroupEnd:function(e,r){return jr.dragGroupEnd(e,ts(r))},unset:function(e){return jr.unset(e)}}),Ru={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},nf=[bu,fu,xc,nn,jr,rf,dl,Ec,Oc,Tc,Ac,kc,Dc,Yc,Xc,Zc,wl,Ru,ef,cu,_u],gf=null,mf=null;function Tu(e,r){var n=e[0],o=e[1],a=e[2];return(n*r[0]+o*r[1]+a)/Math.sqrt(n*n+o*o)}function rl(e,r){var n=e[0],o=e[1];return-n*r[0]-o*r[1]}function Eu(e,r){return Math.max.apply(Math,e.map(function(n){var o=n[0],a=n[1],u=n[2],f=n[3];return Math.max(o[r],a[r],u[r],f[r])}))}function Mu(e,r){return Math.min.apply(Math,e.map(function(n){var o=n[0],a=n[1],u=n[2],f=n[3];return Math.min(o[r],a[r],u[r],f[r])}))}function of(e,r){var n,o=[0,0],a=[0,0],u=[0,0],f=[0,0],v=0,h=0;if(!e.length)return{pos1:o,pos2:a,pos3:u,pos4:f,minX:0,minY:0,maxX:0,maxY:0,width:v,height:h,rotation:r};var b=Lt(r,Je);if(b%90){var C=b/180*Math.PI,_=Math.tan(C),w=-1/_,R=[qi,or],T=[[0,0],[0,0]],M=[qi,or],I=[[0,0],[0,0]];e.forEach(function(ft){ft.forEach(function(at){var _t=Tu([-_,1,0],at),Mt=Tu([-w,1,0],at);R[0]>_t&&(T[0]=at,R[0]=_t),R[1]<_t&&(T[1]=at,R[1]=_t),M[0]>Mt&&(I[0]=at,M[0]=Mt),M[1]180){var J=[f,u,a,o];o=J[0],a=J[1],u=J[2],f=J[3]}var ot=Yn([o,a,u,f]),ut=ot.minX,vt=ot.minY,St=ot.maxX,dt=ot.maxY;return{pos1:o,pos2:a,pos3:u,pos4:f,width:v,height:h,minX:ut,minY:vt,maxX:St,maxY:dt,rotation:r}}function Ou(e,r){var n=r.map(function(o){if(le(o)){var a=Ou(e,o),u=a.length;return u>1?a:u===1?a[0]:null}else{var f=wr(e,function(v){var h=v.manager;return h.props.target===o});return f?(f.finded=!0,f.manager):null}}).filter(Boolean);return n.length===1&&le(n[0])?n[0]:n}var af=function(e){de(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o.differ=new Uo,o.moveables=[],o.transformOrigin="50% 50%",o.renderGroupRects=[],o._targetGroups=[],o._hasFirstTargets=!1,o}var n=r.prototype;return n.componentDidMount=function(){e.prototype.componentDidMount.call(this)},n.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},n.getTargets=function(){return this.props.targets},n.updateRect=function(o,a,u){var f;u===void 0&&(u=!0);var v=this.state;if(!this.controlBox||v.isPersisted)return;Bn(!0),this.moveables.forEach(function(Nt){Nt.updateRect(o,!1,!1)});var h=this.props,b=this.moveables,C=v.target||h.target,_=b.map(function(Nt){return{finded:!1,manager:Nt}}),w=this.props.targetGroups||[],R=Ou(_,w);R.push.apply(R,_.filter(function(Nt){var he=Nt.finded;return!he}).map(function(Nt){var he=Nt.manager;return he}));var T=[],M=!a||o!==""&&h.updateGroup,I=h.defaultGroupRotate||0;if(!this._hasFirstTargets){var D=(f=this.props.persistData)===null||f===void 0?void 0:f.rotation;D!=null&&(I=D)}function z(Nt,he,Dt){var zt=Nt.map(function(te){if(le(te)){var ae=z(te,he),se=[ae.pos1,ae.pos2,ae.pos3,ae.pos4];return T.push(ae),{poses:se,rotation:ae.rotation}}else return{poses:tt(te.state),rotation:te.getRotation()}}),ne=zt.map(function(te){var ae=te.rotation;return ae}),Jt=0,Ke=ne[0],ue=ne.every(function(te){return Math.abs(Ke-te)<.1});M?Jt=ue?Ke:I:Jt=!Dt&&ue?Ke:he;var oe=zt.map(function(te){var ae=te.poses;return ae}),Re=of(oe,Jt);return Re}var W=z(R,this.rotation,!0);M&&(this.rotation=W.rotation,this.transformOrigin=h.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=w,this.renderGroupRects=T;var k=this.transformOrigin,H=this.rotation,L=this.scale,F=W.width,U=W.height,j=W.minX,q=W.minY,Y=rn([[0,0],[F,0],[0,U],[F,U]],xr(k,F,U),this.rotation/180*Math.PI),K=Yn(Y.result),J=K.minX,ot=K.minY,ut=" rotate(".concat(H,"deg)")+" scale(".concat(L[0]>=0?1:-1,", ").concat(L[1]>=0?1:-1,")"),vt="translate(".concat(-J,"px, ").concat(-ot,"px)").concat(ut);this.controlBox.style.transform="translate3d(".concat(j,"px, ").concat(q,"px, ").concat(this.props.translateZ||0,")"),C.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(k,";")+"width:".concat(F,"px;height:").concat(U,"px;")+"transform: ".concat(vt),v.width=F,v.height=U;var St=this.getContainer(),dt=xl(this.controlBox,C,this.controlBox,this.getContainer(),this._rootContainer||St,[]),ft=[dt.left,dt.top],at=tt(dt),_t=at[0],Mt=at[1],Ot=at[2],Ft=at[3],wt=Yn([_t,Mt,Ot,Ft]),xt=[wt.minX,wt.minY],Bt=L[0]*L[1]>0?1:-1;dt.pos1=Et(_t,xt),dt.pos2=Et(Mt,xt),dt.pos3=Et(Ot,xt),dt.pos4=Et(Ft,xt),dt.left=j-dt.left+xt[0],dt.top=q-dt.top+xt[1],dt.origin=Et(Yt(ft,dt.origin),xt),dt.beforeOrigin=Et(Yt(ft,dt.beforeOrigin),xt),dt.originalBeforeOrigin=Yt(ft,dt.originalBeforeOrigin),dt.transformOrigin=Et(Yt(ft,dt.transformOrigin),xt),C.style.transform="translate(".concat(-J-xt[0],"px, ").concat(-ot-xt[1],"px)")+ut,Bn(),this.updateState(N(N({},dt),{posDelta:xt,direction:Bt,beforeDirection:Bt}),u)},n.getRect=function(){return N(N({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(o){return o.getRect()})})},n.triggerEvent=function(o,a,u){if(u||o.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,o,a);this._emitter.trigger(o,a)},n.getRequestChildStyles=function(){var o=this.getEnabledAbles().reduce(function(a,u){var f,v,h=(v=(f=u.requestChildStyle)===null||f===void 0?void 0:f.call(u))!==null&&v!==void 0?v:[];return bt(bt([],a,!0),h,!0)},[]);return o},n.updateAbles=function(){e.prototype.updateAbles.call(this,bt(bt([],this.props.ables,!0),[wl],!1),"Group")},n._updateTargets=function(){e.prototype._updateTargets.call(this),this._prevTarget=this.props.dragTarget||this.areaElement},n._updateEvents=function(){var o=this.state,a=this.props,u=this._prevTarget,f=a.dragTarget||this.areaElement,v=a.targets,h=this.differ.update(v),b=h.added,C=h.changed,_=h.removed,w=b.length||_.length;(w||u!==f)&&(ht(this,!1),ht(this,!0),this.updateState({gestos:{}})),u!==f&&(o.target=null),o.target||(o.target=this.areaElement,this.controlBox.style.display="block"),o.target&&(this.targetGesto||(this.targetGesto=xu(this,f,"Group")),this.controlGesto||(this.controlGesto=_l(this,this.controlBox,"controlAbles","GroupControl")));var R=!Be(o.container,a.container);R&&(o.container=a.container),(R||w||this.transformOrigin!==(a.defaultGroupOrigin||"50% 50%")||C.length||v.length&&!_n(this._targetGroups,a.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!w},n._updateObserver=function(){},r.defaultProps=N(N({},Ja.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),r}(Ja),sf=function(e){de(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o.moveables=[],o}var n=r.prototype;return n.render=function(){var o=this,a,u=this.props,f=u.cspNonce,v=u.cssStyled,h=u.persistData,b=u.targets||[],C=b.length,_=this.isUnmounted||!C,w=(a=h==null?void 0:h.children)!==null&&a!==void 0?a:[];return _&&!C&&w.length?b=w.map(function(){return null}):_||(w=[]),Ue.createElement(v,{cspNonce:f,ref:(0,Ze.iH)(this,"controlBox"),className:Ct("control-box")},b.map(function(R,T){var M,I,D=(I=(M=u.individualGroupableProps)===null||M===void 0?void 0:M.call(u,R,T))!==null&&I!==void 0?I:{};return Ue.createElement(Ja,N({key:"moveable"+T,ref:(0,Ze.xL)(o,"moveables",T)},u,D,{target:R,wrapperMoveable:o,isWrapperMounted:o.isMoveableMounted,persistData:w[T]}))}))},n.componentDidMount=function(){},n.componentDidUpdate=function(){},n.getTargets=function(){return this.props.targets},n.updateRect=function(o,a,u){u===void 0&&(u=!0),Bn(!0),this.moveables.forEach(function(f){f.updateRect(o,a,u)}),Bn()},n.getRect=function(){return N(N({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(o){return o.getRect()})})},n.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},n.dragStart=function(){return this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.updateRenderPoses=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},n._updateEvents=function(){},n._updateObserver=function(){},r}(Ja);function Iu(e,r){var n=[];return e.forEach(function(o){if(!!o){if(Le(o)){r[o]&&n.push.apply(n,r[o]);return}le(o)?n.push.apply(n,Iu(o,r)):n.push(o)}}),n}function Pu(e,r){var n=[];return e.forEach(function(o){if(!!o){if(Le(o)){r[o]&&n.push.apply(n,r[o]);return}le(o)?n.push(Pu(o,r)):n.push(o)}}),n}function Du(e,r){return e.length!==r.length||e.some(function(n,o){var a=r[o];return!n&&!a?!1:n!=a?le(n)&&le(a)?Du(n,a):!0:!1})}var zu=function(e){de(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o.refTargets=[],o.selectorMap={},o._differ=new Uo,o._elementTargets=[],o._onChangeTargets=null,o}var n=r.prototype;return r.makeStyled=function(){var o={},a=this.getTotalAbles();a.forEach(function(f){var v=f.css;!v||v.forEach(function(h){o[h]=!0})});var u=Rn(o).join(` `);this.defaultStyled=La("div",(0,Ze.$i)(Co,ja+u))},r.getTotalAbles=function(){return bt([fu,wl,Ru,cu],this.defaultAbles,!0)},n.render=function(){var o,a=this.constructor;a.defaultStyled||a.makeStyled();var u=this.props,f=u.ables,v=u.props,h=Ga(u,["ables","props"]),b=this._updateRefs(!0),C=Iu(b,this.selectorMap),_=C.length>1,w=a.getTotalAbles(),R=bt(bt([],w,!0),f||[],!0),T=N(N(N({},h),v||{}),{ables:R,cssStyled:a.defaultStyled,customStyledMap:a.customStyledMap});this._elementTargets=C;var M=null,I=this.moveable,D=h.persistData;if((D==null?void 0:D.children)&&(_=!0),h.individualGroupable)return Ue.createElement(sf,N({key:"individual-group",ref:(0,Ze.iH)(this,"moveable")},T,{target:null,targets:C}));if(_){var z=Pu(b,this.selectorMap);if(I&&!I.props.groupable&&!I.props.individualGroupable){var W=I.props.target;W&&C.indexOf(W)>-1&&(M=N({},I.state))}return Ue.createElement(af,N({key:"group",ref:(0,Ze.iH)(this,"moveable")},T,(o=h.groupableProps)!==null&&o!==void 0?o:{},{target:null,targets:C,targetGroups:z,firstRenderState:M}))}else{var k=C[0];if(I&&(I.props.groupable||I.props.individualGroupable)){var H=I.moveables||[],L=wr(H,function(F){return F.props.target===k});L&&(M=N({},L.state))}return Ue.createElement(Ja,N({key:"single",ref:(0,Ze.iH)(this,"moveable")},T,{target:k,firstRenderState:M}))}},n.componentDidMount=function(){this._checkChangeTargets(),this._updateRefs()},n.componentDidUpdate=function(){this._checkChangeTargets()},n.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},n.getTargets=function(){var o,a;return(a=(o=this.moveable)===null||o===void 0?void 0:o.getTargets())!==null&&a!==void 0?a:[]},n.updateSelectors=function(){this.selectorMap={},this._updateRefs()},n.waitToChangeTarget=function(){var o=this,a;return this._onChangeTargets=function(){o._onChangeTargets=null,a()},new Promise(function(u){a=u})},n.waitToChangeTargets=function(){return this.waitToChangeTarget()},n.getManager=function(){return this.moveable},n._updateRefs=function(o){var a=this.refTargets,u=Pt(this.props.target||this.props.targets),f=typeof document!="undefined",v=Du(a,u),h=this.selectorMap,b={};return this.refTargets.forEach(function C(_){if(Le(_)){var w=h[_];w?b[_]=h[_]:f&&(v=!0,b[_]=[].slice.call(document.querySelectorAll(_)))}else le(_)&&_.forEach(C)}),this.refTargets=u,this.selectorMap=b,!o&&v&&this.forceUpdate(),u},n._checkChangeTargets=function(){var o,a,u,f=this._differ.update(this._elementTargets),v=f.added,h=f.removed,b=v.length||h.length;b&&((a=(o=this.props).onChangeTargets)===null||a===void 0||a.call(o,{moveable:this.moveable,targets:this._elementTargets}),(u=this._onChangeTargets)===null||u===void 0||u.call(this)),this._updateRefs()},r.defaultAbles=[],r.customStyledMap={},r.defaultStyled=null,Wa([(0,Ze.qE)(qr)],r.prototype,"moveable",void 0),r}(Ue.PureComponent),lf=function(e){de(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.defaultAbles=nf,r}(zu);function yf(e){var r;return r=function(n){de(o,n);function o(){return n!==null&&n.apply(this,arguments)||this}return o}(zu),r.defaultAbles=e,r}}}]);