filesbox/web/dist/47485.aa62adb4.async.js
2024-07-26 14:10:54 +08:00

532 lines
514 KiB
JavaScript

(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<m.length;d++){var t=m[d];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(g,hr(t.key),t)}}function jt(g,m,d){return m&&ir(g.prototype,m),d&&ir(g,d),Object.defineProperty(g,"prototype",{writable:!1}),g}function et(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Wt(g,m){if(m&&(nr(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return et(g)}function Ut(g){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},Ut(g)}function ur(g,m){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ur(g,m)}function Oe(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&ur(g,m)}function Q(g,m,d){return m=hr(m),m in g?Object.defineProperty(g,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):g[m]=d,g}function Ce(){var g=this.constructor.getDerivedStateFromProps(this.props,this.state);g!=null&&this.setState(g)}function je(g){function m(d){var t=this.constructor.getDerivedStateFromProps(g,d);return t!=null?t:null}this.setState(m.bind(this))}function Lr(g,m){try{var d=this.props,t=this.state;this.props=g,this.state=m,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(d,t)}finally{this.props=d,this.state=t}}Ce.__suppressDeprecationWarning=!0,je.__suppressDeprecationWarning=!0,Lr.__suppressDeprecationWarning=!0;function Ti(g){var m=g.prototype;if(!m||!m.isReactComponent)throw new Error("Can only polyfill class components");if(typeof g.getDerivedStateFromProps!="function"&&typeof m.getSnapshotBeforeUpdate!="function")return g;var d=null,t=null,i=null;if(typeof m.componentWillMount=="function"?d="componentWillMount":typeof m.UNSAFE_componentWillMount=="function"&&(d="UNSAFE_componentWillMount"),typeof m.componentWillReceiveProps=="function"?t="componentWillReceiveProps":typeof m.UNSAFE_componentWillReceiveProps=="function"&&(t="UNSAFE_componentWillReceiveProps"),typeof m.componentWillUpdate=="function"?i="componentWillUpdate":typeof m.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),d!==null||t!==null||i!==null){var s=g.displayName||g.name,l=typeof g.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
`+s+" uses "+l+" but also contains the following legacy lifecycles:"+(d!==null?`
`+d:"")+(t!==null?`
`+t:"")+(i!==null?`
`+i:"")+`
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof g.getDerivedStateFromProps=="function"&&(m.componentWillMount=Ce,m.componentWillReceiveProps=je),typeof m.getSnapshotBeforeUpdate=="function"){if(typeof m.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");m.componentWillUpdate=Lr;var c=m.componentDidUpdate;m.componentDidUpdate=function(S,y,x){var E=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:x;c.call(this,S,y,E)}}return g}function ge(){return ge=Object.assign?Object.assign.bind():function(g){for(var m=1;m<arguments.length;m++){var d=arguments[m];for(var t in d)Object.prototype.hasOwnProperty.call(d,t)&&(g[t]=d[t])}return g},ge.apply(this,arguments)}function Or(g){var m,d,t="";if(typeof g=="string"||typeof g=="number")t+=g;else if(typeof g=="object")if(Array.isArray(g))for(m=0;m<g.length;m++)g[m]&&(d=Or(g[m]))&&(t&&(t+=" "),t+=d);else for(m in g)g[m]&&(t&&(t+=" "),t+=m);return t}function ko(){for(var g,m,d=0,t="";d<arguments.length;)(g=arguments[d++])&&(m=Or(g))&&(t&&(t+=" "),t+=m);return t}var Tt=ko;function Ze(g){var m=g.cellCount,d=g.cellSize,t=g.computeMetadataCallback,i=g.computeMetadataCallbackProps,s=g.nextCellsCount,l=g.nextCellSize,c=g.nextScrollToIndex,p=g.scrollToIndex,S=g.updateScrollOffsetForScrollToIndex;(m!==s||(typeof d=="number"||typeof l=="number")&&d!==l)&&(t(i),p>=0&&p===c&&S())}function Ei(g,m){if(g==null)return{};var d={},t=Object.keys(g),i,s;for(s=0;s<t.length;s++)i=t[s],!(m.indexOf(i)>=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<s.length;i++)t=s[i],!(m.indexOf(t)>=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;i<l&&S<this._cellCount-1;)S++,i+=this.getSizeAndPositionOfCell(S).size;return{start:c,stop:S}}},{key:"resetCell",value:function(d){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,d-1)}},{key:"_binarySearch",value:function(d,t,i){for(;t<=d;){var s=t+Math.floor((d-t)/2),l=this.getSizeAndPositionOfCell(s).offset;if(l===i)return s;l<i?t=s+1:l>i&&(d=s-1)}return t>0?t-1:0}},{key:"_exponentialSearch",value:function(d,t){for(var i=1;d<this._cellCount&&this.getSizeAndPositionOfCell(d).offset<t;)d+=i,i*=2;return this._binarySearch(Math.min(d,this._cellCount-1),Math.floor(d/2),t)}},{key:"_findNearestCell",value:function(d){if(isNaN(d))throw Error("Invalid offset ".concat(d," specified"));d=Math.max(0,d);var t=this.getSizeAndPositionOfLastMeasuredCell(),i=Math.max(0,this._lastMeasuredIndex);return t.offset>=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&&y<P,B=x!==c||E||!i||typeof m=="number"&&m!==i;A&&(B||S!==s||y!==l)?O(y):!A&&P>0&&(x<c||P<t)&&p>d.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;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?Bo(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):Bo(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var Rn=150,Ho={OBSERVED:"observed",REQUESTED:"requested"},Tn=function(){return null},ma=(wr=Fo=function(g){Oe(m,g);function m(d){var t;Kt(this,m),t=Wt(this,Ut(m).call(this,d)),Q(et(t),"_onGridRenderedMemoizer",pr()),Q(et(t),"_onScrollMemoizer",pr(!1)),Q(et(t),"_deferredInvalidateColumnIndex",null),Q(et(t),"_deferredInvalidateRowIndex",null),Q(et(t),"_recomputeScrollLeftFlag",!1),Q(et(t),"_recomputeScrollTopFlag",!1),Q(et(t),"_horizontalScrollBarSize",0),Q(et(t),"_verticalScrollBarSize",0),Q(et(t),"_scrollbarPresenceChanged",!1),Q(et(t),"_scrollingContainer",void 0),Q(et(t),"_childrenToDisplay",void 0),Q(et(t),"_columnStartIndex",void 0),Q(et(t),"_columnStopIndex",void 0),Q(et(t),"_rowStartIndex",void 0),Q(et(t),"_rowStopIndex",void 0),Q(et(t),"_renderedColumnStartIndex",0),Q(et(t),"_renderedColumnStopIndex",0),Q(et(t),"_renderedRowStartIndex",0),Q(et(t),"_renderedRowStopIndex",0),Q(et(t),"_initialScrollTop",void 0),Q(et(t),"_initialScrollLeft",void 0),Q(et(t),"_disablePointerEventsTimeoutId",void 0),Q(et(t),"_styleCache",{}),Q(et(t),"_cellCache",{}),Q(et(t),"_debounceScrollEndedCallback",function(){t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1,needToResetStyleCache:!1})}),Q(et(t),"_invokeOnGridRenderedHelper",function(){var l=t.props.onSectionRendered;t._onGridRenderedMemoizer({callback:l,indices:{columnOverscanStartIndex:t._columnStartIndex,columnOverscanStopIndex:t._columnStopIndex,columnStartIndex:t._renderedColumnStartIndex,columnStopIndex:t._renderedColumnStopIndex,rowOverscanStartIndex:t._rowStartIndex,rowOverscanStopIndex:t._rowStopIndex,rowStartIndex:t._renderedRowStartIndex,rowStopIndex:t._renderedRowStopIndex}})}),Q(et(t),"_setScrollingContainerRef",function(l){t._scrollingContainer=l}),Q(et(t),"_onScroll",function(l){l.target===t._scrollingContainer&&t.handleScrollEvent(l.target)});var i=new Pi({cellCount:d.columnCount,cellSizeGetter:function(c){return m._wrapSizeGetter(d.columnWidth)(c)},estimatedCellSize:m._getEstimatedColumnSize(d)}),s=new Pi({cellCount:d.rowCount,cellSizeGetter:function(c){return m._wrapSizeGetter(d.rowHeight)(c)},estimatedCellSize:m._getEstimatedRowSize(d)});return t.state={instanceProps:{columnSizeAndPositionManager:i,rowSizeAndPositionManager:s,prevColumnWidth:d.columnWidth,prevRowHeight:d.rowHeight,prevColumnCount:d.columnCount,prevRowCount:d.rowCount,prevIsScrolling:d.isScrolling===!0,prevScrollToColumn:d.scrollToColumn,prevScrollToRow:d.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:Le,scrollDirectionVertical:Le,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},d.scrollToRow>0&&(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<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?cr(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):cr(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var jo=(kt=Ur=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"state",{scrollToColumn:0,scrollToRow:0,instanceProps:{prevScrollToColumn:0,prevScrollToRow:0}}),Q(et(t),"_columnStartIndex",0),Q(et(t),"_columnStopIndex",0),Q(et(t),"_rowStartIndex",0),Q(et(t),"_rowStopIndex",0),Q(et(t),"_onKeyDown",function(c){var p=t.props,S=p.columnCount,y=p.disabled,x=p.mode,E=p.rowCount;if(!y){var O=t._getScrollState(),P=O.scrollToColumn,A=O.scrollToRow,B=t._getScrollState(),G=B.scrollToColumn,V=B.scrollToRow;switch(c.key){case"ArrowDown":V=Math.min(x==="cells"?V+1:t._rowStopIndex+1,E-1);break;case"ArrowLeft":G=Math.max(x==="cells"?G-1:t._columnStartIndex-1,0);break;case"ArrowRight":G=Math.min(x==="cells"?G+1:t._columnStopIndex+1,S-1);break;case"ArrowUp":V=Math.max(x==="cells"?V-1:t._rowStartIndex-1,0);break}(G!==P||V!==A)&&(c.preventDefault(),t._updateScrollState({scrollToColumn:G,scrollToRow:V}))}}),Q(et(t),"_onSectionRendered",function(c){var p=c.columnStartIndex,S=c.columnStopIndex,y=c.rowStartIndex,x=c.rowStopIndex;t._columnStartIndex=p,t._columnStopIndex=S,t._rowStartIndex=y,t._rowStopIndex=x}),t}return jt(m,[{key:"setScrollIndexes",value:function(t){var i=t.scrollToColumn,s=t.scrollToRow;this.setState({scrollToRow:s,scrollToColumn:i})}},{key:"render",value:function(){var t=this.props,i=t.className,s=t.children,l=this._getScrollState(),c=l.scrollToColumn,p=l.scrollToRow;return Z.createElement("div",{className:i,onKeyDown:this._onKeyDown},s({onSectionRendered:this._onSectionRendered,scrollToColumn:c,scrollToRow:p}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(t){var i=t.scrollToColumn,s=t.scrollToRow,l=this.props,c=l.isControlled,p=l.onScrollToChange;typeof p=="function"&&p({scrollToColumn:i,scrollToRow:s}),c||this.setState({scrollToColumn:i,scrollToRow:s})}}],[{key:"getDerivedStateFromProps",value:function(t,i){return t.isControlled?{}:t.scrollToColumn!==i.instanceProps.prevScrollToColumn||t.scrollToRow!==i.instanceProps.prevScrollToRow?Lt({},i,{scrollToColumn:t.scrollToColumn,scrollToRow:t.scrollToRow,instanceProps:{prevScrollToColumn:t.scrollToColumn,prevScrollToRow:t.scrollToRow}}):{}}}]),m}(Z.PureComponent),Q(Ur,"propTypes",null),kt);Q(jo,"defaultProps",{disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0}),Ti(jo);var il=null;function Cr(g,m){var d;typeof m!="undefined"?d=m:typeof window!="undefined"?d=window:typeof self!="undefined"?d=self:d=At.g;var t=typeof d.document!="undefined"&&d.document.attachEvent;if(!t){var i=function(){var it=d.requestAnimationFrame||d.mozRequestAnimationFrame||d.webkitRequestAnimationFrame||function(tt){return d.setTimeout(tt,20)};return function(tt){return it(tt)}}(),s=function(){var it=d.cancelAnimationFrame||d.mozCancelAnimationFrame||d.webkitCancelAnimationFrame||d.clearTimeout;return function(tt){return it(tt)}}(),l=function(tt){var ht=tt.__resizeTriggers__,lt=ht.firstElementChild,gt=ht.lastElementChild,ct=lt.firstElementChild;gt.scrollLeft=gt.scrollWidth,gt.scrollTop=gt.scrollHeight,ct.style.width=lt.offsetWidth+1+"px",ct.style.height=lt.offsetHeight+1+"px",lt.scrollLeft=lt.scrollWidth,lt.scrollTop=lt.scrollHeight},c=function(tt){return tt.offsetWidth!=tt.__resizeLast__.width||tt.offsetHeight!=tt.__resizeLast__.height},p=function(tt){if(!(tt.target.className&&typeof tt.target.className.indexOf=="function"&&tt.target.className.indexOf("contract-trigger")<0&&tt.target.className.indexOf("expand-trigger")<0)){var ht=this;l(this),this.__resizeRAF__&&s(this.__resizeRAF__),this.__resizeRAF__=i(function(){c(ht)&&(ht.__resizeLast__.width=ht.offsetWidth,ht.__resizeLast__.height=ht.offsetHeight,ht.__resizeListeners__.forEach(function(lt){lt.call(ht,tt)}))})}},S=!1,y="",x="animationstart",E="Webkit Moz O ms".split(" "),O="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),P="";{var A=d.document.createElement("fakeelement");if(A.style.animationName!==void 0&&(S=!0),S===!1){for(var B=0;B<E.length;B++)if(A.style[E[B]+"AnimationName"]!==void 0){P=E[B],y="-"+P.toLowerCase()+"-",x=O[B],S=!0;break}}}var G="resizeanim",V="@"+y+"keyframes "+G+" { from { opacity: 0; } to { opacity: 0; } } ",$=y+"animation: 1ms "+G+"; "}var X=function(tt){if(!tt.getElementById("detectElementResize")){var ht=(V||"")+".resize-triggers { "+($||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > 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&&gt.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&&gt.position=="static"&&(tt.style.position="relative"),X(lt),tt.__resizeLast__={},tt.__resizeListeners__=[],(tt.__resizeTriggers__=lt.createElement("div")).className="resize-triggers";var ct='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>';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<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?ss(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):ss(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var sn=(Sa=oo=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"state",{height:t.props.defaultHeight||0,width:t.props.defaultWidth||0}),Q(et(t),"_parentNode",void 0),Q(et(t),"_autoSizer",void 0),Q(et(t),"_window",void 0),Q(et(t),"_detectElementResize",void 0),Q(et(t),"_onResize",function(){var c=t.props,p=c.disableHeight,S=c.disableWidth,y=c.onResize;if(t._parentNode){var x=t._parentNode.offsetHeight||0,E=t._parentNode.offsetWidth||0,O=t._window||window,P=O.getComputedStyle(t._parentNode)||{},A=parseInt(P.paddingLeft,10)||0,B=parseInt(P.paddingRight,10)||0,G=parseInt(P.paddingTop,10)||0,V=parseInt(P.paddingBottom,10)||0,$=x-G-V,X=E-A-B;(!p&&t.state.height!==$||!S&&t.state.width!==X)&&(t.setState({height:x-G-V,width:E-A-B}),y({height:x,width:E}))}}),Q(et(t),"_setRef",function(c){t._autoSizer=c}),t}return jt(m,[{key:"componentDidMount",value:function(){var t=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=Cr(t,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var t=this.props,i=t.children,s=t.className,l=t.disableHeight,c=t.disableWidth,p=t.style,S=this.state,y=S.height,x=S.width,E={overflow:"visible"},O={};return l||(E.height=0,O.height=y),c||(E.width=0,O.width=x),Z.createElement("div",{className:s,ref:this._setRef,style:ls({},E,{},p)},i(O))}}]),m}(Z.Component),Q(oo,"propTypes",null),Sa);Q(sn,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}});var ao=At(73935),Gs=null,ba,_a,Ie=(_a=ba=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"_child",void 0),Q(et(t),"_measure",function(){var c=t.props,p=c.cache,S=c.columnIndex,y=S===void 0?0:S,x=c.parent,E=c.rowIndex,O=E===void 0?t.props.index||0:E,P=t._getCellMeasurements(),A=P.height,B=P.width;(A!==p.getHeight(O,y)||B!==p.getWidth(O,y))&&(p.set(O,y,B,A),x&&typeof x.recomputeGridSize=="function"&&x.recomputeGridSize({columnIndex:y,rowIndex:O}))}),Q(et(t),"_registerChild",function(c){c&&!(c instanceof Element)&&console.warn("CellMeasurer registerChild expects to be passed Element or null"),t._child=c,c&&t._maybeMeasureCell()}),t}return jt(m,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var t=this.props.children;return typeof t=="function"?t({measure:this._measure,registerChild:this._registerChild}):t}},{key:"_getCellMeasurements",value:function(){var t=this.props.cache,i=this._child||(0,ao.findDOMNode)(this);if(i&&i.ownerDocument&&i.ownerDocument.defaultView&&i instanceof i.ownerDocument.defaultView.HTMLElement){var s=i.style.width,l=i.style.height;t.hasFixedWidth()||(i.style.width="auto"),t.hasFixedHeight()||(i.style.height="auto");var c=Math.ceil(i.offsetHeight),p=Math.ceil(i.offsetWidth);return s&&(i.style.width=s),l&&(i.style.height=l),{height:c,width:p}}else return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var t=this.props,i=t.cache,s=t.columnIndex,l=s===void 0?0:s,c=t.parent,p=t.rowIndex,S=p===void 0?this.props.index||0:p;if(!i.has(S,l)){var y=this._getCellMeasurements(),x=y.height,E=y.width;i.set(S,l,E,x),c&&typeof c.invalidateCellSizeAfterRender=="function"&&c.invalidateCellSizeAfterRender({columnIndex:l,rowIndex:S})}}}]),m}(Z.PureComponent),Q(ba,"propTypes",null),_a);Q(Ie,"__internalCellMeasurerFlag",!1);var xa=30,No=100,Ws=null;function yr(g,m){return"".concat(g,"-").concat(m)}var fr=null;function ki(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 us(g){for(var m=1;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?ki(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):ki(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var so=150,ln={OBSERVED:"observed",REQUESTED:"requested"},Rr=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"state",{isScrolling:!1,scrollLeft:0,scrollTop:0}),Q(et(t),"_calculateSizeAndPositionDataOnNextUpdate",!1),Q(et(t),"_onSectionRenderedMemoizer",pr()),Q(et(t),"_onScrollMemoizer",pr(!1)),Q(et(t),"_invokeOnSectionRenderedHelper",function(){var c=t.props,p=c.cellLayoutManager,S=c.onSectionRendered;t._onSectionRenderedMemoizer({callback:S,indices:{indices:p.getLastRenderedIndices()}})}),Q(et(t),"_setScrollingContainerRef",function(c){t._scrollingContainer=c}),Q(et(t),"_updateScrollPositionForScrollToCell",function(){var c=t.props,p=c.cellLayoutManager,S=c.height,y=c.scrollToAlignment,x=c.scrollToCell,E=c.width,O=t.state,P=O.scrollLeft,A=O.scrollTop;if(x>=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<m;p++){var S=d({index:p});if(S.height==null||isNaN(S.height)||S.width==null||isNaN(S.width)||S.x==null||isNaN(S.x)||S.y==null||isNaN(S.y))throw Error("Invalid metadata returned for cell ".concat(p,`:
x:`).concat(S.x,", y:").concat(S.y,", width:").concat(S.width,", height:").concat(S.height));l=Math.max(l,S.y+S.height),c=Math.max(c,S.x+S.width),i[p]=S,s.registerCell({cellMetadatum:S,index:p})}return{cellMetadata:i,height:l,sectionManager:s,width:c}}function ci(g){var m=g.align,d=m===void 0?"auto":m,t=g.cellOffset,i=g.cellSize,s=g.containerSize,l=g.currentOffset,c=t,p=c-s+i;switch(d){case"start":return c;case"end":return p;case"center":return c-(s-i)/2;default:return Math.max(p,Math.min(c,l))}}var Qe=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._cellMetadata=[],i._lastRenderedCellIndices=[],i._cellCache=[],i._isScrollingChange=i._isScrollingChange.bind(et(i)),i._setCollectionViewRef=i._setCollectionViewRef.bind(et(i)),i}return jt(m,[{key:"forceUpdate",value:function(){this._collectionView!==void 0&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var t=ge({},this.props);return Z.createElement(cs,ge({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},t))}},{key:"calculateSizeAndPositionData",value:function(){var t=this.props,i=t.cellCount,s=t.cellSizeAndPositionGetter,l=t.sectionSize,c=Gi({cellCount:i,cellSizeAndPositionGetter:s,sectionSize:l});this._cellMetadata=c.cellMetadata,this._sectionManager=c.sectionManager,this._height=c.height,this._width=c.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(t){var i=t.align,s=t.cellIndex,l=t.height,c=t.scrollLeft,p=t.scrollTop,S=t.width,y=this.props.cellCount;if(s>=0&&s<y){var x=this._cellMetadata[s];c=ci({align:i,cellOffset:x.x,cellSize:x.width,containerSize:S,currentOffset:c,targetIndex:s}),p=ci({align:i,cellOffset:x.y,cellSize:x.height,containerSize:l,currentOffset:p,targetIndex:s})}return{scrollLeft:c,scrollTop:p}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(t){var i=this,s=t.height,l=t.isScrolling,c=t.width,p=t.x,S=t.y,y=this.props,x=y.cellGroupRenderer,E=y.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:s,width:c,x:p,y:S}),x({cellCache:this._cellCache,cellRenderer:E,cellSizeAndPositionGetter:function(P){var A=P.index;return i._sectionManager.getCellMetadata({index:A})},indices:this._lastRenderedCellIndices,isScrolling:l})}},{key:"_isScrollingChange",value:function(t){t||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(t){this._collectionView=t}}]),m}(Z.PureComponent);Q(Qe,"defaultProps",{"aria-label":"grid",cellGroupRenderer:Nn}),Qe.propTypes={};function Nn(g){var m=g.cellCache,d=g.cellRenderer,t=g.cellSizeAndPositionGetter,i=g.indices,s=g.isScrolling;return i.map(function(l){var c=t({index:l}),p={index:l,isScrolling:s,key:l,style:{height:c.height,left:c.x,position:"absolute",top:c.y,width:c.width}};return s?(l in m||(m[l]=d(p)),m[l]):d(p)}).filter(function(l){return!!l})}var fi=null,Ca=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._registerChild=i._registerChild.bind(et(i)),i}return jt(m,[{key:"componentDidUpdate",value:function(t){var i=this.props,s=i.columnMaxWidth,l=i.columnMinWidth,c=i.columnCount,p=i.width;(s!==t.columnMaxWidth||l!==t.columnMinWidth||c!==t.columnCount||p!==t.width)&&this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var t=this.props,i=t.children,s=t.columnMaxWidth,l=t.columnMinWidth,c=t.columnCount,p=t.width,S=l||1,y=s?Math.min(s,p):p,x=p/c;x=Math.max(S,x),x=Math.min(y,x),x=Math.floor(x);var E=Math.min(p,x*c);return i({adjustedWidth:E,columnWidth:x,getColumnWidth:function(){return x},registerChild:this._registerChild})}},{key:"_registerChild",value:function(t){if(t&&typeof t.recomputeGridSize!="function")throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=t,this._registeredChild&&this._registeredChild.recomputeGridSize()}}]),m}(Z.PureComponent);Ca.propTypes={};var lo=null;function Vn(g,m){(m==null||m>g.length)&&(m=g.length);for(var d=0,t=new Array(m);d<m;d++)t[d]=g[d];return t}function cn(g){if(Array.isArray(g))return Vn(g)}function Ra(g){if(typeof Symbol!="undefined"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function fn(g,m){if(!!g){if(typeof g=="string")return Vn(g,m);var d=Object.prototype.toString.call(g).slice(8,-1);if(d==="Object"&&g.constructor&&(d=g.constructor.name),d==="Map"||d==="Set")return Array.from(g);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return Vn(g,m)}}function ye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function We(g){return cn(g)||Ra(g)||fn(g)||ye()}var dn=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._loadMoreRowsMemoizer=pr(),i._onRowsRendered=i._onRowsRendered.bind(et(i)),i._registerChild=i._registerChild.bind(et(i)),i}return jt(m,[{key:"resetLoadMoreRowsCache",value:function(t){this._loadMoreRowsMemoizer=pr(),t&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){var t=this.props.children;return t({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(t){var i=this,s=this.props.loadMoreRows;t.forEach(function(l){var c=s(l);c&&c.then(function(){Vo({lastRenderedStartIndex:i._lastRenderedStartIndex,lastRenderedStopIndex:i._lastRenderedStopIndex,startIndex:l.startIndex,stopIndex:l.stopIndex})&&i._registeredChild&&di(i._registeredChild,i._lastRenderedStartIndex)})})}},{key:"_onRowsRendered",value:function(t){var i=t.startIndex,s=t.stopIndex;this._lastRenderedStartIndex=i,this._lastRenderedStopIndex=s,this._doStuff(i,s)}},{key:"_doStuff",value:function(t,i){var s,l=this,c=this.props,p=c.isRowLoaded,S=c.minimumBatchSize,y=c.rowCount,x=c.threshold,E=Bs({isRowLoaded:p,minimumBatchSize:S,rowCount:y,startIndex:Math.max(0,t-x),stopIndex:Math.min(y-1,i+x)}),O=(s=[]).concat.apply(s,We(E.map(function(P){var A=P.startIndex,B=P.stopIndex;return[A,B]})));this._loadMoreRowsMemoizer({callback:function(){l._loadUnloadedRanges(E)},indices:{squashedUnloadedRanges:O}})}},{key:"_registerChild",value:function(t){this._registeredChild=t}}]),m}(Z.PureComponent);Q(dn,"defaultProps",{minimumBatchSize:10,rowCount:0,threshold:15}),dn.propTypes={};function Vo(g){var m=g.lastRenderedStartIndex,d=g.lastRenderedStopIndex,t=g.startIndex,i=g.stopIndex;return!(t>d||i<m)}function Bs(g){for(var m=g.isRowLoaded,d=g.minimumBatchSize,t=g.rowCount,i=g.startIndex,s=g.stopIndex,l=[],c=null,p=null,S=i;S<=s;S++){var y=m({index:S});y?p!==null&&(l.push({startIndex:c,stopIndex:p}),c=p=null):(p=S,c===null&&(c=S))}if(p!==null){for(var x=Math.min(Math.max(p,c+d-1),t-1),E=p+1;E<=x&&!m({index:E});E++)p=E;l.push({startIndex:c,stopIndex:p})}if(l.length)for(var O=l[0];O.stopIndex-O.startIndex+1<d&&O.startIndex>0;){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;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"Grid",void 0),Q(et(t),"_cellRenderer",function(c){var p=c.parent,S=c.rowIndex,y=c.style,x=c.isScrolling,E=c.isVisible,O=c.key,P=t.props.rowRenderer,A=Object.getOwnPropertyDescriptor(y,"width");return A&&A.writable&&(y.width="100%"),P({index:S,style:y,isScrolling:x,isVisible:E,key:O,parent:p})}),Q(et(t),"_setRef",function(c){t.Grid=c}),Q(et(t),"_onScroll",function(c){var p=c.clientHeight,S=c.scrollHeight,y=c.scrollTop,x=t.props.onScroll;x({clientHeight:p,scrollHeight:S,scrollTop:y})}),Q(et(t),"_onSectionRendered",function(c){var p=c.rowOverscanStartIndex,S=c.rowOverscanStopIndex,y=c.rowStartIndex,x=c.rowStopIndex,E=t.props.onRowsRendered;E({overscanStartIndex:p,overscanStopIndex:S,startIndex:y,stopIndex:x})}),t}return jt(m,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var i=t.alignment,s=t.index;if(this.Grid){var l=this.Grid.getOffsetForCell({alignment:i,rowIndex:s,columnIndex:0}),c=l.scrollTop;return c}return 0}},{key:"invalidateCellSizeAfterRender",value:function(t){var i=t.columnIndex,s=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:s,columnIndex:i})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.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;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<t?(i=s,m=s+1):d=s-1}return i}function ps(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 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]<this.mid)this.left?4*(this.left.count+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]<this.mid){if(!this.left)return hi;var d=this.right?this.right.count:0;if(4*d>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<this.leftPoints.length&&this.leftPoints[c][0]===g[0];++c)if(this.leftPoints[c]===g){this.count-=1,this.leftPoints.splice(c,1);for(var t=Wr.ge(this.rightPoints,g,fo);t<this.rightPoints.length&&this.rightPoints[t][1]===g[1];++t)if(this.rightPoints[t]===g)return this.rightPoints.splice(t,1),In}return hi}};function $o(g,m,d){for(var t=0;t<g.length&&g[t][0]<=m;++t){var i=d(g[t]);if(i)return i}}function Ko(g,m,d){for(var t=g.length-1;t>=0&&g[t][1]>=m;--t){var i=d(g[t]);if(i)return i}}function Xn(g,m){for(var d=0;d<g.length;++d){var t=m(g[d]);if(t)return t}}Pe.queryPoint=function(g,m){if(g<this.mid){if(this.left){var d=this.left.queryPoint(g,m);if(d)return d}return $o(this.leftPoints,g,m)}else if(g>this.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(g<this.mid&&this.left){var t=this.left.queryInterval(g,m,d);if(t)return t}if(m>this.mid&&this.right){var t=this.right.queryInterval(g,m,d);if(t)return t}return m<this.mid?$o(this.leftPoints,m,d):g>this.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<g.length;++d)m.push(g[d][0],g[d][1]);m.sort(Yn);for(var t=m[m.length>>1],i=[],s=[],l=[],d=0;d<g.length;++d){var c=g[d];c[1]<t?i.push(c):t<c[0]?s.push(c):l.push(c)}var p=l,S=l.slice();return p.sort(vn),S.sort(fo),new Yo(t,Dr(i),Dr(s),p,S)}function Yr(g){this.root=g}var qn=Yr.prototype;qn.insert=function(g){this.root?this.root.insert(g):this.root=new Yo(g[0],null,null,[g],[g])},qn.remove=function(g){if(this.root){var m=this.root.remove(g);return m===Tr&&(this.root=null),m!==hi}return!1},qn.queryPoint=function(g,m){if(this.root)return this.root.queryPoint(g,m)},qn.queryInterval=function(g,m,d){if(g<=m&&this.root)return this.root.queryInterval(g,m,d)},Object.defineProperty(qn,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(qn,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function vo(g){return!g||g.length===0?new Yr(null):new Yr(Dr(g))}var ji=function(){function g(){Kt(this,g),Q(this,"_columnSizeMap",{}),Q(this,"_intervalTree",vo()),Q(this,"_leftMap",{})}return jt(g,[{key:"estimateTotalHeight",value:function(d,t,i){var s=d-this.count;return this.tallestColumnSize+Math.ceil(s/t)*i}},{key:"range",value:function(d,t,i){var s=this;this._intervalTree.queryInterval(d,d+t,function(l){var c=vs(l,3),p=c[0],S=c[1],y=c[2];return i(y,s._leftMap[y],p)})}},{key:"setPosition",value:function(d,t,i,s){this._intervalTree.insert([i,i+s,d]),this._leftMap[d]=t;var l=this._columnSizeMap,c=l[t];c===void 0?l[t]=i+s:l[t]=Math.max(c,i+s)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var d=this._columnSizeMap,t=0;for(var i in d){var s=d[i];t=t===0?s:Math.min(t,s)}return t}},{key:"tallestColumnSize",get:function(){var d=this._columnSizeMap,t=0;for(var i in d){var s=d[i];t=Math.max(t,s)}return t}}]),g}(),zr,ho;function Ni(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 ms(g){for(var m=1;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?Ni(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):Ni(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var Zo={},po=150,go=(ho=zr=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"state",{isScrolling:!1,scrollTop:0}),Q(et(t),"_debounceResetIsScrollingId",void 0),Q(et(t),"_invalidateOnUpdateStartIndex",null),Q(et(t),"_invalidateOnUpdateStopIndex",null),Q(et(t),"_positionCache",new ji),Q(et(t),"_startIndex",null),Q(et(t),"_startIndexMemoized",null),Q(et(t),"_stopIndex",null),Q(et(t),"_stopIndexMemoized",null),Q(et(t),"_debounceResetIsScrollingCallback",function(){t.setState({isScrolling:!1})}),Q(et(t),"_setScrollingContainerRef",function(c){t._scrollingContainer=c}),Q(et(t),"_onScroll",function(c){var p=t.props.height,S=c.currentTarget.scrollTop,y=Math.min(Math.max(0,t._getEstimatedTotalHeight()-p),S);S===y&&(t._debounceResetIsScrolling(),t.state.scrollTop!==y&&t.setState({isScrolling:!0,scrollTop:y}))}),t}return jt(m,[{key:"clearCellPositions",value:function(){this._positionCache=new ji,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(t){var i=t.rowIndex;this._invalidateOnUpdateStartIndex===null?(this._invalidateOnUpdateStartIndex=i,this._invalidateOnUpdateStopIndex=i):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,i),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,i))}},{key:"recomputeCellPositions",value:function(){var t=this._positionCache.count-1;this._positionCache=new ji,this._populatePositionCache(0,t),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(t,i){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==t.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&mr(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var t=this,i=this.props,s=i.autoHeight,l=i.cellCount,c=i.cellMeasurerCache,p=i.cellRenderer,S=i.className,y=i.height,x=i.id,E=i.keyMapper,O=i.overscanByPixels,P=i.role,A=i.style,B=i.tabIndex,G=i.width,V=i.rowDirection,$=this.state,X=$.isScrolling,rt=$.scrollTop,st=[],it=this._getEstimatedTotalHeight(),tt=this._positionCache.shortestColumnSize,ht=this._positionCache.count,lt=0,gt;if(this._positionCache.range(Math.max(0,rt-O),y+O*2,function(Gt,pt,$e){var _e;typeof gt=="undefined"?(lt=Gt,gt=Gt):(lt=Math.min(lt,Gt),gt=Math.max(gt,Gt)),st.push(p({index:Gt,isScrolling:X,key:E(Gt),parent:t,style:(_e={height:c.getHeight(Gt)},Q(_e,V==="ltr"?"left":"right",pt),Q(_e,"position","absolute"),Q(_e,"top",$e),Q(_e,"width",c.getWidth(Gt)),_e)}))}),tt<rt+y+O&&ht<l)for(var ct=Math.min(l-ht,Math.ceil((rt+y+O-tt)/c.defaultHeight*G/c.defaultWidth)),mt=ht;mt<ht+ct;mt++)gt=mt,st.push(p({index:mt,isScrolling:X,key:E(mt),parent:this,style:{width:c.getWidth(mt)}}));return this._startIndex=lt,this._stopIndex=gt,Z.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Tt("ReactVirtualized__Masonry",S),id:x,onScroll:this._onScroll,role:P,style:ms({boxSizing:"border-box",direction:"ltr",height:s?"auto":y,overflowX:"hidden",overflowY:it<y?"hidden":"auto",position:"relative",width:G,WebkitOverflowScrolling:"touch",willChange:"transform"},A),tabIndex:B},Z.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:it,maxWidth:"100%",maxHeight:it,overflow:"hidden",pointerEvents:X?"none":"",position:"relative"}},st))}},{key:"_checkInvalidateOnUpdate",value:function(){if(typeof this._invalidateOnUpdateStartIndex=="number"){var t=this._invalidateOnUpdateStartIndex,i=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(t,i),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var t=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&mr(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=li(this._debounceResetIsScrollingCallback,t)}},{key:"_getEstimatedTotalHeight",value:function(){var t=this.props,i=t.cellCount,s=t.cellMeasurerCache,l=t.width,c=Math.max(1,Math.floor(l/s.defaultWidth));return this._positionCache.estimateTotalHeight(i,c,s.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var t=this.props,i=t.height,s=t.onScroll,l=this.state.scrollTop;this._onScrollMemoized!==l&&(s({clientHeight:i,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:l}),this._onScrollMemoized=l)}},{key:"_invokeOnCellsRenderedCallback",value:function(){if(this._startIndexMemoized!==this._startIndex||this._stopIndexMemoized!==this._stopIndex){var t=this.props.onCellsRendered;t({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex}}},{key:"_populatePositionCache",value:function(t,i){for(var s=this.props,l=s.cellMeasurerCache,c=s.cellPositioner,p=t;p<=i;p++){var S=c(p),y=S.left,x=S.top;this._positionCache.setPosition(p,y,x,l.getHeight(p))}}}],[{key:"getDerivedStateFromProps",value:function(t,i){return t.scrollTop!==void 0&&i.scrollTop!==t.scrollTop?{isScrolling:!0,scrollTop:t.scrollTop}:null}}]),m}(Z.PureComponent),Q(zr,"propTypes",null),ho);Q(go,"defaultProps",{autoHeight:!1,keyMapper:js,onCellsRendered:mo,onScroll:mo,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:po,style:Zo,tabIndex:0,rowDirection:"ltr"});function js(g){return g}function mo(){}var Ue=null;Ti(go);var Qo=null,Ns=null;function Me(g){var m=g.cellMeasurerCache,d=g.columnCount,t=g.columnWidth,i=g.spacer,s=i===void 0?0:i,l;p();function c(y){for(var x=0,E=1;E<l.length;E++)l[E]<l[x]&&(x=E);var O=x*(t+s),P=l[x]||0;return l[x]=P+m.getHeight(y)+s,{left:O,top:P}}function p(){l=[];for(var y=0;y<d;y++)l[y]=0}function S(y){d=y.columnCount,t=y.columnWidth,s=y.spacer,p()}return c.reset=S,c}var Vs=null,Pn=function(){function g(){var m=this,d=arguments.length>0&&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;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?Vi(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):Vi(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var Pa=20,$n=function(g){Oe(m,g);function m(d,t){var i;Kt(this,m),i=Wt(this,Ut(m).call(this,d,t)),Q(et(i),"state",{scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1}),Q(et(i),"_deferredInvalidateColumnIndex",null),Q(et(i),"_deferredInvalidateRowIndex",null),Q(et(i),"_bottomLeftGridRef",function(p){i._bottomLeftGrid=p}),Q(et(i),"_bottomRightGridRef",function(p){i._bottomRightGrid=p}),Q(et(i),"_cellRendererBottomLeftGrid",function(p){var S=p.rowIndex,y=xn(p,["rowIndex"]),x=i.props,E=x.cellRenderer,O=x.fixedRowCount,P=x.rowCount;return S===P-O?Z.createElement("div",{key:y.key,style:Fe({},y.style,{height:Pa})}):E(Fe({},y,{parent:et(i),rowIndex:S+O}))}),Q(et(i),"_cellRendererBottomRightGrid",function(p){var S=p.columnIndex,y=p.rowIndex,x=xn(p,["columnIndex","rowIndex"]),E=i.props,O=E.cellRenderer,P=E.fixedColumnCount,A=E.fixedRowCount;return O(Fe({},x,{columnIndex:S+P,parent:et(i),rowIndex:y+A}))}),Q(et(i),"_cellRendererTopRightGrid",function(p){var S=p.columnIndex,y=xn(p,["columnIndex"]),x=i.props,E=x.cellRenderer,O=x.columnCount,P=x.fixedColumnCount;return S===O-P?Z.createElement("div",{key:y.key,style:Fe({},y.style,{width:Pa})}):E(Fe({},y,{columnIndex:S+P,parent:et(i)}))}),Q(et(i),"_columnWidthRightGrid",function(p){var S=p.index,y=i.props,x=y.columnCount,E=y.fixedColumnCount,O=y.columnWidth,P=i.state,A=P.scrollbarSize,B=P.showHorizontalScrollbar;return B&&S===x-E?A:typeof O=="function"?O({index:S+E}):O}),Q(et(i),"_onScroll",function(p){var S=p.scrollLeft,y=p.scrollTop;i.setState({scrollLeft:S,scrollTop:y});var x=i.props.onScroll;x&&x(p)}),Q(et(i),"_onScrollbarPresenceChange",function(p){var S=p.horizontal,y=p.size,x=p.vertical,E=i.state,O=E.showHorizontalScrollbar,P=E.showVerticalScrollbar;if(S!==O||x!==P){i.setState({scrollbarSize:y,showHorizontalScrollbar:S,showVerticalScrollbar:x});var A=i.props.onScrollbarPresenceChange;typeof A=="function"&&A({horizontal:S,size:y,vertical:x})}}),Q(et(i),"_onScrollLeft",function(p){var S=p.scrollLeft;i._onScroll({scrollLeft:S,scrollTop:i.state.scrollTop})}),Q(et(i),"_onScrollTop",function(p){var S=p.scrollTop;i._onScroll({scrollTop:S,scrollLeft:i.state.scrollLeft})}),Q(et(i),"_rowHeightBottomGrid",function(p){var S=p.index,y=i.props,x=y.fixedRowCount,E=y.rowCount,O=y.rowHeight,P=i.state,A=P.scrollbarSize,B=P.showVerticalScrollbar;return B&&S===E-x?A:typeof O=="function"?O({index:S+x}):O}),Q(et(i),"_topLeftGridRef",function(p){i._topLeftGrid=p}),Q(et(i),"_topRightGridRef",function(p){i._topRightGrid=p});var s=d.deferredMeasurementCache,l=d.fixedColumnCount,c=d.fixedRowCount;return i._maybeCalculateCachedStyles(!0),s&&(i._deferredMeasurementCacheBottomLeftGrid=c>0?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<i;c++)l+=s({index:c});this._leftGridWidth=l}else this._leftGridWidth=s*i;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(t){var i=t.width,s=this._getLeftGridWidth(t);return i-s}},{key:"_getTopGridHeight",value:function(t){var i=t.fixedRowCount,s=t.rowHeight;if(this._topGridHeight==null)if(typeof s=="function"){for(var l=0,c=0;c<i;c++)l+=s({index:c});this._topGridHeight=l}else this._topGridHeight=s*i;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"){var t=this._deferredInvalidateColumnIndex,i=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:i}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(t){var i=this.props,s=i.columnWidth,l=i.enableFixedColumnScroll,c=i.enableFixedRowScroll,p=i.height,S=i.fixedColumnCount,y=i.fixedRowCount,x=i.rowHeight,E=i.style,O=i.styleBottomLeftGrid,P=i.styleBottomRightGrid,A=i.styleTopLeftGrid,B=i.styleTopRightGrid,G=i.width,V=t||p!==this._lastRenderedHeight||G!==this._lastRenderedWidth,$=t||s!==this._lastRenderedColumnWidth||S!==this._lastRenderedFixedColumnCount,X=t||y!==this._lastRenderedFixedRowCount||x!==this._lastRenderedRowHeight;(t||V||E!==this._lastRenderedStyle)&&(this._containerOuterStyle=Fe({height:p,overflow:"visible",width:G},E)),(t||V||X)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:G},this._containerBottomStyle={height:p-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:G}),(t||O!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=Fe({left:0,overflowX:"hidden",overflowY:l?"auto":"hidden",position:"absolute"},O)),(t||$||P!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=Fe({left:this._getLeftGridWidth(this.props),position:"absolute"},P)),(t||A!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=Fe({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},A)),(t||$||B!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=Fe({left:this._getLeftGridWidth(this.props),overflowX:c?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},B)),this._lastRenderedColumnWidth=s,this._lastRenderedFixedColumnCount=S,this._lastRenderedFixedRowCount=y,this._lastRenderedHeight=p,this._lastRenderedRowHeight=x,this._lastRenderedStyle=E,this._lastRenderedStyleBottomLeftGrid=O,this._lastRenderedStyleBottomRightGrid=P,this._lastRenderedStyleTopLeftGrid=A,this._lastRenderedStyleTopRightGrid=B,this._lastRenderedWidth=G}},{key:"_prepareForRender",value:function(){(this._lastRenderedColumnWidth!==this.props.columnWidth||this._lastRenderedFixedColumnCount!==this.props.fixedColumnCount)&&(this._leftGridWidth=null),(this._lastRenderedFixedRowCount!==this.props.fixedRowCount||this._lastRenderedRowHeight!==this.props.rowHeight)&&(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(t){var i=t.enableFixedColumnScroll,s=t.fixedColumnCount,l=t.fixedRowCount,c=t.rowCount,p=t.hideBottomLeftGridScrollbar,S=this.state.showVerticalScrollbar;if(!s)return null;var y=S?1:0,x=this._getBottomGridHeight(t),E=this._getLeftGridWidth(t),O=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,P=p?E+O:E,A=Z.createElement(Xt,ge({},t,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:s,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:x,onScroll:i?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,c-l)+y,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:P}));return p?Z.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:Fe({},this._bottomLeftGridStyle,{height:x,width:E,overflowY:"hidden"})},A):A}},{key:"_renderBottomRightGrid",value:function(t){var i=t.columnCount,s=t.fixedColumnCount,l=t.fixedRowCount,c=t.rowCount,p=t.scrollToColumn,S=t.scrollToRow;return Z.createElement(Xt,ge({},t,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,i-s),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(t),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,c-l),rowHeight:this._rowHeightBottomGrid,scrollToColumn:p-s,scrollToRow:S-l,style:this._bottomRightGridStyle,width:this._getRightGridWidth(t)}))}},{key:"_renderTopLeftGrid",value:function(t){var i=t.fixedColumnCount,s=t.fixedRowCount;return!i||!s?null:Z.createElement(Xt,ge({},t,{className:this.props.classNameTopLeftGrid,columnCount:i,height:this._getTopGridHeight(t),ref:this._topLeftGridRef,rowCount:s,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(t)}))}},{key:"_renderTopRightGrid",value:function(t){var i=t.columnCount,s=t.enableFixedRowScroll,l=t.fixedColumnCount,c=t.fixedRowCount,p=t.scrollLeft,S=t.hideTopRightGridScrollbar,y=this.state,x=y.showHorizontalScrollbar,E=y.scrollbarSize;if(!c)return null;var O=x?1:0,P=this._getTopGridHeight(t),A=this._getRightGridWidth(t),B=x?E:0,G=P,V=this._topRightGridStyle;S&&(G=P+B,V=Fe({},this._topRightGridStyle,{left:0}));var $=Z.createElement(Xt,ge({},t,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,i-l)+O,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:G,onScroll:s?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:c,scrollLeft:p,style:V,tabIndex:null,width:A}));return S?Z.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:Fe({},this._topRightGridStyle,{height:P,width:A,overflowX:"hidden"})},$):$}}],[{key:"getDerivedStateFromProps",value:function(t,i){return t.scrollLeft!==i.scrollLeft||t.scrollTop!==i.scrollTop?{scrollLeft:t.scrollLeft!=null&&t.scrollLeft>=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;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?Ui(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):Ui(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var zn=function(g){Oe(m,g);function m(d){var t;return Kt(this,m),t=Wt(this,Ut(m).call(this,d)),t.state={scrollbarWidth:0},t._createColumn=t._createColumn.bind(et(t)),t._createRow=t._createRow.bind(et(t)),t._onScroll=t._onScroll.bind(et(t)),t._onSectionRendered=t._onSectionRendered.bind(et(t)),t._setRef=t._setRef.bind(et(t)),t}return jt(m,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(t){var i=t.alignment,s=t.index;if(this.Grid){var l=this.Grid.getOffsetForCell({alignment:i,rowIndex:s}),c=l.scrollTop;return c}return 0}},{key:"invalidateCellSizeAfterRender",value:function(t){var i=t.columnIndex,s=t.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:s,columnIndex:i})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.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;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;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?Si(d,!0).forEach(function(t){Q(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):Si(d).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}var _s=150,Jn=function(){return typeof window!="undefined"?window:void 0},Ba=(Qn=wo=function(g){Oe(m,g);function m(){var d,t;Kt(this,m);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t=Wt(this,(d=Ut(m)).call.apply(d,[this].concat(s))),Q(et(t),"_window",Jn()),Q(et(t),"_isMounted",!1),Q(et(t),"_positionFromTop",0),Q(et(t),"_positionFromLeft",0),Q(et(t),"_detectElementResize",void 0),Q(et(t),"_child",void 0),Q(et(t),"state",bs({},Yi(t.props.scrollElement,t.props),{isScrolling:!1,scrollLeft:0,scrollTop:0})),Q(et(t),"_registerChild",function(c){c&&!(c instanceof Element)&&console.warn("WindowScroller registerChild expects to be passed Element or null"),t._child=c,t.updatePosition()}),Q(et(t),"_onChildScroll",function(c){var p=c.scrollTop;if(t.state.scrollTop!==p){var S=t.props.scrollElement;S&&(typeof S.scrollTo=="function"?S.scrollTo(0,p+t._positionFromTop):S.scrollTop=p+t._positionFromTop)}}),Q(et(t),"_registerResizeListener",function(c){c===window?window.addEventListener("resize",t._onResize,!1):t._detectElementResize.addResizeListener(c,t._onResize)}),Q(et(t),"_unregisterResizeListener",function(c){c===window?window.removeEventListener("resize",t._onResize,!1):c&&t._detectElementResize.removeResizeListener(c,t._onResize)}),Q(et(t),"_onResize",function(){t.updatePosition()}),Q(et(t),"__handleWindowScrollEvent",function(){if(!!t._isMounted){var c=t.props.onScroll,p=t.props.scrollElement;if(p){var S=xo(p),y=Math.max(0,S.left-t._positionFromLeft),x=Math.max(0,S.top-t._positionFromTop);t.setState({isScrolling:!0,scrollLeft:y,scrollTop:x}),c({scrollLeft:y,scrollTop:x})}}}),Q(et(t),"__resetIsScrolling",function(){t.setState({isScrolling:!1})}),t}return jt(m,[{key:"updatePosition",value:function(){var t=arguments.length>0&&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;m<arguments.length;m++){var d=arguments[m]!=null?arguments[m]:{};m%2?ja(Object(d),!0).forEach(function(t){qi(g,t,d[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(d)):ja(Object(d)).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(d,t))})}return g}function Ar(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function Je(g,m){for(var d=0;d<m.length;d++){var t=m[d];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(g,t.key,t)}}function ti(g,m,d){return m&&Je(g.prototype,m),d&&Je(g,d),Object.defineProperty(g,"prototype",{writable:!1}),g}function qi(g,m,d){return m in g?Object.defineProperty(g,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):g[m]=d,g}function or(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&_i(g,m)}function bi(g){return bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},bi(g)}function _i(g,m){return _i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},_i(g,m)}function Na(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(g){return!1}}function qr(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function xi(g,m){if(m&&(typeof m=="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qr(g)}function ei(g){var m=Na();return function(){var t=bi(g),i;if(m){var s=bi(this).constructor;i=Reflect.construct(t,arguments,s)}else i=t.apply(this,arguments);return xi(this,i)}}function pn(g,m){return gn(g)||Va(g,m)||ea(g,m)||Rs()}function $r(g){return Cs(g)||Ro(g)||ea(g)||Kr()}function Cs(g){if(Array.isArray(g))return mn(g)}function gn(g){if(Array.isArray(g))return g}function Ro(g){if(typeof Symbol!="undefined"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function Va(g,m){var d=g==null?null:typeof Symbol!="undefined"&&g[Symbol.iterator]||g["@@iterator"];if(d!=null){var t=[],i=!0,s=!1,l,c;try{for(d=d.call(g);!(i=(l=d.next()).done)&&(t.push(l.value),!(m&&t.length===m));i=!0);}catch(p){s=!0,c=p}finally{try{!i&&d.return!=null&&d.return()}finally{if(s)throw c}}return t}}function ea(g,m){if(!!g){if(typeof g=="string")return mn(g,m);var d=Object.prototype.toString.call(g).slice(8,-1);if(d==="Object"&&g.constructor&&(d=g.constructor.name),d==="Map"||d==="Set")return Array.from(g);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return mn(g,m)}}function mn(g,m){(m==null||m>g.length)&&(m=g.length);for(var d=0,t=new Array(m);d<m;d++)t[d]=g[d];return t}function Kr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ua=function(){function g(m){Ar(this,g),this.events={},this.events=m.handlers}return ti(g,[{key:"on",value:function(d,t){var i=this,s=d instanceof Array?d:d.split(" ");return s.forEach(function(l){if(!i.events[l])throw new Error("The event ".concat(l," does not exist"));i.events[l].push(t)}),this}},{key:"trigger",value:function(d,t){if(!(d in this.events))throw new Error("The event ".concat(String(d)," cannot be triggered"));return this.events[d].reduce(function(i,s){return s(t)!==!1&&i},!0)}},{key:"bind",value:function(d){if(this.events[d])throw new Error("The event ".concat(d," is already bound"));this.events[d]=[]}},{key:"exist",value:function(d){return Array.isArray(this.events[d])}},{key:"off",value:function(d,t){if(this.events[d]){var i=this.events[d];if(!t)this.events[d]=[];else{var s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}},{key:"offAll",value:function(){this.events=Object.fromEntries(Object.keys(this.events).map(function(d){return[d,[]]}))}}]),g}(),Xa=ti(function g(){var m=arguments.length>0&&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._activeActionIds.length;s++){var l=this._activeActionIds[s],c=this._actionMap[l],p=this._effectMap[c==null?void 0:c.effectId];if(i==="start"){var S;(p==null||(S=p.source)===null||S===void 0?void 0:S.start)&&p.source.start({action:c,effect:p,engine:this,isPlaying:this.isPlaying,time:this.getTime()})}else if(i==="stop"){var y;(p==null||(y=p.source)===null||y===void 0?void 0:y.stop)&&p.source.stop({action:c,effect:p,engine:this,isPlaying:this.isPlaying,time:this.getTime()})}}}},{key:"_tick",value:function(i){var s=this;if(!this.isPaused){var l=i.now,c=i.autoEnd,p=i.to,S=this.getTime()+Math.min(1e3,l-this._prev)/1e3*this._playRate;if(this._prev=l,p&&p<=S&&(S=p),this.setTime(S,!0),this._tickAction(S),!p&&c&&this._next>=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;l<s;l++){var c,p=this._activeActionIds[l],S=this._actionMap[p],y=this._effectMap[S.effectId];y&&((c=y.source)===null||c===void 0?void 0:c.update)&&y.source.update({time:i,action:S,isPlaying:this.isPlaying,effect:y,engine:this})}}},{key:"_dealClear",value:function(){for(;this._activeActionIds.length;){var i,s=this._activeActionIds.shift(),l=this._actionMap[s],c=this._effectMap[l==null?void 0:l.effectId];(c==null||(i=c.source)===null||i===void 0?void 0:i.leave)&&c.source.leave({action:l,effect:c,engine:this,isPlaying:this.isPlaying,time:this.getTime()})}this._next=0}},{key:"_dealEnter",value:function(i){for(;this._actionSortIds[this._next];){var s=this._actionSortIds[this._next],l=this._actionMap[s];if(!l.disable){if(l.start>i)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.end<i){var p,S=this._effectMap[c.effectId];S&&((p=S.source)===null||p===void 0?void 0:p.leave)&&S.source.leave({action:c,effect:S,isPlaying:this.isPlaying,time:i,engine:this}),this._activeActionIds.splice(s,1);continue}s++}}},{key:"_dealData",value:function(i){var s=[];i.map(function(S){s.push.apply(s,$r(S.actions))});var l=s.sort(function(S,y){return S.start-y.start}),c={},p=[];l.forEach(function(S){p.push(S.id),c[S.id]=qt({},S)}),this._actionMap=c,this._actionSortIds=p}}]),d}(Ua),ri="timeline-editor",yn=0,ia=1,$i=10,Ki=160,Sn=20,wi=1,Gn=8,Zi=32,Wn=20,Zr=5,qe;(function(g){g[g.VERBOSE=0]="VERBOSE",g[g.LOG=1]="LOG",g[g.INFO=2]="INFO",g[g.WARN=3]="WARN",g[g.ERROR=4]="ERROR",g[g.FATAL=5]="FATAL",g[g.SILENT=Infinity]="SILENT"})(qe||(qe={}));var Fn={VERBOSE:qe.VERBOSE,LOG:qe.LOG,INFO:qe.INFO,WARN:qe.WARN,ERROR:qe.ERROR,SILENT:qe.SILENT};function ni(g,m){return"color:".concat(g,";font-size:").concat(m,"px;")}var Qi=function(){function g(m){Ar(this,g),this.Levels=Fn,this.level=qe.LOG,this.prefix="",this.enabled=!0,this.debugColor=ni("#cccccc",12),this.logColor=ni("#bbbbbb",12),this.infoColor=ni("#2196f3",12),this.warnColor=ni("#ff00ff",12),this.errorColor=ni("#e91e63",12),this.fatalColor=ni("#9a0101",13),this.setPrefix(m),this.level=g.level,g.instances.push(this)}return ti(g,[{key:"setPrefix",value:function(d){this.prefix=d}},{key:"enable",value:function(){var d=arguments.length>0&&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;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).trace.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).trace.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.debugColor].concat(i))}}}},{key:"debug",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;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).debug.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).debug.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.debugColor].concat(i))}}}},{key:"log",value:function(d){if(!(!this.enabled||this.level>qe.LOG)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).log.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).log.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.logColor].concat(i))}}}},{key:"info",value:function(d){if(!(!this.enabled||this.level>qe.INFO)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).info.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).info.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.infoColor].concat(i))}}}},{key:"warn",value:function(d){if(!(!this.enabled||this.level>qe.WARN)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).warn.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).warn.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.warnColor].concat(i))}}}},{key:"error",value:function(d){if(!(!this.enabled||this.level>qe.ERROR)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).error.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).error.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.errorColor].concat(i))}}}},{key:"fatal",value:function(d){if(!(!this.enabled||this.level>qe.FATAL)){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(g.noColor){var l;(l=console).error.apply(l,["[".concat(this.prefix,"] ").concat(d)].concat(i))}else{var c;(c=console).error.apply(c,["%c[".concat(this.prefix,"] ").concat(d),this.fatalColor].concat(i))}}}},{key:"group",value:function(){if(console.group){var d;(d=console).group.apply(d,arguments)}}},{key:"groupEnd",value:function(){console.groupEnd&&console.groupEnd()}},{key:"groupCollapsed",value:function(){if(console.groupCollapsed){var d;(d=console).groupCollapsed.apply(d,arguments)}}}],[{key:"setLevel",value:function(d){this.level=d,this.instances.forEach(function(t){return t.setLevel(d)})}},{key:"enable",value:function(d){d&&(this.level=d),this.instances.forEach(function(t){return t.enable()})}},{key:"disable",value:function(){this.instances.forEach(function(d){return d.disable()})}}]),g}();Qi.instances=[],Qi.level=qe.LOG,Qi.Levels=Fn,Qi.noColor=!1;var br=new Qi("timeline");function oa(g){var m=g.editorData,d=m===void 0?[]:m,t=g.effects,i=t===void 0?{}:t,s=g.scrollTop,l=s===void 0?0:s,c=g.scale,p=c===void 0?ia:c,S=g.scaleSplitCount,y=S===void 0?$i:S,x=g.scaleWidth,E=x===void 0?Ki:x,O=g.startLeft,P=O===void 0?Sn:O,A=g.minScaleCount,B=A===void 0?Wn:A,G=g.maxScaleCount,V=G===void 0?Infinity:G,$=g.rowHeight,X=$===void 0?Zi:$;p<=0&&(br.error("Error: scale must be greater than 0!"),p=ia),l<0&&(br.warn("Warning: scrollTop cannot be less than 0!"),l=0),y<=0&&(br.warn("Warning: scaleSplitCount cannot be less than 1!"),y=1),E<=0&&(br.warn("Warning: scaleWidth must be greater than 0!"),E=Ki),P<0&&(br.warn("Warning: startLeft cannot be less than 0!"),P=0),B<1&&(br.warn("Warning: minScaleCount must be greater than 1!"),B=Wn),B=parseInt(B+""),V<B&&(br.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),V=B),V=V===Infinity?Infinity:parseInt(V+""),X<=0&&(br.warn("Warning: rowHeight must be greater than 0!"),X=Zi);var rt=qt({},g);return delete rt.style,qt(qt({},rt),{},{editorData:d,effects:i,scrollTop:l,scale:p,scaleSplitCount:y,scaleWidth:E,startLeft:P,minScaleCount:B,maxScaleCount:V,rowHeight:X})}function Qr(g,m){var d=m.startLeft,t=m.scale,i=m.scaleWidth;return d+g/t*i}function bn(g,m){var d=m.startLeft,t=m.scale,i=m.scaleWidth;return(g-d)/i*t}function Ji(g,m){var d=g.left,t=g.width,i=bn(d,m),s=bn(d+t,m);return{start:i,end:s}}function to(g,m){var d=g.start,t=g.end,i=Qr(d,m),s=Qr(t,m)-i;return{left:i,width:s}}function To(g,m){var d=0;g.forEach(function(i){i.actions.forEach(function(s){d=Math.max(d,s.end)})});var t=Math.ceil(d/m.scale);return t+Zr}function Ya(g,m){var d=m.startLeft,t=m.scaleWidth,i=Math.ceil((g-d)/t);return Math.max(i+Zr,m.scaleCount)}function Fr(g,m){var d=[];return g.forEach(function(t){d.push(Qr(t.start,m)),d.push(Qr(t.end,m))}),d}function be(){for(var g=arguments.length,m=new Array(g),d=0;d<g;d++)m[d]=arguments[d];return xs.tI.apply(void 0,["".concat(ri,"-")].concat(m))}var ar=1,Bn=3,Eo=10;function Ts(g){var m=(0,Z.useRef)(Number.MIN_SAFE_INTEGER),d=(0,Z.useRef)(Number.MAX_SAFE_INTEGER),t=(0,Z.useRef)(ar),i=(0,Z.useRef)(),s=function(){if(g==null?void 0:g.current){var y=g.current.getBoundingClientRect(),x=y.left,E=y.width;m.current=x,d.current=x+E}},l=function(y,x){if(y.clientX>=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<m.current){cancelAnimationFrame(i.current);var O=Math.abs(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);nn<G&&nn<rn&&(xr=Er);var Ye=Math.abs(Er-(Qt+Ht));Ye<G&&Ye<rn&&(xr=Er-Ht)}),xr!==Qt?(Gt.current=!0,Qt=xr):((Qt-c)%S!=0&&(Qt=c+S*Math.round((Qt-c)/S)),Gt.current=!1),mt.current=mt.current%ie,Qt<x.left?Qt=x.left:Qt+Ht>x.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<G&&He<rn&&(xr=ke)}),xr!==Qt?(Gt.current=!0,Qt=xr):((Qt-c)%S!=0&&(Qt=c+S*Math.round((Qt-c)/S)),Gt.current=!1),mt.current=mt.current%ie;var _n=Vt+Ht;Qt<x.left&&(Qt=x.left);var Er=_n-Qt;if(rt){var nn=rt("left",{lastLeft:Vt,lastWidth:Ht,left:Qt,width:Er});if(nn===!1)return}Xe(Qt,!1),tr(Er,!1)}}else if(Pt==="right"&&Math.abs(mt.current)>=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));He<G&&He<ve&&($t=ke)}),$t!==Vt+we)Gt.current=!0,we=$t-Vt;else{var rr=Vt+we;(rr-c)%S!=0&&(rr=c+S*Math.round((rr-c)/S),we=rr-Vt),Gt.current=!1}if(mt.current=mt.current%ie,Vt+we>x.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<s-it?V.current=s-it:V.current=rt:V.current<s-it-st&&(V.current=s-it-st),G.current.updateLeft(V.current);var tt=bn(V.current+it,{startLeft:s,scale:p,scaleWidth:c});return i({time:tt}),A&&A(tt),!1}},Z.createElement("div",{className:be("cursor")},Z.createElement("svg",{className:be("cursor-top"),width:"8",height:"12",viewBox:"0 0 8 12",fill:"none"},Z.createElement("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"#5297FF"})),Z.createElement("div",{className:be("cursor-area")})))},eo=`.timeline-editor-drag-line-container {
position: absolute;
height: 100%;
top: 0;
left: 0;
}
.timeline-editor-drag-line {
width: 0;
position: absolute;
top: 0;
height: 99%;
border-left: 1px dashed rgba(82, 151, 255, 0.6);
}
`;Ct(eo);var Es=function(m){var d=m.isMoving,t=m.movePositions,i=t===void 0?[]:t,s=m.assistPositions,l=s===void 0?[]:s,c=m.scrollLeft;return Z.createElement("div",{className:be("drag-line-container")},d&&i.filter(function(p){return l.includes(p)}).map(function(p,S){return Z.createElement("div",{key:S,className:be("drag-line"),style:{left:p-c}})}))},Ms=`.timeline-editor:hover .timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar {
height: 4px;
}
.timeline-editor-edit-area {
flex: 1 1 auto;
margin-top: 10px;
overflow: hidden;
position: relative;
}
.timeline-editor-edit-area .ReactVirtualized__Grid {
outline: none !important;
overflow: overlay !important;
}
.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar {
width: 0;
height: 0;
}
.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar-track {
background-color: transparent !important;
}
.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar-thumb {
background: #313132;
border-radius: 16px;
}
`;Ct(Ms);var Hn=`.timeline-editor-action {
position: absolute;
left: 0;
top: 0;
background-color: #2f3134;
}
.timeline-editor-action .timeline-editor-action-left-stretch,
.timeline-editor-action .timeline-editor-action-right-stretch {
position: absolute;
top: 0;
width: 10px;
border-radius: 4px;
height: 100%;
overflow: hidden;
}
.timeline-editor-action .timeline-editor-action-left-stretch::after,
.timeline-editor-action .timeline-editor-action-right-stretch::after {
position: absolute;
top: 0;
bottom: 0;
margin: auto;
border-radius: 4px;
border-top: 28px solid transparent;
border-bottom: 28px solid transparent;
}
.timeline-editor-action .timeline-editor-action-left-stretch {
left: 0;
}
.timeline-editor-action .timeline-editor-action-left-stretch::after {
left: 0;
content: "";
border-left: 7px solid rgba(255, 255, 255, 0.1);
border-right: 7px solid transparent;
}
.timeline-editor-action .timeline-editor-action-right-stretch {
right: 0;
}
.timeline-editor-action .timeline-editor-action-right-stretch::after {
right: 0;
content: "";
border-right: 7px solid rgba(255, 255, 255, 0.1);
border-left: 7px solid transparent;
}
`;Ct(Hn);var Os=function(m){var d=m.editorData,t=m.row,i=m.action,s=m.effects,l=m.rowHeight,c=m.scale,p=m.scaleWidth,S=m.scaleSplitCount,y=m.startLeft,x=m.gridSnap,E=m.disableDrag,O=m.scaleCount,P=m.maxScaleCount,A=m.setScaleCount,B=m.onActionMoveStart,G=m.onActionMoving,V=m.onActionMoveEnd,$=m.onActionResizeStart,X=m.onActionResizeEnd,rt=m.onActionResizing,st=m.dragLineData,it=m.setEditorData,tt=m.onClickAction,ht=m.onClickActionOnly,lt=m.onDoubleClickAction,gt=m.onContextMenuAction,ct=m.getActionRender,mt=m.handleTime,Gt=m.areaRef,pt=m.deltaScrollLeft,$e=(0,Z.useRef)(),_e=(0,Z.useRef)(!1),Be=i.id,xe=i.maxEnd,Xe=i.minStart,tr=i.end,er=i.start,De=i.selected,ze=i.flexible,fe=ze===void 0?!0:ze,tn=i.movable,_r=tn===void 0?!0:tn,en=i.effectId,Ri=Qr(Xe||0,{startLeft:y,scale:c,scaleWidth:p}),jn=Math.min(P*p+y,Qr(xe||Number.MAX_VALUE,{startLeft:y,scale:c,scaleWidth:p})),Oo=(0,Z.useState)(function(){return to({start:er,end:tr},{startLeft:y,scale:c,scaleWidth:p})}),Zt=pn(Oo,2),yt=Zt[0],Pt=Zt[1];(0,Z.useLayoutEffect)(function(){Pt(to({start:er,end:tr},{startLeft:y,scale:c,scaleWidth:p}))},[tr,er,y,p,c]);var Ht=p/S,Vt=["action"];_r&&Vt.push("action-movable"),De&&Vt.push("action-selected"),fe&&Vt.push("action-flexible"),s[en]&&Vt.push("action-effect-".concat(en));var ie=function($t,ve){var rr=Ya($t+ve,{startLeft:y,scaleCount:O,scaleWidth:p});rr!==O&&A(rr)},dr=function(){B&&B({action:i,row:t})},Qt=function($t){var ve=$t.left,rr=$t.width;if(_e.current=!0,G){var Br=Ji({left:ve,width:rr},{scaleWidth:p,scale:c,startLeft:y}),ke=Br.start,He=Br.end,Hr=G({action:i,row:t,start:ke,end:He});if(Hr===!1)return!1}Pt({left:ve,width:rr}),ie(ve,rr)},xr=function($t){var ve=$t.left,rr=$t.width,Br=Ji({left:ve,width:rr},{scaleWidth:p,scale:c,startLeft:y}),ke=Br.start,He=Br.end,Hr=d.find(function(ro){return ro.id===t.id}),ii=Hr.actions.find(function(ro){return ro.id===Be});ii.start=ke,ii.end=He,it(d),V&&V({action:ii,row:t,start:ke,end:He})},rn=function($t){$&&$({action:i,row:t,dir:$t})},_n=function($t,ve){var rr=ve.left,Br=ve.width;if(_e.current=!0,rt){var ke=Ji({left:rr,width:Br},{scaleWidth:p,scale:c,startLeft:y}),He=ke.start,Hr=ke.end,ii=rt({action:i,row:t,start:He,end:Hr,dir:$t});if(ii===!1)return!1}Pt({left:rr,width:Br}),ie(rr,Br)},Er=function($t,ve){var rr=ve.left,Br=ve.width,ke=Ji({left:rr,width:Br},{scaleWidth:p,scale:c,startLeft:y}),He=ke.start,Hr=ke.end,ii=d.find(function(la){return la.id===t.id}),ro=ii.actions.find(function(la){return la.id===Be});ro.start=He,ro.end=Hr,it(d),X&&X({action:ro,row:t,start:He,end:Hr,dir:$t})},nn=qt(qt({},i),Ji({left:yt.left,width:yt.width},{startLeft:y,scaleWidth:p,scale:c})),Ye=qt(qt({},t),{},{actions:$r(t.actions)});return t.actions.includes(i)&&(Ye.actions[t.actions.indexOf(i)]=nn),Z.createElement(qa,{ref:$e,parentRef:Gt,start:y,left:yt.left,width:yt.width,grid:x&&Ht||wi,adsorptionDistance:x?Math.max((Ht||wi)/2,Gn):Gn,adsorptionPositions:st.assistPositions,bounds:{left:Ri,right:jn},edges:{left:!E&&fe&&".".concat(be("action-left-stretch")),right:!E&&fe&&".".concat(be("action-right-stretch"))},enableDragging:!E&&_r,enableResizing:!E&&fe,onDragStart:dr,onDrag:Qt,onDragEnd:xr,onResizeStart:rn,onResize:_n,onResizeEnd:Er,deltaScrollLeft:pt},Z.createElement("div",{onMouseDown:function(){_e.current=!1},onClick:function($t){var ve;tt&&(ve=mt($t),tt($t,{row:t,action:i,time:ve})),!_e.current&&ht&&(ve||(ve=mt($t)),ht($t,{row:t,action:i,time:ve}))},onDoubleClick:function($t){if(lt){var ve=mt($t);lt($t,{row:t,action:i,time:ve})}},onContextMenu:function($t){if(gt){var ve=mt($t);gt($t,{row:t,action:i,time:ve})}},className:be((Vt||[]).join(" ")),style:{height:l}},ct&&ct(nn,Ye),fe&&Z.createElement("div",{className:be("action-left-stretch")}),fe&&Z.createElement("div",{className:be("action-right-stretch")})))},Ka=`.timeline-editor-edit-row {
background-repeat: no-repeat, repeat;
background-image: linear-gradient(#191b1d, #191b1d), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 0);
display: flex;
flex-direction: row;
box-sizing: border-box;
}
`;Ct(Ka);var Jr=function(m){var d=m.rowData,t=m.style,i=t===void 0?{}:t,s=m.onClickRow,l=m.onDoubleClickRow,c=m.onContextMenuRow,p=m.areaRef,S=m.scrollLeft,y=m.startLeft,x=m.scale,E=m.scaleWidth,O=["edit-row"];(d==null?void 0:d.selected)&&O.push("edit-row-selected");var P=function(B){if(!!p.current){var G=p.current.getBoundingClientRect(),V=B.clientX-G.x,$=V+S,X=bn($,{startLeft:y,scale:x,scaleWidth:E});return X}};return Z.createElement("div",{className:"".concat(be.apply(void 0,O)," ").concat(((d==null?void 0:d.classNames)||[]).join(" ")),style:i,onClick:function(B){if(d&&s){var G=P(B);s(B,{row:d,time:G})}},onDoubleClick:function(B){if(d&&l){var G=P(B);l(B,{row:d,time:G})}},onContextMenu:function(B){if(d&&c){var G=P(B);c(B,{row:d,time:G})}}},((d==null?void 0:d.actions)||[]).map(function(A){return Z.createElement(Os,qt(qt({key:A.id},m),{},{handleTime:P,row:d,action:A}))}))};function Za(){var g=(0,Z.useState)({isMoving:!1,movePositions:[],assistPositions:[]}),m=pn(g,2),d=m[0],t=m[1],i=function(y){var x=y.editorData,E=y.assistActionIds,O=y.action,P=y.row,A=y.scale,B=y.scaleWidth,G=y.startLeft,V=y.cursorLeft,$=y.hideCursor,X=[];E?x.forEach(function(st){st.actions.forEach(function(it){E.includes(it.id)&&X.push(it)})}):x.forEach(function(st){st.id!==P.id?X.push.apply(X,$r(st.actions)):st.actions.forEach(function(it){it.id!==O.id&&X.push(it)})});var rt=Fr(X,{startLeft:G,scale:A,scaleWidth:B});return $||rt.push(V),rt},s=function(y){var x=y.start,E=y.end,O=y.dir,P=y.scale,A=y.scaleWidth,B=y.startLeft,G=to({start:x,end:E},{startLeft:B,scaleWidth:A,scale:P}),V=G.left,$=G.width;return O?O==="right"?[V+$]:[V]:[V,V+$]},l=function(y){var x=y.movePositions,E=y.assistPositions;t({isMoving:!0,movePositions:x||[],assistPositions:E||[]})},c=function(y){var x=y.movePositions,E=y.assistPositions;t(function(O){return qt(qt({},O),{},{movePositions:x||O.movePositions,assistPositions:E||O.assistPositions})})},p=function(){t({isMoving:!1,movePositions:[],assistPositions:[]})};return{initDragLine:l,updateDragLine:c,disposeDragLine:p,dragLineData:d,defaultGetAssistPosition:i,defaultGetMovePosition:s}}var Qa=Z.forwardRef(function(g,m){var d=g.editorData,t=g.rowHeight,i=g.scaleWidth,s=g.scaleCount,l=g.startLeft,c=g.scrollLeft,p=g.scrollTop,S=g.scale,y=g.hideCursor,x=g.cursorTime,E=g.onScroll,O=g.dragLine,P=g.getAssistDragLineActionIds,A=g.onActionMoveEnd,B=g.onActionMoveStart,G=g.onActionMoving,V=g.onActionResizeEnd,$=g.onActionResizeStart,X=g.onActionResizing,rt=Za(),st=rt.dragLineData,it=rt.initDragLine,tt=rt.updateDragLine,ht=rt.disposeDragLine,lt=rt.defaultGetAssistPosition,gt=rt.defaultGetMovePosition,ct=(0,Z.useRef)(),mt=(0,Z.useRef)(),Gt=(0,Z.useRef)(-1);(0,Z.useImperativeHandle)(m,function(){return{get domRef(){return ct}}});var pt=function(xe){if(O){var Xe=P&&P({action:xe.action,row:xe.row,editorData:d}),tr=Qr(x,{scaleWidth:i,scale:S,startLeft:l}),er=lt({editorData:d,assistActionIds:Xe,action:xe.action,row:xe.row,scale:S,scaleWidth:i,startLeft:l,hideCursor:y,cursorLeft:tr});it({assistPositions:er})}},$e=function(xe){if(O){var Xe=gt(qt(qt({},xe),{},{startLeft:l,scaleWidth:i,scale:S}));tt({movePositions:Xe})}},_e=function(xe){var Xe=xe.rowIndex,tr=xe.key,er=xe.style,De=d[Xe];return Z.createElement(Jr,qt(qt({},g),{},{style:qt(qt({},er),{},{backgroundPositionX:"0, ".concat(l,"px"),backgroundSize:"".concat(l,"px, ").concat(i,"px")}),areaRef:ct,key:tr,rowHeight:(De==null?void 0:De.rowHeight)||t,rowData:De,dragLineData:st,onActionMoveStart:function(fe){return pt(fe),B&&B(fe)},onActionResizeStart:function(fe){return pt(fe),$&&$(fe)},onActionMoving:function(fe){return $e(fe),G&&G(fe)},onActionResizing:function(fe){return $e(fe),X&&X(fe)},onActionResizeEnd:function(fe){return ht(),V&&V(fe)},onActionMoveEnd:function(fe){return ht(),A&&A(fe)}}))};return(0,Z.useLayoutEffect)(function(){var Be;(Be=mt.current)===null||Be===void 0||Be.scrollToPosition({scrollTop:p,scrollLeft:c})},[p,c]),(0,Z.useEffect)(function(){mt.current.recomputeGridSize()},[d]),Z.createElement("div",{ref:ct,className:be("edit-area")},Z.createElement(sn,null,function(Be){var xe=Be.width,Xe=Be.height,tr=0,er=d.map(function(De){var ze=De.rowHeight||t;return tr+=ze,ze});return tr<Xe&&(er.push(Xe-tr),Gt.current!==Xe&&Gt.current>=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<arguments.length;Wt++)et[Wt-1]=arguments[Wt];return et.map(function(Ut){return Ut.split(" ").map(function(ur){return ur?""+jt+ur:""}).join(" ")}).join(" ")}function Kt(jt,et){return et.replace(/([^}{]*){/gm,function(Wt,Ut){return Ut.replace(/\.([^{,\s\d.]+)/g,"."+jt+"$1")+"{"})}function nr(jt,et){return function(Wt){Wt&&(jt[et]=Wt)}}function nt(jt,et,Wt){return function(Ut){Ut&&(jt[et][Wt]=Ut)}}function hr(jt,et){return function(Wt){var Ut=Wt.prototype;jt.forEach(function(ur){et(Ut,ur)})}}function ir(jt,et){return et===void 0&&(et={}),function(Wt,Ut){jt.forEach(function(ur){var Oe=et[ur]||ur;Oe in Wt||(Wt[Oe]=function(){for(var Q,Ce=[],je=0;je<arguments.length;je++)Ce[je]=arguments[je];var Lr=(Q=this[Ut])[ur].apply(Q,Ce);return Lr===this[Ut]?this:Lr})})}}},68496:function(Ao){(function(lr){Ao.exports=lr()})(function(){var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.default=void 0,lr.default=function(t){return!(!t||!t.Window)&&t instanceof t.Window};var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.getWindow=function(t){return(0,lr.default)(t)?t:(t.ownerDocument||t).defaultView||Kt.window},At.init=nr,At.window=At.realWindow=void 0;var Z=void 0;At.realWindow=Z;var Kt=void 0;function nr(t){At.realWindow=Z=t;var i=t.document.createTextNode("");i.ownerDocument!==t.document&&typeof t.wrap=="function"&&t.wrap(i)===i&&(t=t.wrap(t)),At.window=Kt=t}At.window=Kt,typeof window!="undefined"&&window&&nr(window);var nt={};function hr(t){return hr=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},hr(t)}Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var ir=function(t){return!!t&&hr(t)==="object"},jt=function(t){return typeof t=="function"},et={window:function(t){return t===At.window||(0,lr.default)(t)},docFrag:function(t){return ir(t)&&t.nodeType===11},object:ir,func:jt,number:function(t){return typeof t=="number"},bool:function(t){return typeof t=="boolean"},string:function(t){return typeof t=="string"},element:function(t){if(!t||hr(t)!=="object")return!1;var i=At.getWindow(t)||At.window;return/object|function/.test(typeof Element=="undefined"?"undefined":hr(Element))?t instanceof Element||t instanceof i.Element:t.nodeType===1&&typeof t.nodeName=="string"},plainObject:function(t){return ir(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString())},array:function(t){return ir(t)&&t.length!==void 0&&jt(t.splice)}};nt.default=et;var Wt={};function Ut(t){var i=t.interaction;if(i.prepared.name==="drag"){var s=i.prepared.axis;s==="x"?(i.coords.cur.page.y=i.coords.start.page.y,i.coords.cur.client.y=i.coords.start.client.y,i.coords.velocity.client.y=0,i.coords.velocity.page.y=0):s==="y"&&(i.coords.cur.page.x=i.coords.start.page.x,i.coords.cur.client.x=i.coords.start.client.x,i.coords.velocity.client.x=0,i.coords.velocity.page.x=0)}}function ur(t){var i=t.iEvent,s=t.interaction;if(s.prepared.name==="drag"){var l=s.prepared.axis;if(l==="x"||l==="y"){var c=l==="x"?"y":"x";i.page[c]=s.coords.start.page[c],i.client[c]=s.coords.start.client[c],i.delta[c]=0}}}Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=void 0;var Oe={id:"actions/drag",install:function(t){var i=t.actions,s=t.Interactable,l=t.defaults;s.prototype.draggable=Oe.draggable,i.map.drag=Oe,i.methodDict.drag="draggable",l.actions.drag=Oe.defaults},listeners:{"interactions:before-action-move":Ut,"interactions:action-resume":Ut,"interactions:action-move":ur,"auto-start:check":function(t){var i=t.interaction,s=t.interactable,l=t.buttons,c=s.options.drag;if(c&&c.enabled&&(!i.pointerIsDown||!/mouse|pointer/.test(i.pointerType)||(l&s.options.drag.mouseButtons)!=0))return t.action={name:"drag",axis:c.lockAxis==="start"?c.startAxis:c.lockAxis},!1}},draggable:function(t){return nt.default.object(t)?(this.options.drag.enabled=t.enabled!==!1,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):nt.default.bool(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:Ut,move:ur,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"}},Q=Oe;Wt.default=Q;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var je={init:function(t){var i=t;je.document=i.document,je.DocumentFragment=i.DocumentFragment||Lr,je.SVGElement=i.SVGElement||Lr,je.SVGSVGElement=i.SVGSVGElement||Lr,je.SVGElementInstance=i.SVGElementInstance||Lr,je.Element=i.Element||Lr,je.HTMLElement=i.HTMLElement||je.Element,je.Event=i.Event,je.Touch=i.Touch||Lr,je.PointerEvent=i.PointerEvent||i.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function Lr(){}var Ti=je;Ce.default=Ti;var ge={};Object.defineProperty(ge,"__esModule",{value:!0}),ge.default=void 0;var Or={init:function(t){var i=Ce.default.Element,s=t.navigator||{};Or.supportsTouch="ontouchstart"in t||nt.default.func(t.DocumentTouch)&&Ce.default.document instanceof t.DocumentTouch,Or.supportsPointerEvent=s.pointerEnabled!==!1&&!!Ce.default.PointerEvent,Or.isIOS=/iP(hone|od|ad)/.test(s.platform),Or.isIOS7=/iP(hone|od|ad)/.test(s.platform)&&/OS 7[^\d]/.test(s.appVersion),Or.isIe9=/MSIE 9/.test(s.userAgent),Or.isOperaMobile=s.appName==="Opera"&&Or.supportsTouch&&/Presto/.test(s.userAgent),Or.prefixedMatchesSelector="matches"in i.prototype?"matches":"webkitMatchesSelector"in i.prototype?"webkitMatchesSelector":"mozMatchesSelector"in i.prototype?"mozMatchesSelector":"oMatchesSelector"in i.prototype?"oMatchesSelector":"msMatchesSelector",Or.pEventTypes=Or.supportsPointerEvent?Ce.default.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Or.wheelEvent=Ce.default.document&&"onmousewheel"in Ce.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},ko=Or;ge.default=ko;var Tt={};function Ze(t){var i=t.parentNode;if(nt.default.docFrag(i)){for(;(i=i.host)&&nt.default.docFrag(i););return i}return i}function Ei(t,i){return At.window!==At.realWindow&&(i=i.replace(/\/deep\//g," ")),t[ge.default.prefixedMatchesSelector](i)}Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.closest=function(t,i){for(;nt.default.element(t);){if(Ei(t,i))return t;t=Ze(t)}return null},Tt.getActualElement=function(t){return t.correspondingUseElement||t},Tt.getElementClientRect=zs,Tt.getElementRect=function(t){var i=zs(t);if(!ge.default.isIOS7&&i){var s=da(At.getWindow(t));i.left+=s.x,i.right+=s.x,i.top+=s.y,i.bottom+=s.y}return i},Tt.getPath=function(t){for(var i=[];t;)i.push(t),t=Ze(t);return i},Tt.getScrollXY=da,Tt.indexOfDeepestElement=function(t){for(var i,s=[],l=0;l<t.length;l++){var c=t[l],p=t[i];if(c&&l!==i)if(p){var S=xn(c),y=xn(p);if(S!==c.ownerDocument)if(y!==c.ownerDocument)if(S!==y){s=s.length?s:fa(p);var x=void 0;if(p instanceof Ce.default.HTMLElement&&c instanceof Ce.default.SVGElement&&!(c instanceof Ce.default.SVGSVGElement)){if(c===y)continue;x=c.ownerSVGElement}else x=c;for(var E=fa(x,p.ownerDocument),O=0;E[O]&&E[O]===s[O];)O++;var P=[E[O-1],E[O],s[O]];if(P[0])for(var A=P[0].lastChild;A;){if(A===P[1]){i=l,s=E;break}if(A===P[2])break;A=A.previousSibling}}else B=c,G=p,(parseInt(At.getWindow(B).getComputedStyle(B).zIndex,10)||0)>=(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);s<i;s++)l[s]=t[s];return l}function ns(t,i,s){return t==="parent"?(0,Tt.parentNode)(s):t==="self"?i.getRect(s):(0,Tt.closest)(s,t)}Object.defineProperty(Te,"__esModule",{value:!0}),Te.addEdges=function(t,i,s){t.left&&(i.left+=s.x),t.right&&(i.right+=s.x),t.top&&(i.top+=s.y),t.bottom&&(i.bottom+=s.y),i.width=i.right-i.left,i.height=i.bottom-i.top},Te.getStringOptionResult=ns,Te.rectToXY=function(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}},Te.resolveRectLike=function(t,i,s,l){var c,p=t;return nt.default.string(p)?p=ns(p,i,s):nt.default.func(p)&&(p=p.apply(void 0,function(S){if(Array.isArray(S))return rs(S)}(c=l)||function(S){if(typeof Symbol!="undefined"&&S[Symbol.iterator]!=null||S["@@iterator"]!=null)return Array.from(S)}(c)||function(S,y){if(S){if(typeof S=="string")return rs(S,y);var x=Object.prototype.toString.call(S).slice(8,-1);return x==="Object"&&S.constructor&&(x=S.constructor.name),x==="Map"||x==="Set"?Array.from(S):x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x)?rs(S,y):void 0}}(c)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),nt.default.element(p)&&(p=(0,Tt.getElementRect)(p)),p},Te.tlbrToXywh=function(t){return!t||"x"in t&&"y"in t||((t=(0,It.default)({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t},Te.xywhToTlbr=function(t){return!t||"left"in t&&"top"in t||((t=(0,It.default)({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t};var oi={};Object.defineProperty(oi,"__esModule",{value:!0}),oi.default=function(t,i,s){var l=t.options[s],c=l&&l.origin||t.options.origin,p=(0,Te.resolveRectLike)(c,t,i,[t&&i]);return(0,Te.rectToXY)(p)||{x:0,y:0}};var Mi={};function Oi(t){return t.trim().split(/ +/)}Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.default=function t(i,s,l){if(l=l||{},nt.default.string(i)&&i.search(" ")!==-1&&(i=Oi(i)),nt.default.array(i))return i.reduce(function(x,E){return(0,It.default)(x,t(E,s,l))},l);if(nt.default.object(i)&&(s=i,i=""),nt.default.func(s))l[i]=l[i]||[],l[i].push(s);else if(nt.default.array(s))for(var c=0;c<s.length;c++){var p;p=s[c],t(i,p,l)}else if(nt.default.object(s))for(var S in s){var y=Oi(S).map(function(x){return"".concat(i).concat(x)});t(y,s[S],l)}return l};var wn={};Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=void 0,wn.default=function(t,i){return Math.sqrt(t*t+i*i)};var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.default=function(t,i){t.__set||(t.__set={});var s=function(c){typeof t[c]!="function"&&c!=="__set"&&Object.defineProperty(t,c,{get:function(){return c in t.__set?t.__set[c]:t.__set[c]=i[c]},set:function(p){t.__set[c]=p},configurable:!0})};for(var l in i)s(l);return t};var Rt={};function is(t){return t instanceof Ce.default.Event||t instanceof Ce.default.Touch}function Lo(t,i,s){return t=t||"page",(s=s||{}).x=i[t+"X"],s.y=i[t+"Y"],s}function As(t,i){return i=i||{x:0,y:0},ge.default.isOperaMobile&&is(t)?(Lo("screen",t,i),i.x+=window.scrollX,i.y+=window.scrollY):Lo("page",t,i),i}function ks(t,i){return i=i||{},ge.default.isOperaMobile&&is(t)?Lo("screen",t,i):Lo("client",t,i),i}function va(t){var i=[];return nt.default.array(t)?(i[0]=t[0],i[1]=t[1]):t.type==="touchend"?t.touches.length===1?(i[0]=t.touches[0],i[1]=t.changedTouches[0]):t.touches.length===0&&(i[0]=t.changedTouches[0],i[1]=t.changedTouches[1]):(i[0]=t.touches[0],i[1]=t.touches[1]),i}function ha(t){for(var i={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},s=0;s<t.length;s++){var l=t[s];for(var c in i)i[c]+=l[c]}for(var p in i)i[p]/=t.length;return i}Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.coordsToEvent=function(t){return{coords:t,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}},Rt.copyCoords=function(t,i){t.page=t.page||{},t.page.x=i.page.x,t.page.y=i.page.y,t.client=t.client||{},t.client.x=i.client.x,t.client.y=i.client.y,t.timeStamp=i.timeStamp},Rt.getClientXY=ks,Rt.getEventTargets=function(t){var i=nt.default.func(t.composedPath)?t.composedPath():t.path;return[Tt.getActualElement(i?i[0]:t.target),Tt.getActualElement(t.currentTarget)]},Rt.getPageXY=As,Rt.getPointerId=function(t){return nt.default.number(t.pointerId)?t.pointerId:t.identifier},Rt.getPointerType=function(t){return nt.default.string(t.pointerType)?t.pointerType:nt.default.number(t.pointerType)?[void 0,void 0,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type||"")||t instanceof Ce.default.Touch?"touch":"mouse"},Rt.getTouchPair=va,Rt.getXY=Lo,Rt.isNativePointer=is,Rt.newCoords=function(){return{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},Rt.pointerAverage=ha,Object.defineProperty(Rt,"pointerExtend",{enumerable:!0,get:function(){return Cn.default}}),Rt.setCoordDeltas=function(t,i,s){t.page.x=s.page.x-i.page.x,t.page.y=s.page.y-i.page.y,t.client.x=s.client.x-i.client.x,t.client.y=s.client.y-i.client.y,t.timeStamp=s.timeStamp-i.timeStamp},Rt.setCoordVelocity=function(t,i){var s=Math.max(i.timeStamp/1e3,.001);t.page.x=i.page.x/s,t.page.y=i.page.y/s,t.client.x=i.client.x/s,t.client.y=i.client.y/s,t.timeStamp=s},Rt.setCoords=function(t,i,s){var l=i.length>1?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;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function Ii(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(me,"__esModule",{value:!0}),me.BaseEvent=void 0;var pa=function(){function t(l){(function(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")})(this,t),Ii(this,"immediatePropagationStopped",!1),Ii(this,"propagationStopped",!1),this._interaction=l}var i,s;return i=t,(s=[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}])&&Ls(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();me.BaseEvent=pa,Object.defineProperty(pa.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var re={};Object.defineProperty(re,"__esModule",{value:!0}),re.remove=re.merge=re.from=re.findIndex=re.find=re.contains=void 0,re.contains=function(t,i){return t.indexOf(i)!==-1},re.remove=function(t,i){return t.splice(t.indexOf(i),1)};var Pi=function(t,i){for(var s=0;s<i.length;s++){var l=i[s];t.push(l)}return t};re.merge=Pi,re.from=function(t){return Pi([],t)};var pr=function(t,i){for(var s=0;s<t.length;s++)if(i(t[s],s,t))return s;return-1};re.findIndex=pr,re.find=function(t,i){return t[pr(t,i)]};var le={};function Le(t){return Le=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},Le(t)}function Go(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function no(t,i){return no=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,l){return s.__proto__=l,s},no(t,i)}function os(t,i){if(i&&(Le(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return an(t)}function an(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ai(t){return ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},ai(t)}function Di(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(le,"__esModule",{value:!0}),le.DropEvent=void 0;var Wo=function(t){(function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),x&&no(y,x)})(S,t);var i,s,l,c,p=(l=S,c=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){return!1}}(),function(){var y,x=ai(l);if(c){var E=ai(this).constructor;y=Reflect.construct(x,arguments,E)}else y=x.apply(this,arguments);return os(this,y)});function S(y,x,E){var O;(function(G,V){if(!(G instanceof V))throw new TypeError("Cannot call a class as a function")})(this,S),Di(an(O=p.call(this,x._interaction)),"dropzone",void 0),Di(an(O),"dragEvent",void 0),Di(an(O),"relatedTarget",void 0),Di(an(O),"draggable",void 0),Di(an(O),"propagationStopped",!1),Di(an(O),"immediatePropagationStopped",!1);var P=E==="dragleave"?y.prev:y.cur,A=P.element,B=P.dropzone;return O.type=E,O.target=A,O.currentTarget=A,O.dropzone=B,O.dragEvent=x,O.relatedTarget=x.target,O.draggable=x.interactable,O.timeStamp=x.timeStamp,O}return i=S,(s=[{key:"reject",value:function(){var y=this,x=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&x.cur.dropzone===this.dropzone&&x.cur.element===this.target)if(x.prev.dropzone=this.dropzone,x.prev.element=this.target,x.rejected=!0,x.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var E=x.activeDrops,O=re.findIndex(E,function(A){var B=A.dropzone,G=A.element;return B===y.dropzone&&G===y.target});x.activeDrops.splice(O,1);var P=new S(x,this.dragEvent,"dropdeactivate");P.dropzone=this.dropzone,P.target=this.target,this.dropzone.fire(P)}else this.dropzone.fire(new S(x,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}])&&Go(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),S}(me.BaseEvent);le.DropEvent=Wo;var gr={};function Gr(t,i){for(var s=0;s<t.slice().length;s++){var l=t.slice()[s],c=l.dropzone,p=l.element;i.dropzone=c,i.target=p,c.fire(i),i.propagationStopped=i.immediatePropagationStopped=!1}}function Ne(t,i){for(var s=function(p,S){for(var y=p.interactables,x=[],E=0;E<y.list.length;E++){var O=y.list[E];if(O.options.drop.enabled){var P=O.options.drop.accept;if(!(nt.default.element(P)&&P!==S||nt.default.string(P)&&!Tt.matchesSelector(S,P)||nt.default.func(P)&&!P({dropzone:O,draggableElement:S})))for(var A=nt.default.string(O.target)?O._context.querySelectorAll(O.target):nt.default.array(O.target)?O.target:[O.target],B=0;B<A.length;B++){var G=A[B];G!==S&&x.push({dropzone:O,element:G,rect:O.getRect(G)})}}}return x}(t,i),l=0;l<s.length;l++){var c=s[l];c.rect=c.dropzone.getRect(c.element)}return s}function si(t,i,s){for(var l=t.dropState,c=t.interactable,p=t.element,S=[],y=0;y<l.activeDrops.length;y++){var x=l.activeDrops[y],E=x.dropzone,O=x.element,P=x.rect;S.push(E.dropCheck(i,s,c,p,O,P)?O:null)}var A=Tt.indexOfDeepestElement(S);return l.activeDrops[A]||null}function ga(t,i,s){var l=t.dropState,c={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return s.type==="dragstart"&&(c.activate=new le.DropEvent(l,s,"dropactivate"),c.activate.target=null,c.activate.dropzone=null),s.type==="dragend"&&(c.deactivate=new le.DropEvent(l,s,"dropdeactivate"),c.deactivate.target=null,c.deactivate.dropzone=null),l.rejected||(l.cur.element!==l.prev.element&&(l.prev.dropzone&&(c.leave=new le.DropEvent(l,s,"dragleave"),s.dragLeave=c.leave.target=l.prev.element,s.prevDropzone=c.leave.dropzone=l.prev.dropzone),l.cur.dropzone&&(c.enter=new le.DropEvent(l,s,"dragenter"),s.dragEnter=l.cur.element,s.dropzone=l.cur.dropzone)),s.type==="dragend"&&l.cur.dropzone&&(c.drop=new le.DropEvent(l,s,"drop"),s.dropzone=l.cur.dropzone,s.relatedTarget=l.cur.element),s.type==="dragmove"&&l.cur.dropzone&&(c.move=new le.DropEvent(l,s,"dropmove"),c.move.dragmove=s,s.dropzone=l.cur.dropzone)),c}function io(t,i){var s=t.dropState,l=s.activeDrops,c=s.cur,p=s.prev;i.leave&&p.dropzone.fire(i.leave),i.enter&&c.dropzone.fire(i.enter),i.move&&c.dropzone.fire(i.move),i.drop&&c.dropzone.fire(i.drop),i.deactivate&&Gr(l,i.deactivate),s.prev.dropzone=c.dropzone,s.prev.element=c.element}function as(t,i){var s=t.interaction,l=t.iEvent,c=t.event;if(l.type==="dragmove"||l.type==="dragend"){var p=s.dropState;i.dynamicDrop&&(p.activeDrops=Ne(i,s.element));var S=l,y=si(s,S,c);p.rejected=p.rejected&&!!y&&y.dropzone===p.cur.dropzone&&y.element===p.cur.element,p.cur.dropzone=y&&y.dropzone,p.cur.element=y&&y.element,p.events=ga(s,0,S)}}Object.defineProperty(gr,"__esModule",{value:!0}),gr.default=void 0;var zi={id:"actions/drop",install:function(t){var i=t.actions,s=t.interactStatic,l=t.Interactable,c=t.defaults;t.usePlugin(Wt.default),l.prototype.dropzone=function(p){return function(S,y){if(nt.default.object(y)){if(S.options.drop.enabled=y.enabled!==!1,y.listeners){var x=(0,Mi.default)(y.listeners),E=Object.keys(x).reduce(function(O,P){return O[/^(enter|leave)/.test(P)?"drag".concat(P):/^(activate|deactivate|move)/.test(P)?"drop".concat(P):P]=x[P],O},{});S.off(S.options.drop.listeners),S.on(E),S.options.drop.listeners=E}return nt.default.func(y.ondrop)&&S.on("drop",y.ondrop),nt.default.func(y.ondropactivate)&&S.on("dropactivate",y.ondropactivate),nt.default.func(y.ondropdeactivate)&&S.on("dropdeactivate",y.ondropdeactivate),nt.default.func(y.ondragenter)&&S.on("dragenter",y.ondragenter),nt.default.func(y.ondragleave)&&S.on("dragleave",y.ondragleave),nt.default.func(y.ondropmove)&&S.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?S.options.drop.overlap=y.overlap:nt.default.number(y.overlap)&&(S.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(S.options.drop.accept=y.accept),"checker"in y&&(S.options.drop.checker=y.checker),S}return nt.default.bool(y)?(S.options.drop.enabled=y,S):S.options.drop}(this,p)},l.prototype.dropCheck=function(p,S,y,x,E,O){return function(P,A,B,G,V,$,X){var rt=!1;if(!(X=X||P.getRect($)))return!!P.options.drop.checker&&P.options.drop.checker(A,B,rt,P,$,G,V);var st=P.options.drop.overlap;if(st==="pointer"){var it=(0,oi.default)(G,V,"drag"),tt=Rt.getPageXY(A);tt.x+=it.x,tt.y+=it.y;var ht=tt.x>X.left&&tt.x<X.right,lt=tt.y>X.top&&tt.y<X.bottom;rt=ht&&lt}var gt=G.getRect(V);if(gt&&st==="center"){var ct=gt.left+gt.width/2,mt=gt.top+gt.height/2;rt=ct>=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<E+S}if(t==="top"){var O=x>=0?p.top:p.bottom;return s.y<O+S}if(t==="right")return s.x>(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<y.length;x++){var E=y[x];i[E]&&(S+=E)}p=c[S]}return p},defaultMargin:null},ma=Tn;Vr.default=ma;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.default=void 0;var ya={id:"actions",install:function(t){t.usePlugin(li.default),t.usePlugin(Vr.default),t.usePlugin(Wt.default),t.usePlugin(gr.default)}};Xt.default=ya;var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.default=void 0;var En,ui,Ai=0,Ge={request:function(t){return En(t)},cancel:function(t){return ui(t)},init:function(t){if(En=t.requestAnimationFrame,ui=t.cancelAnimationFrame,!En)for(var i=["ms","moz","webkit","o"],s=0;s<i.length;s++){var l=i[s];En=t["".concat(l,"RequestAnimationFrame")],ui=t["".concat(l,"CancelAnimationFrame")]||t["".concat(l,"CancelRequestAnimationFrame")]}En=En&&En.bind(t),ui=ui&&ui.bind(t),En||(En=function(c){var p=Date.now(),S=Math.max(0,16-(p-Ai)),y=t.setTimeout(function(){c(p+S)},S);return Ai=p+S,y},ui=function(c){return clearTimeout(c)})}};Ir.default=Ge;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.default=void 0,Ur.getContainer=cr,Ur.getScroll=Lt,Ur.getScrollSize=function(t){return nt.default.window(t)&&(t=window.document.body),{x:t.scrollWidth,y:t.scrollHeight}},Ur.getScrollSizeDelta=function(t,i){var s=t.interaction,l=t.element,c=s&&s.interactable.options[s.prepared.name].autoScroll;if(!c||!c.enabled)return i(),{x:0,y:0};var p=cr(c.container,s.interactable,l),S=Lt(p);i();var y=Lt(p);return{x:y.x-S.x,y:y.y-S.y}};var kt={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(t){kt.isScrolling=!0,Ir.default.cancel(kt.i),t.autoScroll=kt,kt.interaction=t,kt.prevTime=kt.now(),kt.i=Ir.default.request(kt.scroll)},stop:function(){kt.isScrolling=!1,kt.interaction&&(kt.interaction.autoScroll=null),Ir.default.cancel(kt.i)},scroll:function(){var t=kt.interaction,i=t.interactable,s=t.element,l=t.prepared.name,c=i.options[l].autoScroll,p=cr(c.container,i,s),S=kt.now(),y=(S-kt.prevTime)/1e3,x=c.speed*y;if(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.clientX<kt.margin,l=s.clientY<kt.margin,c=s.clientX>P.innerWidth-kt.margin,p=s.clientY>P.innerHeight-kt.margin;else{var A=Tt.getElementClientRect(P);S=s.clientX<A.left+kt.margin,l=s.clientY<A.top+kt.margin,c=s.clientX>A.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<x;y++){var E=l[y],O=c[y],P=E.getAction(i,s,t,O);if(P){var A=ao(P,E,O,p,S);if(A)return{action:A,interactable:E,element:O}}}return{action:null,interactable:null,element:null}}function ba(t,i,s,l,c){var p=[],S=[],y=l;function x(O){p.push(O),S.push(y)}for(;nt.default.element(y);){p=[],S=[],c.interactables.forEachMatch(y,x);var E=Gs(t,i,s,p,S,l,c);if(E.action&&!E.interactable.options[E.action.name].manualStart)return E;y=Tt.parentNode(y)}return{action:null,interactable:null,element:null}}function _a(t,i,s){var l=i.action,c=i.interactable,p=i.element;l=l||{name:null},t.interactable=c,t.element=p,(0,Cr.copyAction)(t.prepared,l),t.rect=c&&l.name?c.getRect(p):null,Ws(t,s),s.fire("autoStart:prepared",{interaction:t})}function Ie(t,i,s,l){var c=t.options,p=c[s.name].max,S=c[s.name].maxPerElement,y=l.autoStart.maxInteractions,x=0,E=0,O=0;if(!(p&&S&&y))return!1;for(var P=0;P<l.interactions.list.length;P++){var A=l.interactions.list[P],B=A.prepared.name;if(A.interacting()&&(++x>=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":S<y?"y":"xy";if(s.prepared.axis=x.lockAxis==="start"?O[0]:x.lockAxis,O!=="xy"&&E!=="xy"&&E!==O){s.prepared.name=null;for(var P=l,A=function(G){if(G!==s.interactable){var V=s.interactable.options.drag;if(!V.manualStart&&G.testIgnoreAllow(V,P,l)){var $=G.getAction(s.downPointer,s.downEvent,s,P);if($&&$.name==="drag"&&function(X,rt){if(!rt)return!1;var st=rt.options.drag.startAxis;return X==="xy"||st==="xy"||st===X}(O,G)&&sn.default.validateAction($,G,P,l,i))return G}}};nt.default.element(P);){var B=i.interactables.forEachMatch(P,A);if(B){s.prepared.name="drag",s.interactable=B,s.element=P;break}P=(0,Tt.parentNode)(P)}}}}}};ki.default=us;var so={};function ln(t){var i=t.prepared&&t.prepared.name;if(!i)return null;var s=t.interactable.options;return s[i].hold||s[i].delay}Object.defineProperty(so,"__esModule",{value:!0}),so.default=void 0;var Rr={id:"auto-start/hold",install:function(t){var i=t.defaults;t.usePlugin(sn.default),i.perAction.hold=0,i.perAction.delay=0},listeners:{"interactions:new":function(t){t.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(t){var i=t.interaction,s=ln(i);s>0&&(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;l<t.interactions.list.length;l++){var c=t.interactions.list[l];if(c.element&&(c.element===s.target||(0,Tt.nodeContains)(c.element,s.target)))return void c.interactable.checkAndPreventDefault(s)}}})}Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.default=void 0,Pr.install=ce;var Yt={id:"core/interactablePreventDefault",install:ce,listeners:["down","move","up","cancel"].reduce(function(t,i){return t["interactions:".concat(i)]=wa,t},{})};Pr.default=Yt;var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=void 0,Et.default={};var Gi,ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.default=void 0,function(t){t.touchAction="touchAction",t.boxSizing="boxSizing",t.noListeners="noListeners"}(Gi||(Gi={})),Gi.touchAction,Gi.boxSizing,Gi.noListeners;var Qe={id:"dev-tools",install:function(){}};ci.default=Qe;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=function t(i){var s={};for(var l in i){var c=i[l];nt.default.plainObject(c)?s[l]=t(c):nt.default.array(c)?s[l]=re.from(c):s[l]=c}return s};var fi={};function Ca(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 lo(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)?lo(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 lo(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s<i;s++)l[s]=t[s];return l}function Vn(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function cn(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(fi,"__esModule",{value:!0}),fi.default=void 0,fi.getRectOffset=ye;var Ra=function(){function t(l){(function(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")})(this,t),cn(this,"states",[]),cn(this,"startOffset",{left:0,right:0,top:0,bottom:0}),cn(this,"startDelta",void 0),cn(this,"result",void 0),cn(this,"endResult",void 0),cn(this,"edges",void 0),cn(this,"interaction",void 0),this.interaction=l,this.result=fn()}var i,s;return i=t,(s=[{key:"start",value:function(l,c){var p=l.phase,S=this.interaction,y=function(E){var O=E.interactable.options[E.prepared.name],P=O.modifiers;return P&&P.length?P:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(A){var B=O[A];return B&&B.enabled&&{options:B,methods:B._methods}}).filter(function(A){return!!A})}(S);this.prepareStates(y),this.edges=(0,It.default)({},S.edges),this.startOffset=ye(S.rect,c),this.startDelta={x:0,y:0};var x=this.fillArg({phase:p,pageCoords:c,preEnd:!1});return this.result=fn(),this.startAll(x),this.result=this.setAll(x)}},{key:"fillArg",value:function(l){var c=this.interaction;return l.interaction=c,l.interactable=c.interactable,l.element=c.element,l.rect=l.rect||c.rect,l.edges=this.edges,l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var c=0;c<this.states.length;c++){var p=this.states[c];p.methods.start&&(l.state=p,p.methods.start(l))}}},{key:"setAll",value:function(l){var c=l.phase,p=l.preEnd,S=l.skipModifiers,y=l.rect;l.coords=(0,It.default)({},l.pageCoords),l.rect=(0,It.default)({},y);for(var x=S?this.states.slice(S):this.states,E=fn(l.coords,l.rect),O=0;O<x.length;O++){var P,A=x[O],B=A.options,G=(0,It.default)({},l.coords),V=null;(P=A.methods)!=null&&P.set&&this.shouldDo(B,p,c)&&(l.state=A,V=A.methods.set(l),Te.addEdges(this.interaction.edges,l.rect,{x:l.coords.x-G.x,y:l.coords.y-G.y})),E.eventProps.push(V)}E.delta.x=l.coords.x-l.pageCoords.x,E.delta.y=l.coords.y-l.pageCoords.y,E.rectDelta.left=l.rect.left-y.left,E.rectDelta.right=l.rect.right-y.right,E.rectDelta.top=l.rect.top-y.top,E.rectDelta.bottom=l.rect.bottom-y.bottom;var $=this.result.coords,X=this.result.rect;if($&&X){var rt=E.rect.left!==X.left||E.rect.right!==X.right||E.rect.top!==X.top||E.rect.bottom!==X.bottom;E.changed=rt||$.x!==E.coords.x||$.y!==E.coords.y}return E}},{key:"applyToInteraction",value:function(l){var c=this.interaction,p=l.phase,S=c.coords.cur,y=c.coords.start,x=this.result,E=this.startDelta,O=x.delta;p==="start"&&(0,It.default)(this.startDelta,x.delta);for(var P=0;P<[[y,E],[S,O]].length;P++){var A=Ca([[y,E],[S,O]][P],2),B=A[0],G=A[1];B.page.x+=G.x,B.page.y+=G.y,B.client.x+=G.x,B.client.y+=G.y}var V=this.result.rectDelta,$=l.rect||c.rect;$.left+=V.left,$.right+=V.right,$.top+=V.top,$.bottom+=V.bottom,$.width=$.right-$.left,$.height=$.bottom-$.top}},{key:"setAndApply",value:function(l){var c=this.interaction,p=l.phase,S=l.preEnd,y=l.skipModifiers,x=this.setAll(this.fillArg({preEnd:S,phase:p,pageCoords:l.modifiedCoords||c.coords.cur.page}));if(this.result=x,!x.changed&&(!y||y<this.states.length)&&c.interacting())return!1;if(l.modifiedCoords){var E=c.coords.cur.page,O={x:l.modifiedCoords.x-E.x,y:l.modifiedCoords.y-E.y};x.coords.x+=O.x,x.coords.y+=O.y,x.delta.x+=O.x,x.delta.y+=O.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var c=l.interaction,p=l.event,S=this.states;if(S&&S.length){for(var y=!1,x=0;x<S.length;x++){var E=S[x];l.state=E;var O=E.options,P=E.methods,A=P.beforeEnd&&P.beforeEnd(l);if(A)return this.endResult=A,!1;y=y||!y&&this.shouldDo(O,!0,l.phase,!0)}y&&c.move({event:p,preEnd:!0})}}},{key:"stop",value:function(l){var c=l.interaction;if(this.states&&this.states.length){var p=(0,It.default)({states:this.states,interactable:c.interactable,element:c.element,rect:null},l);this.fillArg(p);for(var S=0;S<this.states.length;S++){var y=this.states[S];p.state=y,y.methods.stop&&y.methods.stop(p)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var c=0;c<l.length;c++){var p=l[c],S=p.options,y=p.methods,x=p.name;this.states.push({options:S,methods:y,index:c,name:x})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var c=l.interaction,p=c.coords,S=c.rect,y=c.modification;if(y.result){for(var x=y.startDelta,E=y.result,O=E.delta,P=E.rectDelta,A=[[p.start,x],[p.cur,O]],B=0;B<A.length;B++){var G=Ca(A[B],2),V=G[0],$=G[1];V.page.x-=$.x,V.page.y-=$.y,V.client.x-=$.x,V.client.y-=$.y}S.left-=P.left,S.right-=P.right,S.top-=P.top,S.bottom-=P.bottom}}},{key:"shouldDo",value:function(l,c,p,S){return!(!l||l.enabled===!1||S&&!l.endOnly||l.endOnly&&!c||p==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.edges=l.edges,this.states=l.states.map(function(c){return(0,Nn.default)(c)}),this.result=fn((0,It.default)({},l.result.coords),(0,It.default)({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}])&&Vn(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();function fn(t,i){return{rect:i,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function ye(t,i){return t?{left:i.x-t.left,top:i.y-t.top,right:t.right-i.x,bottom:t.bottom-i.y}:{left:0,top:0,right:0,bottom:0}}fi.default=Ra;var We={};function dn(t){var i=t.iEvent,s=t.interaction.modification.result;s&&(i.modifiers=s.eventProps)}Object.defineProperty(We,"__esModule",{value:!0}),We.addEventModifiers=dn,We.default=void 0,We.makeModifier=function(t,i){var s=t.defaults,l={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},c=function(p){var S=p||{};for(var y in S.enabled=S.enabled!==!1,s)y in S||(S[y]=s[y]);var x={options:S,methods:l,name:i,enable:function(){return S.enabled=!0,x},disable:function(){return S.enabled=!1,x}};return x};return i&&typeof i=="string"&&(c._defaults=s,c._methods=l),c};var Vo={id:"modifiers/base",before:["actions"],install:function(t){t.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(t){var i=t.interaction;i.modification=new fi.default(i)},"interactions:before-action-start":function(t){var i=t.interaction.modification;i.start(t,t.interaction.coords.start.page),t.interaction.edges=i.edges,i.applyToInteraction(t)},"interactions:before-action-move":function(t){return t.interaction.modification.setAndApply(t)},"interactions:before-action-end":function(t){return t.interaction.modification.beforeEnd(t)},"interactions:action-start":dn,"interactions:action-move":dn,"interactions:action-end":dn,"interactions:after-action-start":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:after-action-move":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:stop":function(t){return t.interaction.modification.stop(t)}}},Bs=Vo;We.default=Bs;var di={};Object.defineProperty(di,"__esModule",{value:!0}),di.defaults=void 0,di.defaults={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};var Mn={};function fs(t){return fs=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},fs(t)}function Hs(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function ds(t,i){return ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,l){return s.__proto__=l,s},ds(t,i)}function Wi(t,i){if(i&&(fs(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ee(t)}function ee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fi(t){return Fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},Fi(t)}function Se(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.InteractEvent=void 0;var Ta=function(t){(function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),x&&ds(y,x)})(S,t);var i,s,l,c,p=(l=S,c=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){return!1}}(),function(){var y,x=Fi(l);if(c){var E=Fi(this).constructor;y=Reflect.construct(x,arguments,E)}else y=x.apply(this,arguments);return Wi(this,y)});function S(y,x,E,O,P,A,B){var G;(function(ht,lt){if(!(ht instanceof lt))throw new TypeError("Cannot call a class as a function")})(this,S),Se(ee(G=p.call(this,y)),"relatedTarget",null),Se(ee(G),"screenX",void 0),Se(ee(G),"screenY",void 0),Se(ee(G),"button",void 0),Se(ee(G),"buttons",void 0),Se(ee(G),"ctrlKey",void 0),Se(ee(G),"shiftKey",void 0),Se(ee(G),"altKey",void 0),Se(ee(G),"metaKey",void 0),Se(ee(G),"page",void 0),Se(ee(G),"client",void 0),Se(ee(G),"delta",void 0),Se(ee(G),"rect",void 0),Se(ee(G),"x0",void 0),Se(ee(G),"y0",void 0),Se(ee(G),"t0",void 0),Se(ee(G),"dt",void 0),Se(ee(G),"duration",void 0),Se(ee(G),"clientX0",void 0),Se(ee(G),"clientY0",void 0),Se(ee(G),"velocity",void 0),Se(ee(G),"speed",void 0),Se(ee(G),"swipe",void 0),Se(ee(G),"axes",void 0),Se(ee(G),"preEnd",void 0),P=P||y.element;var V=y.interactable,$=(V&&V.options||di.defaults).deltaSource,X=(0,oi.default)(V,P,E),rt=O==="start",st=O==="end",it=rt?ee(G):y.prevEvent,tt=rt?y.coords.start:st?{page:it.page,client:it.client,timeStamp:y.coords.cur.timeStamp}:y.coords.cur;return G.page=(0,It.default)({},tt.page),G.client=(0,It.default)({},tt.client),G.rect=(0,It.default)({},y.rect),G.timeStamp=tt.timeStamp,st||(G.page.x-=X.x,G.page.y-=X.y,G.client.x-=X.x,G.client.y-=X.y),G.ctrlKey=x.ctrlKey,G.altKey=x.altKey,G.shiftKey=x.shiftKey,G.metaKey=x.metaKey,G.button=x.button,G.buttons=x.buttons,G.target=P,G.currentTarget=P,G.preEnd=A,G.type=B||E+(O||""),G.interactable=V,G.t0=rt?y.pointers[y.pointers.length-1].downTime:it.t0,G.x0=y.coords.start.page.x-X.x,G.y0=y.coords.start.page.y-X.y,G.clientX0=y.coords.start.client.x-X.x,G.clientY0=y.coords.start.client.y-X.y,G.delta=rt||st?{x:0,y:0}:{x:G[$].x-it[$].x,y:G[$].y-it[$].y},G.dt=y.coords.delta.timeStamp,G.duration=G.timeStamp-G.t0,G.velocity=(0,It.default)({},y.coords.velocity[$]),G.speed=(0,wn.default)(G.velocity.x,G.velocity.y),G.swipe=st||O==="inertiastart"?G.getSwipe():null,G}return i=S,(s=[{key:"getSwipe",value:function(){var y=this._interaction;if(y.prevEvent.speed<600||this.timeStamp-y.prevEvent.timeStamp>150)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;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function vs(t,i,s){return i&&Ea(t.prototype,i),s&&Ea(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}function Un(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.PointerInfo=void 0;var hs=vs(function t(i,s,l,c,p){(function(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")})(this,t),Un(this,"id",void 0),Un(this,"pointer",void 0),Un(this,"event",void 0),Un(this,"downTime",void 0),Un(this,"downTarget",void 0),this.id=i,this.pointer=s,this.event=l,this.downTime=c,this.downTarget=p});Bi.PointerInfo=hs;var uo,vi,Sr={};function Ma(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function Ee(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Interaction=void 0,Object.defineProperty(Sr,"PointerInfo",{enumerable:!0,get:function(){return Bi.PointerInfo}}),Sr.default=Sr._ProxyValues=Sr._ProxyMethods=void 0,Sr._ProxyValues=uo,function(t){t.interactable="",t.element="",t.prepared="",t.pointerIsDown="",t.pointerWasMoved="",t._proxy=""}(uo||(Sr._ProxyValues=uo={})),Sr._ProxyMethods=vi,function(t){t.start="",t.move="",t.end="",t.stop="",t.interacting=""}(vi||(Sr._ProxyMethods=vi={}));var ps=0,Uo=function(){function t(l){var c=this,p=l.pointerType,S=l.scopeFire;(function(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")})(this,t),Ee(this,"interactable",null),Ee(this,"element",null),Ee(this,"rect",null),Ee(this,"_rects",void 0),Ee(this,"edges",null),Ee(this,"_scopeFire",void 0),Ee(this,"prepared",{name:null,axis:null,edges:null}),Ee(this,"pointerType",void 0),Ee(this,"pointers",[]),Ee(this,"downEvent",null),Ee(this,"downPointer",{}),Ee(this,"_latestPointer",{pointer:null,event:null,eventTarget:null}),Ee(this,"prevEvent",null),Ee(this,"pointerIsDown",!1),Ee(this,"pointerWasMoved",!1),Ee(this,"_interacting",!1),Ee(this,"_ending",!1),Ee(this,"_stopped",!0),Ee(this,"_proxy",null),Ee(this,"simulation",null),Ee(this,"doMove",(0,Cr.warnOnce)(function(A){this.move(A)},"The interaction.doMove() method has been renamed to interaction.move()")),Ee(this,"coords",{start:Rt.newCoords(),prev:Rt.newCoords(),cur:Rt.newCoords(),delta:Rt.newCoords(),velocity:Rt.newCoords()}),Ee(this,"_id",ps++),this._scopeFire=S,this.pointerType=p;var y=this;this._proxy={};var x=function(A){Object.defineProperty(c._proxy,A,{get:function(){return y[A]}})};for(var E in uo)x(E);var O=function(A){Object.defineProperty(c._proxy,A,{value:function(){return y[A].apply(y,arguments)}})};for(var P in vi)O(P);this._scopeFire("interactions:new",{interaction:this})}var i,s;return i=t,s=[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,c,p){var S=this.updatePointer(l,c,p,!0),y=this.pointers[S];this._scopeFire("interactions:down",{pointer:l,event:c,eventTarget:p,pointerIndex:S,pointerInfo:y,type:"down",interaction:this})}},{key:"start",value:function(l,c,p){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!c.options[l.name].enabled)&&((0,Cr.copyAction)(this.prepared,l),this.interactable=c,this.element=p,this.rect=c.getRect(p),this.edges=this.prepared.edges?(0,It.default)({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,c,p){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,c,p,!1);var S,y,x=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(S=this.coords.cur.client.x-this.coords.start.client.x,y=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=(0,wn.default)(S,y)>this.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;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function Pe(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.default=Tr.InertiaState=void 0;var Xr=function(){function t(l){(function(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")})(this,t),Pe(this,"active",!1),Pe(this,"isModified",!1),Pe(this,"smoothEnd",!1),Pe(this,"allowResume",!1),Pe(this,"modification",void 0),Pe(this,"modifierCount",0),Pe(this,"modifierArg",void 0),Pe(this,"startCoords",void 0),Pe(this,"t0",0),Pe(this,"v0",0),Pe(this,"te",0),Pe(this,"targetOffset",void 0),Pe(this,"modifiedOffset",void 0),Pe(this,"currentOffset",void 0),Pe(this,"lambda_v0",0),Pe(this,"one_ve_v0",0),Pe(this,"timeout",void 0),Pe(this,"interaction",void 0),this.interaction=l}var i,s;return i=t,(s=[{key:"start",value:function(l){var c=this.interaction,p=Ve(c);if(!p||!p.enabled)return!1;var S=c.coords.velocity.client,y=(0,wn.default)(S.x,S.y),x=this.modification||(this.modification=new fi.default(c));if(x.copyFrom(c.modification),this.t0=c._now(),this.allowResume=p.allowResume,this.v0=y,this.currentOffset={x:0,y:0},this.startCoords=c.coords.cur.page,this.modifierArg=x.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-c.coords.cur.timeStamp<50&&y>p.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<this.te){var A,B=1-(Math.exp(-O*P)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=this.targetOffset.x,c=this.targetOffset.y,p=this.modifiedOffset.x,S=this.modifiedOffset.y,A={x:qo(y=B,0,l,p),y:qo(y,0,c,S)}):A={x:this.targetOffset.x*B,y:this.targetOffset.y*B};var G={x:A.x-this.currentOffset.x,y:A.y-this.currentOffset.y};this.currentOffset.x+=G.x,this.currentOffset.y+=G.y,E.offsetBy(G),E.move(),this.onNextFrame(function(){return x.inertiaTick()})}else E.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,c=this.interaction,p=c._now()-this.t0,S=Ve(c).smoothEndDuration;if(p<S){var y={x:$o(p,0,this.targetOffset.x,S),y:$o(p,0,this.targetOffset.y,S)},x={x:y.x-this.currentOffset.x,y:y.y-this.currentOffset.y};this.currentOffset.x+=x.x,this.currentOffset.y+=x.y,c.offsetBy(x),c.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else c.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var c=l.pointer,p=l.event,S=l.eventTarget,y=this.interaction;y.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),y.updatePointer(c,p,S,!0),y._doPhase({interaction:y,event:p,phase:"resume"}),(0,Rt.copyCoords)(y.coords.prev,y.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,Ir.default.cancel(this.timeout)}}])&&Yo(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();function Ve(t){var i=t.interactable,s=t.prepared;return i&&i.options&&s.name&&i.options[s.name].inertia}Tr.InertiaState=Xr;var Ia={id:"inertia",before:["modifiers","actions"],install:function(t){var i=t.defaults;t.usePlugin(On.default),t.usePlugin(We.default),t.actions.phases.inertiastart=!0,t.actions.phases.resume=!0,i.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(t){var i=t.interaction;i.inertia=new Xr(i)},"interactions:before-action-end":function(t){var i=t.interaction,s=t.event;return(!i._interacting||i.simulation||!i.inertia.start(s))&&null},"interactions:down":function(t){var i=t.interaction,s=t.eventTarget,l=i.inertia;if(l.active)for(var c=s;nt.default.element(c);){if(c===i.element){l.resume(t);break}c=Tt.parentNode(c)}},"interactions:stop":function(t){var i=t.interaction.inertia;i.active&&i.stop()},"interactions:before-action-resume":function(t){var i=t.interaction.modification;i.stop(t),i.start(t,t.interaction.coords.cur.page),i.applyToInteraction(t)},"interactions:before-action-inertiastart":function(t){return t.interaction.modification.setAndApply(t)},"interactions:action-resume":We.addEventModifiers,"interactions:action-inertiastart":We.addEventModifiers,"interactions:after-action-inertiastart":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:after-action-resume":function(t){return t.interaction.modification.restoreInteractionCoords(t)}}};function qo(t,i,s,l){var c=1-t;return c*c*i+2*c*t*s+t*t*l}function $o(t,i,s,l){return-s*(t/=l)*(t-2)+i}var Ko=Ia;Tr.default=Ko;var Xn={};function Yn(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function vn(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}function fo(t,i){for(var s=0;s<i.length;s++){var l=i[s];if(t.immediatePropagationStopped)break;l(t)}}Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.Eventable=void 0;var Dr=function(){function t(l){(function(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")})(this,t),vn(this,"options",void 0),vn(this,"types",{}),vn(this,"propagationStopped",!1),vn(this,"immediatePropagationStopped",!1),vn(this,"global",void 0),this.options=(0,It.default)({},l||{})}var i,s;return i=t,(s=[{key:"fire",value:function(l){var c,p=this.global;(c=this.types[l.type])&&fo(l,c),!l.propagationStopped&&p&&(c=p[l.type])&&fo(l,c)}},{key:"on",value:function(l,c){var p=(0,Mi.default)(l,c);for(l in p)this.types[l]=re.merge(this.types[l]||[],p[l])}},{key:"off",value:function(l,c){var p=(0,Mi.default)(l,c);for(l in p){var S=this.types[l];if(S&&S.length)for(var y=0;y<p[l].length;y++){var x=p[l][y],E=S.indexOf(x);E!==-1&&S.splice(E,1)}}}},{key:"getRect",value:function(l){return null}}])&&Yn(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();Xn.Eventable=Dr;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=function(t,i){if(i.phaselessTypes[t])return!0;for(var s in i.map)if(t.indexOf(s)===0&&t.substr(s.length)in i.phases)return!0;return!1};var qn={};Object.defineProperty(qn,"__esModule",{value:!0}),qn.createInteractStatic=function(t){var i=function s(l,c){var p=t.interactables.get(l,c);return p||((p=t.interactables.new(l,c)).events.global=s.globalEvents),p};return i.getPointerAverage=Rt.pointerAverage,i.getTouchBBox=Rt.touchBBox,i.getTouchDistance=Rt.touchDistance,i.getTouchAngle=Rt.touchAngle,i.getElementRect=Tt.getElementRect,i.getElementClientRect=Tt.getElementClientRect,i.matchesSelector=Tt.matchesSelector,i.closest=Tt.closest,i.globalEvents={},i.version="1.10.17",i.scope=t,i.use=function(s,l){return this.scope.usePlugin(s,l),this},i.isSet=function(s,l){return!!this.scope.interactables.get(s,l&&l.context)},i.on=(0,Cr.warnOnce)(function(s,l,c){if(nt.default.string(s)&&s.search(" ")!==-1&&(s=s.trim().split(/ +/)),nt.default.array(s)){for(var p=0;p<s.length;p++){var S=s[p];this.on(S,l,c)}return this}if(nt.default.object(s)){for(var y in s)this.on(y,s[y],l);return this}return(0,Yr.default)(s,this.scope.actions)?this.globalEvents[s]?this.globalEvents[s].push(l):this.globalEvents[s]=[l]:this.scope.events.add(this.scope.document,s,l,{options:c}),this},"The interact.on() method is being deprecated"),i.off=(0,Cr.warnOnce)(function(s,l,c){if(nt.default.string(s)&&s.search(" ")!==-1&&(s=s.trim().split(/ +/)),nt.default.array(s)){for(var p=0;p<s.length;p++){var S=s[p];this.off(S,l,c)}return this}if(nt.default.object(s)){for(var y in s)this.off(y,s[y],l);return this}var x;return(0,Yr.default)(s,this.scope.actions)?s in this.globalEvents&&(x=this.globalEvents[s].indexOf(l))!==-1&&this.globalEvents[s].splice(x,1):this.scope.events.remove(this.scope.document,s,l,c),this},"The interact.off() method is being deprecated"),i.debug=function(){return this.scope},i.supportsTouch=function(){return ge.default.supportsTouch},i.supportsPointerEvent=function(){return ge.default.supportsPointerEvent},i.stop=function(){for(var s=0;s<this.scope.interactions.list.length;s++)this.scope.interactions.list[s].stop();return this},i.pointerMoveTolerance=function(s){return nt.default.number(s)?(this.scope.interactions.pointerMoveTolerance=s,this):this.scope.interactions.pointerMoveTolerance},i.addDocument=function(s,l){this.scope.addDocument(s,l)},i.removeDocument=function(s){this.scope.removeDocument(s)},i};var vo={};function ji(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function zr(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(vo,"__esModule",{value:!0}),vo.Interactable=void 0;var ho=function(){function t(l,c,p,S){(function(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")})(this,t),zr(this,"options",void 0),zr(this,"_actions",void 0),zr(this,"target",void 0),zr(this,"events",new Xn.Eventable),zr(this,"_context",void 0),zr(this,"_win",void 0),zr(this,"_doc",void 0),zr(this,"_scopeEvents",void 0),zr(this,"_rectChecker",void 0),this._actions=c.actions,this.target=l,this._context=c.context||p,this._win=(0,At.getWindow)((0,Tt.trySelector)(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=S,this.set(c)}var i,s;return i=t,(s=[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,c){return nt.default.func(c.onstart)&&this.on("".concat(l,"start"),c.onstart),nt.default.func(c.onmove)&&this.on("".concat(l,"move"),c.onmove),nt.default.func(c.onend)&&this.on("".concat(l,"end"),c.onend),nt.default.func(c.oninertiastart)&&this.on("".concat(l,"inertiastart"),c.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,c,p){(nt.default.array(c)||nt.default.object(c))&&this.off(l,c),(nt.default.array(p)||nt.default.object(p))&&this.on(l,p)}},{key:"setPerAction",value:function(l,c){var p=this._defaults;for(var S in c){var y=S,x=this.options[l],E=c[y];y==="listeners"&&this.updatePerActionListeners(l,x.listeners,E),nt.default.array(E)?x[y]=re.from(E):nt.default.plainObject(E)?(x[y]=(0,It.default)(x[y]||{},(0,Nn.default)(E)),nt.default.object(p.perAction[y])&&"enabled"in p.perAction[y]&&(x[y].enabled=E.enabled!==!1)):nt.default.bool(E)&&nt.default.object(p.perAction[y])?x[y].enabled=E:x[y]=E}}},{key:"getRect",value:function(l){return l=l||(nt.default.element(this.target)?this.target:null),nt.default.string(this.target)&&(l=l||this._context.querySelector(this.target)),(0,Tt.getElementRect)(l)}},{key:"rectChecker",value:function(l){var c=this;return nt.default.func(l)?(this._rectChecker=l,this.getRect=function(p){var S=(0,It.default)({},c._rectChecker(p));return"width"in S||(S.width=S.right-S.left,S.height=S.bottom-S.top),S},this):l===null?(delete this.getRect,delete this._rectChecker,this):this.getRect}},{key:"_backCompatOption",value:function(l,c){if((0,Tt.trySelector)(c)||nt.default.object(c)){for(var p in this.options[l]=c,this._actions.map)this.options[p][l]=c;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||(0,Tt.nodeContains)(this._context,l)}},{key:"testIgnoreAllow",value:function(l,c,p){return!this.testIgnore(l.ignoreFrom,c,p)&&this.testAllow(l.allowFrom,c,p)}},{key:"testAllow",value:function(l,c,p){return!l||!!nt.default.element(p)&&(nt.default.string(l)?(0,Tt.matchesUpTo)(p,l,c):!!nt.default.element(l)&&(0,Tt.nodeContains)(l,p))}},{key:"testIgnore",value:function(l,c,p){return!(!l||!nt.default.element(p))&&(nt.default.string(l)?(0,Tt.matchesUpTo)(p,l,c):!!nt.default.element(l)&&(0,Tt.nodeContains)(l,p))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,c,p,S){nt.default.object(c)&&!nt.default.array(c)&&(S=p,p=null);var y=l==="on"?"add":"remove",x=(0,Mi.default)(c,p);for(var E in x){E==="wheel"&&(E=ge.default.wheelEvent);for(var O=0;O<x[E].length;O++){var P=x[E][O];(0,Yr.default)(E,this._actions)?this.events[l](E,P):nt.default.string(this.target)?this._scopeEvents["".concat(y,"Delegate")](this.target,this._context,E,P,S):this._scopeEvents[y](this.target,E,P,S)}}return this}},{key:"on",value:function(l,c,p){return this._onOff("on",l,c,p)}},{key:"off",value:function(l,c,p){return this._onOff("off",l,c,p)}},{key:"set",value:function(l){var c=this._defaults;for(var p in nt.default.object(l)||(l={}),this.options=(0,Nn.default)(c.base),this._actions.methodDict){var S=p,y=this._actions.methodDict[S];this.options[S]={},this.setPerAction(S,(0,It.default)((0,It.default)({},c.perAction),c.actions[S])),this[y](l[S])}for(var x in l)nt.default.func(this[x])&&this[x](l[x]);return this}},{key:"unset",value:function(){if(nt.default.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var c=this._scopeEvents.delegatedEvents[l],p=c.length-1;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;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function Zo(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.InteractableSet=void 0;var po=function(){function t(l){var c=this;(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")})(this,t),Zo(this,"list",[]),Zo(this,"selectorMap",{}),Zo(this,"scope",void 0),this.scope=l,l.addListeners({"interactable:unset":function(p){var S=p.interactable,y=S.target,x=S._context,E=nt.default.string(y)?c.selectorMap[y]:y[c.scope.id],O=re.findIndex(E,function(P){return P.context===x});E[O]&&(E[O].context=null,E[O].interactable=null),E.splice(O,1)}})}var i,s;return i=t,(s=[{key:"new",value:function(l,c){c=(0,It.default)(c||{},{actions:this.scope.actions});var p=new this.scope.Interactable(l,c,this.scope.document,this.scope.events),S={context:p._context,interactable:p};return this.scope.addDocument(p._doc),this.list.push(p),nt.default.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(S)):(p.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(S)),this.scope.fire("interactable:new",{target:l,options:c,interactable:p,win:this.scope._win}),p}},{key:"get",value:function(l,c){var p=c&&c.context||this.scope.document,S=nt.default.string(l),y=S?this.selectorMap[l]:l[this.scope.id];if(!y)return null;var x=re.find(y,function(E){return E.context===p&&(S||E.interactable.inContext(l))});return x&&x.interactable}},{key:"forEachMatch",value:function(l,c){for(var p=0;p<this.list.length;p++){var S=this.list[p],y=void 0;if((nt.default.string(S.target)?nt.default.element(l)&&Tt.matchesSelector(l,S.target):l===S.target)&&S.inContext(l)&&(y=c(S)),y!==void 0)return y}}}])&&ms(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();Ni.InteractableSet=po;var go={};function js(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function mo(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}function Ue(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 Qo(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)?Qo(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 Qo(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s<i;s++)l[s]=t[s];return l}Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0;var Ns=function(){function t(l){(function(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")})(this,t),mo(this,"currentTarget",void 0),mo(this,"originalEvent",void 0),mo(this,"type",void 0),this.originalEvent=l,(0,Cn.default)(this,l)}var i,s;return i=t,(s=[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}])&&js(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),t}();function Me(t){if(!nt.default.object(t))return{capture:!!t,passive:!1};var i=(0,It.default)({},t);return i.capture=!!t.capture,i.passive=!!t.passive,i}var Vs={id:"events",install:function(t){var i,s=[],l={},c=[],p={add:S,remove:y,addDelegate:function(O,P,A,B,G){var V=Me(G);if(!l[A]){l[A]=[];for(var $=0;$<c.length;$++){var X=c[$];S(X,A,x),S(X,A,E,!0)}}var rt=l[A],st=re.find(rt,function(it){return it.selector===O&&it.context===P});st||(st={selector:O,context:P,listeners:[]},rt.push(st)),st.listeners.push([B,V])},removeDelegate:function(O,P,A,B,G){var V,$=Me(G),X=l[A],rt=!1;if(X)for(V=X.length-1;V>=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<rt.length;it++)if(rt[it]===A){O.removeEventListener(P,A,p.supportsOptions?G:G.capture),rt.splice(it,1),rt.length===0&&(delete $.events[P],X=!0);break}}X&&!Object.keys($.events).length&&s.splice(V,1)}else for(P in $.events)$.events.hasOwnProperty(P)&&y(O,P,"all")}function x(O,P){for(var A=Me(P),B=new Ns(O),G=l[O.type],V=Ue(Rt.getEventTargets(O),1)[0],$=V;nt.default.element($);){for(var X=0;X<G.length;X++){var rt=G[X],st=rt.selector,it=rt.context;if(Tt.matchesSelector($,st)&&Tt.nodeContains(it,V)&&Tt.nodeContains(it,$)){var tt=rt.listeners;B.currentTarget=$;for(var ht=0;ht<tt.length;ht++){var lt=Ue(tt[ht],2),gt=lt[0],ct=lt[1],mt=ct.capture,Gt=ct.passive;mt===A.capture&&Gt===A.passive&&gt(B)}}}$=Tt.parentNode($)}}function E(O){return x(O,!0)}return(i=t.document)==null||i.createElement("div").addEventListener("test",null,{get capture(){return p.supportsOptions=!0},get passive(){return p.supportsPassive=!0}}),t.events=p,p}};go.default=Vs;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.default=void 0;var Vi={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(t){for(var i=0;i<Vi.methodOrder.length;i++){var s;s=Vi.methodOrder[i];var l=Vi[s](t);if(l)return l}return null},simulationResume:function(t){var i=t.pointerType,s=t.eventType,l=t.eventTarget,c=t.scope;if(!/down|start/i.test(s))return null;for(var p=0;p<c.interactions.list.length;p++){var S=c.interactions.list[p],y=l;if(S.simulation&&S.simulation.allowResume&&S.pointerType===i)for(;y;){if(y===S.element)return S;y=Tt.parentNode(y)}}return null},mouseOrPen:function(t){var i,s=t.pointerId,l=t.pointerType,c=t.eventType,p=t.scope;if(l!=="mouse"&&l!=="pen")return null;for(var S=0;S<p.interactions.list.length;S++){var y=p.interactions.list[S];if(y.pointerType===l){if(y.simulation&&!Fe(y,s))continue;if(y.interacting())return y;i||(i=y)}}if(i)return i;for(var x=0;x<p.interactions.list.length;x++){var E=p.interactions.list[x];if(!(E.pointerType!==l||/down/i.test(c)&&E.simulation))return E}return null},hasPointer:function(t){for(var i=t.pointerId,s=t.scope,l=0;l<s.interactions.list.length;l++){var c=s.interactions.list[l];if(Fe(c,i))return c}return null},idle:function(t){for(var i=t.pointerType,s=t.scope,l=0;l<s.interactions.list.length;l++){var c=s.interactions.list[l];if(c.pointers.length===1){var p=c.interactable;if(p&&(!p.options.gesture||!p.options.gesture.enabled))continue}else if(c.pointers.length>=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<i;s++)l[s]=t[s];return l}function bo(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Da(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function Jo(t,i){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,l){return s.__proto__=l,s},Jo(t,i)}function Us(t,i){if(i&&(yo(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 ta(t){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},ta(t)}Object.defineProperty($n,"__esModule",{value:!0}),$n.default=void 0;var za=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Aa(t,i){return function(s){var l=i.interactions.list,c=Rt.getPointerType(s),p=ys(Rt.getEventTargets(s),2),S=p[0],y=p[1],x=[];if(/^touch/.test(s.type)){i.prevTouchTime=i.now();for(var E=0;E<s.changedTouches.length;E++){var O=s.changedTouches[E],P={pointer:O,pointerId:Rt.getPointerId(O),pointerType:c,eventType:s.type,eventTarget:S,curEventTarget:y,scope:i},A=ka(P);x.push([P.pointer,P.eventTarget,P.curEventTarget,A])}}else{var B=!1;if(!ge.default.supportsPointerEvent&&/mouse/.test(s.type)){for(var G=0;G<l.length&&!B;G++)B=l[G].pointerType!=="mouse"&&l[G].pointerIsDown;B=B||i.now()-i.prevTouchTime<500||s.timeStamp===0}if(!B){var V={pointer:s,pointerId:Rt.getPointerId(s),pointerType:c,eventType:s.type,curEventTarget:y,eventTarget:S,scope:i},$=ka(V);x.push([V.pointer,V.eventTarget,V.curEventTarget,$])}}for(var X=0;X<x.length;X++){var rt=ys(x[X],4),st=rt[0],it=rt[1],tt=rt[2];rt[3][t](st,s,it,tt)}}}function ka(t){var i=t.pointerType,s=t.scope,l={interaction:Pn.default.search(t),searchDetails:t};return s.fire("interactions:find",l),l.interaction||s.interactions.new({pointerType:i})}function _o(t,i){var s=t.doc,l=t.scope,c=t.options,p=l.interactions.docEvents,S=l.events,y=S[i];for(var x in l.browser.isIOS&&!c.events&&(c.events={passive:!1}),S.delegatedEvents)y(s,x,S.delegateListener),y(s,x,S.delegateUseCapture,!0);for(var E=c&&c.events,O=0;O<p.length;O++){var P=p[O];y(s,P.type,P.listener,E)}}var Ss={id:"core/interactions",install:function(t){for(var i={},s=0;s<za.length;s++){var l=za[s];i[l]=Aa(l,t)}var c,p=ge.default.pEventTypes;function S(){for(var y=0;y<t.interactions.list.length;y++){var x=t.interactions.list[y];if(x.pointerIsDown&&x.pointerType==="touch"&&!x._interacting)for(var E=function(){var P=x.pointers[O];t.documents.some(function(A){var B=A.doc;return(0,Tt.nodeContains)(B,P.downTarget)})||x.removePointer(P.pointer,P.event)},O=0;O<x.pointers.length;O++)E()}}(c=Ce.default.PointerEvent?[{type:p.down,listener:S},{type:p.down,listener:i.pointerDown},{type:p.move,listener:i.pointerMove},{type:p.up,listener:i.pointerUp},{type:p.cancel,listener:i.pointerUp}]:[{type:"mousedown",listener:i.pointerDown},{type:"mousemove",listener:i.pointerMove},{type:"mouseup",listener:i.pointerUp},{type:"touchstart",listener:S},{type:"touchstart",listener:i.pointerDown},{type:"touchmove",listener:i.pointerMove},{type:"touchend",listener:i.pointerUp},{type:"touchcancel",listener:i.pointerUp}]).push({type:"blur",listener:function(y){for(var x=0;x<t.interactions.list.length;x++)t.interactions.list[x].documentBlur(y)}}),t.prevTouchTime=0,t.Interaction=function(y){(function(G,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");G.prototype=Object.create(V&&V.prototype,{constructor:{value:G,writable:!0,configurable:!0}}),Object.defineProperty(G,"prototype",{writable:!1}),V&&Jo(G,V)})(B,y);var x,E,O,P,A=(O=B,P=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(G){return!1}}(),function(){var G,V=ta(O);if(P){var $=ta(this).constructor;G=Reflect.construct(V,arguments,$)}else G=V.apply(this,arguments);return Us(this,G)});function B(){return bo(this,B),A.apply(this,arguments)}return x=B,(E=[{key:"pointerMoveTolerance",get:function(){return t.interactions.pointerMoveTolerance},set:function(G){t.interactions.pointerMoveTolerance=G}},{key:"_now",value:function(){return t.now()}}])&&Da(x.prototype,E),Object.defineProperty(x,"prototype",{writable:!1}),B}(Sr.default),t.interactions={list:[],new:function(y){y.scopeFire=function(E,O){return t.fire(E,O)};var x=new t.Interaction(y);return t.interactions.list.push(x),x},listeners:i,docEvents:c,pointerMoveTolerance:1},t.usePlugin(Pr.default)},listeners:{"scope:add-document":function(t){return _o(t,"add")},"scope:remove-document":function(t){return _o(t,"remove")},"interactable:unset":function(t,i){for(var s=t.interactable,l=i.interactions.list.length-1;l>=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;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function kn(t,i,s){return i&&An(t.prototype,i),s&&An(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}function de(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(pi,"__esModule",{value:!0}),pi.Scope=void 0,pi.initScope=Ga;var N=function(){function t(){var i=this;La(this,t),de(this,"id","__interact_scope_".concat(Math.floor(100*Math.random()))),de(this,"isInitialized",!1),de(this,"listenerMaps",[]),de(this,"browser",ge.default),de(this,"defaults",(0,Nn.default)(di.defaults)),de(this,"Eventable",Xn.Eventable),de(this,"actions",{map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}}),de(this,"interactStatic",(0,qn.createInteractStatic)(this)),de(this,"InteractEvent",Mn.InteractEvent),de(this,"Interactable",void 0),de(this,"interactables",new Ni.InteractableSet(this)),de(this,"_win",void 0),de(this,"document",void 0),de(this,"window",void 0),de(this,"documents",[]),de(this,"_plugins",{list:[],map:{}}),de(this,"onWindowUnload",function(l){return i.removeDocument(l.target)});var s=this;this.Interactable=function(l){(function(x,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(E&&E.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),E&&Ui(x,E)})(y,l);var c,p,S=(c=y,p=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(x){return!1}}(),function(){var x,E=zn(c);if(p){var O=zn(this).constructor;x=Reflect.construct(E,arguments,O)}else x=E.apply(this,arguments);return yi(this,x)});function y(){return La(this,y),S.apply(this,arguments)}return kn(y,[{key:"_defaults",get:function(){return s.defaults}},{key:"set",value:function(x){return Kn(zn(y.prototype),"set",this).call(this,x),s.fire("interactable:set",{options:x,interactable:this}),this}},{key:"unset",value:function(){Kn(zn(y.prototype),"unset",this).call(this);var x=s.interactables.list.indexOf(this);x<0||(Kn(zn(y.prototype),"unset",this).call(this),s.interactables.list.splice(x,1),s.fire("interactable:unset",{interactable:this}))}}]),y}(vo.Interactable)}return kn(t,[{key:"addListeners",value:function(i,s){this.listenerMaps.push({id:s,map:i})}},{key:"fire",value:function(i,s){for(var l=0;l<this.listenerMaps.length;l++){var c=this.listenerMaps[l].map[i];if(c&&c(s,this,i)===!1)return!1}}},{key:"init",value:function(i){return this.isInitialized?this:Ga(this,i)}},{key:"pluginIsInstalled",value:function(i){return this._plugins.map[i.id]||this._plugins.list.indexOf(i)!==-1}},{key:"usePlugin",value:function(i,s){if(!this.isInitialized)return this;if(this.pluginIsInstalled(i))return this;if(i.id&&(this._plugins.map[i.id]=i),this._plugins.list.push(i),i.install&&i.install(this,s),i.listeners&&i.before){for(var l=0,c=this.listenerMaps.length,p=i.before.reduce(function(y,x){return y[x]=!0,y[Wa(x)]=!0,y},{});l<c;l++){var S=this.listenerMaps[l].id;if(p[S]||p[Wa(S)])break}this.listenerMaps.splice(l,0,{id:i.id,map:i.listeners})}else i.listeners&&this.listenerMaps.push({id:i.id,map:i.listeners});return this}},{key:"addDocument",value:function(i,s){if(this.getDocIndex(i)!==-1)return!1;var l=At.getWindow(i);s=s?(0,It.default)({},s):{},this.documents.push({doc:i,options:s}),this.events.documents.push(i),i!==this.document&&this.events.add(l,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:i,window:l,scope:this,options:s})}},{key:"removeDocument",value:function(i){var s=this.getDocIndex(i),l=At.getWindow(i),c=this.documents[s].options;this.events.remove(l,"unload",this.onWindowUnload),this.documents.splice(s,1),this.events.documents.splice(s,1),this.fire("scope:remove-document",{doc:i,window:l,scope:this,options:c})}},{key:"getDocIndex",value:function(i){for(var s=0;s<this.documents.length;s++)if(this.documents[s].doc===i)return s;return-1}},{key:"getDocOptions",value:function(i){var s=this.getDocIndex(i);return s===-1?null:this.documents[s].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),t}();function Ga(t,i){return t.isInitialized=!0,nt.default.window(i)&&At.init(i),Ce.default.init(i),ge.default.init(i),Ir.default.init(i),t.window=i,t.document=i.document,t.usePlugin($n.default),t.usePlugin(go.default),t}function Wa(t){return t&&t.replace(/\/.*$/,"")}pi.Scope=N;var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=void 0;var Zn=new pi.Scope,Fa=Zn.interactStatic;bt.default=Fa;var Xi=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:void 0;Zn.init(Xi);var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.default=void 0,Ln.default=function(){};var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0,Yi.default=function(){};var hn={};function xo(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 wo(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)?wo(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 wo(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s<i;s++)l[s]=t[s];return l}Object.defineProperty(hn,"__esModule",{value:!0}),hn.default=void 0,hn.default=function(t){var i=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(l){var c=xo(l,2),p=c[0],S=c[1];return p in t||S in t}),s=function(l,c){for(var p=t.range,S=t.limits,y=S===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:S,x=t.offset,E=x===void 0?{x:0,y:0}:x,O={range:p,grid:t,x:null,y:null},P=0;P<i.length;P++){var A=xo(i[P],2),B=A[0],G=A[1],V=Math.round((l-E.x)/t[B]),$=Math.round((c-E.y)/t[G]);O[B]=Math.max(y.left,Math.min(y.right,V*t[B]+E.x)),O[G]=Math.max(y.top,Math.min(y.bottom,$*t[G]+E.y))}return O};return s.grid=t,s.coordFields=i,s};var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Object.defineProperty(Qn,"edgeTarget",{enumerable:!0,get:function(){return Ln.default}}),Object.defineProperty(Qn,"elements",{enumerable:!0,get:function(){return Yi.default}}),Object.defineProperty(Qn,"grid",{enumerable:!0,get:function(){return hn.default}});var Si={};Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=void 0;var bs={id:"snappers",install:function(t){var i=t.interactStatic;i.snappers=(0,It.default)(i.snappers||{},Qn),i.createSnapGrid=i.snappers.grid}},_s=bs;Si.default=_s;var Jn={};function Ba(t,i){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);i&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),s.push.apply(s,l)}return s}function Ha(t){for(var i=1;i<arguments.length;i++){var s=arguments[i]!=null?arguments[i]:{};i%2?Ba(Object(s),!0).forEach(function(l){xs(t,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Ba(Object(s)).forEach(function(l){Object.defineProperty(t,l,Object.getOwnPropertyDescriptor(s,l))})}return t}function xs(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.default=Jn.aspectRatio=void 0;var Co={start:function(t){var i=t.state,s=t.rect,l=t.edges,c=t.pageCoords,p=i.options.ratio,S=i.options,y=S.equalDelta,x=S.modifiers;p==="preserve"&&(p=s.width/s.height),i.startCoords=(0,It.default)({},c),i.startRect=(0,It.default)({},s),i.ratio=p,i.equalDelta=y;var E=i.linkedEdges={top:l.top||l.left&&!l.bottom,left:l.left||l.top&&!l.right,bottom:l.bottom||l.right&&!l.top,right:l.right||l.bottom&&!l.left};if(i.xIsPrimaryAxis=!(!l.left&&!l.right),i.equalDelta){var O=(E.left?1:-1)*(E.top?1:-1);i.edgeSign={x:O,y:O}}else i.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if((0,It.default)(t.edges,E),x&&x.length){var P=new fi.default(t.interaction);P.copyFrom(t.interaction.modification),P.prepareStates(x),i.subModification=P,P.startAll(Ha({},t))}},set:function(t){var i=t.state,s=t.rect,l=t.coords,c=(0,It.default)({},l),p=i.equalDelta?ws:ja;if(p(i,i.xIsPrimaryAxis,l,s),!i.subModification)return null;var S=(0,It.default)({},s);(0,Te.addEdges)(i.linkedEdges,S,{x:l.x-c.x,y:l.y-c.y});var y=i.subModification.setAll(Ha(Ha({},t),{},{rect:S,edges:i.linkedEdges,pageCoords:l,prevCoords:l,prevRect:S})),x=y.delta;return y.changed&&(p(i,Math.abs(x.x)>Math.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;l<s.length;l++){var c=s[l];c in t||(t[c]=i[c])}return t}var $r={noInner:xi,noOuter:ei,start:function(t){var i,s=t.interaction,l=t.startOffset,c=t.state,p=c.options;if(p){var S=(0,or.getRestrictionRect)(p.offset,s,s.coords.start.page);i=Te.rectToXY(S)}i=i||{x:0,y:0},c.offset={top:i.y+l.top,left:i.x+l.left,bottom:i.y-l.bottom,right:i.x-l.right}},set:function(t){var i=t.coords,s=t.edges,l=t.interaction,c=t.state,p=c.offset,S=c.options;if(s){var y=(0,It.default)({},i),x=(0,or.getRestrictionRect)(S.inner,l,y)||{},E=(0,or.getRestrictionRect)(S.outer,l,y)||{};pn(x,xi),pn(E,ei),s.top?i.y=Math.min(Math.max(E.top+p.top,y.y),x.top+p.top):s.bottom&&(i.y=Math.max(Math.min(E.bottom+p.bottom,y.y),x.bottom+p.bottom)),s.left?i.x=Math.min(Math.max(E.left+p.left,y.x),x.left+p.left):s.right&&(i.x=Math.max(Math.min(E.right+p.right,y.x),x.right+p.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}};qr.restrictEdges=$r;var Cs=(0,We.makeModifier)($r,"restrictEdges");qr.default=Cs;var gn={};Object.defineProperty(gn,"__esModule",{value:!0}),gn.restrictRect=gn.default=void 0;var Ro=(0,It.default)({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},or.restrict.defaults),Va={start:or.restrict.start,set:or.restrict.set,defaults:Ro};gn.restrictRect=Va;var ea=(0,We.makeModifier)(Va,"restrictRect");gn.default=ea;var mn={};Object.defineProperty(mn,"__esModule",{value:!0}),mn.restrictSize=mn.default=void 0;var Kr={width:-1/0,height:-1/0},Rs={width:1/0,height:1/0},Ua={start:function(t){return qr.restrictEdges.start(t)},set:function(t){var i=t.interaction,s=t.state,l=t.rect,c=t.edges,p=s.options;if(c){var S=Te.tlbrToXywh((0,or.getRestrictionRect)(p.min,i,t.coords))||Kr,y=Te.tlbrToXywh((0,or.getRestrictionRect)(p.max,i,t.coords))||Rs;s.options={endOnly:p.endOnly,inner:(0,It.default)({},qr.restrictEdges.noInner),outer:(0,It.default)({},qr.restrictEdges.noOuter)},c.top?(s.options.inner.top=l.bottom-S.height,s.options.outer.top=l.bottom-y.height):c.bottom&&(s.options.inner.bottom=l.top+S.height,s.options.outer.bottom=l.top+y.height),c.left?(s.options.inner.left=l.right-S.width,s.options.outer.left=l.right-y.width):c.right&&(s.options.inner.right=l.left+S.width,s.options.outer.right=l.left+y.width),qr.restrictEdges.set(t),s.options=p}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}};mn.restrictSize=Ua;var Xa=(0,We.makeModifier)(Ua,"restrictSize");mn.default=Xa;var ra={};Object.defineProperty(ra,"__esModule",{value:!0}),Object.defineProperty(ra,"default",{enumerable:!0,get:function(){return Ar.default}});var pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.snap=pe.default=void 0;var na={start:function(t){var i,s=t.interaction,l=t.interactable,c=t.element,p=t.rect,S=t.state,y=t.startOffset,x=S.options,E=x.offsetWithOrigin?function(A){var B=A.interaction.element;return(0,Te.rectToXY)((0,Te.resolveRectLike)(A.state.options.origin,null,null,[B]))||(0,oi.default)(A.interactable,B,A.interaction.prepared.name)}(t):{x:0,y:0};if(x.offset==="startCoords")i={x:s.coords.start.page.x,y:s.coords.start.page.y};else{var O=(0,Te.resolveRectLike)(x.offset,l,c,[s]);(i=(0,Te.rectToXY)(O)||{x:0,y:0}).x+=E.x,i.y+=E.y}var P=x.relativePoints;S.offsets=p&&P&&P.length?P.map(function(A,B){return{index:B,relativePoint:A,x:y.left-p.width*A.x+i.x,y:y.top-p.height*A.y+i.y}}):[{index:0,relativePoint:null,x:i.x,y:i.y}]},set:function(t){var i=t.interaction,s=t.coords,l=t.state,c=l.options,p=l.offsets,S=(0,oi.default)(i.interactable,i.element,i.prepared.name),y=(0,It.default)({},s),x=[];c.offsetWithOrigin||(y.x-=S.x,y.y-=S.y);for(var E=0;E<p.length;E++)for(var O=p[E],P=y.x-O.x,A=y.y-O.y,B=0,G=c.targets.length;B<G;B++){var V,$=c.targets[B];(V=nt.default.func($)?$(P,A,i._proxy,O,B):$)&&x.push({x:(nt.default.number(V.x)?V.x:P)+O.x,y:(nt.default.number(V.y)?V.y:A)+O.y,range:nt.default.number(V.range)?V.range:c.range,source:$,index:B,offset:O})}for(var X={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},rt=0;rt<x.length;rt++){var st=x[rt],it=st.range,tt=st.x-y.x,ht=st.y-y.y,lt=(0,wn.default)(tt,ht),gt=lt<=it;it===1/0&&X.inRange&&X.range!==1/0&&(gt=!1),X.target&&!(gt?X.inRange&&it!==1/0?lt/it<X.distance/X.range:it===1/0&&X.range!==1/0||lt<X.distance:!X.inRange&&lt<X.distance)||(X.target=st,X.distance=lt,X.range=it,X.inRange=gt,X.delta.x=tt,X.delta.y=ht)}return X.inRange&&(s.x=X.target.x,s.y=X.target.y),l.closest=X,X},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}};pe.snap=na;var ri=(0,We.makeModifier)(na,"snap");pe.default=ri;var yn={};function ia(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=Array(i);s<i;s++)l[s]=t[s];return l}Object.defineProperty(yn,"__esModule",{value:!0}),yn.snapSize=yn.default=void 0;var $i={start:function(t){var i=t.state,s=t.edges,l=i.options;if(!s)return null;t.state={options:{targets:null,relativePoints:[{x:s.left?0:1,y:s.top?0:1}],offset:l.offset||"self",origin:{x:0,y:0},range:l.range}},i.targetFields=i.targetFields||[["width","height"],["x","y"]],pe.snap.start(t),i.offsets=t.state.offsets,t.state=i},set:function(t){var i,s,l=t.interaction,c=t.state,p=t.coords,S=c.options,y=c.offsets,x={x:p.x-y[0].x,y:p.y-y[0].y};c.options=(0,It.default)({},S),c.options.targets=[];for(var E=0;E<(S.targets||[]).length;E++){var O=(S.targets||[])[E],P=void 0;if(P=nt.default.func(O)?O(x.x,x.y,l):O){for(var A=0;A<c.targetFields.length;A++){var B=(i=c.targetFields[A],s=2,function(X){if(Array.isArray(X))return X}(i)||function(X,rt){var st=X==null?null:typeof Symbol!="undefined"&&X[Symbol.iterator]||X["@@iterator"];if(st!=null){var it,tt,ht=[],lt=!0,gt=!1;try{for(st=st.call(X);!(lt=(it=st.next()).done)&&(ht.push(it.value),!rt||ht.length!==rt);lt=!0);}catch(ct){gt=!0,tt=ct}finally{try{lt||st.return==null||st.return()}finally{if(gt)throw tt}}return ht}}(i,s)||function(X,rt){if(X){if(typeof X=="string")return ia(X,rt);var st=Object.prototype.toString.call(X).slice(8,-1);return st==="Object"&&X.constructor&&(st=X.constructor.name),st==="Map"||st==="Set"?Array.from(X):st==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(st)?ia(X,rt):void 0}}(i,s)||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.`)}()),G=B[0],V=B[1];if(G in P||V in P){P.x=P[G],P.y=P[V];break}}c.options.targets.push(P)}}var $=pe.snap.set(t);return c.options=S,$},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}};yn.snapSize=$i;var Ki=(0,We.makeModifier)($i,"snapSize");yn.default=Ki;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.snapEdges=Sn.default=void 0;var wi={start:function(t){var i=t.edges;return i?(t.state.targetFields=t.state.targetFields||[[i.left?"left":"right",i.top?"top":"bottom"]],yn.snapSize.start(t)):null},set:yn.snapSize.set,defaults:(0,It.default)((0,Nn.default)(yn.snapSize.defaults),{targets:null,range:null,offset:{x:0,y:0}})};Sn.snapEdges=wi;var Gn=(0,We.makeModifier)(wi,"snapEdges");Sn.default=Gn;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0}),Object.defineProperty(Zi,"default",{enumerable:!0,get:function(){return Ar.default}});var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0}),Object.defineProperty(Wn,"default",{enumerable:!0,get:function(){return Ar.default}});var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.default=void 0;var qe={aspectRatio:Jn.default,restrictEdges:qr.default,restrict:or.default,restrictRect:gn.default,restrictSize:mn.default,snapEdges:Sn.default,snap:pe.default,snapSize:yn.default,spring:Zi.default,avoid:qi.default,transform:Wn.default,rubberband:ra.default};Zr.default=qe;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var ni={id:"modifiers",install:function(t){var i=t.interactStatic;for(var s in t.usePlugin(We.default),t.usePlugin(Si.default),i.modifiers=Zr.default,Zr.default){var l=Zr.default[s],c=l._defaults,p=l._methods;c._methods=p,t.defaults.perAction[s]=c}}},Qi=ni;Fn.default=Qi;var br={};function oa(t){return oa=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},oa(t)}function Qr(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function bn(t,i){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,l){return s.__proto__=l,s},bn(t,i)}function Ji(t,i){if(i&&(oa(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return to(t)}function to(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function To(t){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},To(t)}Object.defineProperty(br,"__esModule",{value:!0}),br.default=br.PointerEvent=void 0;var Ya=function(t){(function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),x&&bn(y,x)})(S,t);var i,s,l,c,p=(l=S,c=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){return!1}}(),function(){var y,x=To(l);if(c){var E=To(this).constructor;y=Reflect.construct(x,arguments,E)}else y=x.apply(this,arguments);return Ji(this,y)});function S(y,x,E,O,P,A){var B;if(function($,X){if(!($ instanceof X))throw new TypeError("Cannot call a class as a function")}(this,S),B=p.call(this,P),Rt.pointerExtend(to(B),E),E!==x&&Rt.pointerExtend(to(B),x),B.timeStamp=A,B.originalEvent=E,B.type=y,B.pointerId=Rt.getPointerId(x),B.pointerType=Rt.getPointerType(x),B.target=O,B.currentTarget=null,y==="tap"){var G=P.getPointerIndex(x);B.dt=B.timeStamp-P.pointers[G].downTime;var V=B.timeStamp-P.tapTime;B.double=!!P.prevTap&&P.prevTap.type!=="doubletap"&&P.prevTap.target===B.target&&V<500}else y==="doubletap"&&(B.dt=x.timeStamp-P.tapTime,B.double=!0);return B}return i=S,(s=[{key:"_subtractOrigin",value:function(y){var x=y.x,E=y.y;return this.pageX-=x,this.pageY-=E,this.clientX-=x,this.clientY-=E,this}},{key:"_addOrigin",value:function(y){var x=y.x,E=y.y;return this.pageX+=x,this.pageY+=E,this.clientX+=x,this.clientY+=E,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}])&&Qr(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),S}(me.BaseEvent);br.PointerEvent=br.default=Ya;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.default=void 0;var be={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(t){t.pointerEvents=be,t.defaults.actions.pointerEvents=be.defaults,(0,It.default)(t.actions.phaselessTypes,be.types)},listeners:{"interactions:new":function(t){var i=t.interaction;i.prevTap=null,i.tapTime=0},"interactions:update-pointer":function(t){var i=t.down,s=t.pointerInfo;!i&&s.hold||(s.hold={duration:1/0,timeout:null})},"interactions:move":function(t,i){var s=t.interaction,l=t.pointer,c=t.event,p=t.eventTarget;t.duplicate||s.pointerIsDown&&!s.pointerWasMoved||(s.pointerIsDown&&Eo(t),ar({interaction:s,pointer:l,event:c,eventTarget:p,type:"move"},i))},"interactions:down":function(t,i){(function(s,l){for(var c=s.interaction,p=s.pointer,S=s.event,y=s.eventTarget,x=s.pointerIndex,E=c.pointers[x].hold,O=Tt.getPath(y),P={interaction:c,pointer:p,event:S,eventTarget:y,type:"hold",targets:[],path:O,node:null},A=0;A<O.length;A++){var B=O[A];P.node=B,l.fire("pointerEvents:collect-targets",P)}if(P.targets.length){for(var G=1/0,V=0;V<P.targets.length;V++){var $=P.targets[V].eventable.options.holdDuration;$<G&&(G=$)}E.duration=G,E.timeout=setTimeout(function(){ar({interaction:c,eventTarget:y,pointer:p,event:S,type:"hold"},l)},G)}})(t,i),ar(t,i)},"interactions:up":function(t,i){Eo(t),ar(t,i),function(s,l){var c=s.interaction,p=s.pointer,S=s.event,y=s.eventTarget;c.pointerWasMoved||ar({interaction:c,eventTarget:y,pointer:p,event:S,type:"tap"},l)}(t,i)},"interactions:cancel":function(t,i){Eo(t),ar(t,i)}},PointerEvent:br.PointerEvent,fire:ar,collectEventTargets:Bn,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function ar(t,i){var s=t.interaction,l=t.pointer,c=t.event,p=t.eventTarget,S=t.type,y=t.targets,x=y===void 0?Bn(t,i):y,E=new br.PointerEvent(S,l,c,p,s,i.now());i.fire("pointerEvents:new",{pointerEvent:E});for(var O={interaction:s,pointer:l,event:c,eventTarget:p,targets:x,type:S,pointerEvent:E},P=0;P<x.length;P++){var A=x[P];for(var B in A.props||{})E[B]=A.props[B];var G=(0,oi.default)(A.eventable,A.node);if(E._subtractOrigin(G),E.eventable=A.eventable,E.currentTarget=A.node,A.eventable.fire(E),E._addOrigin(G),E.immediatePropagationStopped||E.propagationStopped&&P+1<x.length&&x[P+1].node!==E.currentTarget)break}if(i.fire("pointerEvents:fired",O),S==="tap"){var V=E.double?ar({interaction:s,pointer:l,event:c,eventTarget:p,type:"doubletap"},i):E;s.prevTap=V,s.tapTime=V.timeStamp}return E}function Bn(t,i){var s=t.interaction,l=t.pointer,c=t.event,p=t.eventTarget,S=t.type,y=s.getPointerIndex(l),x=s.pointers[y];if(S==="tap"&&(s.pointerWasMoved||!x||x.downTarget!==p))return[];for(var E=Tt.getPath(p),O={interaction:s,pointer:l,event:c,eventTarget:p,type:S,path:E,targets:[],node:null},P=0;P<E.length;P++){var A=E[P];O.node=A,i.fire("pointerEvents:collect-targets",O)}return S==="hold"&&(O.targets=O.targets.filter(function(B){var G;return B.eventable.options.holdDuration===((G=s.pointers[y])==null?void 0:G.hold.duration)})),O.targets}function Eo(t){var i=t.interaction,s=t.pointerIndex,l=i.pointers[s].hold;l&&l.timeout&&(clearTimeout(l.timeout),l.timeout=null)}var Ts=be;Fr.default=Ts;var sr={};function qa(t){var i=t.interaction;i.holdIntervalHandle&&(clearInterval(i.holdIntervalHandle),i.holdIntervalHandle=null)}Object.defineProperty(sr,"__esModule",{value:!0}),sr.default=void 0;var Ct={id:"pointer-events/holdRepeat",install:function(t){t.usePlugin(Fr.default);var i=t.pointerEvents;i.defaults.holdRepeatInterval=0,i.types.holdrepeat=t.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(t,i){return t["pointerEvents:".concat(i)]=qa,t},{"pointerEvents:new":function(t){var i=t.pointerEvent;i.type==="hold"&&(i.count=(i.count||0)+1)},"pointerEvents:fired":function(t,i){var s=t.interaction,l=t.pointerEvent,c=t.eventTarget,p=t.targets;if(l.type==="hold"&&p.length){var S=p[0].eventable.options.holdRepeatInterval;S<=0||(s.holdIntervalHandle=setTimeout(function(){i.pointerEvents.fire({interaction:s,eventTarget:c,type:"hold",pointer:l,event:l},i)},S))}}})},$a=Ct;sr.default=$a;var Mo={};function eo(t){return(0,It.default)(this.events.options,t),this}Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.default=void 0;var Es={id:"pointer-events/interactableTargets",install:function(t){var i=t.Interactable;i.prototype.pointerEvents=eo;var s=i.prototype._backCompatOption;i.prototype._backCompatOption=function(l,c){var p=s.call(this,l,c);return p===this&&(this.events.options[l]=c),p}},listeners:{"pointerEvents:collect-targets":function(t,i){var s=t.targets,l=t.node,c=t.type,p=t.eventTarget;i.interactables.forEachMatch(l,function(S){var y=S.events,x=y.options;y.types[c]&&y.types[c].length&&S.testIgnoreAllow(x,l,p)&&s.push({node:l,eventable:y,props:{interactable:S}})})},"interactable:new":function(t){var i=t.interactable;i.events.getRect=function(s){return i.getRect(s)}},"interactable:set":function(t,i){var s=t.interactable,l=t.options;(0,It.default)(s.events.options,i.pointerEvents.defaults),(0,It.default)(s.events.options,l.pointerEvents||{})}}},Ms=Es;Mo.default=Ms;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.default=void 0;var Os={id:"pointer-events",install:function(t){t.usePlugin(Fr),t.usePlugin(sr.default),t.usePlugin(Mo.default)}},Ka=Os;Hn.default=Ka;var Jr={};function Za(t){var i=t.Interactable;t.actions.phases.reflow=!0,i.prototype.reflow=function(s){return function(l,c,p){for(var S=nt.default.string(l.target)?re.from(l._context.querySelectorAll(l.target)):[l.target],y=p.window.Promise,x=y?[]:null,E=function(){var P=S[O],A=l.getRect(P);if(!A)return"break";var B=re.find(p.interactions.list,function(rt){return rt.interacting()&&rt.interactable===l&&rt.element===P&&rt.prepared.name===c.name}),G=void 0;if(B)B.move(),x&&(G=B._reflowPromise||new y(function(rt){B._reflowResolve=rt}));else{var V=(0,Te.tlbrToXywh)(A),$={page:{x:V.x,y:V.y},client:{x:V.x,y:V.y},timeStamp:p.now()},X=Rt.coordsToEvent($);G=function(rt,st,it,tt,ht){var lt=rt.interactions.new({pointerType:"reflow"}),gt={interaction:lt,event:ht,pointer:ht,eventTarget:it,phase:"reflow"};lt.interactable=st,lt.element=it,lt.prevEvent=ht,lt.updatePointer(ht,ht,it,!0),Rt.setZeroCoords(lt.coords.delta),(0,Cr.copyAction)(lt.prepared,tt),lt._doPhase(gt);var ct=rt.window.Promise,mt=ct?new ct(function(Gt){lt._reflowResolve=Gt}):void 0;return lt._reflowPromise=mt,lt.start(tt,st,it),lt._interacting?(lt.move(gt),lt.end(ht)):(lt.stop(),lt._reflowResolve()),lt.removePointer(ht,ht),mt}(p,l,P,c,X)}x&&x.push(G)},O=0;O<S.length&&E()!=="break";O++);return x&&y.all(x).then(function(){return l})}(this,s,t)}}Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.default=void 0,Jr.install=Za;var Qa={id:"reflow",install:Za,listeners:{"interactions:stop":function(t,i){var s=t.interaction;s.pointerType==="reflow"&&(s._reflowResolve&&s._reflowResolve(),re.remove(i.interactions.list,s))}}},aa=Qa;Jr.default=aa;var kr={exports:{}};function Ci(t){return Ci=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},Ci(t)}Object.defineProperty(kr.exports,"__esModule",{value:!0}),kr.exports.default=void 0,bt.default.use(Pr.default),bt.default.use(On.default),bt.default.use(Hn.default),bt.default.use(Tr.default),bt.default.use(Fn.default),bt.default.use(Li.default),bt.default.use(Xt.default),bt.default.use(Ur.default),bt.default.use(Jr.default);var sa=bt.default;if(kr.exports.default=sa,Ci(kr)==="object"&&kr)try{kr.exports=bt.default}catch(t){}bt.default.default=bt.default,Xt.default,Ur.default,Li.default,Pr.default,ci.default,Tr.default,bt.default,Fn.default,On.default,Hn.default,Jr.default,kr=kr.exports;var g={exports:{}};function m(t){return m=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},m(t)}Object.defineProperty(g.exports,"__esModule",{value:!0}),g.exports.default=void 0;var d=kr.default;if(g.exports.default=d,m(g)==="object"&&g)try{g.exports=kr.default}catch(t){}return kr.default.default=kr.default,g.exports})},57849:function(Ao,lr,At){"use strict";At.d(lr,{ZP:function(){return lf}});function Z(e,r){for(var n=e.length,o=0;o<n;++o)if(r(e[o],o))return!0;return!1}function Kt(e,r){for(var n=e.length,o=0;o<n;++o)if(r(e[o],o))return e[o];return null}function nr(e){var r=e;if(typeof r=="undefined"){if(typeof navigator=="undefined"||!navigator)return"";r=navigator.userAgent||""}return r.toLowerCase()}function nt(e,r){try{return new RegExp(e,"g").exec(r)}catch(n){return null}}function hr(){if(typeof navigator=="undefined"||!navigator||!navigator.userAgentData)return!1;var e=navigator.userAgentData,r=e.brands||e.uaList;return!!(r&&r.length)}function ir(e,r){var n=nt("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",r);return n?n[3]:""}function jt(e){return e.replace(/_/g,".")}function et(e,r){var n=null,o="-1";return Z(e,function(a){var u=nt("("+a.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return!u||a.brand?!1:(n=a,o=u[3]||"-1",a.versionAlias?o=a.versionAlias:a.versionTest&&(o=ir(a.versionTest.toLowerCase(),r)||o),o=jt(o),!0)}),{preset:n,version:o}}function Wt(e,r){var n={brand:"",version:"-1"};return Z(e,function(o){var a=Ut(r,o);return a?(n.brand=o.id,n.version=o.versionAlias||a.version,n.version!=="-1"):!1}),n}function Ut(e,r){return Kt(e,function(n){var o=n.brand;return nt(""+r.test,o.toLowerCase())})}var ur=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],Oe=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],Q=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],Ce=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],je=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Lr(e){return!!et(Ce,e).preset}function Ti(e){var r=nr(e),n=!!/mobi/g.exec(r),o={name:"unknown",version:"-1",majorVersion:-1,webview:Lr(r),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},a={name:"unknown",version:"-1",majorVersion:-1},u=et(ur,r),f=u.preset,v=u.version,h=et(je,r),b=h.preset,C=h.version,_=et(Oe,r);if(o.chromium=!!_.preset,o.chromiumVersion=_.version,!o.chromium){var w=et(Q,r);o.webkit=!!w.preset,o.webkitVersion=w.version}return b&&(a.name=b.id,a.version=C,a.majorVersion=parseInt(C,10)),f&&(o.name=f.id,o.version=v,o.webview&&a.name==="ios"&&o.name!=="safari"&&(o.webview=!1)),o.majorVersion=parseInt(o.version,10),{browser:o,os:a,isMobile:n,isHints:!1}}function ge(e){var r=navigator.userAgentData,n=(r.uaList||r.brands).slice(),o=e&&e.fullVersionList,a=r.mobile||!1,u=n[0],f=(e&&e.platform||r.platform||navigator.platform).toLowerCase(),v={name:u.brand,version:u.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!Wt(Ce,n).brand||Lr(nr())},h={name:"unknown",version:"-1",majorVersion:-1};v.webkit=!v.chromium&&Z(Q,function(T){return Ut(n,T)});var b=Wt(Oe,n);if(v.chromium=!!b.brand,v.chromiumVersion=b.version,!v.chromium){var C=Wt(Q,n);v.webkit=!!C.brand,v.webkitVersion=C.version}var _=Kt(je,function(T){return new RegExp(""+T.test,"g").exec(f)});if(h.name=_?_.id:"",e&&(h.version=e.platformVersion),o&&o.length){var w=Wt(ur,o);v.name=w.brand||v.name,v.version=w.version||v.version}else{var R=Wt(ur,n);v.name=R.brand||v.name,v.version=R.brand&&e?e.uaFullVersion:R.version}return v.webkit&&(h.name=a?"ios":"mac"),h.name==="ios"&&v.webview&&(v.version="-1"),h.version=jt(h.version),v.version=jt(v.version),h.majorVersion=parseInt(h.version,10),v.majorVersion=parseInt(v.version,10),{browser:v,os:h,isMobile:a,isHints:!0}}function Or(e){return hr()?navigator.userAgentData.getHighEntropyValues(["architecture","model","platform","platformVersion","uaFullVersion","fullVersionList"]).then(function(r){var n=ge(r);return e&&e(n),n}):(e&&e(ko()),typeof Promise=="undefined"||!Promise?null:Promise.resolve(ko()))}function ko(e){return typeof e=="undefined"&&hr()?ge():Ti(e)}var Tt=ko,Ze=At(12397),Ei="rgb",xn="rgba",fa="hsl",da="hsla",zs=[Ei,xn,fa,da],It="function",Te="property",rs="array",ns="object",oi="string",Mi="number",Oi="undefined",wn=typeof window!==Oi,Cn=typeof document!==Oi&&document,Rt=null,is=function(e){if(!Cn)return"";var r=(Cn.body||Cn.documentElement).style,n=Rt.length;if(typeof r[e]!==Oi)return e;for(var o=0;o<n;++o){var a="-"+Rt[o]+"-"+e;if(typeof r[a]!==Oi)return a}return""},Lo=null,As=null,ks=null,va=null,ha=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],me=1e-7,Ls=1/me,Ii={cm:function(e){return e*96/2.54},mm:function(e){return e*96/254},in:function(e){return e*96},pt:function(e){return e*96/72},pc:function(e){return e*96/6},"%":function(e,r){return e*r/100},vw:function(e,r){return r===void 0&&(r=window.innerWidth),e/100*r},vh:function(e,r){return r===void 0&&(r=window.innerHeight),e/100*r},vmax:function(e,r){return r===void 0&&(r=Math.max(window.innerWidth,window.innerHeight)),e/100*r},vmin:function(e,r){return r===void 0&&(r=Math.min(window.innerWidth,window.innerHeight)),e/100*r}};/*! *****************************************************************************
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 pa(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var o=Array(e),a=0,r=0;r<n;r++)for(var u=arguments[r],f=0,v=u.length;f<v;f++,a++)o[a]=u[f];return o}function re(e,r,n,o){return(e*o+r*n)/(n+o)}function Pi(e){return typeof e===Oi}function pr(e){return e&&typeof e===ns}function le(e){return Array.isArray(e)}function Le(e){return typeof e===oi}function Go(e){return typeof e===Mi}function no(e){return typeof e===It}function os(e,r){var n=e===""||e==" ",o=r===""||r==" ";return o&&n||e===r}function an(e,r,n,o,a){var u=ai(e,r,n);return u?n:Di(e,r,n+1,o,a)}function ai(e,r,n){if(!e.ignore)return null;var o=r.slice(Math.max(n-3,0),n+3).join("");return new RegExp(e.ignore).exec(o)}function Di(e,r,n,o,a){for(var u=function(b){var C=r[b].trim();if(C===e.close&&!ai(e,r,b))return{value:b};var _=b,w=wr(a,function(R){var T=R.open;return T===C});if(w&&(_=an(w,r,b,o,a)),_===-1)return f=b,"break";b=_,f=b},f,v=n;v<o;++v){var h=u(v);if(v=f,typeof h=="object")return h.value;if(h==="break")break}return-1}function Wo(e,r){var n=Le(r)?{separator:r}:r,o=n.separator,a=o===void 0?",":o,u=n.isSeparateFirst,f=n.isSeparateOnlyOpenClose,v=n.isSeparateOpenClose,h=v===void 0?f:v,b=n.openCloseCharacters,C=b===void 0?ha:b,_=C.map(function(F){var U=F.open,j=F.close;return U===j?U:U+"|"+j}).join("|"),w="(\\s*"+a+"\\s*|"+_+"|\\s+)",R=new RegExp(w,"g"),T=e.split(R).filter(function(F){return F&&F!=="undefined"}),M=T.length,I=[],D=[];function z(){return D.length?(I.push(D.join("")),D=[],!0):!1}for(var W=function(F){var U=T[F].trim(),j=F,q=wr(C,function(J){var ot=J.open;return ot===U}),Y=wr(C,function(J){var ot=J.close;return ot===U});if(q){if(j=an(q,T,F,M,C),j!==-1&&h)return z()&&u||(I.push(T.slice(F,j+1).join("")),F=j,u)?(k=F,"break"):(k=F,"continue")}else if(Y&&!ai(Y,T,F)){var K=pa(C);return K.splice(C.indexOf(Y),1),{value:Wo(e,{separator:a,isSeparateFirst:u,isSeparateOnlyOpenClose:f,isSeparateOpenClose:h,openCloseCharacters:K})}}else if(os(U,a)&&!f)return z(),u?(k=F,"break"):(k=F,"continue");j===-1&&(j=M-1),D.push(T.slice(F,j+1).join("")),F=j,k=F},k,H=0;H<M;++H){var L=W(H);if(H=k,typeof L=="object")return L.value;if(L==="break")break}return D.length&&I.push(D.join("")),I}function gr(e){return Wo(e,"")}function Gr(e){return Wo(e,",")}function Ne(e){var r=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!r||r.length<4?{}:{prefix:r[1],value:r[2],suffix:r[3]}}function si(e){var r=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!r)return{prefix:"",unit:"",value:NaN};var n=r[1],o=r[2],a=r[3];return{prefix:n,unit:a,value:parseFloat(o)}}function ga(e){return e.replace(/[\s-_]+([^\s-_])/g,function(r,n){return n.toUpperCase()})}function io(e,r){return r===void 0&&(r="-"),e.replace(/([a-z])([A-Z])/g,function(n,o,a){return""+o+r+a.toLowerCase()})}function as(e){return[].slice.call(e)}function zi(){return Date.now?Date.now():new Date().getTime()}function mr(e,r,n){n===void 0&&(n=-1);for(var o=e.length,a=0;a<o;++a)if(r(e[a],a,e))return a;return n}function li(e,r,n){n===void 0&&(n=-1);for(var o=e.length,a=o-1;a>=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<h||u<b?(a=h,u=b):(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 n<o&&o-n<Math.PI||n>o&&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<e;++n)r.push(n);return r}function Cr(e,r,n){var o=!1;return e.replace(r,function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];return o?a[0]:(o=!0,Le(n)?n:n.apply(void 0,a))})}function oo(e){return e.reduce(function(r,n){return r.concat(n)},[])}function Sa(e){return e.reduce(function(r,n){return le(n)?r.push.apply(r,Sa(n)):r.push(n),r},[])}function ss(e,r){e.indexOf(r)===-1&&e.push(r)}function ls(e){return e.replace("#","")}function sn(e){var r=ls(e),n=parseInt(r.substring(0,2),16),o=parseInt(r.substring(2,4),16),a=parseInt(r.substring(4,6),16),u=parseInt(r.substring(6,8),16)/255;return isNaN(u)&&(u=1),[n,o,a,u]}function ao(e){var r=e.charAt(1),n=e.charAt(2),o=e.charAt(3),a=e.charAt(4),u=["#",r,r,n,n,o,o,a,a];return u.join("")}function Gs(e){var r,n=e[0],o=e[1],a=e[2];n<0&&(n+=Math.floor((Math.abs(n)+360)/360)*360),n%=360;var u=(1-Math.abs(2*a-1))*o,f=u*(1-Math.abs(n/60%2-1)),v=a-u/2,h;return n<60?h=[u,f,0]:n<120?h=[f,u,0]:n<180?h=[0,u,f]:n<240?h=[0,f,u]:n<300?h=[f,0,u]:n<360?h=[u,0,f]:h=[0,0,0],[Math.round((h[0]+v)*255),Math.round((h[1]+v)*255),Math.round((h[2]+v)*255),(r=e[3])!==null&&r!==void 0?r:1]}function ba(e){if(e.charAt(0)==="#")return e.length===4||e.length===5?sn(ao(e)):sn(e);if(e.indexOf("(")!==-1){var r=Ne(e),n=r.prefix,o=r.value;if(!n||!o)return;var a=Gr(o),u=[0,0,0,1],f=a.length;switch(n){case Ei:case xn:for(var v=0;v<f;++v)u[v]=parseFloat(a[v]);return u;case fa:case da:for(var v=0;v<f;++v)a[v].indexOf("%")!==-1?u[v]=parseFloat(a[v])/100:u[v]=parseFloat(a[v]);return Gs(u)}}}function _a(e,r){return Cn?r?Cn.querySelectorAll(e):Cn.querySelector(e):r?[]:null}function Ie(e,r){return e.classList?e.classList.contains(r):!!e.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))}function xa(e,r){e.classList?e.classList.add(r):e.className+=" "+r}function No(e,r){if(e.classList)e.classList.remove(r);else{var n=new RegExp("(\\s|^)"+r+"(\\s|$)");e.className=e.className.replace(n," ")}}function Ws(e,r){if(!e||!r||!r.length)return{};var n;if(e instanceof Element)n=e;else if(e.length)n=e[0];else return{};for(var o={},a=window.getComputedStyle(n),u=r.length,f=0;f<u;++f)o[r[f]]=a[r[f]];return o}function yr(e,r,n,o){e.addEventListener(r,n,o)}function fr(e,r,n,o){e.removeEventListener(r,n,o)}function ki(e,r,n,o,a,u){for(var f=0;f<a;++f){var v=n+f*a,h=o+f*a;e[v]+=e[h]*u,r[v]+=r[h]*u}}function us(e,r,n,o,a){for(var u=0;u<a;++u){var f=n+u*a,v=o+u*a,h=e[f],b=r[f];e[f]=e[v],e[v]=h,r[f]=r[v],r[v]=b}}function so(e,r,n,o,a){for(var u=0;u<o;++u){var f=n+u*o;e[f]/=a,r[f]/=a}}function ln(e,r,n){n===void 0&&(n=Math.sqrt(e.length));for(var o=e.slice(),a=0;a<n;++a)o[a*n+r-1]=0,o[(r-1)*n+a]=0;return o[(r-1)*(n+1)]=1,o}function Rr(e,r){r===void 0&&(r=Math.sqrt(e.length));for(var n=e.slice(),o=ye(r),a=0;a<r;++a){var u=r*a+a;if(!Lt(n[u],me)){for(var f=a+1;f<r;++f)if(n[r*a+f]){us(n,o,a,f,r);break}}if(!Lt(n[u],me))return[];so(n,o,a,r,n[u]);for(var f=0;f<r;++f){var v=f,h=f+a*r,b=n[h];!Lt(b,me)||a===f||ki(n,o,v,a,r,-b)}}return o}function cs(e,r){r===void 0&&(r=Math.sqrt(e.length));for(var n=[],o=0;o<r;++o)for(var a=0;a<r;++a)n[a*r+o]=e[r*o+a];return n}function Li(e,r){r===void 0&&(r=Math.sqrt(e.length));for(var n=[],o=e[r*r-1],a=0;a<r-1;++a)n[a]=e[r*(r-1)+a]/o;return n[r-1]=0,n}function Fs(e,r){for(var n=ye(r),o=0;o<r-1;++o)n[r*(r-1)+o]=e[o]||0;return n}function Pr(e,r){for(var n=e.slice(),o=e.length;o<r-1;++o)n[o]=0;return n[r-1]=1,n}function un(e,r,n){if(r===void 0&&(r=Math.sqrt(e.length)),r===n)return e;for(var o=ye(n),a=Math.min(r,n),u=0;u<a-1;++u){for(var f=0;f<a-1;++f)o[u*n+f]=e[u*r+f];o[(u+1)*n-1]=e[(u+1)*r-1],o[(n-1)*n+u]=e[(r-1)*r+u]}return o[n*n-1]=e[r*r-1],o}function wa(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=ye(e);return r.forEach(function(a){o=ce(o,a,e)}),o}function ce(e,r,n){n===void 0&&(n=Math.sqrt(e.length));var o=[],a=e.length/n,u=r.length/a;if(a){if(!u)return e}else return r;for(var f=0;f<n;++f)for(var v=0;v<u;++v){o[v*n+f]=0;for(var h=0;h<a;++h)o[v*n+f]+=e[h*n+f]*r[v*a+h]}return o}function Yt(e,r){for(var n=Math.min(e.length,r.length),o=e.slice(),a=0;a<n;++a)o[a]=o[a]+r[a];return o}function Et(e,r){for(var n=Math.min(e.length,r.length),o=e.slice(),a=0;a<n;++a)o[a]=o[a]-r[a];return o}function Gi(e,r){return r===void 0&&(r=e.length===6),r?[e[0],e[1],0,e[2],e[3],0,e[4],e[5],1]:e}function ci(e,r){return r===void 0&&(r=e.length===9),r?[e[0],e[1],e[3],e[4],e[6],e[7]]:e}function Qe(e,r,n){n===void 0&&(n=r.length);var o=ce(e,r,n),a=o[n-1];return o.map(function(u){return u/a})}function Nn(e,r){return ce(e,[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1],4)}function fi(e,r){return ce(e,[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1],4)}function Ca(e,r){return ce(e,fn(r,4))}function lo(e,r){var n=r[0],o=n===void 0?1:n,a=r[1],u=a===void 0?1:a,f=r[2],v=f===void 0?1:f;return ce(e,[o,0,0,0,0,u,0,0,0,0,v,0,0,0,0,1],4)}function Vn(e,r){return Qe(fn(r,3),Pr(e,3))}function cn(e,r){var n=r[0],o=n===void 0?0:n,a=r[1],u=a===void 0?0:a,f=r[2],v=f===void 0?0:f;return ce(e,[1,0,0,0,0,1,0,0,0,0,1,0,o,u,v,1],4)}function Ra(e,r){return ce(e,r,4)}function fn(e,r){var n=Math.cos(e),o=Math.sin(e),a=ye(r);return a[0]=n,a[1]=o,a[r]=-o,a[r+1]=n,a}function ye(e){for(var r=e*e,n=[],o=0;o<r;++o)n[o]=o%(e+1)?0:1;return n}function We(e,r){for(var n=ye(r),o=Math.min(e.length,r-1),a=0;a<o;++a)n[(r+1)*a]=e[a];return n}function dn(e,r){for(var n=ye(r),o=Math.min(e.length,r-1),a=0;a<o;++a)n[r*(r-1)+a]=e[a];return n}function Vo(e,r,n,o,a,u,f,v){var h=e[0],b=e[1],C=r[0],_=r[1],w=n[0],R=n[1],T=o[0],M=o[1],I=a[0],D=a[1],z=u[0],W=u[1],k=f[0],H=f[1],L=v[0],F=v[1],U=[h,0,C,0,w,0,T,0,b,0,_,0,R,0,M,0,1,0,1,0,1,0,1,0,0,h,0,C,0,w,0,T,0,b,0,_,0,R,0,M,0,1,0,1,0,1,0,1,-I*h,-D*h,-z*C,-W*C,-k*w,-H*w,-L*T,-F*T,-I*b,-D*b,-z*_,-W*_,-k*R,-H*R,-L*M,-F*M],j=Rr(U,8);if(!j.length)return[];var q=ce(j,[I,D,z,W,k,H,L,F],8);return q[8]=1,un(cs(q),3,4)}function Bs(e){return[0,1].map(function(r){return average(e.map(function(n){return n[r]}))})}function di(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mn(e){return Wi(ee(e))}function fs(e){return Mn(getComputedStyle(e).transform)}function Hs(e,r){var n=Qe(e,[r[0],r[1]||0,r[2]||0,1],4),o=n[3]||1;return[n[0]/o,n[1]/o,n[2]/o]}function ds(e,r){r===void 0&&(r=document.body);for(var n=e,o=di();n;){var a=getComputedStyle(n).transform;if(o=matrix3d(Mn(a),o),n===r)break;n=n.parentElement}return o=invert(o,4),o[12]=0,o[13]=0,o[14]=0,o}function Wi(e){var r=di();return e.forEach(function(n){var o=n.matrixFunction,a=n.functionValue;!o||(r=o(r,a))}),r}function ee(e){var r=le(e)?e:gr(e);return r.map(function(n){var o=Ne(n),a=o.prefix,u=o.value,f=null,v=a,h="";if(a==="translate"||a==="translateX"||a==="translate3d"){var b=Gr(u).map(function(q){return parseFloat(q)}),C=b[0],_=b[1],w=_===void 0?0:_,R=b[2],T=R===void 0?0:R;f=cn,h=[C,w,T]}else if(a==="translateY"){var w=parseFloat(u);f=cn,h=[0,w,0]}else if(a==="translateZ"){var T=parseFloat(u);f=cn,h=[0,0,T]}else if(a==="scale"||a==="scale3d"){var M=Gr(u).map(function(q){return parseFloat(q)}),I=M[0],D=M[1],z=D===void 0?I:D,W=M[2],k=W===void 0?1:W;f=lo,h=[I,z,k]}else if(a==="scaleX"){var I=parseFloat(u);f=lo,h=[I,1,1]}else if(a==="scaleY"){var z=parseFloat(u);f=lo,h=[1,z,1]}else if(a==="scaleZ"){var k=parseFloat(u);f=lo,h=[1,1,k]}else if(a==="rotate"||a==="rotateZ"||a==="rotateX"||a==="rotateY"){var H=si(u),L=H.unit,F=H.value,U=L==="rad"?F:F*Math.PI/180;a==="rotate"||a==="rotateZ"?(v="rotateZ",f=Ca):a==="rotateX"?f=Nn:a==="rotateY"&&(f=fi),h=U}else if(a==="matrix3d")f=Ra,h=Gr(u).map(function(q){return parseFloat(q)});else if(a==="matrix"){var j=Gr(u).map(function(q){return parseFloat(q)});f=Ra,h=[j[0],j[1],0,0,j[2],j[3],0,0,0,0,1,0,j[4],j[5],0,1]}else v="";return{name:a,functionName:v,value:u,matrixFunction:f,functionValue:h}})}var Fi=function(){function e(){this.keys=[],this.values=[]}var r=e.prototype;return r.get=function(n){return this.values[this.keys.indexOf(n)]},r.set=function(n,o){var a=this.keys,u=this.values,f=a.indexOf(n),v=f===-1?a.length:f;a[v]=n,u[v]=o},e}(),Se=function(){function e(){this.object={}}var r=e.prototype;return r.get=function(n){return this.object[n]},r.set=function(n,o){this.object[n]=o},e}(),Ta=typeof Map=="function",Bi=function(){function e(){}var r=e.prototype;return r.connect=function(n,o){this.prev=n,this.next=o,n&&(n.next=this),o&&(o.prev=this)},r.disconnect=function(){var n=this.prev,o=this.next;n&&(n.next=o),o&&(o.prev=n)},r.getIndex=function(){for(var n=this,o=-1;n;)n=n.prev,++o;return o},e}();function Ea(e,r){var n=[],o=[];return e.forEach(function(a){var u=a[0],f=a[1],v=new Bi;n[u]=v,o[f]=v}),n.forEach(function(a,u){a.connect(n[u-1])}),e.filter(function(a,u){return!r[u]}).map(function(a,u){var f=a[0],v=a[1];if(f===v)return[0,0];var h=n[f],b=o[v-1],C=h.getIndex();h.disconnect(),b?h.connect(b,b.next):h.connect(void 0,n[0]);var _=h.getIndex();return[C,_]})}var vs=function(){function e(n,o,a,u,f,v,h,b){this.prevList=n,this.list=o,this.added=a,this.removed=u,this.changed=f,this.maintained=v,this.changedBeforeAdded=h,this.fixed=b}var r=e.prototype;return Object.defineProperty(r,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(r,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),r.caculateOrdered=function(){var n=Ea(this.changedBeforeAdded,this.fixed),o=this.changed,a=[];this.cacheOrdered=n.filter(function(u,f){var v=u[0],h=u[1],b=o[f],C=b[0],_=b[1];if(v!==h)return a.push([C,_]),!0}),this.cachePureChanged=a},e}();function Un(e,r,n){var o=Ta?Map:n?Se:Fi,a=n||function(z){return z},u=[],f=[],v=[],h=e.map(a),b=r.map(a),C=new o,_=new o,w=[],R=[],T={},M=[],I=0,D=0;return h.forEach(function(z,W){C.set(z,W)}),b.forEach(function(z,W){_.set(z,W)}),h.forEach(function(z,W){var k=_.get(z);typeof k=="undefined"?(++D,f.push(W)):T[k]=D}),b.forEach(function(z,W){var k=C.get(z);typeof k=="undefined"?(u.push(W),++I):(v.push([k,W]),D=T[W]||0,w.push([k-D,W-I]),R.push(W===k),k!==W&&M.push([k,W]))}),f.reverse(),new vs(e,r,u,f,M,v,w,R)}var hs=function(){function e(n,o){n===void 0&&(n=[]),this.findKeyCallback=o,this.list=[].slice.call(n)}var r=e.prototype;return r.update=function(n){var o=[].slice.call(n),a=Un(this.list,o,this.findKeyCallback);return this.list=o,a},e}(),uo=hs;/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var vi=function(e,r){return vi=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])},vi(e,r)};function Sr(e,r){vi(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Ma=typeof Map=="function"?void 0:function(){var e=0;return function(r){return r.__DIFF_KEY__||(r.__DIFF_KEY__=++e)}}(),Ee=function(e){Sr(r,e);function r(n){return n===void 0&&(n=[]),e.call(this,n,Ma)||this}return r}(uo);function ps(e,r){return Un(e,r,Ma)}var Uo=Ee;/*! *****************************************************************************
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 Xo=function(){return Xo=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},Xo.apply(this,arguments)};function On(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var o=Array(e),a=0,r=0;r<n;r++)for(var u=arguments[r],f=0,v=u.length;f<v;f++,a++)o[a]=u[f];return o}var Oa=function(){function e(){this._events={}}var r=e.prototype;return r.on=function(n,o){if(pr(n))for(var a in n)this.on(a,n[a]);else this._addEvent(n,o,{});return this},r.off=function(n,o){if(!n)this._events={};else if(pr(n))for(var a in n)this.off(a);else if(!o)this._events[n]=[];else{var u=this._events[n];if(u){var f=mr(u,function(v){return v.listener===o});f>-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;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},Wr.apply(this,arguments)};function hi(e){var r=e.container;return r===document.body?[r.scrollLeft||document.documentElement.scrollLeft,r.scrollTop||document.documentElement.scrollTop]:[r.scrollLeft,r.scrollTop]}function In(e,r){return e.addEventListener("scroll",r),function(){e.removeEventListener("scroll",r)}}function Tr(e){if(e){if(Le(e))return document.querySelector(e)}else return null;if(no(e))return e();if(e instanceof Element)return e;if("current"in e)return e.current;if("value"in e)return e.value}var Yo=function(e){gs(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o._startRect=null,o._startPos=[],o._prevTime=0,o._timer=0,o._prevScrollPos=[0,0],o._isWait=!1,o._flag=!1,o._currentOptions=null,o._lock=!1,o._unregister=null,o._onScroll=function(){var a=o._currentOptions;o._lock||!a||o.emit("scrollDrag",{next:function(u){o.checkScroll({container:a.container,inputEvent:u})}})},o}var n=r.prototype;return n.dragStart=function(o,a){var u=Tr(a.container);if(!u){this._flag=!1;return}var f=0,v=0,h=0,b=0;if(u===document.body)h=window.innerWidth,b=window.innerHeight;else{var C=u.getBoundingClientRect();f=C.top,v=C.left,h=C.width,b=C.height}this._flag=!0,this._startPos=[o.clientX,o.clientY],this._startRect={top:f,left:v,width:h,height:b},this._prevScrollPos=this._getScrollPosition([0,0],a),this._currentOptions=a,this._registerScrollEvent(a)},n.drag=function(o,a){if(clearTimeout(this._timer),!!this._flag){var u=o.clientX,f=o.clientY,v=a.threshold,h=v===void 0?0:v,b=this,C=b._startRect,_=b._startPos;this._currentOptions=a;var w=[0,0];return C.top>f-h?(_[1]>C.top||f<_[1])&&(w[1]=-1):C.top+C.height<f+h&&(_[1]<C.top+C.height||f>_[1])&&(w[1]=1),C.left>u-h?(_[0]>C.left||u<_[0])&&(w[0]=-1):C.left+C.width<u+h&&(_[0]<C.left+C.width||u>_[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;r<n;r++)e+=arguments[r].length;for(var o=Array(e),a=0,r=0;r<n;r++)for(var u=arguments[r],f=0,v=u.length;f<v;f++,a++)o[a]=u[f];return o}function Ve(e){return Lt(e,me)}function Ia(e,r){return e.every(function(n,o){return Ve(n-r[o])===0})}function qo(e,r){return!Ve(e[0]-r[0])&&!Ve(e[1]-r[1])}function $o(e){return e.reduce(function(r,n){return r.push.apply(r,n),r},[])}function Ko(e){return e.length<3?0:Math.abs(ui(e.map(function(r,n){var o=e[n+1]||e[0];return r[0]*o[1]-o[0]*r[1]})))/2}function Xn(e,r){var n=r.width,o=r.height,a=r.left,u=r.top,f=Yn(e),v=f.minX,h=f.minY,b=f.maxX,C=f.maxY,_=n/(b-v),w=o/(C-h);return e.map(function(R){return[a+(R[0]-v)*_,u+(R[1]-h)*w]})}function Yn(e){var r=e.map(function(o){return o[0]}),n=e.map(function(o){return o[1]});return{minX:Math.min.apply(Math,r),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,r),maxY:Math.max.apply(Math,n)}}function vn(e,r,n){var o=e[0],a=e[1],u=Yn(r),f=u.minX,v=u.maxX,h=[[f,a],[v,a]],b=Dr(h[0],h[1]),C=zr(r),_=[];if(C.forEach(function(T){var M=Dr(T[0],T[1]),I=T[0];if(Ia(b,M))_.push({pos:e,line:T,type:"line"});else{var D=ji(Yr(b,M),[h,T]);D.forEach(function(z){T.some(function(W){return qo(W,z)})?_.push({pos:z,line:T,type:"point"}):Ve(I[1]-a)!==0&&_.push({pos:z,line:T,type:"intersection"})})}}),!n&&wr(_,function(T){return T[0]===o}))return!0;var w=0,R={};return _.forEach(function(T){var M=T.pos,I=T.type,D=T.line;if(!(M[0]>o))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)<me&&(f=0),Math.abs(v)<me&&(v=0);var h=0,b=0,C=0;return f?v?(h=-v/f,b=1,C=-h*n-o):(b=1,C=-o):v&&(h=-1,C=n),[h,b,C]}function Yr(e,r){var n=e[0],o=e[1],a=e[2],u=r[0],f=r[1],v=r[2],h=n===0&&u===0,b=o===0&&f===0,C=[];if(h&&b)return[];if(h){var _=-a/o,w=-v/f;return _!==w?[]:[[-Infinity,_],[Infinity,_]]}else if(b){var R=-a/n,T=-v/u;return R!==T?[]:[[R,-Infinity],[R,Infinity]]}else if(n===0){var M=-a/o,I=-(f*M+v)/u;C=[[I,M]]}else if(u===0){var M=-v/f,I=-(o*M+a)/n;C=[[I,M]]}else if(o===0){var I=-a/n,M=-(u*I+v)/f;C=[[I,M]]}else if(f===0){var I=-v/u,M=-(n*I+a)/o;C=[[I,M]]}else{var I=(o*v-f*a)/(f*n-o*u),M=-(n*I+a)/o;C=[[I,M]]}return C.map(function(D){return[D[0],D[1]]})}function qn(e,r,n){var o=Yr(Dr(e[0],e[1]),Dr(r[0],r[1]));return n?ji(o,[e,r]):o}function vo(e,r){var n=Dr(r[0],r[1]);return Ve(fo(n,e))===0}function ji(e,r){var n=r.map(function(_){return[0,1].map(function(w){return[Math.min(_[0][w],_[1][w]),Math.max(_[0][w],_[1][w])]})}),o=[];if(e.length===2){var a=e[0],u=a[0],f=a[1];if(Ve(u-e[1][0])){if(!Ve(f-e[1][1])){var b=Math.max.apply(Math,n.map(function(_){return _[0][0]})),C=Math.min.apply(Math,n.map(function(_){return _[0][1]}));if(Ve(b-C)>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<u;++b){var C=h(b);if(C==="break")break}return o}function go(e,r){return po(e,Xr(r).reverse())}function js(e,r){if(!r.length)return[Xr(e)];var n=Zo(e,r),o=[e];return n.forEach(function(a){var u=Xr(a).reverse();o=$o(o.map(function(f){var v=po(f,u),h=v[0];if(v.length===1&&u.every(function(w){return h.indexOf(w)===-1})){var b=h[h.length-1],C=Xr(u).sort(function(w,R){return getDist(b,w)-getDist(b,R)})[0],_=u.indexOf(C);h.push.apply(h,Xr(u.slice(_),u.slice(0,_),[u[_],b]))}return v}))}),o}function mo(e,r){var n=Ni(e,r);return Ko(n)}var Ue=At(67294);/*! *****************************************************************************
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 Qo=function(e,r){return Qo=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])},Qo(e,r)};function Ns(e,r){Qo(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Me=function(){return Me=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},Me.apply(this,arguments)};function Vs(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 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<r;++o)n.push(So(e[o]));return n}function So(e){return{clientX:e.clientX,clientY:e.clientY}}function bo(e,r){r===void 0&&(r=e.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},o=0;o<r;++o){var a=e[o];n.originalClientX+="originalClientX"in a?a.originalClientX:a.clientX,n.originalClientY+="originalClientY"in a?a.originalClientY:a.clientY,n.clientX+=a.clientX,n.clientY+=a.clientY}return r?{clientX:n.clientX/r,clientY:n.clientY/r,originalClientX:n.originalClientX/r,originalClientY:n.originalClientY/r}:n}var Da=function(){function e(r){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=r,this.prevClients=r,this.length=r.length}return e.prototype.getAngle=function(r){return r===void 0&&(r=this.prevClients),Pn(r)},e.prototype.getRotation=function(r){return r===void 0&&(r=this.prevClients),Pn(r)-Pn(this.startClients)},e.prototype.getPosition=function(r,n){r===void 0&&(r=this.prevClients);var o=$n(r||this.prevClients,this.prevClients,this.startClients),a=o.deltaX,u=o.deltaY;return this.movement+=Math.sqrt(a*a+u*u),this.prevClients=r,o},e.prototype.getPositions=function(r){r===void 0&&(r=this.prevClients);var n=this.prevClients;return this.startClients.map(function(o,a){return $n([r[a]],[n[a]],[o])})},e.prototype.getMovement=function(r){var n=this.movement;if(!r)return n;var o=bo(r,this.length),a=bo(this.prevClients,this.length),u=o.clientX-a.clientX,f=o.clientY-a.clientY;return Math.sqrt(u*u+f*f)+n},e.prototype.getDistance=function(r){return r===void 0&&(r=this.prevClients),yo(r)},e.prototype.getScale=function(r){return r===void 0&&(r=this.prevClients),yo(r)/yo(this.startClients)},e.prototype.move=function(r,n){this.startClients.forEach(function(o){o.clientX-=r,o.clientY-=n}),this.prevClients.forEach(function(o){o.clientX-=r,o.clientY-=n})},e}(),Jo=["textarea","input"],Us=function(e){Ns(r,e);function r(n,o){o===void 0&&(o={});var a=e.call(this)||this;a.options={},a.flag=!1,a.pinchFlag=!1,a.data={},a.isDrag=!1,a.isPinch=!1,a.isMouse=!1,a.isTouch=!1,a.clientStores=[],a.targets=[],a.prevTime=0,a.doubleFlag=!1,a._dragFlag=!1,a._isTrusted=!1,a._isMouseEvent=!1,a._isSecondaryButton=!1,a._preventMouseEvent=!1,a._prevInputEvent=null,a._isDragAPI=!1,a._isIdle=!0,a.onDragStart=function(_,w){if(w===void 0&&(w=!0),!(!a.flag&&_.cancelable===!1)){var R=_.type.indexOf("drag")>=-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<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},mi.apply(this,arguments)};function Ui(e,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n}var yi=function(e){Kn(r,e);function r(){var o=e!==null&&e.apply(this,arguments)||this;return o.injectResult=null,o.tag="div",o}var n=r.prototype;return n.render=function(){var o=this.props,a=o.className,u=a===void 0?"":a,f=o.cspNonce,v=o.portalContainer,h=Ui(o,["className","cspNonce","portalContainer"]),b=this.injector.className,C=this.tag,_={};return(Ue.version||"").indexOf("simple")>-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<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},N.apply(this,arguments)};function Ga(e,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n}function Wa(e,r,n,o){var a=arguments.length,u=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(e,r,n,o);else for(var v=e.length-1;v>=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<a;o++)(u||!(o in r))&&(u||(u=Array.prototype.slice.call(r,0,o)),u[o]=r[o]);return e.concat(u||Array.prototype.slice.call(r))}function Zn(e,r){return N({events:[],props:[],name:e},r)}var Fa=["n","w","s","e"],Xi=["n","w","s","e","nw","ne","sw","se"];function Ln(e,r){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(32*e,'px" height="').concat(32*e,'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate(').concat(r,'deg);transform-origin: 16px 16px"></path></svg>')}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.index<a}).length;var b=Oo(u,h),C=b.targetFunction,_=r==="rotate"?"rotateZ":r;n.beforeFunctionTexts=b.beforeFunctionTexts,n.afterFunctionTexts=b.afterFunctionTexts,n.beforeTransform=b.beforeFunctionMatrix,n.beforeTransform2=b.beforeFunctionMatrix2,n.targetTansform=b.targetFunctionMatrix,n.afterTransform=b.afterFunctionMatrix,n.afterTransform2=b.afterFunctionMatrix2,n.targetAllTransform=b.allFunctionMatrix,C.functionName===_?(n.afterFunctionTexts.splice(0,1),n.isAppendTransform=!1):f>h&&(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;r<arguments.length;r++)e[r]=arguments[r];return Ze.tI.apply(void 0,bt([Co],e,!1))}function $a(e){e()}function Mo(e){return!e||e==="none"?[1,0,0,1,0,0]:pr(e)?e:Mn(e)}function eo(e,r,n){return wa(r,dn(n,r),e,dn(n.map(function(o){return-o}),r))}function Es(e,r,n){if(r==="%"){var o=sa(e.ownerSVGElement);return o[n?"width":"height"]/100}return 1}function Ms(e){var r=Os($e(e,":before"));return r.map(function(n,o){var a=si(n),u=a.value,f=a.unit;return u*Es(e,f,o===0)})}function Hn(e){return e?e.split(" "):["0","0"]}function Os(e){return Hn(e.transformOrigin)}function Ka(e){var r=sr(e),n=r("transform");if(n&&n!=="none")return n;if("transform"in e){var o=e.transform,a=o.baseVal;if(!a)return"";var u=a.length;if(!u)return"";for(var f=[],v=function(b){var C=a[b].matrix;f.push("matrix(".concat(["a","b","c","d","e","f"].map(function(_){return C[_]}).join(", "),")"))},h=0;h<u;++h)v(h);return f.join(" ")}return""}function Jr(e,r,n,o,a){var u,f,v=e&&e.ownerDocument?e.ownerDocument:document,h=v.documentElement||v.body,b=!1,C,_;if(!e||n)C=e;else{var w=(u=e==null?void 0:e.assignedSlot)===null||u===void 0?void 0:u.parentElement,R=e.parentElement;w?(b=!0,_=R,C=w):C=R}for(var T=!1,M=e===r||C===r,I="relative",D=1,z=parseFloat(a==null?void 0:a("zoom"))||1,W=a==null?void 0:a("position");C&&C!==h;){r===C&&(M=!0);var k=sr(C),H=C.tagName.toLowerCase(),L=Ka(C),F=k("willChange"),U=parseFloat(k("zoom"))||1;if(I=k("position"),o&&U!==1){D=U;break}if(!n&&o&&z!==1&&W&&W!=="absolute"||H==="svg"||I!=="static"||L&&L!=="none"||F==="transform")break;var j=(f=e==null?void 0:e.assignedSlot)===null||f===void 0?void 0:f.parentNode,q=C.parentNode;j&&(b=!0,_=q);var Y=q;if(Y&&Y.nodeType===11){C=Y.host,T=!0,I=sr(C)("position");break}C=Y,I="relative"}return{offsetZoom:D,hasSlot:b,parentSlotElement:_,isCustomElement:T,isStatic:I==="static",isEnd:M||!C||C===h,offsetParent:C||h}}function Za(e,r){var n,o=e.tagName.toLowerCase(),a=e.offsetLeft,u=e.offsetTop,f=sr(e),v=Pi(a),h=!v,b,C;return!h&&o!=="svg"?(b=wo?Ms(e):Hn(f("transformOrigin")).map(function(_){return parseFloat(_)}),C=b.slice(),h=!0,n=m(e,b,e===r&&r.tagName.toLowerCase()==="g"),a=n[0],u=n[1],b[0]=n[2],b[1]=n[3]):(b=Hn(f("transformOrigin")).map(function(_){return parseFloat(_)}),C=b.slice()),{tagName:o,isSVG:v,hasOffset:h,offset:[a||0,u||0],origin:b,targetOrigin:C}}function Qa(e,r){var n=sr(e),o=sr(document.body),a=o("position");if(!r&&(!a||a==="static"))return[0,0];var u=parseInt(o("marginLeft"),10),f=parseInt(o("marginTop"),10);return n("position")==="absolute"&&((n("top")!=="auto"||n("bottom")!=="auto")&&(f=0),(n("left")!=="auto"||n("right")!=="auto")&&(u=0)),[u,f]}function aa(e){e.forEach(function(r){var n=r.matrix;n&&(r.matrix=un(n,3,4))})}function kr(e){for(var r=e.parentElement,n=!1;r;){var o=$e(r).transform;if(o&&o!=="none"){n=!0;break}if(r===document.body)break;r=r.parentElement}return{fixedContainer:r||document.body,hasTransform:n}}function Ci(e,r){return r===void 0&&(r=e.length>9),"".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;o<arguments.length;o++)n[o-2]=arguments[o];var a=n.length,u=n.reduce(function(v,h){return v+h[0]},0)/a,f=n.reduce(function(v,h){return v+h[1]},0)/a;return{transform:"translateZ(0px) translate(".concat(u,"px, ").concat(f,"px) rotate(").concat(e,"rad) scale(").concat(r,")")}}function O(e,r){var n=e[r];return pr(n)?N(N({},e),n):e}function P(e){var r=e&&!Pi(e.offsetWidth),n=0,o=0,a=0,u=0,f=0,v=0,h=0,b=0,C=0,_=0,w=0,R=0,T=Infinity,M=Infinity,I=Infinity,D=Infinity,z=0,W=0,k=!1;if(e)if(!r&&e.tagName.toLowerCase()!=="svg"){var H=e.getBBox();k=!0,n=H.width,o=H.height,f=n,v=o,h=n,b=o,a=n,u=o}else{var L=sr(e),F=e.style,U=L("boxSizing")==="border-box",j=parseFloat(L("borderLeftWidth"))||0,q=parseFloat(L("borderRightWidth"))||0,Y=parseFloat(L("borderTopWidth"))||0,K=parseFloat(L("borderBottomWidth"))||0,J=parseFloat(L("paddingLeft"))||0,ot=parseFloat(L("paddingRight"))||0,ut=parseFloat(L("paddingTop"))||0,vt=parseFloat(L("paddingBottom"))||0,St=J+ot,dt=ut+vt,ft=j+q,at=Y+K,_t=St+ft,Mt=dt+at,Ot=L("position"),Ft=0,wt=0;if("clientLeft"in e){var xt=null;if(Ot==="absolute"){var Bt=Jr(e,document.body);xt=Bt.offsetParent}else xt=e.parentElement;if(xt){var Nt=sr(xt);Ft=parseFloat(Nt("width")),wt=parseFloat(Nt("height"))}}C=Math.max(St,Xt(L("minWidth"),Ft)||0),_=Math.max(dt,Xt(L("minHeight"),wt)||0),T=Xt(L("maxWidth"),Ft),M=Xt(L("maxHeight"),wt),isNaN(T)&&(T=Infinity),isNaN(M)&&(M=Infinity),z=Xt(F.width,0)||0,W=Xt(F.height,0)||0,f=parseFloat(L("width"))||0,v=parseFloat(L("height"))||0,h=Math.abs(f-z)<1?ya(C,z||f,T):f,b=Math.abs(v-W)<1?ya(_,W||v,M):v,n=h,o=b,a=h,u=b,U?(I=T,D=M,w=C,R=_,h=n-_t,b=o-Mt):(I=T+_t,D=M+Mt,w=C+_t,R=_+Mt,n=h+_t,o=b+Mt),a=h+St,u=b+dt}return{svg:k,offsetWidth:n,offsetHeight:o,clientWidth:a,clientHeight:u,contentWidth:h,contentHeight:b,inlineCSSWidth:z,inlineCSSHeight:W,cssWidth:f,cssHeight:v,minWidth:C,minHeight:_,maxWidth:T,maxHeight:M,minOffsetWidth:w,minOffsetHeight:R,maxOffsetWidth:I,maxOffsetHeight:D}}function A(e,r){return Ge(r>0?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<arguments.length;r++)e[r]=arguments[r];for(var n=e.length-1,o=0;o<n;++o){var a=e[o];if(!Pi(a))return a}return e[n]}function Xe(e,r){var n=[],o=[];return e.forEach(function(a,u){var f=r(a,u,e),v=o.indexOf(f),h=n[v]||[];v===-1&&(o.push(f),n.push(h)),h.push(a)}),n}function tr(e,r){var n=[],o={};return e.forEach(function(a,u){var f=r(a,u,e),v=o[f];v||(v=[],o[f]=v,n.push(v)),v.push(a)}),n}function er(e){return e.reduce(function(r,n){return r.concat(n)},[])}function De(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.sort(function(n,o){return Math.abs(o)-Math.abs(n)}),e[0]}function ze(e,r,n){return Qe(Rr(e,n),Pr(r,n),n)}function fe(e,r){var n,o=e.is3d,a=e.rootMatrix,u=o?4:3;return n=ze(a,[r.distX,r.distY],u),r.distX=n[0],r.distY=n[1],r}function tn(e,r,n,o,a){return Et(d(e,Yt(n,r),a),o)}function _r(e,r,n){return n?"".concat(e/r*100,"%"):"".concat(e,"px")}function en(e){return Math.abs(e)<=Je?0:e}function Ri(e){return function(r){if(!r.isDragging(e))return"";var n=to(r,e),o=n.deg;return o?Ct("view-control-rotation".concat(o)):""}}function jn(e,r){return r===void 0&&(r=[e]),function(n,o){if(o.isRequest)return r.some(function(u){return o.requestAble===u})?o.parentDirection:!1;var a=o.inputEvent.target;return Ie(a,Ct("direction"))&&(!e||Ie(a,Ct(e)))}}function Oo(e,r){var n=e.slice(0,r<0?void 0:r),o=e.slice(0,r<0?void 0:r+1),a=e[r]||"",u=r<0?[]:e.slice(r),f=r<0?[]:e.slice(r+1),v=ee(n),h=ee(o),b=ee([a]),C=ee(u),_=ee(f),w=Wi(v),R=Wi(h),T=Wi(C),M=Wi(_),I=ce(w,T,4);return{transforms:e,beforeFunctionMatrix:w,beforeFunctionMatrix2:R,targetFunctionMatrix:Wi(b),afterFunctionMatrix:T,afterFunctionMatrix2:M,allFunctionMatrix:I,beforeFunctions:v,beforeFunctions2:h,targetFunction:b[0],afterFunctions:C,afterFunctions2:_,beforeFunctionTexts:n,beforeFunctionTexts2:o,targetFunctionText:a,afterFunctionTexts:u,afterFunctionTexts2:f}}function Zt(e){return!e||!pr(e)||e instanceof Element?!1:le(e)||"length"in e}function yt(e,r){return e?e instanceof Element?e:Le(e)?r?document.querySelector(e):e:no(e)?e():"current"in e?e.current:e:null}function Pt(e,r){if(!e)return[];var n=Zt(e)?[].slice.call(e):[e];return n.reduce(function(o,a){return Le(a)&&r?bt(bt([],o,!0),[].slice.call(document.querySelectorAll(a)),!0):(le(a)?o.push(Pt(a,r)):o.push(yt(a,r)),o)},[])}function Ht(e,r,n){var o=Ge(e,r)/Math.PI*180;return o=n>=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||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)<me&&(o=0),Math.abs(a)<me&&(a=0);var u=0,f=0,v=0;return o?a?(u=-a/o,f=1,v=u*r[0]-r[1]):(f=1,v=-r[1]):(u=-1,v=r[0]),[u,f,v].map(function(h){return Lt(h,me)})}function Xs(e,r,n,o){var a=e.props,u=xe(o,a.snapThreshold,5);return Ml(e.state.guidelines,r,n,u)}function Ml(e,r,n,o){return{vertical:Il(e,"vertical",r,o),horizontal:Il(e,"horizontal",n,o)}}function Hu(e,r,n){var o=n[0],a=n[1],u=r[0],f=r[1],v=Et(n,r),h=v[0],b=v[1],C=b>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||n<Je?1:o<Je?-1:n-o}function Ys(e,r){return e.slice().sort(function(n,o){var a=n.sign[r],u=o.sign[r],f=n.offset[r],v=o.offset[r];if(a){if(!u)return-1}else return 1;return Pl({isBound:n.isBound,isSnap:n.isSnap,offset:f},{isBound:o.isBound,isSnap:o.isSnap,offset:v})})[0]}function Nu(e,r,n){var o=[];if(n)Math.abs(r[0])!==1||Math.abs(r[1])!==1?o.push([r,[-1,-1]],[r,[-1,1]],[r,[1,-1]],[r,[1,1]]):o.push([r,[e[0],-e[1]]],[r,[-e[0],e[1]]]),o.push([r,e]);else if(e[0]&&e[1]||!e[0]&&!e[1]){var a=e[0]?e:[1,1];[1,-1].forEach(function(f){[1,-1].forEach(function(v){var h=[f*a[0],v*a[1]];r[0]===h[0]&&r[1]===h[1]||o.push([r,h])})})}else if(e[0]){var u=Math.abs(r[0])===1?[1]:[1,-1];u.forEach(function(f){o.push([[r[0],-1],[f*e[0],-1]],[[r[0],0],[f*e[0],0]],[[r[0],1],[f*e[0],1]])})}else if(e[1]){var u=Math.abs(r[1])===1?[1]:[1,-1];u.forEach(function(v){o.push([[-1,r[1]],[-1,v*e[1]]],[[0,r[1]],[0,v*e[1]]],[[1,r[1]],[1,v*e[1]]])})}return o}function Dl(e,r){var n=Ai([r[0][0],r[1][0]]),o=Ai([r[0][1],r[1][1]]);return{vertical:n<=e[0],horizontal:o<=e[1]}}function al(e,r){var n=r[0],o=r[1],a=o[0]-n[0],u=o[1]-n[1];Math.abs(a)<Je&&(a=0),Math.abs(u)<Je&&(u=0);var f,v;if(!a)f=n[0],v=e[0];else if(!u)f=n[1],v=e[1];else{var h=u/a;f=h*(e[0]-n[0])+n[1],v=e[1]}return f-v}function zl(e,r,n,o){return o===void 0&&(o=Je),e.every(function(a){var u=al(a,r),f=u<=0;return f===n||Math.abs(u)<=o})}function Al(e,r,n,o,a){return a===void 0&&(a=0),o&&r-a<=e||!o&&e<=n+a?{isBound:!0,offset:o?r-e:n-e}:{isBound:!1,offset:0}}function Vu(e,r){var n=r.line,o=r.centerSign,a=r.verticalSign,u=r.horizontalSign,f=r.lineConstants,v=e.props.innerBounds;if(!v)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var h=v.left,b=v.top,C=v.width,_=v.height,w=[[h,b],[h,b+_]],R=[[h,b],[h+C,b]],T=[[h+C,b],[h+C,b+_]],M=[[h,b+_],[h+C,b+_]];if(zl([[h,b],[h+C,b],[h,b+_],[h+C,b+_]],n,o))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var I=Io(n,f,R,a),D=Io(n,f,M,a),z=Io(n,f,w,u),W=Io(n,f,T,u),k=I.isBound&&D.isBound,H=I.isBound||D.isBound,L=z.isBound&&W.isBound,F=z.isBound||W.isBound,U=De(I.offset,D.offset),j=De(z.offset,W.offset),q=[0,0],Y=!1,K=!1;return Math.abs(j)<Math.abs(U)?(q=[U,0],Y=H,K=k):(q=[0,j],Y=F,K=L),{isAllBound:K,isVerticalBound:H,isHorizontalBound:F,isBound:Y,offset:q}}function Io(e,r,n,o,a,u){var f=r[0],v=r[1],h=e[0],b=n[0],C=n[1],_=en(C[1]-b[1]),w=en(C[0]-b[0]),R=v,T=f,M=-f/v;if(w){if(!_){if(u&&!R)return{isBound:!1,offset:0};if(T){var W=(b[1]-h[1])/M+h[0];return Al(W,b[0],C[0],o,a)}else{var D=b[1]-h[1],z=Math.abs(D)<=(a||0);return{isBound:z,offset:z?D:0}}}}else{if(u&&!T)return{isBound:!1,offset:0};if(R){var I=M*(b[0]-h[0])+h[1];return Al(I,b[1],C[1],o,a)}else{var D=b[0]-h[0],z=Math.abs(D)<=(a||0);return{isBound:z,offset:z?D:0}}}return{isBound:!1,offset:0}}function kl(e,r,n){return r.map(function(o){var a=Vu(e,o),u=a.isBound,f=a.offset,v=a.isVerticalBound,h=a.isHorizontalBound,b=o.multiple,C=Kr({datas:n,distX:f[0],distY:f[1]}).map(function(_,w){return _*(b[w]?2/b[w]:0)});return{sign:b,isBound:u,isVerticalBound:v,isHorizontalBound:h,isSnap:!1,offset:C}})}function Uu(e,r,n){var o,a=sl(e,r,[0,0],!1).map(function(w){return N(N({},w),{multiple:w.multiple.map(function(R){return Math.abs(R)*2})})}),u=kl(e,a,n),f=Ys(u,0),v=Ys(u,1),h=0,b=0,C=f.isVerticalBound||v.isVerticalBound,_=f.isHorizontalBound||v.isHorizontalBound;return(C||_)&&(o=Rs({datas:n,distX:-f.offset[0],distY:-v.offset[1]}),h=o[0],b=o[1]),{vertical:{isBound:C,offset:h},horizontal:{isBound:_,offset:b}}}function Xu(e,r){var n=[],o=e[0],a=e[1];return o&&a?n.push([[0,a*2],e,[-o,a]],[[o*2,0],e,[o,-a]]):o?(n.push([[o*2,0],[o,1],[o,-1]]),r&&n.push([[0,-1],[o,-1],[-o,-1]],[[0,1],[o,1],[-o,1]])):a?(n.push([[0,a*2],[1,a],[-1,a]]),r&&n.push([[-1,0],[-1,a],[-1,-a]],[[1,0],[1,a],[1,-a]])):n.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),n}function sl(e,r,n,o){var a=e.state,u=a.allMatrix,f=a.is3d,v=t(u,100,100,f?4:3),h=pe(v,[0,0]);return Xu(n,o).map(function(b){var C=b[0],_=b[1],w=b[2],R=[pe(v,_),pe(v,w)],T=Bu(R),M=Dl(h,R),I=M.vertical,D=M.horizontal,z=al(h,R)<=0;return{multiple:C,centerSign:z,verticalSign:I,horizontalSign:D,lineConstants:T,line:[pe(r,_),pe(r,w)]}})}function Ll(e,r,n,o){var a=o?e.map(function(u){return Vn(u,o)}):e;return[[a[0],a[1]],[a[1],a[3]],[a[3],a[2]],[a[2],a[0]]].some(function(u){var f=al(n,u)<=0;return!zl(r,u,f)})}function Yu(e){var r=e[0],n=e[1],o=n[0]-r[0],a=n[1]-r[1];if(!o)return Math.abs(r[0]);if(!a)return Math.abs(r[1]);var u=a/o;return Math.abs((-u*r[0]+r[1])/Math.sqrt(Math.pow(u,2)+1))}function qu(e){var r=e[0],n=e[1],o=n[0]-r[0],a=n[1]-r[1];if(!o)return[r[0],0];if(!a)return[0,r[1]];var u=a/o,f=-u*r[0]+r[1];return[-f/(u+1/u),f/(u*u+1)]}function $u(e,r,n,o,a){var u=e.props.innerBounds,f=a*Math.PI/180;if(!u)return[];var v=u.left,h=u.top,b=u.width,C=u.height,_=v-o[0],w=v+b-o[0],R=h-o[1],T=h+C-o[1],M=[[_,R],[w,R],[_,T],[w,T]],I=pe(n,[0,0]);if(!Ll(n,M,I,0))return[];var D=[],z=M.map(function(W){return[S(W),Ge([0,0],W)]});return[[n[0],n[1]],[n[1],n[3]],[n[3],n[2]],[n[2],n[0]]].forEach(function(W){var k=Ge([0,0],qu(W)),H=Yu(W);D.push.apply(D,z.filter(function(L){var F=L[0];return F&&H<=F}).map(function(L){var F=L[0],U=L[1],j=Math.acos(F?H/F:0),q=U+j,Y=U-j;return[f+q-k,f+Y-k]}).reduce(function(L,F){return L.push.apply(L,F),L},[]).filter(function(L){return!Ll(r,M,I,L)}).map(function(L){return Lt(L*180/Math.PI,Je)}))}),D}function Ku(e){var r=e.props.innerBounds;if(!r)return{vertical:[],horizontal:[]};var n=e.getRect(),o=n.pos1,a=n.pos2,u=n.pos3,f=n.pos4,v=[o,a,u,f],h=pe(v,[0,0]),b=r.left,C=r.top,_=r.width,w=r.height,R=[[b,C],[b,C+w]],T=[[b,C],[b+_,C]],M=[[b+_,C],[b+_,C+w]],I=[[b,C+w],[b+_,C+w]],D=sl(e,v,[0,0],!1),z=[],W=[],k={top:!1,bottom:!1,left:!1,right:!1};return D.forEach(function(H){var L=H.line,F=H.lineConstants,U=Dl(h,L),j=U.horizontal,q=U.vertical,Y=Io(L,F,T,q,1,!0),K=Io(L,F,I,q,1,!0),J=Io(L,F,R,j,1,!0),ot=Io(L,F,M,j,1,!0);Y.isBound&&!k.top&&(z.push(C),k.top=!0),K.isBound&&!k.bottom&&(z.push(C+w),k.bottom=!0),J.isBound&&!k.left&&(W.push(b),k.left=!0),ot.isBound&&!k.right&&(W.push(b+_),k.right=!0)}),{horizontal:z,vertical:W}}function ll(e,r,n){var o=e||{},a=o.position,u=a===void 0?"client":a,f=o.left,v=f===void 0?-Infinity:f,h=o.top,b=h===void 0?-Infinity:h,C=o.right,_=C===void 0?Infinity:C,w=o.bottom,R=w===void 0?Infinity:w,T={position:u,left:v,top:b,right:_,bottom:R};return{vertical:Gl(T,r,!0),horizontal:Gl(T,n,!1)}}function qs(e,r){var n=e.state,o=n.containerClientRect,a=o.clientHeight,u=o.clientWidth,f=o.clientLeft,v=o.clientTop,h=n.snapOffset,b=h.left,C=h.top,_=h.right,w=h.bottom,R=r||e.props.bounds||{},T=R.position||"client",M=T==="css",I=R.left,D=I===void 0?-Infinity:I,z=R.top,W=z===void 0?-Infinity:z,k=R.right,H=k===void 0?M?-Infinity:Infinity:k,L=R.bottom,F=L===void 0?M?-Infinity:Infinity:L;return M&&(H=u+_-b-H,F=a+w-C-F),{left:D+b-f,right:H+b-f,top:W+C-v,bottom:F+C-v}}function Zu(e,r,n){var o=qs(e),a=o.left,u=o.top,f=o.right,v=o.bottom,h=n[0],b=n[1],C=Et(n,r),_=C[0],w=C[1];Math.abs(_)<Je&&(_=0),Math.abs(w)<Je&&(w=0);var R=w>0,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?v<b&&(I.pos=v,I.offset=b-v):u>b&&(I.pos=u,I.offset=b-u);else if(w===0)T?f<h&&(M.pos=f,M.offset=h-f):a>h&&(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&&(W<u||W>v)&&(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<f&&v.push({isBound:!0,offset:f-a,pos:a}),v.length||v.push({isBound:!1,offset:0,pos:0}),v.sort(function(h,b){return Math.abs(b.offset)-Math.abs(h.offset)})}function Wl(e,r,n){var o=n?e.map(function(a){return Vn(a,n)}):e;return o.some(function(a){return a[0]<r.left&&Math.abs(a[0]-r.left)>.1||a[0]>r.right&&Math.abs(a[0]-r.right)>.1||a[1]<r.top&&Math.abs(a[1]-r.top)>.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]<v)C.push(R);else if(h<D[f.start])_.push(R);else if(D[f.start]<=v&&h<=D[f.end]&&o){var z=R.pos,W={element:I,rect:N(N({},D),(T={},T[f.end]=D[f.start],T))},k={element:I,rect:N(N({},D),(M={},M[f.start]=D[f.end],M))},H=[0,0],L=[0,0];H[a]=z[a],H[u]=z[u],L[a]=z[a],L[u]=z[u]+R.size,C.push({type:e,pos:H,size:0,elementRect:W}),_.push({type:e,pos:L,size:0,elementRect:k})}}),C.sort(function(R,T){return T.pos[u]-R.pos[u]}),_.sort(function(R,T){return R.pos[u]-T.pos[u]}),{total:b,start:C,end:_,inner:w}})}function rc(e,r,n,o,a){var u=e.props.isDisplayInnerSnapDigit,f=[];return["vertical","horizontal"].forEach(function(v){var h=r.filter(function(I){return I.type===v}),b=v==="vertical"?1:0,C=b?0:1,_=ec(v,h,o,u),w=b?He:ke,R=b?ke:He,T=o[w.start],M=o[w.end];_.forEach(function(I){var D=I.total,z=I.start,W=I.end,k=I.inner,H=n[C]+D[0].pos[C]-o[R.start],L=o;z.forEach(function(F){var U=F.elementRect.rect,j=L[w.start]-U[w.end];if(j>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]<w)j[h]+=F[C.end]-w;else if(R<F[C.start])j[h]+=F[C.start]-w-D;else return;j[b]+=H-T,u.push(Is(e,h?"vertical":"horizontal","gap",u.length,D,j,U,a))})})}),u}function ic(e,r,n,o){var a=r[0]-e[0],u=r[1]-e[1];if(Math.abs(a)<me&&(a=0),Math.abs(u)<me&&(u=0),!a)return o?[0,0]:[0,n];if(!u)return o?[n,0]:[0,0];var f=u/a,v=e[1]-f*e[0];if(o){var h=f*(r[0]+n)+v;return[n,h-r[1]]}else{var b=(r[1]+n-v)/f;return[b-r[0],n]}}function cl(e,r,n,o,a){var u=ic(e,r,n,o);if(!u)return{isOutside:!1,offset:[0,0]};var f=cr(e,r),v=cr(u,e),h=cr(u,r),b=v>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)<Math.abs(_)){var z=Math.abs(_)/Math.abs(R);R*=z,T*=z}else if(Math.abs(T)>me&&Math.abs(T)<Math.abs(w)){var z=Math.abs(w)/Math.abs(T);R*=z,T*=z}else R=De(-_,R),T=De(-w,T)}}else R=u||v?-_:0,T=f||h?-w:0;return[R,T]}function ac(e,r,n,o,a,u){if(!Hr(e,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var f=it(u.absolutePoses,[r,n]),v=i(f),h=v.left,b=v.right,C=v.top,_=v.bottom,w={horizontal:f.map(function(ot){return ot[1]}),vertical:f.map(function(ot){return ot[0]})},R=ii(e.props.snapDirections),T=la(R,{left:h,right:b,top:C,bottom:_,center:(h+b)/2,middle:(C+_)/2}),M=Ks(e,a,T,w),I=M.vertical,D=M.horizontal,z=Uu(e,f,u),W=z.vertical,k=z.horizontal,H=I.isSnap,L=D.isSnap,F=I.isBound||W.isBound,U=D.isBound||k.isBound,j=De(I.offset,W.offset),q=De(D.offset,k.offset),Y=oc(o,[r,n],[F,U],[H,L],[j,q]),K=Y[0],J=Y[1];return[{isBound:F,isSnap:H,offset:K},{isBound:U,isSnap:L,offset:J}]}function Ks(e,r,n,o){o===void 0&&(o=n);var a=ll(qs(e),o.vertical,o.horizontal),u=a.horizontal,f=a.vertical,v=r?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Xs(e,n.vertical,n.horizontal),h=v.horizontal,b=v.vertical,C=$s(u[0],h),_=$s(f[0],b),w=Math.abs(C),R=Math.abs(_);return{horizontal:{isBound:u[0].isBound,isSnap:h.isSnap,snapIndex:h.index,offset:C,dist:w,bounds:u,snap:h},vertical:{isBound:f[0].isBound,isSnap:b.isSnap,snapIndex:b.index,offset:_,dist:R,bounds:f,snap:b}}}function Hl(e,r,n,o,a){var u=ll(r,n,o),f=u.horizontal,v=u.vertical,h=Ml(e,n,o,a),b=h.horizontal,C=h.vertical,_=$s(f[0],b),w=$s(v[0],C),R=Math.abs(_),T=Math.abs(w);return{horizontal:{isBound:f[0].isBound,isSnap:b.isSnap,snapIndex:b.index,offset:_,dist:R,bounds:f,snap:b},vertical:{isBound:v[0].isBound,isSnap:C.isSnap,snapIndex:C.index,offset:w,dist:T,bounds:v,snap:C}}}function sc(e,r,n,o){var a=Ge(e,r)/Math.PI*180,u=n.vertical,f=u.isBound,v=u.isSnap,h=u.dist,b=n.horizontal,C=b.isBound,_=b.isSnap,w=b.dist,R=a%180,T=R<3||R>177,M=R>87&&R<93;return w<h&&(f||v&&!M&&(!o||!T))?"vertical":C||_&&!T&&(!o||!M)?"horizontal":""}function lc(e,r,n,o,a,u){return n.map(function(f){var v=f[0],h=f[1],b=pe(r,v),C=pe(r,h),_=o?uc(e,b,C,a):Ks(e,a,{vertical:[C[0]],horizontal:[C[1]]}),w=_.horizontal,R=w.offset,T=w.isBound,M=w.isSnap,I=_.vertical,D=I.offset,z=I.isBound,W=I.isSnap,k=Et(h,v);if(!D&&!R)return{isBound:z||T,isSnap:W||M,sign:k,offset:[0,0]};var H=sc(b,C,_,o);if(!H)return{sign:k,isBound:!1,isSnap:!1,offset:[0,0]};var L=H==="vertical",F=[0,0];return!o&&Math.abs(h[0])===1&&Math.abs(h[1])===1&&v[0]!==h[0]&&v[1]!==h[1]?F=Kr({datas:u,distX:-D,distY:-R}):F=cl(b,C,-(L?D:R),L,u).offset,F=F.map(function(U,j){return U*(k[j]?2/k[j]:0)}),{sign:k,isBound:L?z:T,isSnap:L?W:M,offset:F}})}function jl(e,r){return e.isBound?e.offset:r.isSnap?r.offset:0}function uc(e,r,n,o){var a=Zu(e,r,n),u=a.horizontal,f=a.vertical,v=o?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:Hu(e,r,n),h=v.horizontal,b=v.vertical,C=jl(u,h),_=jl(f,b),w=Math.abs(C),R=Math.abs(_);return{horizontal:{isBound:u.isBound,isSnap:h.isSnap,offset:C,dist:w},vertical:{isBound:f.isBound,isSnap:b.isSnap,offset:_,dist:R}}}function cc(e,r,n,o,a){var u=[-n[0],-n[1]],f=e.state,v=f.width,h=f.height,b=e.props.bounds,C=Infinity,_=Infinity;if(b){var w=[[n[0],-n[1]],[-n[0],n[1]]],R=b.left,T=R===void 0?-Infinity:R,M=b.top,I=M===void 0?-Infinity:M,D=b.right,z=D===void 0?Infinity:D,W=b.bottom,k=W===void 0?Infinity:W;w.forEach(function(H){var L=H[0]!==u[0],F=H[1]!==u[1],U=pe(r,H),j=Ge(o,U)*360/Math.PI;if(F){var q=U.slice();(Math.abs(j-360)<2||Math.abs(j-180)<2)&&(q[1]=o[1]);var Y=cl(o,q,(o[1]<U[1]?k:I)-U[1],!1,a),K=Y.offset,J=K[1],ot=Y.isOutside;isNaN(J)||(_=h+(ot?1:-1)*Math.abs(J))}if(L){var q=U.slice();(Math.abs(j-90)<2||Math.abs(j-270)<2)&&(q[0]=o[0]);var ut=cl(o,q,(o[0]<U[0]?z:T)-U[0],!0,a),vt=ut.offset[0],St=ut.isOutside;isNaN(vt)||(C=v+(St?1:-1)*Math.abs(vt))}})}return{maxWidth:C,maxHeight:_}}function fl(e){var r=e.state,n=r.containerClientRect,o=r.hasFixed,a=n.overflow,u=n.scrollHeight,f=n.scrollWidth,v=n.clientHeight,h=n.clientWidth,b=n.clientLeft,C=n.clientTop,_=e.props,w=_.snapGap,R=w===void 0?!0:w,T=_.verticalGuidelines,M=_.horizontalGuidelines,I=_.snapThreshold,D=I===void 0?5:I,z=_.snapGridWidth,W=z===void 0?0:z,k=_.snapGridHeight,H=k===void 0?0:k,L=_.maxSnapElementGuidelineDistance,F=L===void 0?Infinity:L,U=i(tt(e.state)),j=U.top,q=U.left,Y=U.bottom,K=U.right,J={top:j,left:q,bottom:Y,right:K,center:(q+K)/2,middle:(j+Y)/2},ot=vc(e),ut=bt([],ot,!0);R&&ut.push.apply(ut,fc(e,J,D));var vt=N({},r.snapOffset||{left:0,top:0,bottom:0,right:0});if(ut.push.apply(ut,dc(W,H,a?f:h,a?u:v,b,C,vt)),o){var St=n.left,dt=n.top;vt.left+=St,vt.top+=dt,vt.right+=St,vt.bottom+=dt}return ut.push.apply(ut,Ul(M||!1,T||!1,a?f:h,a?u:v,b,C,vt)),ut=ut.filter(function(ft){var at=ft.element,_t=ft.elementRect,Mt=ft.type;if(!at||!_t)return!0;var Ot=_t.rect;return Nl(J,Ot,Mt,F)}),ut}function fc(e,r,n){var o=e.props,a=o.maxSnapElementGuidelineDistance,u=a===void 0?Infinity:a,f=o.maxSnapElementGapDistance,v=f===void 0?Infinity:f,h=e.state.elementRects,b=[];return[["vertical",ke,He],["horizontal",He,ke]].forEach(function(C){var _=C[0],w=C[1],R=C[2],T=r[w.start],M=r[w.end],I=r[w.center],D=r[R.start],z=r[R.end];function W(L){var F=L.rect;return F[w.end]<T+n?T-F[w.end]:M-n<F[w.start]?F[w.start]-M:-1}var k=h.filter(function(L){var F=L.rect;return F[R.start]>z||F[R.end]<D?!1:W(L)>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(K<J&&ot<T+n){if(St=!0,ut=J-K,vt=ot+ut,Math.abs(vt-T)>n)return}else if(K<J&&M-n<Y){if(ft=!0,ut=J-K,vt=Y-ut,Math.abs(vt-M)>n)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?H<L:z||!D&&H<L;F?W=n*k/o:k=o*W/n}C+=W,_+=k}if(a[0]&&a[1]){var U=cc(e,h,a,u,v),j=U.maxWidth,q=U.maxHeight,Y=gc(e,r(C,_).map(function(ot){return ot.map(function(ut){return Lt(ut,Ar)})}),n+C,o+_,j,q,a,f,v),W=Y[0],k=Y[1];C+=W,_+=k}return[C,_]}function mc(e,r,n){if(!Hr(e,"rotatable"))return{isSnap:!1,rotation:n};var o=r.pos1,a=r.pos2,u=r.pos3,f=r.pos4,v=r.origin,h=n*Math.PI/180,b=[o,a,u,f].map(function(R){return Et(R,v)}),C=b.map(function(R){return Vn(R,h)}),_=bt(bt([],Ju(e,b,C,v,n),!0),$u(e,b,C,v,n),!0);_.sort(function(R,T){return Math.abs(R-n)-Math.abs(T-n)});var w=_.length>0;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;v<arguments.length;v++)f[v-6]=arguments[v];var h=Ge(n,o),b=r?Lt(h/Math.PI*180,15)%180:-1;return e.createElement("div",{key:"line-".concat(u),className:Ct.apply(void 0,bt(["line","direction",r?"edge":"",r],f,!1)),"data-rotation":b,"data-line-key":u,"data-direction":r,style:x(n,o,a,h)})}function Ql(e,r,n,o,a){var u=n===!0?Fa:n;return u.map(function(f,v){var h=_i[f],b=h[0],C=h[1];if(C!=null)return Ps(e,f,o[b],o[C],a,"".concat(r,"Edge").concat(v),r)}).filter(Boolean)}function Jl(e){return function(r,n){var o=O(r.props,e).edge;return o&&(o===!0||o.length)?bt(bt([],Ql(n,e,o,r.getState().renderPoses,r.props.zoom),!0),wc(r,e,n),!0):tu(r,e,n)}}function tu(e,r,n){return Zl(e,Xi,r,n)}function wc(e,r,n){return Zl(e,["nw","ne","sw","se"],r,n)}function eu(e,r,n,o){var a=e.renderState;a.renderDirectionMap||(a.renderDirectionMap={});var u=e.getState(),f=u.renderPoses,v=u.rotation,h=u.direction,b=a.renderDirectionMap,C=e.props.zoom,_=h>0?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:u<e&&u<90&&e>270&&--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<o;++a){var u=e[a];!u.sub||(u.horizontal&&(r[1]===0&&(r[0]=a),r[1]=a-r[0]+1,n[0]=a+1),u.vertical&&(n[1]===0&&(n[0]=a),n[1]=a-n[0]+1))}return{horizontalRange:r,verticalRange:n}}function hu(e,r,n,o,a,u,f){var v,h,b,C;u===void 0&&(u=[0,0]),f===void 0&&(f=!1);var _=e.indexOf("/"),w=(_>-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<f[1])b=f[1]-h;else if(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]<Mt&&(I[1]=at,M[1]=Mt)})});var D=T[0],z=T[1],W=I[0],k=I[1],H=[-_,1,rl([-_,1],D)],L=[-_,1,rl([-_,1],z)],F=[-w,1,rl([-w,1],W)],U=[-w,1,rl([-w,1],k)];n=[[H,F],[H,U],[L,F],[L,U]].map(function(ft){var at=ft[0],_t=ft[1];return Yr(at,_t)[0]}),o=n[0],a=n[1],u=n[2],f=n[3],v=M[1]-M[0],h=R[1]-R[0]}else{var j=Mu(e,0),q=Mu(e,1),Y=Eu(e,0),K=Eu(e,1);if(o=[j,q],a=[Y,q],u=[j,K],f=[Y,K],v=Y-j,h=K-q,b%180){var J=[u,o,f,a];o=J[0],a=J[1],u=J[2],f=J[3],v=K-q,h=Y-j}}if(b%360>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}}}]);