@accounter/client
Version:
Accounter client application
7 lines • 221 kB
JavaScript
import{a as e,n as t,o as n,r,s as i,t as a}from"./dist-BbgEzppd.js";import{i as o,o as s}from"./utils-BUNz070n.js";import{Ar as c,Bn as l,E as u,Ja as d,Mn as f,Wi as p,Ya as m,r as h,t as g,vn as _}from"./error-handling-AQOG1RNy.js";import{n as v,t as y}from"./dist-CgECp_RN.js";import{a as b,r as x,s as S}from"./routes-BXbESQBe.js";import{c as C,d as w,dt as ee,f as te,gt as ne,ht as re,o as ie,p as ae,s as oe,u as se,ut as ce}from"./select-6mBYg_R6.js";import{At as le,Ft as ue,G as de,I as fe,It as pe,Lr as me,N as he,Nt as ge,Ot as _e,Pt as ve,Qt as ye,Rr as be,Vt as xe,bt as Se,gn as Ce,jr as we,jt as Te,kt as Ee,q as De,vt as Oe,yr as ke,zt as Ae}from"./common-Cy-x5Vhe.js";import{t as je}from"./arrow-up-down-C39PJhum.js";import{b as Me,c as Ne,d as Pe,f as Fe,i as Ie,l as Le,o as Re,p as ze,s as Be,u as Ve}from"./separator-EFzchRgs.js";import{t as He}from"./funnel-BvwoBZ0O.js";import{t as Ue}from"./pencil-C7tx8CH2.js";import{t as T}from"./button-CBTN3XMQ.js";import{X as We,a as Ge,at as Ke,c as qe,f as Je,h as Ye,i as Xe,m as Ze,n as Qe,o as $e,p as et,r as tt,s as nt,t as rt,u as it,v as at}from"./table-tK8pMUMS.js";import{n as ot,t as st}from"./Typography-B60sj84M.js";import{t as ct}from"./MultiSelect-CaeZsH-J.js";import{F as lt,b as ut,w as dt,y as ft}from"./index-B8E5XsZe.js";import{t as pt}from"./use-url-query-BZOFfgST.js";import{t as mt}from"./business-extended-info-Csuv6Ydx.js";var ht=ne(`cloud-cog`,[[`path`,{d:`m10.852 19.772-.383.924`,key:`r7sl7d`}],[`path`,{d:`m13.148 14.228.383-.923`,key:`1d5zpm`}],[`path`,{d:`M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1ydik7`}],[`path`,{d:`m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1m1vsf`}],[`path`,{d:`m14.772 15.852.923-.383`,key:`660p6e`}],[`path`,{d:`m14.772 18.148.923.383`,key:`hrcpis`}],[`path`,{d:`M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2`,key:`j2q98n`}],[`path`,{d:`m9.228 15.852-.923-.383`,key:`1p9ong`}],[`path`,{d:`m9.228 18.148-.923.383`,key:`6558rz`}]]),gt=ne(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),_t=ne(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),vt=ne(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),yt=ne(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),E=i(s(),1),bt=(0,E.createContext)({dragDropManager:void 0});function D(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var xt=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),St=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},Ct={INIT:`@@redux/INIT`+St(),REPLACE:`@@redux/REPLACE`+St(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+St()}};function wt(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Tt(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(D(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(D(1));return n(Tt)(e,t)}if(typeof e!=`function`)throw Error(D(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(D(3));return a}function d(e){if(typeof e!=`function`)throw Error(D(4));if(c)throw Error(D(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(D(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!wt(e))throw Error(D(7));if(e.type===void 0)throw Error(D(8));if(c)throw Error(D(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(D(10));i=e,f({type:Ct.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(D(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[xt]=function(){return this},e}return f({type:Ct.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[xt]=m,r}a();function O(e,t,...n){if(Et()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function Et(){return t!==void 0&&!0}function Dt(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function Ot(e,t){return e.filter(e=>e!==t)}function kt(e){return typeof e==`object`}function At(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function jt(e,t){return e.filter(e=>t.indexOf(e)>-1)}var Mt=`dnd-core/INIT_COORDS`,Nt=`dnd-core/BEGIN_DRAG`,Pt=`dnd-core/PUBLISH_DRAG_SOURCE`,Ft=`dnd-core/HOVER`,It=`dnd-core/DROP`,Lt=`dnd-core/END_DRAG`;function Rt(e,t){return{type:Mt,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var zt={type:Mt,payload:{clientOffset:null,sourceClientOffset:null}};function Bt(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Rt(i)),Vt(t,o,s);let c=Wt(t,o);if(c==null){e.dispatch(zt);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);Ht(a),l=a(c)}e.dispatch(Rt(i,l));let u=s.getSource(c).beginDrag(o,c);if(u!=null)return Ut(u),s.pinSource(c),{type:Nt,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}}}}function Vt(e,t,n){O(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){O(n.getSource(e),`Expected sourceIds to be registered.`)})}function Ht(e){O(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Ut(e){O(kt(e),`Item must be an object.`)}function Wt(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Gt(e,t,n[t])})}return e}function qt(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Jt(n),Zt(n).forEach((i,a)=>{let o={type:It,payload:{dropResult:Kt({},t,Yt(i,a,r,n))}};e.dispatch(o)})}}function Jt(e){O(e.isDragging(),`Cannot call drop while not dragging.`),O(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Yt(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Xt(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Xt(e){O(e===void 0||kt(e),`Drop result must either be an object or undefined.`)}function Zt(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Qt(e){return function(){let t=e.getMonitor(),n=e.getRegistry();$t(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:Lt}}}function $t(e){O(e.isDragging(),`Cannot call endDrag while not dragging.`)}function en(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function tn(e){return function(t,{clientOffset:n}={}){nn(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return an(r,a,i.getItemType()),rn(r,i,a),on(r,i,a),{type:Ft,payload:{targetIds:r,clientOffset:n||null}}}}function nn(e){O(Array.isArray(e),`Expected targetIds to be an array.`)}function rn(e,t,n){O(t.isDragging(),`Cannot call hover while not dragging.`),O(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];O(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),O(n.getTarget(r),`Expected targetIds to be registered.`)}}function an(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];en(t.getTargetType(i),n)||e.splice(r,1)}}function on(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function sn(e){return function(){if(e.getMonitor().isDragging())return{type:Pt}}}function cn(e){return{beginDrag:Bt(e),publishDragSource:sn(e),hover:tn(e),drop:qt(e),endDrag:Qt(e)}}var ln=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=cn(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function un(e,t){return{x:e.x+t.x,y:e.y+t.y}}function dn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fn(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:dn(un(t,r),n)}function pn(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:dn(t,n)}var mn=[],hn=[];mn.__IS_NONE__=!0,hn.__IS_ALL__=!0;function gn(e,t){return e===mn?!1:e===hn||t===void 0?!0:jt(t,e).length>0}var _n=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;O(typeof e==`function`,`listener must be a function.`),O(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!gn(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){O(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return O(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return O(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:en(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return O(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!en(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return fn(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return pn(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}};v();var vn=y===void 0?self:y,yn=vn.MutationObserver||vn.WebKitMutationObserver;function bn(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function xn(e){let t=1,n=new yn(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var Sn=typeof yn==`function`?xn:bn,Cn=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Sn(this.flush),this.requestErrorThrow=bn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},wn=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},Tn=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new wn(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},En=new Cn,Dn=new Tn(En.registerPendingError);function On(e){En.enqueueTask(Dn.create(e))}var kn=`dnd-core/ADD_SOURCE`,An=`dnd-core/ADD_TARGET`,jn=`dnd-core/REMOVE_SOURCE`,Mn=`dnd-core/REMOVE_TARGET`;function Nn(e){return{type:kn,payload:{sourceId:e}}}function Pn(e){return{type:An,payload:{targetId:e}}}function Fn(e){return{type:jn,payload:{sourceId:e}}}function In(e){return{type:Mn,payload:{targetId:e}}}function Ln(e){O(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),O(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),O(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function Rn(e){O(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),O(typeof e.hover==`function`,`Expected hover to be a function.`),O(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function zn(e,t){if(t&&Array.isArray(e)){e.forEach(e=>zn(e,!1));return}O(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var k;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(k||={});var Bn=0;function Vn(){return Bn++}function Hn(e){let t=Vn().toString();switch(e){case k.SOURCE:return`S${t}`;case k.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Un(e){switch(e[0]){case`S`:return k.SOURCE;case`T`:return k.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function Wn(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var Gn=class{addSource(e,t){zn(e),Ln(t);let n=this.addHandler(k.SOURCE,e,t);return this.store.dispatch(Nn(n)),n}addTarget(e,t){zn(e,!0),Rn(t);let n=this.addHandler(k.TARGET,e,t);return this.store.dispatch(Pn(n)),n}containsHandler(e){return Wn(this.dragSources,e)||Wn(this.dropTargets,e)}getSource(e,t=!1){return O(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return O(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return O(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return O(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Un(e)===k.SOURCE}isTargetId(e){return Un(e)===k.TARGET}removeSource(e){O(this.getSource(e),`Expected an existing source.`),this.store.dispatch(Fn(e)),On(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){O(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(In(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);O(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){O(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Hn(e);return this.types.set(r,t),e===k.SOURCE?this.dragSources.set(r,n):e===k.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Kn=(e,t)=>e===t;function qn(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Jn(e,t,n=Kn){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Yn(e=mn,t){switch(t.type){case Ft:break;case kn:case An:case Mn:case jn:return mn;case Nt:case Pt:case Lt:case It:default:return hn}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=At(n,r);if(!(i.length>0||!Jn(n,r)))return mn;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Xn(e,t,n[t])})}return e}var Qn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $n(e=Qn,t){let{payload:n}=t;switch(t.type){case Mt:case Nt:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ft:return qn(e.clientOffset,n.clientOffset)?e:Zn({},e,{clientOffset:n.clientOffset});case Lt:case It:return Qn;default:return e}}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){er(e,t,n[t])})}return e}var nr={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function rr(e=nr,t){let{payload:n}=t;switch(t.type){case Nt:return tr({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Pt:return tr({},e,{isSourcePublic:!0});case Ft:return tr({},e,{targetIds:n.targetIds});case Mn:return e.targetIds.indexOf(n.targetId)===-1?e:tr({},e,{targetIds:Ot(e.targetIds,n.targetId)});case It:return tr({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Lt:return tr({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function ir(e=0,t){switch(t.type){case kn:case An:return e+1;case jn:case Mn:return e-1;default:return e}}function ar(e=0){return e+1}function or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){or(e,t,n[t])})}return e}function cr(e={},t){return{dirtyHandlerIds:Yn(e.dirtyHandlerIds,{type:t.type,payload:sr({},t.payload,{prevTargetIds:Dt(e,`dragOperation.targetIds`,[])})}),dragOffset:$n(e.dragOffset,t),refCount:ir(e.refCount,t),dragOperation:rr(e.dragOperation,t),stateId:ar(e.stateId)}}function lr(e,t=void 0,n={},r=!1){let i=ur(r),a=new ln(i,new _n(i,new Gn(i))),o=e(a,t,n);return a.receiveBackend(o),a}function ur(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return Tt(cr,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}v();var A=o();function dr(e,t){if(e==null)return{};var n=fr(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var pr=0,mr=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),hr=(0,E.memo)(function(e){var{children:t}=e;let[n,r]=gr(dr(e,[`children`]));return(0,E.useEffect)(()=>{if(r){let e=vr();return++pr,()=>{--pr===0&&(e[mr]=null)}}},[]),(0,A.jsx)(bt.Provider,{value:n,children:t})});function gr(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[_r(e.backend,e.context,e.options,e.debugMode),!e.context]}function _r(e,t=vr(),n,r){let i=t;return i[mr]||(i[mr]={dragDropManager:lr(e,t,n,r)}),i[mr]}function vr(){return y===void 0?window:y}var yr=r(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),br=typeof window<`u`?E.useLayoutEffect:E.useEffect,xr=i(yr(),1);function Sr(e,t,n){let[r,i]=(0,E.useState)(()=>t(e)),a=(0,E.useCallback)(()=>{let a=t(e);(0,xr.default)(r,a)||(i(a),n&&n())},[r,e,n]);return br(a),[r,a]}function Cr(e,t,n){let[r,i]=Sr(e,t,n);return br(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function wr(e,t,n){return Cr(t,e||(()=>({})),()=>n.reconnect())}function Tr(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),(0,E.useMemo)(()=>typeof e==`function`?e():e,n)}function Er(e){return(0,E.useMemo)(()=>e.hooks.dragSource(),[e])}function Dr(e){return(0,E.useMemo)(()=>e.hooks.dragPreview(),[e])}var Or=!1,kr=!1,Ar=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){O(!Or,`You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return Or=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Or=!1}}isDragging(){if(!this.sourceId)return!1;O(!kr,`You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return kr=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{kr=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},jr=!1,Mr=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;O(!jr,`You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor`);try{return jr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{jr=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function Nr(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function Pr(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function Fr(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o<a.length;o++){let c=a[o];if(!s(c))return!1;let l=e[c],u=t[c];if(i=n?n.call(r,l,u,c):void 0,i===!1||i===void 0&&l!==u)return!1}return!0}function Ir(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`current`)}function Lr(e){if(typeof e.type==`string`)return;let t=e.type.displayName||e.type.name||`the component`;throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Rr(e){return(t=null,n=null)=>{if(!(0,E.isValidElement)(t)){let r=t;return e(r,n),r}let r=t;return Lr(r),Vr(r,n?t=>e(t,n):e)}}function zr(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=Rr(r);t[n]=()=>e}}),t}function Br(e,t){typeof e==`function`?e(t):e.current=t}function Vr(e,t){let n=e.ref;return O(typeof n!=`string`,`Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs`),n?(0,E.cloneElement)(e,{ref:e=>{Br(n,e),Br(t,e)}}):(0,E.cloneElement)(e,{ref:t})}var Hr=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Fr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Fr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&=(this.dragSourceUnsubscribe(),void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=zr({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,Ir(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,Ir(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},Ur=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Fr(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=zr({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,Ir(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function Wr(){let{dragDropManager:e}=(0,E.useContext)(bt);return O(e!=null,`Expected drag drop context`),e}function Gr(e,t){let n=Wr(),r=(0,E.useMemo)(()=>new Hr(n.getBackend()),[n]);return br(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),br(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function Kr(){let e=Wr();return(0,E.useMemo)(()=>new Ar(e),[e])}var qr=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag==`function`?e.canDrag(t):!0}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};function Jr(e,t,n){let r=(0,E.useMemo)(()=>new qr(e,t,n),[t,n]);return(0,E.useEffect)(()=>{r.spec=e},[e]),r}function Yr(e){return(0,E.useMemo)(()=>{let t=e.type;return O(t!=null,`spec.type must be defined`),t},[e])}function Xr(e,t,n){let r=Wr(),i=Jr(e,t,n),a=Yr(e);br(function(){if(a!=null){let[e,o]=Pr(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Zr(e,t){let n=Tr(e,t);O(!n.begin,`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`);let r=Kr(),i=Gr(n.options,n.previewOptions);return Xr(n,r,i),[wr(n.collect,r,i),Er(i),Dr(i)]}function Qr(e){let t=Wr().getMonitor(),[n,r]=Sr(t,e);return(0,E.useEffect)(()=>t.subscribeToOffsetChange(r)),(0,E.useEffect)(()=>t.subscribeToStateChange(r)),n}function $r(e){return(0,E.useMemo)(()=>e.hooks.dropTarget(),[e])}function ei(e){let t=Wr(),n=(0,E.useMemo)(()=>new Ur(t.getBackend()),[t]);return br(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function ti(){let e=Wr();return(0,E.useMemo)(()=>new Mr(e),[e])}function ni(e){let{accept:t}=e;return(0,E.useMemo)(()=>(O(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var ri=class{canDrop(){let e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function ii(e,t){let n=(0,E.useMemo)(()=>new ri(e,t),[t]);return(0,E.useEffect)(()=>{n.spec=e},[e]),n}function ai(e,t,n){let r=Wr(),i=ii(e,t),a=ni(e);br(function(){let[e,o]=Nr(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function oi(e,t){let n=Tr(e,t),r=ti(),i=ei(n.options);return ai(n,r,i),[wr(n.collect,r,i),$r(i)]}function si(e){let t=null;return()=>(t??=e(),t)}function ci(e,t){return e.filter(e=>e!==t)}function li(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var ui=class{enter(e){let t=this.entered.length;return this.entered=li(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=ci(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},di=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},fi=e({FILE:()=>pi,HTML:()=>gi,TEXT:()=>hi,URL:()=>mi}),pi=`__NATIVE_FILE__`,mi=`__NATIVE_URL__`,hi=`__NATIVE_TEXT__`,gi=`__NATIVE_HTML__`;function _i(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var vi={[pi]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[gi]:{exposeProperties:{html:(e,t)=>_i(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[mi]:{exposeProperties:{urls:(e,t)=>_i(e,t,``).split(`
`),dataTransfer:e=>e},matchesTypes:[`Url`,`text/uri-list`]},[hi]:{exposeProperties:{text:(e,t)=>_i(e,t,``),dataTransfer:e=>e},matchesTypes:[`Text`,`text/plain`]}};function yi(e,t){let n=vi[e];if(!n)throw Error(`native type ${e} has no configuration`);let r=new di(n);return r.loadDataTransfer(t),r}function bi(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(vi).filter(e=>{let n=vi[e];return n?.matchesTypes?n.matchesTypes.some(e=>t.indexOf(e)>-1):!1})[0]||null}var xi=si(()=>/firefox/i.test(navigator.userAgent)),Si=si(()=>!!window.safari),Ci=class{interpolate(e){let{xs:t,ys:n,c1s:r,c2s:i,c3s:a}=this,o=t.length-1;if(e===t[o])return n[o];let s=0,c=a.length-1,l;for(;s<=c;){l=Math.floor(.5*(s+c));let r=t[l];if(r<e)s=l+1;else if(r>e)c=l-1;else return n[l]}o=Math.max(0,c);let u=e-t[o],d=u*u;return n[o]+r[o]*u+i[o]*d+a[o]*u*d}constructor(e,t){let{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);let i=[],a=[],o=[],s,c;for(let r=0;r<n-1;r++)s=e[r+1]-e[r],c=t[r+1]-t[r],a.push(s),i.push(c),o.push(c/s);let l=[o[0]];for(let e=0;e<a.length-1;e++){let t=o[e],n=o[e+1];if(t*n<=0)l.push(0);else{s=a[e];let r=a[e+1],i=s+r;l.push(3*i/((i+r)/t+(i+s)/n))}}l.push(o[o.length-1]);let u=[],d=[],f;for(let e=0;e<l.length-1;e++){f=o[e];let t=l[e],n=1/a[e],r=t+l[e+1]-f-f;u.push((f-t-r)*n),d.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=d}},wi=1;function Ti(e){let t=e.nodeType===wi?e:e.parentElement;if(!t)return null;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Ei(e){return{x:e.clientX,y:e.clientY}}function Di(e){return e.nodeName===`IMG`&&(xi()||!document.documentElement?.contains(e))}function Oi(e,t,n,r){let i=e?t.width:n,a=e?t.height:r;return Si()&&e&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function ki(e,t,n,r,i){let a=Di(t),o=Ti(a?e:t),s={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:l}=e,{anchorX:u,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=Oi(a,t,c,l),m=()=>{let e=new Ci([0,.5,1],[s.y,s.y/l*p,s.y+p-l]).interpolate(d);return Si()&&a&&(e+=(window.devicePixelRatio-1)*p),e},h=()=>new Ci([0,.5,1],[s.x,s.x/c*f,s.x+f-c]).interpolate(u),{offsetX:g,offsetY:_}=i,v=g===0||g,y=_===0||_;return{x:v?g:h(),y:y?_:m()}}var Ai=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<`u`)return window}get document(){if(this.globalContext?.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){return this.optionsArgs?.rootElement||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ji(e,t,n[t])})}return e}var Ni=class{profile(){return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:this.dragStartSourceIds?.length||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:this.dragOverTargetIds?.length||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw Error(`Cannot have two HTML5 backends at the same time.`);e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)==null||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);let r=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute(`draggable`,`true`),t.addEventListener(`dragstart`,r),t.addEventListener(`selectstart`,i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener(`dragstart`,r),t.removeEventListener(`selectstart`,i),t.setAttribute(`draggable`,`false`)}}connectDropTarget(e,t){let n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener(`dragenter`,n),t.addEventListener(`dragover`,r),t.addEventListener(`drop`,i),()=>{t.removeEventListener(`dragenter`,n),t.removeEventListener(`dragover`,r),t.removeEventListener(`drop`,i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener(`dragstart`,this.handleTopDragStart),e.addEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.addEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.addEventListener(`dragenter`,this.handleTopDragEnter),e.addEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.addEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.addEventListener(`dragover`,this.handleTopDragOver),e.addEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.addEventListener(`drop`,this.handleTopDrop),e.addEventListener(`drop`,this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener(`dragstart`,this.handleTopDragStart),e.removeEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.removeEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.removeEventListener(`dragenter`,this.handleTopDragEnter),e.removeEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.removeEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.removeEventListener(`dragover`,this.handleTopDragOver),e.removeEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.removeEventListener(`drop`,this.handleTopDrop),e.removeEventListener(`drop`,this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Mi({dropEffect:this.altKeyPressed?`copy`:`move`},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?`copy`:this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return Mi({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(fi).some(t=>fi[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=yi(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>this.rootElement?.addEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0),1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||=[],this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&Ti(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>!!(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{let e=this.currentDragSourceNode;e==null||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{this.hoverRafId===null&&typeof requestAnimationFrame<`u`&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<`u`&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;let{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;let n=Ei(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});let{dataTransfer:r}=e,i=bi(r);if(this.monitor.isDragging()){if(r&&typeof r.setDragImage==`function`){let e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){let{anchorX:e,anchorY:a,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),c=ki(t,i,n,{anchorX:e,anchorY:a},{offsetX:o,offsetY:s});r.setDragImage(i,c.x,c.y)}}try{r?.setData(`application/json`,{})}catch{}this.setCurrentDragSourceNode(e.target);let{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute(`draggable`)))return;else e.preventDefault()},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;let{dataTransfer:n}=e,r=bi(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{let{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:Ei(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}},this.handleTopDragOver=e=>{let{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}this.altKeyPressed=e.altKey,this.lastClientOffset=Ei(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var t;e.preventDefault(),(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}else bi(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{let{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:Ei(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{let t=e.target;typeof t.dragDrop==`function`&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new Ai(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new ui(this.isNodeInDocument)}},Pi;function Fi(){return Pi||(Pi=new Image,Pi.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),Pi}var Ii=function(e,t,n){return new Ni(e,t,n)},Li=[],Ri=function(){return Li.some(function(e){return e.activeTargets.length>0})},zi=function(){return Li.some(function(e){return e.skippedTargets.length>0})},Bi=`ResizeObserver loop completed with undelivered notifications.`,Vi=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:Bi}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=Bi),window.dispatchEvent(e)},Hi;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(Hi||={});var Ui=function(e){return Object.freeze(e)},Wi=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,Ui(this)}return e}(),Gi=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ui(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ki=function(e){return e instanceof SVGElement&&`getBBox`in e},qi=function(e){if(Ki(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},Ji=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},Yi=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},Xi=typeof window<`u`?window:{},Zi=new WeakMap,Qi=/auto|scroll/,$i=/^tb|vertical/,ea=/msie|trident/i.test(Xi.navigator&&Xi.navigator.userAgent),j=function(e){return parseFloat(e||`0`)},ta=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Wi((n?t:e)||0,(n?e:t)||0)},na=Ui({devicePixelContentBoxSize:ta(),borderBoxSize:ta(),contentBoxSize:ta(),contentRect:new Gi(0,0,0,0)}),ra=function(e,t){if(t===void 0&&(t=!1),Zi.has(e)&&!t)return Zi.get(e);if(qi(e))return Zi.set(e,na),na;var n=getComputedStyle(e),r=Ki(e)&&e.ownerSVGElement&&e.getBBox(),i=!ea&&n.boxSizing===`border-box`,a=$i.test(n.writingMode||``),o=!r&&Qi.test(n.overflowY||``),s=!r&&Qi.test(n.overflowX||``),c=r?0:j(n.paddingTop),l=r?0:j(n.paddingRight),u=r?0:j(n.paddingBottom),d=r?0:j(n.paddingLeft),f=r?0:j(n.borderTopWidth),p=r?0:j(n.borderRightWidth),m=r?0:j(n.borderBottomWidth),h=r?0:j(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,S=i?g+v:0,C=i?_+y:0,w=r?r.width:j(n.width)-S-x,ee=r?r.height:j(n.height)-C-b,te=w+g+x+v,ne=ee+_+b+y,re=Ui({devicePixelContentBoxSize:ta(Math.round(w*devicePixelRatio),Math.round(ee*devicePixelRatio),a),borderBoxSize:ta(te,ne,a),contentBoxSize:ta(w,ee,a),contentRect:new Gi(d,c,w,ee)});return Zi.set(e,re),re},ia=function(e,t,n){var r=ra(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case Hi.DEVICE_PIXEL_CONTENT_BOX:return o;case Hi.BORDER_BOX:return i;default:return a}},aa=function(){function e(e){var t=ra(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Ui([t.borderBoxSize]),this.contentBoxSize=Ui([t.contentBoxSize]),this.devicePixelContentBoxSize=Ui([t.devicePixelContentBoxSize])}return e}(),oa=function(e){if(qi(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},sa=function(){var e=1/0,t=[];Li.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new aa(t.target),i=oa(t.target);r.push(n),t.lastReportedSize=ia(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},ca=function(e){Li.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(oa(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},la=function(){var e=0;for(ca(e);Ri();)e=sa(),ca(e);return zi()&&Vi(),e>0},ua,da=[],fa=function(){return da.splice(0).forEach(function(e){return e()})},pa=function(e){if(!ua){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return fa()}).observe(n,{characterData:!0}),ua=function(){n.textContent=`${t?t--:t++}`}}da.push(e),ua()},ma=function(e){pa(function(){requestAnimationFrame(e)})},ha=0,ga=function(){return!!ha},_a=250,va={attributes:!0,characterData:!0,childList:!0,subtree:!0},ya=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],ba=function(e){return e===void 0&&(e=0),Date.now()+e},xa=!1,Sa=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=_a),!xa){xa=!0;var n=ba(e);ma(function(){var r=!1;try{r=la()}finally{if(xa=!1,e=n-ba(),!ga())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,va)};document.body?t():Xi.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ya.forEach(function(t){return Xi.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),ya.forEach(function(t){return Xi.removeEventListener(t,e.listener,!0)}),!0)},e}()),Ca=function(e){!ha&&e>0&&Sa.start(),ha+=e,!ha&&Sa.stop()},wa=function(e){return!Ki(e)&&!Yi(e)&&getComputedStyle(e).display===`inline`},Ta=function(){function e(e,t){this.target=e,this.observedBox=t||Hi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=ia(this.target,this.observedBox,!0);return wa(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ea=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),Da=new WeakMap,Oa=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ka=function(){function e(){}return e.connect=function(e,t){var n=new Ea(e,t);Da.set(e,n)},e.observe=function(e,t,n){var r=Da.get(e),i=r.observationTargets.length===0;Oa(r.observationTargets,t)<0&&(i&&Li.push(r),r.observationTargets.push(new Ta(t,n&&n.box)),Ca(1),Sa.schedule())},e.unobserve=function(e,t){var n=Da.get(e),r=Oa(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&Li.splice(Li.indexOf(n),1),n.observationTargets.splice(r,1),Ca(-1))},e.disconnect=function(e){var t=this,n=Da.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Aa=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);ka.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!Ji(e))throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);ka.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!Ji(e))throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);ka.unobserve(this,e)},e.prototype.disconnect=function(){ka.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),ja=(0,E.createContext)({});function Ma(e){let t=(0,E.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Na=(0,E.createContext)(null),Pa=(0,E.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Fa(e=!0){let t=(0,E.useContext)(Na);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,E.useId)();(0,E.useEffect)(()=>{e&&i(a)},[e]);let o=(0,E.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Ia=typeof window<`u`,La=Ia?E.useLayoutEffect:E.useEffect,M=e=>e,Ra=M,za=M;function Ba(e){let t;return()=>(t===void 0&&(t=e()),t)}var Va=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},N=e=>e*1e3,Ha=e=>e/1e3,Ua={skipAnimations:!1,useManualTiming:!1};function Wa(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Ga=[`read`,`resolveKeyframes`,`update`,`preRender`,`render`,`postRender`],Ka=40;function qa(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ga.reduce((e,t)=>(e[t]=Wa(a),e),{}),{read:s,resolveKeyframes:c,update:l,preRender:u,render:d,postRender:f}=o,p=()=>{let a=Ua.useManualTiming?i.timestamp:performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Ka),1),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Ga.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||m(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ga.length;t++)o[Ga[t]].cancel(e)},state:i,steps:o}}var{schedule:P,cancel:Ja,state:F,steps:Ya}=qa(typeof requestAnimationFrame<`u`?requestAnimationFrame:M,!0),Xa=(0,E.createContext)({strict:!1}),Za={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Qa={};for(let e in Za)Qa[e]={isEnabled:t=>Za[e].some(e=>!!t[e])};function $a(e){for(let t in e)Qa[t]={...Qa[t],...e[t]}}var eo=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function to(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||eo.has(e)}var no=e=>!to(e);function ro(e){e&&(no=t=>t.startsWith(`on`)?!to(t):e(t))}try{ro((ut(),n(ft)).default)}catch{}function io(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(no(i)||n===!0&&to(i)||!t&&!to(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function ao(e){if(typeof Proxy>`u`)return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>r===`create`?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}var oo=(0,E.createContext)({});function so(e){return typeof e==`string`||Array.isArray(e)}function co(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var lo=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],uo=[`initial`,...lo];function fo(e){return co(e.animate)||uo.some(t=>so(e[t]))}function po(e){return!!(fo(e)||e.variants)}function mo(e,t){if(fo(e)){let{initial:t,animate:n}=e;return{initial:t===!1||so(t)?t:void 0,animate:so(n)?n:void 0}}return e.inherit===!1?{}:t}function ho(e){let{initial:t,animate:n}=mo(e,(0,E.useContext)(oo));return(0,E.useMemo)(()=>({initial:t,animate:n}),[go(t),go(n)])}function go(e){return Array.isArray(e)?e.join(` `):e}var _o=Symbol.for(`motionComponentSymbol`);function vo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function yo(e,t,n){return(0,E.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):vo(n)&&(n.current=r))},[t])}var bo=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),xo=`data-`+bo(`framerAppearId`),{schedule:So,cancel:Co}=qa(queueMicrotask,!1),wo=(0,E.createContext)({});function To(e,t,n,r,i){let{visualElement:a}=(0,E.useContext)(oo),o=(0,E.useContext)(Xa),s=(0,E.useContext)(Na),c=(0,E.useContext)(Pa).reducedMotion,l=(0,E.useRef)(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,d=(0,E.useContext)(wo);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Eo(l.current,n,i,d);let f=(0,E.useRef)(!1);(0,E.useInsertionEffect)(()=>{u&&f.current&&u.update(n,s)});let p=n[xo],m=(0,E.useRef)(!!p&&!window.MotionHandoffIsComplete?.call(window,p)&&window.MotionHasOptimisedAnimation?.call(window,p));return La(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),So.render(u.render),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,E.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&=(queueMicrotask(()=>{var e;(e=window.MotionHandoffMarkAsComplete)==null||e.call(window,p)}),!1))}),u}function Eo(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Do(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&vo(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,layoutScroll:c,layoutRoot:l})}function Do(e){if(e)return e.options.allowProjection===!1?Do(e.parent):e.projection}function Oo({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&$a(e);function a(a,o){let s,c={...(0,E.useContext)(Pa),...a,layoutId:ko(a)},{isStatic:l}=c,u=ho(a),d=r(a,l);if(!l&&Ia){Ao(c,e);let n=jo(c);s=n.MeasureLayout,u.visualElement=To(i,d,c,t,n.ProjectionNode)}return(0,A.jsxs)(oo.Provider,{value:u,children:[s&&u.visualElement?(0,A.jsx)(s,{visualElement:u.visualElement,...c}):null,n(i,a,yo(d,u.visualElement,o),d,l,u.visualElement)]})}a.displayName=`motion.${typeof i==`string`?i:`create(${i.displayName??i.name??``})`}`;let o=(0,E.forwardRef)(a);return o[_o]=i,o}function ko({layoutId:e}){let t=(0,E.useContext)(ja).id;return t&&e!==void 0?t+`-`+e:e}function Ao(e,t){(0,E.useContext)(Xa).strict}function jo(e){let{drag:t,layout:n}=Qa;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var Mo=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function No(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Mo.indexOf(e)>-1||/[A-Z]/u.test(e))}function Po(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Fo(e,t,n,r){if(typeof t==`function`){let[i,a]=Po(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Po(r);t=t(n===void 0?e.custom:n,i,a)}return t}var Io=e=>Array.isArray(e),Lo=e=>!!(e&&typeof e==`object`&&e.mix&&e.toValue),Ro=e=>Io(e)?e[e.length-1]||0:e,I=e=>!!(e&&e.getVelocity);function zo(e){let t=I(e)?e.get():e;return Lo(t)?t.toValue():t}function Bo({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){let o={latestValues:Ho(r,i,a,e),renderState:t()};return n&&(o.onMount=e=>n({props:r,current:e,...o}),o.onUpdate=e=>n(e)),o}var Vo=e=>(t,n)=>{let r=(0,E.useContext)(oo),i=(0,E.useContext)(Na),a=()=>Bo(e,t,r,i);return n?a():Ma(a)};function Ho(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=zo(a[e]);let{initial:o,animate:s}=e,c=fo(e),l=po(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!co(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Fo(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Uo=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Wo=new Set(Uo),Go=e=>t=>typeof t==`string`&&t.startsWith(e),Ko=Go(`--`),qo=Go(`var(--`),Jo=e=>qo(e)?Yo.test(e.split(`/*`)[0].trim()):!1,Yo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xo=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Zo=(e,t,n)=>n>t?t:n<e?e:n,Qo={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},$o={...Qo,transform:e=>Zo(0,1,e)},es={...Qo,default:1},ts=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ns=ts(`deg`),L=ts(`%`),R=ts(`px`),rs=ts(`vh`),is=ts(`vw`),as={...L,parse:e=>L.parse(e)/100,transform:e=>L.transform(e*100)},os={borderWidth:R,borderTopWidth:R,borderRightWidth:R,borderBottomWidth:R,borderLeftWidth:R,borderRadius:R,radius:R,borderTopLeftRadius:R,borderTopRightRadius:R,borderBottomRightRadius:R,borderBottomLeftRadius:R,width:R,maxWidth:R,height:R,maxHeight:R,top:R,right:R,bottom:R,left:R,padding:R,paddingTop:R,paddingRight:R,paddingBottom:R,paddingLeft:R,margin:R,marginTop:R,marginRight:R,marginBottom:R,marginLeft:R,backgroundPositionX:R,backgroundPositionY:R},ss={rotate:ns,rotateX:ns,rotateY:ns,rotateZ:ns,scale:es,scaleX:es,scaleY:es,scaleZ:es,skew:ns,skewX:ns,skewY:ns,distance:R,translateX:R,translateY:R,translateZ:R,x:R,y:R,z:R,perspective:R,transformPerspective:R,opacity:$o,originX:as,originY:as,originZ:R},cs={...Qo,transform:Math.round},ls={...os,...ss,zIndex:cs,size:R,fillOpacity:$o,strokeOpacity:$o,numOctaves:cs},us={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ds=Uo.length;function fs(e,t,n){let r=``,i=!0;for(let a=0;a<ds;a++){let o=Uo[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=Xo(s,ls[o]);if(!c){i=!1;let t=us[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function ps(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Wo.has(e)){o=!0;continue}else if(Ko(e)){i[e]=n;continue}else{let t=Xo(n,ls[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fs(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ms={offset:`stroke-dashoffset`,array:`stroke-dasharray`},hs={offset:`strokeDashoffset`,array:`strokeDasharray`};function gs(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ms:hs;e[a.offset]=R.transform(-r);let o=R.transform(t),s=R.transform(n);e[a.array]=`${o} ${s}`}function _s(e,t,n){return typeof e==`string`?e:R.transform(t+n*e)}function vs(e,t,n){return`${_s(t,e.x,e.width)} ${_s(n,e.y,e.height)}`}function ys(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...l},u,d){if(ps(e,l,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=vs(m,i===void 0?.5:i,a===void 0?.5:a)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&gs(f,o,s,c,!1)}var bs=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),xs=()=>({...bs(),attrs:{}}),Ss=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Cs(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(let t in n)e.style.setProperty(t,n[t])}var ws=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function Ts(e,t,n,r){Cs(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ws.has(n)?n:bo(n),t.attrs[n])}var Es={};function Ds(e){Object.assign(Es,e)}function Os(e,{layout:t,layoutId:n}){return Wo.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Es[e]||e===`opacity`)}function ks(e,t,n){let{style:r}=e,i={};for(let a in r)(I(r[a])||t.style&&I(t.style[a])||Os(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}function As(e,t,n){let r=ks(e,t,n);for(let n in e)if(I(e[n])||I(t[n])){let t=Uo.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}function js(e,t){try{t.dimensions=typeof e.getBBox==`function`?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var Ms=[`x`,`y`,`width`,`height`,`cx`,`cy`,`r`],Ns={useVisualState:Vo({scrapeMotionValuesFromProps:As,createRenderState:xs,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(let e in i)if(Wo.has(e)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let n=0;n<Ms.length;n++){let r=Ms[n];e[r]!==t[r]&&(o=!0)}o&&P.read(()=>{js(n,r),P.render(()=>{ys(r,i,Ss(n.tagName),e.transformTemplate),Ts(n,r)})})}})},Ps={useVisualState:Vo({scrapeMotionValuesFromProps:ks,createRenderState:bs})};function Fs(e,t,n){for(let r in t)!I(t[r])&&!Os(r,n)&&(e[r]=t[r])}function Is({transformTemplate:e},t){return(0,E.useMemo)(()=>{let n=bs();return ps(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ls(e,t){let n=e.style||{},r={};return Fs(r,n,e),Object.assign(r,Is(e,t)),r}function Rs(e,t){let n={},r=Ls(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function zs(e,t,n,r){let i=(0,E.useMemo)(()=>{let n=xs();return ys(n,t,Ss(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Fs(t,e.style,e),i.style={...t,...i.style}}return i}function Bs(e=!1){return(t,n,r,{latestValues:i},a)=>{let o=(No(t)?zs:Rs)(n,i,a,t),s=io(n,typeof t==`string`,e),c=t===E.Fragment?{}:{...s,...o,ref:r},{children:l}=n,u=(0,E.useMemo)(()=>I(l)?l.get():l,[l]);return(0,E.createElement)(t,{...c,children:u})}}function Vs(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Oo({...No(n)?Ns:Ps,preloadedFeatures:e,useRender:Bs(r),createVisualElement:t,Component:n})}}function Hs(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Us(e,t,n){let r=e.getProps();return Fo(r,t,n===void 0?r.custom:n,e)}var Ws=Ba(()=>window.ScrollTimeline!==void 0),Gs=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>`finished`in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){let n=this.animations.map(n=>{if(Ws()&&n.attachTimeline)return n.attachTimeline(e);if(typeof t==`function`)return t(n)});return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get startTime(){return this.getAll(`startTime`)}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll(`flatten`)}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}},Ks=class extends Gs{then(e,t){return Promise.all(this.animations).then(e).catch(t)}};function qs(e,t){return e?e[t]||e.default||e:void 0}var Js=2e4;function Ys(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Xs(e){return typeof e==`function`}function Zs(e,t){e.timeline=t,e.onfinish=null}var Qs=e=>Array.isArray(e)&&typeof e[0]==`number`,$s={linearEasing:void 0};function ec(e,t){let n=Ba(e);return()=>$s[t]??n()}var tc=ec(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),nc=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=e(Va(0,i-1,t))+`, `;return`linear(${r.substring(0,r.length-2)})`};function rc(e){return!!(typeof e==`function`&&tc()||!e||typeof e==`string`&&(e in ac||tc())||Qs(e)||Array.isArray(e)&&e.every(rc))}var ic=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ac={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ic([0,.65,.55,1]),circOut:ic([.55,0,1,.45]),backIn:ic([.31,.01,.66,-.59]),backOut:ic([.33,1.53,.69,.99])};function oc(e,t){if(e)return typeof e==`function`&&tc()?nc(e,t):Qs(e)?ic(e):Array.isArray(e)?e.map(e=>oc(e,t)||ac.easeOut):ac[e]}var z={x:!1,y:!1};function sc(){return z.x||z.y}function cc(e,t,n){if(e instanceof Element)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function lc(e,t){let n=cc(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function uc(e){return t=>{t.pointerType===`touch`||sc()||e(t)}}function dc(e,t,n={}){let[r,i,a]=lc(e,n),o=uc(e=>{let{target:n}=e,r=t(e);if(typeof r!=`function`||!n)return;let a=uc(e=>{r(e),n.removeEventListener(`pointerleave`,a)});n.addEventListener(`pointerleave`,a,i)});return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var fc=(e,t)=>t?e===t?!0:fc(e,t.parentElement):!1,pc=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,mc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function hc(e){return mc.has(e.tagName)||e.tabIndex!==-1}var gc=new WeakSet;function _c(e){return t=>{t.key===`Enter`&&e(t)}}function vc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var yc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=_c(()=>{if(gc.has(n))return;vc(n,`down`);let e=_c(()=>{vc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>vc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function bc(e){return pc(e)&&!sc()}function xc(e,t,n={}){let[r,i,a]=lc(e,n),o=e=>{let r=e.currentTarget;if(!bc(e)||gc.has(r))return;gc.add(r);let a=t(e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),!(!bc(e)||!gc.has(r))&&(gc.delete(r),typeof a==`function`&&a(e,{success:t}))},s=e=>{o(e,n.useGlobalTarget||fc(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{!hc(e)&&e.getAttribute(`tabindex`)===null&&(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),e.addEventListener(`focus`,e=>yc(e,i),i)}),a}function Sc(e){return e===`x`||e===`y`?z[e]?null:(z[e]=!0,()=>{z[e]=!1}):z.x||z.y?null:(z.x=z.y=!0,()=>{z.x=z.y=!1})}var Cc=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Uo]),wc;function Tc(){wc=void 0}var B={now:()=>(wc===void 0&&B.set(F.isProcessing||Ua.useManualTiming?F.timestamp:performance.now()),wc),set:e=>{wc=e,queueMicrotask(Tc)}};function Ec(e,t){e.indexOf(t)===-1&&e.push(t)}function Dc(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Oc=class{constructor(){this.subscriptions=[]}add(e){return Ec(this.subscriptions,e),()=>Dc(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function kc(e,t){return t?1e3/t*e:0}var Ac=30,jc=e=>!isNaN(parseFloat(e)),Mc={current:void 0},Nc=class{constructor(e,t={}){this.version=`11.18.2`,this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let n=B.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=jc(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Oc);let n=this.events[e].add(t);return e===`change`?()=>{n(),P.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Mc.current&&Mc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ac)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ac);return kc(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Pc(e,t){return new Nc(e,t)}function Fc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pc(n))}function Ic(e,t){let{transitionEnd:n={},transition:r={},...i}=Us(e,t)||{};i={...i,...n};for(let t in i)Fc(e,t,Ro(i[t]))}function Lc(e){return!!(I(e)&&e.add)}function Rc(e,t){let n=e.getValue(`willChange`);if(Lc(n))return n.add(t)}function zc(e){return e.props[xo]}var Bc={current:!1},Vc=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Hc=1e-7,Uc=12;function Wc(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Vc(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Hc&&++s<Uc);return o}function Gc(e,t,n,r){if(e===t&&n===r)return M;let i=t=>Wc(t,0,1,e,n);return e=>e===0||e===1?e:Vc(i(e),t,r)}var Kc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qc=e=>t=>1-e(1-t),Jc=Gc(.33,1.53,.69,.99),Yc=qc(Jc),Xc=Kc(Yc),Zc=e=>(e*=2)<1?.5*Yc(e):.5*(2-2**(-10*(e-1))),Qc=e=>1-Math.sin(Math.acos(e)),$c=qc(Qc),el=Kc(Qc),tl=e=>/^0[^.\s]+$/u.test(e);function nl(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||tl(e)}var rl=e=>Math.round(e*1e5)/1e5,il=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function al(e){return e==null}var ol=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sl=(e,t)=>n=>!!(typeof n==`string`&&ol.test(n)&&n.startsWith(e)||t&&!al(n)&&Object.prototype.hasOwnProperty.call(n,t)),cl=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(il);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},ll=e=>Zo(0,255,e),ul={...Qo,transform:e=>Math.round(ll(e))},dl={test:sl(`rgb`,`red`),parse:cl(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ul.transform(e)+`, `+ul.transform(t)+`, `+ul.transform(n)+`, `+rl($o.transform(r))+`)`};function fl(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var pl={test:sl(`#`),parse:fl,transform:dl.transform},ml={test:sl(`hsl`,`hue`),parse:cl(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+L.transform(rl(t))+`, `+L.transform(rl(n))+`, `+rl($o.transform(r))+`)`},V={test:e=>dl.test(e)||pl.test(e)||ml.test(e),parse:e=>dl.test(e)?dl.parse(e):ml.test(e)?ml.parse(e):pl.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?dl.transform(e):ml.transform(e)},hl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gl(e){return isNaN(e)&&typeof e==`string`&&(e.match(il)?.length||0)+(e.match(hl)?.length||0)>0}var _l=`number`,vl=`color`,yl=`var`,bl=`var(`,xl="${}",Sl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Cl(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Sl,e=>(V.test(e)?(r.color.push(a),i.push(vl),n.push(V.parse(e))):e.startsWith(bl)?(r.var.push(a),i.push(yl),n.push(e)):(r.number.push(a),i.push(_l),n.push(parseFloat(e))),++a,xl)).split(xl),indexes:r,types:i}}function wl(e){return Cl(e).values}function Tl(e){let{split:t,types:n}=Cl(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===_l?i+=rl(e[a]):t===vl?i+=V.transform(e[a]):i+=e[a]}return i}}var El=e=>typeof e==`number`?0:e;function Dl(e){let t=wl(e);return Tl(e)(t.map(El))}var Ol={test:gl,parse:wl,createTransformer:Tl,getAnimatableNone:Dl},kl=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Al(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(il)||[];if(!r)return e;let i=n.replace(r,``),a=kl.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var jl=/\b([a-z-]*)\(.*?\)/gu,Ml={...Ol,getAnimatableNone:e=>{let t=e.match(jl);return t?t.map(Al).join(` `):e}},Nl={...ls,color:V,backgroundColor:V,outlineColor:V,fill:V,stroke:V,borderColor:V,borderTopColor:V,borderRightColor:V,borderBottomColor:V,borderLeftColor:V,filter:Ml,WebkitFilter:Ml},Pl=e=>Nl[e];function Fl(e,t){let n=Pl(e);return n!==Ml&&(n=Ol),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Il=new Set([`auto`,`none`,`0`]);function Ll(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Il.has(t)&&Cl(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Fl(n,i)}var Rl=e=>e===Qo||e===R,zl=(e,t)=>parseFloat(e.split(`, `)[t]),Bl=(e,t)=>(n,{transform:r})=>{if(r===`none`||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/u);if(i)return zl(i[1],t);{let t=r.match(/^matrix\((.+)\)$/u);return t?zl(t[1],e):0}},Vl=new Set([`x`,`y`,`z`]),Hl=Uo.filter(e=>!Vl.has(e));function Ul(e){let t=[];return Hl.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var Wl={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Bl(4,13),y:Bl(5,14)};Wl.translateX=Wl.x,Wl.translateY=Wl.y;var Gl=new Set,Kl=!1,ql=!1;function Jl(){if(ql){let e=Array.from(Gl).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Ul(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{var r;(r=e.getValue(t))==null||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}ql=!1,Kl=!1,Gl.forEach(e=>e.complete()),Gl.clear()}function Yl(){Gl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ql=!0)})}function Xl(){Yl(),Jl()}var Zl=class{constructor(e,t,n,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gl.add(this),Kl||(Kl=!0,P.read(Yl),P.resolveKeyframes(Jl))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gl.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gl.delete(this))}resume(){this.isComplete||this.scheduleResolve()}},Ql=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$l=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eu(e){let t=$l.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var tu=4;function nu(e,t,n=1){za(n<=tu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,i]=eu(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Ql(e)?parseFloat(e):e}return Jo(i)?nu(i,t,n+1):i}var ru=e=>t=>t.test(e),iu=[Qo,R,L,ns,is,rs,{test:e=>e===`auto`,parse:e=>e}],au=e=>iu.find(ru(e)),ou=class extends Zl{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Jo(r))){let i=nu(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Cc.has(n)||e.length!==2)return;let[r,i]=e,a=au(r),o=au(i);if(a!==o)if(Rl(a)&&Rl(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)nl(e[t])&&n.push(t);n.length&&Ll(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Wl[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Wl[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},su=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ol.test(e)||e===`0`)&&!e.startsWith(`url(`));function cu(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function lu(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=su(i,t),s=su(a,t);return Ra(o===s,`You are trying to animate ${t} from "${i}" to "${a}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${a} via the \`style\` property.`),!o||!s?!1:cu(e)||(n===`spring`||Xs(n))&&r}var uu=e=>e!==null;function du(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(uu),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var fu=40,pu=class{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=B.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>fu?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xl(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=B.now(),this.hasAttemptedResolve=!0;let{name:n,type:r,velocity:i,delay:a,onComplete:o,onUpdate:s,isGenerator:c}=this.options;if(!c&&!lu(e,n,r,i))if(Bc.current||!a){s&&s(du(e,this.options,t)),o&&o(),this.resolveFinishedPromise();return}else this.options.duration=0;let l=this.initPlayback(e,t);l!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...l},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type=`keyframes`,this.options.ease=`linear`}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}},H=(e,t,n)=>e+(t-e)*n;function mu(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=mu(s,r,e+1/3),a=mu(s,r,e),o=mu(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function gu(e,t){return n=>n>0?t:e}var _u=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},vu=[pl,dl,ml],yu=e=>vu.find(t=>t.test(e));function bu(e){let t=yu(e);if(Ra(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ml&&(n=hu(n)),n}var xu=(e,t)=>{let n=bu(e),r=bu(t);if(!n||!r)return gu(e,t);let i={...n};return e=>(i.red=_u(n.red,r.red,e),i.green=_u(n.green,r.green,e),i.blue=_u(n.blue,r.blue,e),i.alpha=H(n.alpha,r.alpha,e),dl.transform(i))},Su=(e,t)=>n=>t(e(n)),Cu=(...e)=>e.reduce(Su),wu=new Set([`none`,`hidden`]);function Tu(e,t){return wu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Eu(e,t){return n=>H(e,t,n)}function Du(e){return typeof e==`number`?Eu:typeof e==`string`?Jo(e)?gu:V.test(e)?xu:ju:Array.isArray(e)?Ou:typeof e==`object`?V.test(e)?xu:ku:gu}function Ou(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Du(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ku(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Du(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Au(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var ju=(e,t)=>{let n=Ol.createTransformer(t),r=Cl(e),i=Cl(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?wu.has(e)&&!i.values.length||wu.has(t)&&!r.values.length?Tu(e,t):Cu(Ou(Au(r,i),i.values),n):(Ra(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gu(e,t))};function Mu(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?H(e,t,n):Du(e)(e,t)}var Nu=5;function Pu(e,t,n){let r=Math.max(t-Nu,0);return kc(n-e(r),t-r)}var U={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Fu=.001;function Iu({duration:e=U.duration,bounce:t=U.bounce,velocity:n=U.velocity,mass:r=U.mass}){let i,a;Ra(e<=N(U.maxDuration),`Spring duration must be 10 seconds or less`);let o=1-t;o=Zo(U.minDamping,U.maxDamping,o),e=Zo(U.minDuration,U.maxDuration,Ha(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=zu(t,o),c=Math.exp(-i);return Fu-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=zu(t**2,o);return(-i(t)+Fu>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Fu+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ru(i,a,s);if(e=N(e),isNaN(c))return{stiffness:U.stiffness,damping:U.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Lu=12;function Ru(e,t,n){let r=n;for(let n=1;n<Lu;n++)r-=e(r)/t(r);return r}function zu(e,t){return e*Math.sqrt(1-t*t)}var Bu=[`duration`,`bounce`],Vu=[`stiffness`,`damping`,`mass`];function Hu(e,t){return t.some(t=>e[t]!==void 0)}function Uu(e){let t={velocity:U.velocity,stiffness:U.stiffness,damping:U.damping,mass:U.mass,isResolvedFromDuration:!1,...e};if(!Hu(e,Vu)&&Hu(e,Bu))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Zo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:U.mass,stiffness:i,damping:a}}else{let n=Iu(e);t={...t,...n,mass:U.mass},t.isResolvedFromDuration=!0}return t}function Wu(e=U.visualDuration,t=U.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Uu({...n,velocity:-Ha(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Ha(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?U.restSpeed.granular:U.restSpeed.default,i||=v?U.restDelta.granular:U.restDelta.default;let y;if(h<1){let e=zu(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=0;h<1&&(n=e===0?N(m):Pu(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Ys(b),Js),t=nc(t=>b.next(e*t).value,e,30);return e+`ms `+t}};return b}function Gu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Wu({keyframes:[f.value,m(f.value)],velocity:Pu(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}var Ku=Gc(.42,0,1,1),qu=Gc(0,0,.58,1),Ju=Gc(.42,0,.58,1),Yu=e=>Array.isArray(e)&&typeof e[0]!=`number`,Xu={linear:M,easeIn:Ku,easeInOut:Ju,easeOut:qu,circIn:Qc,circInOut:el,circOut:$c,backIn:Yc,backInOut:Xc,backOut:Jc,anticipate:Zc},Zu=e=>{if(Qs(e)){za(e.length===4,`Cubic bezier arrays must contain four numerical values.`);let[t,n,r,i]=e;return Gc(t,n,r,i)}else if(typeof e==`string`)return za(Xu[e]!==void 0,`Invalid easing type '${e}'`),Xu[e];return e};function Qu(e,t,n){let r=[],i=n||Mu,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Cu(Array.isArray(t)?t[n]||M:t,a)),r.push(a)}return r}function $u(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(za(a===t.length,`Both input and output ranges must be the same length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Qu(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Va(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Zo(e[0],e[a-1],t)):l}function ed(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Va(0,t,r);e.push(H(n,1,i))}}function td(e){let t=[0];return ed(t,e.length-1),t}function nd(e,t){return e.map(e=>e*t)}function rd(e,t){return e.map(()=>t||Ju).splice(0,e.length-1)}function id({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Yu(r)?r.map(Zu):Zu(r),a={done:!1,value:t[0]},o=$u(nd(n&&n.length===t.length?n:td(t),e),t,{ease:Array.isArray(i)?i:rd(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ad=e=>{let t=({timestamp:t})=>e(t);return{start:()=>P.update(t,!0),stop:()=>Ja(t),now:()=>F.isProcessing?F.timestamp:B.now()}},od={decay:Gu,inertia:Gu,tween:id,keyframes:id,spring:Wu},sd=e=>e/100,cd=class extends pu{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState=`running`,this.startTime=null,this.state=`idle`,this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state===`idle`)return;this.teardown();let{onStop:e}=this.options;e&&e()};let{name:t,motionValue:n,element:r,keyframes:i}=this.options;this.resolver=new(r?.KeyframeResolver||Zl)(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){let{type:t=`keyframes`,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=this.options,o=Xs(t)?t:od[t]||id,s,c;o!==id&&typeof e[0]!=`number`&&(s=Cu(sd,Mu(e[0],e[1])),e=[0,100]);let l=o({...this.options,keyframes:e});i===`mirror`&&(c=o({...this.options,keyframes:[...e].reverse(),velocity:-a})),l.calculatedDuration===null&&(l.calculatedDuration=Ys(l));let{calculatedDuration:u}=l,d=u+r,f=d*(n+1)-r;return{generator:l,mirroredGenerator:c,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:f}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState===`paused`||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){let{resolved:n}=this;if(!n){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:s,calculatedDuration:c,totalDuration:l,resolvedDuration:u}=n;if(this.startTime===null)return i.next(0);let{delay:d,repeat:f,repeatType:p,repeatDelay:m,onUpdate:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-l/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime===null?this.currentTime=Math.round(e-this.startTime)*this.speed:this.currentTime=this.holdTime;let g=this.currentTime-d*(this.speed>=0?1:-1),_=this.speed>=0?g<0:g>l;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=l);let v=this.currentTime,y=i;if(f){let e=Math.min(this.currentTime,l)/u,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,f+1),t%2&&(p===`reverse`?(n=1-n,m&&(n-=m/u)):p===`mirror`&&(y=a)),v=Zo(0,1,n)*u}let b=_?{done:!1,value:s[0]}:y.next(v);o&&(b.value=o(b.value));let{done:x}=b;!_&&c!==null&&(x=this.speed>=0?this.currentTime>=l:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&r!==void 0&&(b.value=du(s,this.options,r)),h&&h(b.value),S&&this.finish(),b}get duration(){let{resolved:e}=this;return e?Ha(e.calculatedDuration):0}get time(){return Ha(this.currentTime)}set time(e){e=N(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ha(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState=`running`;return}if(this.isStopped)return;let{driver:e=ad,onPlay:t,startTime:n}=this.options;this.driver||=e(e=>this.tick(e)),t&&t();let r=this.driver.now();this.holdTime===null?this.startTime?this.state===`finished`&&(this.startTime=r):this.startTime=n??this.calcStartTime():this.startTime=r-this.holdTime,this.state===`finished`&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state=`running`,this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState=`paused`;return}this.state=`paused`,this.holdTime=this.currentTime??0}complete(){this.state!==`running`&&this.play(),this.pendingPlayState=this.state=`finished`,this.holdTime=null}finish(){this.teardown(),this.state=`finished`;let{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state=`idle`,this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}},ld=new Set([`opacity`,`clipPath`,`filter`,`transform`]);function ud(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeInOut`,times:c}={}){let l={[t]:n};c&&(l.offset=c);let u=oc(s,i);return Array.isArray(u)&&(l.easing=u),e.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?`linear`:u,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`})}var dd=Ba(()=>Object.hasOwnProperty.call(Element.prototype,`animate`)),fd=10,pd=2e4;function md(e){return Xs(e.type)||e.type===`spring`||!rc(e.ease)}function hd(e,t){let n=new cd({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},i=[],a=0;for(;!r.done&&a<pd;)r=n.sample(a),i.push(r.value),a+=fd;return{times:void 0,keyframes:i,duration:a-fd,ease:`linear`}}var gd={anticipate:Zc,backInOut:Xc,circInOut:el};function _d(e){return e in gd}var vd=class extends pu{constructor(e){super(e);let{name:t,motionValue:n,element:r,keyframes:i}=this.options;this.resolver=new ou(i,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:i,type:a,motionValue:o,name:s,startTime:c}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof i==`string`&&tc()&&_d(i)&&(i=gd[i]),md(this.options)){let{onComplete:t,onUpdate:o,motionValue:s,element:c,...l}=this.options,u=hd(e,l);e=u.keyframes,e.length===1&&(e[1]=e[0]),n=u.duration,r=u.times,i=u.ease,a=`keyframes`}let l=ud(o.owner.current,s,e,{...this.options,duration:n,times:r,ease:i});return l.startTime=c??this.calcStartTime(),this.pendingTimeline?(Zs(l,this.pendingTimeline),this.pendingTimeline=void 0):l.onfinish=()=>{let{onComplete:n}=this.options;o.set(du(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:l,duration:n,times:r,type:a,ease:i,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return Ha(t)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return Ha(t.currentTime||0)}set time(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.currentTime=N(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:n}=t;n.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return`idle`;let{animation:t}=e;return t.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{let{resolved:t}=this;if(!t)return M;let{animation:n}=t;Zs(n,e)}return M}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.playState===`finished`&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state===`idle`)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:n,duration:r,type:i,ease:a,times:o}=e;if(t.playState===`idle`||t.playState===`finished`)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:s,element:c,...l}=this.options,u=new cd({...l,keyframes:n,duration:r,type:i,ease:a,times:o,isGenerator:!0}),d=N(this.time);e.setWithVelocity(u.sample(d-fd).value,u.sample(d).value,fd)}let{onStop:s}=this.options;s&&s(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return dd()&&n&&ld.has(n)&&!s&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}},yd={type:`spring`,stiffness:500,damping:25,restSpeed:10},bd=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xd={type:`keyframes`,duration:.8},Sd={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cd=(e,{keyframes:t})=>t.length>2?xd:Wo.has(e)?e.startsWith(`scale`)?bd(t[1]):yd:Sd;function wd({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var Td=(e,t,n,r={},i,a)=>o=>{let s=qs(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=N(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};wd(s)||(u={...u,...Cd(e,u)}),u.duration&&=N(u.duration),u.repeatDelay&&=N(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),(Bc.current||Ua.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),d&&!a&&t.get()!==void 0){let e=du(u.keyframes,s);if(e!==void 0)return P.update(()=>{u.onUpdate(e),u.onComplete()}),new Ks([])}return!a&&vd.supports(u)?new vd(u):new cd(u)};function Ed({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Dd(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&Ed(l,t))continue;let o={delay:n,...qs(a||{},t)},u=!1;if(window.MotionHandoffAnimation){let n=zc(e);if(n){let e=window.MotionHandoffAnimation(n,t,P);e!==null&&(o.startTime=e,u=!0)}}Rc(e,t),r.start(Td(t,r,i,e.shouldReduceMotion&&Cc.has(t)?{type:!1}:o,e,u));let d=r.animation;d&&c.push(d)}return o&&Promise.all(c).then(()=>{P.update(()=>{o&&Ic(e,o)})}),c}function Od(e,t,n={}){let r=Us(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Dd(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return kd(e,t,a+r,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function kd(e,t,n=0,r=0,i=1,a){let o=[],s=(e.variantChildren.size-1)*r,c=i===1?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(Ad).forEach((e,r)=>{e.notify(`AnimationStart`,t),o.push(Od(e,t,{...a,delay:n+c(r)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(o)}function Ad(e,t){return e.sortNodePosition(t)}function jd(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Od(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Od(e,t,n);else{let i=typeof t==`function`?Us(e,t,n.custom):t;r=Promise.all(Dd(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Md=uo.length;function Nd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Nd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Md;n++){let r=uo[n],i=e.props[r];(so(i)||i===!1)&&(t[r]=i)}return t}var Pd=[...lo].reverse(),Fd=lo.length;function Id(e){return t=>Promise.all(t.map(({animation:t,options:n})=>jd(e,t,n)))}function Ld(e){let t=Id(e),n=Bd(),r=!0,i=t=>(n,r)=>{let i=Us(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=Nd(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<Fd;t++){let f=Pd[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=so(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||co(m)||typeof m==`boolean`)continue;let v=Rd(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},ee=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Io(t)&&Io(n)?!Hs(t,n):t!==n,r?t==null?l.add(e):ee(e):t!==void 0&&l.has(e)?ee(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1),y&&(!(_&&v)||b)&&c.push(...x.map(e=>({animation:e,options:{type:f}})))}if(l.size){let t={};l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){var i;if(n[t].isActive===r)return Promise.resolve();(i=e.variantChildren)==null||i.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let a=o(t);for(let e in n)n[e].protectedKeys={};return a}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Bd(),r=!0}}}function Rd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Hs(t,e):!1}function zd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Bd(){return{animate:zd(!0),whileInView:zd(),whileHover:zd(),whileTap:zd(),whileDrag:zd(),whileFocus:zd(),exit:zd()}}var Vd=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},Hd=class extends Vd{constructor(e){super(e),e.animationState||=Ld(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();co(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},Ud=0,Wd={animation:{Feature:Hd},exit:{Feature:class extends Vd{constructor(){super(...arguments),this.id=Ud++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function Gd(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Kd(e){return{point:{x:e.pageX,y:e.pageY}}}var qd=e=>t=>pc(t)&&e(t,Kd(t));function Jd(e,t,n,r){return Gd(e,t,qd(n),r)}var Yd=(e,t)=>Math.abs(e-t);function Xd(e,t){let n=Yd(e.x,t.x),r=Yd(e.y,t.y);return Math.sqrt(n**2+r**2)}var Zd=class{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=ef(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Xd(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=F;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Qd(t,this.transformPagePoint),P.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ef(e.type===`pointercancel`?this.lastMoveEventInfo:Qd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!pc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;let a=Qd(Kd(e),this.transformPagePoint),{point:o}=a,{timestamp:s}=F;this.history=[{...o,timestamp:s}];let{onSessionStart:c}=t;c&&c(e,ef(a,this.history)),this.removeListeners=Cu(Jd(this.contextWindow,`pointermove`,this.handlePointerMove),Jd(this.contextWindow,`pointerup`,this.handlePointerUp),Jd(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ja(this.updatePoint)}};function Qd(e,t){return t?{point:t(e.point)}:e}function $d(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ef({point:e},t){return{point:e,delta:$d(e,nf(t)),offset:$d(e,tf(t)),velocity:rf(t,.1)}}function tf(e){return e[0]}function nf(e){return e[e.length-1]}function rf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=nf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>N(t)));)n--;if(!r)return{x:0,y:0};let a=Ha(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var af=1e-4,of=1-af,sf=1+af,cf=.01,lf=0-cf,uf=0+cf;function W(e){return e.max-e.min}function df(e,t,n){return Math.abs(e-t)<=n}function ff(e,t,n,r=.5){e.origin=r,e.originPoint=H(t.min,t.max,e.origin),e.scale=W(n)/W(t),e.translate=H(n.min,n.max,e.origin)-e.originPoint,(e.scale>=of&&e.scale<=sf||isNaN(e.scale))&&(e.scale=1),(e.translate>=lf&&e.translate<=uf||isNaN(e.translate))&&(e.translate=0)}function pf(e,t,n,r){ff(e.x,t.x,n.x,r?r.originX:void 0),ff(e.y,t.y,n.y,r?r.originY:void 0)}function mf(e,t,n){e.min=n.min+t.min,e.max=e.min+W(t)}function hf(e,t,n){mf(e.x,t.x,n.x),mf(e.y,t.y,n.y)}function gf(e,t,n){e.min=t.min-n.min,e.max=e.min+W(t)}function _f(e,t,n){gf(e.x,t.x,n.x),gf(e.y,t.y,n.y)}function vf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?H(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?H(n,e,r.max):Math.min(e,n)),e}function yf(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function bf(e,{top:t,left:n,bottom:r,right:i}){return{x:yf(e.x,n,i),y:yf(e.y,t,r)}}function xf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Sf(e,t){return{x:xf(e.x,t.x),y:xf(e.y,t.y)}}function Cf(e,t){let n=.5,r=W(e),i=W(t);return i>r?n=Va(t.min,t.max-r,e.min):r>i&&(n=Va(e.min,e.max-i,t.min)),Zo(0,1,n)}function wf(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Tf=.35;function Ef(e=Tf){return e===!1?e=0:e===!0&&(e=Tf),{x:Df(e,`left`,`right`),y:Df(e,`top`,`bottom`)}}function Df(e,t,n){return{min:Of(e,t),max:Of(e,n)}}function Of(e,t){return typeof e==`number`?e:e[t]||0}var kf=()=>({translate:0,scale:1,origin:0,originPoint:0}),Af=()=>({x:kf(),y:kf()}),jf=()=>({min:0,max:0}),G=()=>({x:jf(),y:jf()});function K(e){return[e(`x`),e(`y`)]}function Mf({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Nf({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Pf(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ff(e){return e===void 0||e===1}function If({scale:e,scaleX:t,scaleY:n}){return!Ff(e)||!Ff(t)||!Ff(n)}function Lf(e){return If(e)||Rf(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rf(e){return zf(e.x)||zf(e.y)}function zf(e){return e&&e!==`0%`}function Bf(e,t,n){return n+t*(e-n)}function Vf(e,t,n,r,i){return i!==void 0&&(e=Bf(e,i,r)),Bf(e,n,r)+t}function Hf(e,t=0,n=1,r,i){e.min=Vf(e.min,t,n,r,i),e.max=Vf(e.max,t,n,r,i)}function Uf(e,{x:t,y:n}){Hf(e.x,t.translate,t.scale,t.originPoint),Hf(e.y,n.translate,n.scale,n.originPoint)}var Wf=.999999999999,Gf=1.0000000000001;function Kf(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Yf(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Uf(e,o)),r&&Lf(a.latestValues)&&Yf(e,a.latestValues))}t.x<Gf&&t.x>Wf&&(t.x=1),t.y<Gf&&t.y>Wf&&(t.y=1)}function qf(e,t){e.min+=t,e.max+=t}function Jf(e,t,n,r,i=.5){Hf(e,t,n,H(e.min,e.max,i),r)}function Yf(e,t){Jf(e.x,t.x,t.scaleX,t.scale,t.originX),Jf(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xf(e,t){return Mf(Pf(e.getBoundingClientRect(),t))}function Zf(e,t,n){let r=Xf(e,n),{scroll:i}=t;return i&&(qf(r.x,i.offset.x),qf(r.y,i.offset.y)),r}var Qf=({current:e})=>e?e.ownerDocument.defaultView:null,$f=new WeakMap,ep=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let r=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Kd(e).point)},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Sc(n),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),K(e=>{let t=this.getAxisMotionValue(e).get()||0;if(L.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=W(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&P.postRender(()=>i(e,t)),Rc(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},a=(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=np(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},o=(e,t)=>this.stop(e,t),s=()=>K(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Zd(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Qf(this.visualElement)})}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();i&&P.postRender(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!tp(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=vf(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&vo(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=bf(n.layoutBox,e):this.constraints=!1,this.elastic=Ef(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&K(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=wf(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!vo(e))return!1;let n=e.current;za(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Zf(n,r.root,this.visualElement.getTransformPagePoint()),a=Sf(r.layout.layoutBox,i);if(t){let e=t(Nf(a));this.hasMutatedConstraints=!!e,e&&(a=Mf(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=K(o=>{if(!tp(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Rc(this.visualElement,e),n.start(Td(e,n,0,t,this.visualElement,!1))}stopAnimation(){K(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){K(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){K(t=>{let{drag:n}=this.getProps();if(!tp(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-H(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!vo(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};K(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Cf({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),K(t=>{if(!tp(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(H(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;$f.set(this.visualElement,this);let e=this.visualElement.current,t=Jd(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();vo(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),P.read(n);let a=Gd(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(K(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Tf,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function tp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function np(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var rp=class extends Vd{constructor(e){super(e),this.removeGroupControls=M,this.removeListeners=M,this.controls=new ep(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||M}unmount(){this.removeGroupControls(),this.removeListeners()}},ip=e=>(t,n)=>{e&&P.postRender(()=>e(t,n))},ap=class extends Vd{constructor(){super(...arguments),this.removePointerDownListener=M}onPointerDown(e){this.session=new Zd(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qf(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ip(e),onStart:ip(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&P.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Jd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},op={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function sp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var cp={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(R.test(e))e=parseFloat(e);else return e;return`${sp(e,t.target.x)}% ${sp(e,t.target.y)}%`}},lp={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ol.parse(e);if(i.length>5)return r;let a=Ol.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=H(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},up=class extends E.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;Ds(fp),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),op.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,a=n.projection;return a?(a.isPresent=i,r||e.layoutDependency!==t||t===void 0?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||P.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),So.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function dp(e){let[t,n]=Fa(),r=(0,E.useContext)(ja);return(0,A.jsx)(up,{...e,layoutGroup:r,switchLayoutGroup:(0,E.useContext)(wo),isPresent:t,safeToRemove:n})}var fp={borderRadius:{...cp,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:cp,borderTopRightRadius:cp,borderBottomLeftRadius:cp,borderBottomRightRadius:cp,boxShadow:lp};function pp(e,t,n){let r=I(e)?e:Pc(e);return r.start(Td(``,r,t,n)),r.animation}function mp(e){return e instanceof SVGElement&&e.tagName!==`svg`}var hp=(e,t)=>e.depth-t.depth,gp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ec(this.children,e),this.isDirty=!0}remove(e){Dc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hp),this.isDirty=!1,this.children.forEach(e)}};function _p(e,t){let n=B.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Ja(r),e(a-t))};return P.read(r,!0),()=>Ja(r)}var vp=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yp=vp.length,bp=e=>typeof e==`string`?parseFloat(e):e,xp=e=>typeof e==`number`||R.test(e);function Sp(e,t,n,r,i,a){i?(e.opacity=H(0,n.opacity===void 0?1:n.opacity,wp(r)),e.opacityExit=H(t.opacity===void 0?1:t.opacity,0,Tp(r))):a&&(e.opacity=H(t.opacity===void 0?1:t.opacity,n.opacity===void 0?1:n.opacity,r));for(let i=0;i<yp;i++){let a=`border${vp[i]}Radius`,o=Cp(t,a),s=Cp(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||xp(o)===xp(s)?(e[a]=Math.max(H(bp(o),bp(s),r),0),(L.test(s)||L.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=H(t.rotate||0,n.rotate||0,r))}function Cp(e,t){return e[t]===void 0?e.borderRadius:e[t]}var wp=Ep(0,.5,$c),Tp=Ep(.5,.95,M);function Ep(e,t,n){return r=>r<e?0:r>t?1:n(Va(e,t,r))}function Dp(e,t){e.min=t.min,e.max=t.max}function q(e,t){Dp(e.x,t.x),Dp(e.y,t.y)}function Op(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function kp(e,t,n,r,i){return e-=t,e=Bf(e,1/n,r),i!==void 0&&(e=Bf(e,1/i,r)),e}function Ap(e,t=0,n=1,r=.5,i,a=e,o=e){if(L.test(t)&&(t=parseFloat(t),t=H(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=H(a.min,a.max,r);e===a&&(s-=t),e.min=kp(e.min,t,n,s,i),e.max=kp(e.max,t,n,s,i)}function jp(e,t,[n,r,i],a,o){Ap(e,t[n],t[r],t[i],t.scale,a,o)}var Mp=[`x`,`scaleX`,`originX`],Np=[`y`,`scaleY`,`originY`];function Pp(e,t,n,r){jp(e.x,t,Mp,n?n.x:void 0,r?r.x:void 0),jp(e.y,t,Np,n?n.y:void 0,r?r.y:void 0)}function Fp(e){return e.translate===0&&e.scale===1}function Ip(e){return Fp(e.x)&&Fp(e.y)}function Lp(e,t){return e.min===t.min&&e.max===t.max}function Rp(e,t){return Lp(e.x,t.x)&&Lp(e.y,t.y)}function zp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Bp(e,t){return zp(e.x,t.x)&&zp(e.y,t.y)}function Vp(e){return W(e.x)/W(e.y)}function Hp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Up=class{constructor(){this.members=[]}add(e){Ec(this.members,e),e.scheduleRender()}remove(e){if(Dc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Wp(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Gp={type:`projectionFrame`,totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Kp=typeof window<`u`&&window.MotionDebug!==void 0,qp=[``,`X`,`Y`,`Z`],Jp={visibility:`hidden`},Yp=1e3,Xp=0;function Zp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Qp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=zc(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,P,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Qp(r)}function $p({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Xp++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Kp&&(Gp.totalNodes=Gp.resolvedTargetDeltas=Gp.recalculatedProjection=0),this.nodes.forEach(nm),this.nodes.forEach(lm),this.nodes.forEach(um),this.nodes.forEach(rm),Kp&&window.MotionDebug.record(Gp)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new gp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Oc),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=mp(t),this.instance=t;let{layoutId:r,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=_p(r,250),op.hasAnimatedSinceResize&&(op.hasAnimatedSinceResize=!1,this.nodes.forEach(cm))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&a&&(r||i)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||a.getDefaultTransition()||_m,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),c=!this.targetLayout||!Bp(this.targetLayout,r)||n,l=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,l);let t={...qs(i,`layout`),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||cm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ja(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(dm),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(am);return}this.isUpdating||this.nodes.forEach(om),this.isUpdating=!1,this.nodes.forEach(sm),this.nodes.forEach(em),this.nodes.forEach(tm),this.clearAllSnapshots();let e=B.now();F.delta=Zo(0,1e3/60,e-F.timestamp),F.timestamp=e,F.isProcessing=!0,Ya.update.process(F),Ya.preRender.process(F),Ya.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,So.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(im),this.sharedNodes.forEach(fm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,P.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){P.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=G(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ip(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&(t||Lf(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),xm(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return G();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Cm))){let{scroll:e}=this.root;e&&(qf(t.x,e.offset.x),qf(t.y,e.offset.y))}return t}removeElementScroll(e){let t=G();if(q(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&q(t,e),qf(t.x,i.offset.x),qf(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=G();q(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Yf(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Lf(r.latestValues)&&Yf(n,r.latestValues)}return Lf(this.latestValues)&&Yf(n,this.latestValues),n}removeTransform(e){let t=G();q(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!Lf(n.latestValues))continue;If(n.latestValues)&&n.updateSnapshot();let r=G();q(r,n.measurePageBox()),Pp(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return Lf(this.latestValues)&&Pp(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==F.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!(!this.layout||!(r||i))){if(this.resolvedRelativeTargetAt=F.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),_f(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=G(),this.targetWithTransforms=G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):q(this.target,this.layout.layoutBox),Uf(this.target,this.targetDelta)):q(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&this.animationProgress!==1?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),_f(this.relativeTargetOrigin,this.target,e.target),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Kp&&Gp.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||If(this.parent.latestValues)||Rf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===F.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;q(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Kf(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=G());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Op(this.prevProjectionDelta.x,this.projectionDelta.x),Op(this.prevProjectionDelta.y,this.projectionDelta.y)),pf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Hp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Kp&&Gp.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if((t=this.options.visualElement)==null||t.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Af(),this.projectionDelta=Af(),this.projectionDeltaWithTransform=Af()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Af();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=G(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(gm));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;pm(a.x,e.x,n),pm(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_f(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),hm(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Rp(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=G(),q(d,this.relativeTarget)),s&&(this.animationValues=i,Sp(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&=(Ja(this.pendingAnimation),void 0),this.pendingAnimation=P.update(()=>{op.hasAnimatedSinceResize=!0,this.currentAnimation=pp(0,Yp,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Yp),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Sm(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||G();let t=W(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=W(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}q(t,n),Yf(t,i),pf(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Up),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Zp(`z`,e,r,this.animationValues);for(let t=0;t<qp.length;t++)Zp(`rotate${qp[t]}`,e,r,this.animationValues),Zp(`skew${qp[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Jp;let t={visibility:``},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.opacity=``,t.pointerEvents=zo(e?.pointerEvents)||``,t.transform=n?n(this.latestValues,``):`none`,t;let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){let t={};return this.options.layoutId&&(t.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,t.pointerEvents=zo(e?.pointerEvents)||``),this.hasProjected&&!Lf(this.latestValues)&&(t.transform=n?n({},``):`none`,this.hasProjected=!1),t}let i=r.animationValues||r.latestValues;this.applyTransformsToTarget(),t.transform=Wp(this.projectionDeltaWithTransform,this.treeScale,i),n&&(t.transform=n(i,t.transform));let{x:a,y:o}=this.projectionDelta;t.transformOrigin=`${a.origin*100}% ${o.origin*100}% 0`,r.animationValues?t.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:t.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let e in Es){if(i[e]===void 0)continue;let{correct:n,applyTo:a}=Es[e],o=t.transform===`none`?i[e]:n(i[e],r);if(a){let e=a.length;for(let n=0;n<e;n++)t[a[n]]=o}else t[e]=o}return this.options.layoutId&&(t.pointerEvents=r===this?zo(e?.pointerEvents)||``:`none`),t}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(am),this.root.sharedNodes.clear()}}}function em(e){e.updateLayout()}function tm(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?K(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=W(r);r.min=n[e].min,r.max=r.min+i}):Sm(i,t.layoutBox,n)&&K(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=W(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Af();pf(o,n,t.layoutBox);let s=Af();a?pf(s,e.applyTransform(r,!0),t.measuredBox):pf(s,n,t.layoutBox);let c=!Ip(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=G();_f(o,t.layoutBox,i.layoutBox);let s=G();_f(s,n,a.layoutBox),Bp(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function nm(e){Kp&&Gp.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function rm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function im(e){e.clearSnapshot()}function am(e){e.clearMeasurements()}function om(e){e.isLayoutDirty=!1}function sm(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function cm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function lm(e){e.resolveTargetDelta()}function um(e){e.calcProjection()}function dm(e){e.resetSkewAndRotation()}function fm(e){e.removeLeadSnapshot()}function pm(e,t,n){e.translate=H(t.translate,0,n),e.scale=H(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mm(e,t,n,r){e.min=H(t.min,n.min,r),e.max=H(t.max,n.max,r)}function hm(e,t,n,r){mm(e.x,t.x,n.x,r),mm(e.y,t.y,n.y,r)}function gm(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var _m={duration:.45,ease:[.4,0,.1,1]},vm=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ym=vm(`applewebkit/`)&&!vm(`chrome/`)?Math.round:M;function bm(e){e.min=ym(e.min),e.max=ym(e.max)}function xm(e){bm(e.x),bm(e.y)}function Sm(e,t,n){return e===`position`||e===`preserve-aspect`&&!df(Vp(t),Vp(n),.2)}function Cm(e){return e!==e.root&&e.scroll?.wasRoot}var wm=$p({attachResizeListener:(e,t)=>Gd(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Tm={current:void 0},Em=$p({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Tm.current){let e=new wm({});e.mount(window),e.setOptions({layoutScroll:!0}),Tm.current=e}return Tm.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Dm={pan:{Feature:ap},drag:{Feature:rp,ProjectionNode:Em,MeasureLayout:dp}};function Om(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&P.postRender(()=>i(t,Kd(t)))}var km=class extends Vd{mount(){let{current:e}=this.node;e&&(this.unmount=dc(e,e=>(Om(this.node,e,`Start`),e=>Om(this.node,e,`End`))))}unmount(){}},Am=class extends Vd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Cu(Gd(this.node.current,`focus`,()=>this.onFocus()),Gd(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function jm(e,t,n){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&P.postRender(()=>i(t,Kd(t)))}var Mm=class extends Vd{mount(){let{current:e}=this.node;e&&(this.unmount=xc(e,e=>(jm(this.node,e,`Start`),(e,{success:t})=>jm(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},Nm=new WeakMap,Pm=new WeakMap,Fm=e=>{let t=Nm.get(e.target);t&&t(e)},Im=e=>{e.forEach(Fm)};function Lm({root:e,...t}){let n=e||document;Pm.has(n)||Pm.set(n,{});let r=Pm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Im,{root:e,...t})),r[i]}function Rm(e,t,n){let r=Lm(t);return Nm.set(e,n),r.observe(e),()=>{Nm.delete(e),r.unobserve(e)}}var zm={some:0,all:1},Bm=class extends Vd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:zm[r]};return Rm(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Vm(e,t))&&this.startObserver()}unmount(){}};function Vm({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Hm={inView:{Feature:Bm},tap:{Feature:Mm},focus:{Feature:Am},hover:{Feature:km}},Um={layout:{ProjectionNode:Em,MeasureLayout:dp}},Wm={current:null},Gm={current:!1};function Km(){if(Gm.current=!0,Ia)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Wm.current=e.matches;e.addListener(t),t()}else Wm.current=!1}var qm=[...iu,V,Ol],Jm=e=>qm.find(ru(e)),Ym=new WeakMap;function Xm(e,t,n){for(let r in t){let i=t[r],a=n[r];if(I(i))e.addValue(r,i);else if(I(a))e.addValue(r,Pc(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Pc(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Zm=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Qm=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Zl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=B.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,P.render(this.render,!1,!0))};let{latestValues:s,renderState:c,onUpdate:l}=a;this.onUpdate=l,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=fo(t),this.isVariantNode=po(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];s[e]!==void 0&&I(t)&&t.set(s[e],!1)}}mount(e){this.current=e,Ym.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),Gm.current||Km(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:Wm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ym.delete(this.current),this.projection&&this.projection.unmount(),Ja(this.notifyUpdate),Ja(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=Wo.has(e),r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&P.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on(`renderRequest`,this.scheduleRender),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Qa){let t=Qa[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Zm.length;t++){let n=Zm[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Xm(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Pc(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Ql(n)||tl(n))?n=parseFloat(n):!Jm(n)&&Ol.test(t)&&(n=Fl(e,t)),this.setBaseTarget(e,I(n)?n.get():n)),I(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Fo(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!I(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Oc),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}},$m=class extends Qm{constructor(){super(...arguments),this.KeyframeResolver=ou}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;I(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function eh(e){return window.getComputedStyle(e)}var th=class extends $m{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Cs}readValueFromInstance(e,t){if(Wo.has(t)){let e=Pl(t);return e&&e.default||0}else{let n=eh(e),r=(Ko(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Xf(e,t)}build(e,t,n){ps(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ks(e,t,n)}},nh=class extends $m{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=G}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Wo.has(t)){let e=Pl(t);return e&&e.default||0}return t=ws.has(t)?t:bo(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return As(e,t,n)}build(e,t,n){ys(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Ts(e,t,n,r)}mount(e){this.isSVGTag=Ss(e.tagName),super.mount(e)}},rh=(e,t)=>No(e)?new nh(t):new th(t,{allowProjection:e!==E.Fragment}),ih=ao(Vs({...Wd,...Hm,...Dm,...Um},rh));function ah(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function oh({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){let i=n||(typeof window>`u`?class{}:window.ResizeObserver);if(!i)throw Error(`This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills`);let[a,o]=(0,E.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=(0,E.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=e?typeof e==`number`?e:e.scroll:null,l=e?typeof e==`number`?e:e.resize:null,u=(0,E.useRef)(!1);(0,E.useEffect)(()=>(u.current=!0,()=>void(u.current=!1)));let[d,f,p]=(0,E.useMemo)(()=>{let e=()=>{if(!s.current.element)return;let{left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d}=s.current.element.getBoundingClientRect(),f={left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d};s.current.element instanceof HTMLElement&&r&&(f.height=s.current.element.offsetHeight,f.width=s.current.element.offsetWidth),Object.freeze(f),u.current&&!dh(s.current.lastBounds,f)&&o(s.current.lastBounds=f)};return[e,l?ah(e,l):e,c?ah(e,c):e]},[o,r,c,l]);function m(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(e=>e.removeEventListener(`scroll`,p,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null),s.current.orientationHandler&&(`orientation`in screen&&`removeEventListener`in screen.orientation?screen.orientation.removeEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.removeEventListener(`orientationchange`,s.current.orientationHandler))}function h(){s.current.element&&(s.current.resizeObserver=new i(p),s.current.resizeObserver.observe(s.current.element),t&&s.current.scrollContainers&&s.current.scrollContainers.forEach(e=>e.addEventListener(`scroll`,p,{capture:!0,passive:!0})),s.current.orientationHandler=()=>{p()},`orientation`in screen&&`addEventListener`in screen.orientation?screen.orientation.addEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.addEventListener(`orientationchange`,s.current.orientationHandler))}return ch(p,!!t),sh(f),(0,E.useEffect)(()=>{m(),h()},[t,p,f]),(0,E.useEffect)(()=>m,[]),[e=>{!e||e===s.current.element||(m(),s.current.element=e,s.current.scrollContainers=lh(e),h())},a,d]}function sh(e){(0,E.useEffect)(()=>{let t=e;return window.addEventListener(`resize`,t),()=>void window.removeEventListener(`resize`,t)},[e])}function ch(e,t){(0,E.useEffect)(()=>{if(t){let t=e;return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>void window.removeEventListener(`scroll`,t,!0)}},[e,t])}function lh(e){let t=[];if(!e||e===document.body)return t;let{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some(e=>e===`auto`||e===`scroll`)&&t.push(e),[...t,...lh(e.parentElement)]}var uh=[`x`,`y`,`top`,`bottom`,`left`,`right`,`width`,`height`],dh=(e,t)=>uh.every(n=>e[n]===t[n]),fh=e=>{throw TypeError(e)},ph=(e,t,n)=>t.has(e)||fh(`Cannot `+n),J=(e,t,n)=>(ph(e,t,`read from private field`),n?n.call(e):t.get(e)),Y=(e,t,n)=>t.has(e)?fh(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),mh=(e,t,n,r)=>(ph(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),hh,gh=class{constructor(){Y(this,hh),this.register=e=>{J(this,hh).push(e)},this.unregister=e=>{for(;J(this,hh).indexOf(e)!==-1;)J(this,hh).splice(J(this,hh).indexOf(e),1)},this.backendChanged=e=>{for(let t of J(this,hh))t.backendChanged(e)},mh(this,hh,[])}};hh=new WeakMap;var X,_h,Z,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh=class e{constructor(t,n,r){if(Y(this,X),Y(this,_h),Y(this,Z),Y(this,vh),Y(this,yh),Y(this,bh,(e,t,n)=>{if(!n.backend)throw Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(n)}`);let r=n.backend(e,t,n.options),i=n.id,a=!n.id&&r&&r.constructor;if(a&&(i=r.constructor.name),!i)throw Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(n)}
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(a&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
This might be unsupported in the future, please specify 'id' explicitely for every backend.`),J(this,Z)[i])throw Error(`You must specify a unique 'id' property in your Backend entry:
${JSON.stringify(n)} (conflicts with: ${JSON.stringify(J(this,Z)[i])})`);return{id:i,instance:r,preview:n.preview??!1,transition:n.transition,skipDispatchOnTransition:n.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>`u`)){if(e.isSetUp)throw Error(`Cannot have two MultiBackends at the same time.`);e.isSetUp=!0,J(this,xh).call(this,window),J(this,Z)[J(this,X)].instance.setup()}},this.teardown=()=>{typeof window>`u`||(e.isSetUp=!1,J(this,Sh).call(this,window),J(this,Z)[J(this,X)].instance.teardown())},this.connectDragSource=(e,t,n)=>J(this,Th).call(this,`connectDragSource`,e,t,n),this.connectDragPreview=(e,t,n)=>J(this,Th).call(this,`connectDragPreview`,e,t,n),this.connectDropTarget=(e,t,n)=>J(this,Th).call(this,`connectDropTarget`,e,t,n),this.profile=()=>J(this,Z)[J(this,X)].instance.profile(),this.previewEnabled=()=>J(this,Z)[J(this,X)].preview,this.previewsList=()=>J(this,_h),this.backendsList=()=>J(this,vh),Y(this,xh,e=>{for(let t of J(this,vh))t.transition&&e.addEventListener(t.transition.event,J(this,Ch))}),Y(this,Sh,e=>{for(let t of J(this,vh))t.transition&&e.removeEventListener(t.transition.event,J(this,Ch))}),Y(this,Ch,e=>{let t=J(this,X);if(J(this,vh).some(t=>t.id!==J(this,X)&&t.transition&&t.transition.check(e)?(mh(this,X,t.id),!0):!1),J(this,X)!==t){J(this,Z)[t].instance.teardown();for(let[e,t]of Object.entries(J(this,yh)))t.unsubscribe(),t.unsubscribe=J(this,wh).call(this,t.func,...t.args);J(this,_h).backendChanged(this);let n=J(this,Z)[J(this,X)];if(n.instance.setup(),n.skipDispatchOnTransition)return;let r=e.constructor,i=new r(e.type,e);e.target?.dispatchEvent(i)}}),Y(this,wh,(e,t,n,r)=>J(this,Z)[J(this,X)].instance[e](t,n,r)),Y(this,Th,(e,t,n,r)=>{let i=`${e}_${t}`,a=J(this,wh).call(this,e,t,n,r);return J(this,yh)[i]={func:e,args:[t,n,r],unsubscribe:a},()=>{J(this,yh)[i].unsubscribe(),delete J(this,yh)[i]}}),!r||!r.backends||r.backends.length<1)throw Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);mh(this,_h,new gh),mh(this,Z,{}),mh(this,vh,[]);for(let e of r.backends){let r=J(this,bh).call(this,t,n,e);J(this,Z)[r.id]=r,J(this,vh).push(r)}mh(this,X,J(this,vh)[0].id),mh(this,yh,{})}};X=new WeakMap,_h=new WeakMap,Z=new WeakMap,vh=new WeakMap,yh=new WeakMap,bh=new WeakMap,xh=new WeakMap,Sh=new WeakMap,Ch=new WeakMap,wh=new WeakMap,Th=new WeakMap,Eh.isSetUp=!1;var Dh=Eh,Oh=(e,t,n)=>new Dh(e,t,n),kh=(e,t)=>({event:e,check:t}),Ah=kh(`touchstart`,e=>{let t=e;return t.touches!==null&&t.touches!==void 0}),jh=kh(`pointerdown`,e=>e.pointerType===`mouse`),Mh;(function(e){e.mouse=`mouse`,e.touch=`touch`,e.keyboard=`keyboard`})(Mh||={});var Nh=class{get delay(){return this.args.delay??0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){return this.args.ignoreContextMenu??!1}get enableHoverOutsideTarget(){return this.args.enableHoverOutsideTarget??!1}get enableKeyboardEvents(){return this.args.enableKeyboardEvents??!1}get enableMouseEvents(){return this.args.enableMouseEvents??!1}get enableTouchEvents(){return this.args.enableTouchEvents??!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){return this.args?.delayTouchStart??this.args?.delay??0}get delayMouseStart(){return this.args?.delayMouseStart??this.args?.delay??0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<`u`)return window}get document(){if(this.context?.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){return this.args?.rootElement||this.document}constructor(e,t){this.args=e,this.context=t}};function Ph(e,t,n,r){return Math.sqrt(Math.abs(n-e)**2+Math.abs(r-t)**2)}function Fh(e,t,n,r,i){if(!i)return!1;let a=Math.atan2(r-t,n-e)*180/Math.PI+180;for(let e=0;e<i.length;++e){let t=i[e];if(t&&(t.start==null||a>=t.start)&&(t.end==null||a<=t.end))return!0}return!1}var Ih={Left:1,Right:2,Center:4},Lh={Left:0,Center:1,Right:2};function Rh(e){return e.button===void 0||e.button===Lh.Left}function zh(e){return e.buttons===void 0||(e.buttons&Ih.Left)===0}function Bh(e){return!!e.targetTouches}var Vh=1;function Hh(e){let t=e.nodeType===Vh?e:e.parentElement;if(!t)return;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Uh(e,t){if(e.targetTouches.length===1)return Wh(e.targetTouches[0]);if(t&&e.touches.length===1&&e.touches[0].target===t.target)return Wh(e.touches[0])}function Wh(e,t){return Bh(e)?Uh(e,t):{x:e.clientX,y:e.clientY}}var Gh=(()=>{let e=!1;try{addEventListener(`test`,()=>{},Object.defineProperty({},`passive`,{get(){return e=!0,!0}}))}catch{}return e})(),Kh={[Mh.mouse]:{start:`mousedown`,move:`mousemove`,end:`mouseup`,contextmenu:`contextmenu`},[Mh.touch]:{start:`touchstart`,move:`touchmove`,end:`touchend`},[Mh.keyboard]:{keydown:`keydown`}},qh=class e{profile(){return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:this.dragOverTargetIds?.length||0}}get document(){return this.options.document}setup(){let t=this.options.rootElement;t&&(O(!e.isSetUp,`Cannot have two Touch backends at the same time.`),e.isSetUp=!0,this.addEventListener(t,`start`,this.getTopMoveStartHandler()),this.addEventListener(t,`start`,this.handleTopMoveStartCapture,!0),this.addEventListener(t,`move`,this.handleTopMove),this.addEventListener(t,`move`,this.handleTopMoveCapture,!0),this.addEventListener(t,`end`,this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,`contextmenu`,this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,`keydown`,this.handleCancelOnEscape,!0))}teardown(){let t=this.options.rootElement;t&&(e.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,`start`,this.handleTopMoveStartCapture,!0),this.removeEventListener(t,`start`,this.handleTopMoveStart),this.removeEventListener(t,`move`,this.handleTopMoveCapture,!0),this.removeEventListener(t,`move`,this.handleTopMove),this.removeEventListener(t,`end`,this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,`contextmenu`,this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,`keydown`,this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,t,n,r=!1){let i=Gh?{capture:r,passive:!1}:r;this.listenerTypes.forEach(function(r){let a=Kh[r][t];a&&e.addEventListener(a,n,i)})}removeEventListener(e,t,n,r=!1){let i=Gh?{capture:r,passive:!1}:r;this.listenerTypes.forEach(function(r){let a=Kh[r][t];a&&e.removeEventListener(a,n,i)})}connectDragSource(e,t){let n=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,t),this.addEventListener(t,`start`,n),()=>{this.sourceNodes.delete(e),this.removeEventListener(t,`start`,n)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,t){let n=this.options.rootElement;if(!this.document||!n)return()=>{};let r=r=>{if(!this.document||!n||!this.monitor.isDragging())return;let i;switch(r.type){case Kh.mouse.move:i={x:r.clientX,y:r.clientY};break;case Kh.touch.move:i={x:r.touches[0]?.clientX||0,y:r.touches[0]?.clientY||0};break}let a=i==null?void 0:this.document.elementFromPoint(i.x,i.y),o=a&&t.contains(a);if(a===t||o)return this.handleMove(r,e)};return this.addEventListener(this.document.body,`move`,r),this.targetNodes.set(e,t),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,`move`,r))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display=`none`,this.draggedSourceNode.removeAttribute(`data-reactid`),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,t,n){this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&Hh(t)},this.handleTopMoveStartCapture=e=>{Rh(e)&&(this.moveStartSourceIds=[])},this.handleMoveStart=e=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(e)},this.handleTopMoveStart=e=>{if(!Rh(e))return;let t=Wh(e);t&&(Bh(e)&&(this.lastTargetTouchFallback=e.targetTouches[0]),this._mouseClientOffset=t),this.waitingForDelay=!1},this.handleTopMoveStartDelay=e=>{if(!Rh(e))return;let t=e.type===Kh.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(e,t)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(t)},this.handleTopMove=e=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;let{moveStartSourceIds:t,dragOverTargetIds:n}=this,r=this.options.enableHoverOutsideTarget,i=Wh(e,this.lastTargetTouchFallback);if(!i)return;if(this._isScrolling||!this.monitor.isDragging()&&Fh(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,i.x,i.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty(`x`)&&t&&Ph(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,i.x,i.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;let a=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(a),this.actions.publishDragSource(),e.cancelable&&e.preventDefault();let o=(n||[]).map(e=>this.targetNodes.get(e)).filter(e=>!!e),s=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(i.x,i.y,o):this.document.elementsFromPoint(i.x,i.y),c=[];for(let e in s){if(!s.hasOwnProperty(e))continue;let t=s[e];for(t!=null&&c.push(t);t;)t=t.parentElement,t&&c.indexOf(t)===-1&&c.push(t)}let l=c.filter(e=>o.indexOf(e)>-1).map(e=>this._getDropTargetId(e)).filter(e=>!!e).filter((e,t,n)=>n.indexOf(e)===t);if(r)for(let e in this.targetNodes){let t=this.targetNodes.get(e);if(a&&t&&t.contains(a)&&l.indexOf(e)===-1){l.unshift(e);break}}l.reverse(),this.actions.hover(l,{clientOffset:i})},this._getDropTargetId=e=>{let t=this.targetNodes.keys(),n=t.next();for(;n.done===!1;){let r=n.value;if(e===this.targetNodes.get(r))return r;n=t.next()}},this.handleTopMoveEndCapture=e=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,zh(e)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}e.cancelable&&e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=e=>{e.key===`Escape`&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new Nh(n,t),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Mh.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Mh.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Mh.keyboard)}},Jh=function(e,t={},n={}){return new qh(e,t,n)},Q=function(){return Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Q.apply(this,arguments)};function $(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Yh(e){var t=e.isVisible,n=e.ease,r=n===void 0?`easeIn`:n,i=e.duration,a=e.variants,o=a===void 0?{open:{opacity:1,height:`auto`},close:{opacity:0,height:0}}:a,s=e.children,c=oh({polyfill:Aa}),l=c[0],u=c[1].height,d=(0,E.useState)(t),f=d[0],p=d[1],m=(0,E.useState)(t),h=m[0],g=m[1],_=(0,E.useState)(!1),v=_[0],y=_[1];return(0,E.useEffect)(function(){y(!0),t?p(!0):g(!1)},[t]),(0,E.useEffect)(function(){f&&g(!0)},[u===0]),E.createElement(ih.div,{style:v?{overflow:`hidden`}:void 0,onAnimationComplete:function(){y(!1),t||p(!1)},initial:h?`open`:`close`,animate:h?`open`:`close`,inherit:!1,variants:o,transition:{ease:r,duration:Xh(u,i)}},E.createElement(`div`,{ref:l},f&&s))}function Xh(e,t){if(t)return t;if(!e)return 0;var n=e/36;return Math.round((4+10*n**.25+n/5)*10)/1500}var Zh=(0,E.createContext)({}),Qh={isLock:!1},$h=function(e){var t=(0,E.useState)(Qh.isLock),n=t[0],r=t[1];return E.createElement(Zh.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},e.children)},eg=(0,E.createContext)({}),tg={dropTargetId:void 0,index:void 0},ng=function(e){var t=(0,E.useState)(tg.dropTargetId),n=t[0],r=t[1],i=(0,E.useState)(tg.index),a=i[0],o=i[1];return E.createElement(eg.Provider,{value:{dropTargetId:n,index:a,showPlaceholder:function(e,t){r(e),o(t)},hidePlaceholder:function(){r(tg.dropTargetId),o(tg.index)}}},e.children)},rg=function(e,t){return e.text>t.text?1:e.text<t.text?-1:0},ig=function(e,t){return e.find(function(e){return e.id===t})},ag=function(e,t,n){if(n===0)return!1;var r=e.find(function(e){return e.id===n});return r===void 0?!1:r.parent===t?!0:ag(e,t,r.parent)},og=function(e){return typeof e==`object`&&!!e&&`id`in e&&`parent`in e&&`text`in e},sg=function(e,t,n){var r=n.tree,i=n.rootId,a=n.canDrop;if(e===null){if(t===i)return!0;var o=r.find(function(e){return e.id===t});return!!(o&&o.droppable)}else{var s=og(e)?e.id:null;if(a){var c=a(s,t);if(c!==void 0)return c}if(s===t)return!1;var l=r.find(function(e){return e.id===s}),o=r.find(function(e){return e.id===t});return l===void 0||s===null?t===i||!!o?.droppable:o===void 0?l.parent!==0:l.parent===t||!o.droppable?!1:!ag(r,s,t)}},cg=function(e,t,n){return e.map(function(e){return e.id===t?Q(Q({},e),{parent:n}):e})},lg=function(e,t,n){if(n===0)return 0;var r=e.filter(function(e){return e.parent===t});return r[n]?e.findIndex(function(e){return e.id===r[n].id}):e.findIndex(function(e){return e.id===r[n-1].id})+1},ug=function(e,t){return e.findIndex(function(e){return e.id===t})},dg=function(e,t,n,r){var i=ug(e,t),a=lg(e,n,r);return a=a>i?a-1:a,[i,a]},fg=function(e,t,n){var r=t<0?e.length+t:t;if(r>=0&&r<e.length){var i=n<0?e.length+n:n,a=e.splice(t,1)[0];e.splice(i,0,a)}},pg=function(e,t,n,r){var i=dg(e,t,n,r),a=i[0],o=i[1],s=$([],e,!0);return fg(s,a,o),s.map(function(e){return e.id===t?Q(Q({},e),{parent:n}):e})},mg=function(e,t){var n=e.getBoundingClientRect();return t>n.top+n.height/2?`down`:`up`},hg=function(e,t){var n=``,r=0;return e.forEach(function(i,a){var o=mg(i,t.getClientOffset()?.y||0);n===``?n=o:n!==o&&(n=o,r=a),a===e.length-1&&o===`down`&&(r=a+1)}),r},gg=function(e,t,n){var r=t.closest(`[role="list"]`)?.querySelectorAll(`:scope > [role="listitem"]`);return r?hg(r,n):null},_g=function(e,t,n){var r=e.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return`middle`;var a=r.top+i;return t>r.bottom-i?`lower`:t<a?`upper`:`middle`},vg=function(e,t,n,r){if(!t)return null;if(e===null){var i=t.querySelectorAll(`:scope > [role="listitem"]`);return{id:r.rootId,index:hg(i,n)}}var a=n.getItem(),o=t.querySelector(`[role="list"]`),s=_g(t,n.getClientOffset()?.y||0,r);if(o){if(s===`upper`)if(sg(a,e.parent,r)){var c=gg(e,t,n);return c===null?null:{id:e.parent,index:c}}else return{id:e.id,index:0};var i=o.querySelectorAll(`:scope > [role="listitem"]`);return{id:e.id,index:hg(i,n)}}else{if(s===`middle`)return{id:e.id,index:0};if(sg(a,e.parent,r)){var c=gg(e,t,n);return c===null?null:{id:e.parent,index:c}}return null}},yg=function(e,t){var n=[],r=function(e,t){var i=e.filter(function(e){return t.includes(e.parent)});i.length>0&&(n=$($([],n,!0),i,!0),r(e,i.map(function(e){return e.id})))};return r(e,[t]),n},bg=function(e){return e===void 0&&(e={}),{backends:[{id:`html5`,backend:Ii,options:e.html5,transition:jh},{id:`touch`,backend:Jh,options:e.touch||{enableMouseEvents:!0},preview:!0,transition:Ah}]}},xg=function(e,t){return e.some(function(e){return e.parent===t})},Sg=(0,E.createContext)({}),Cg=function(e){var t=Fg(e.tree,e.initialOpen),n=t[0],r=t[1],i=r.handleToggle,a=r.handleCloseAll,o=r.handleOpenAll,s=r.handleOpen,c=r.handleClose;(0,E.useImperativeHandle)(e.treeRef,function(){return{open:function(t){return s(t,e.onChangeOpen)},close:function(t){return c(t,e.onChangeOpen)},openAll:function(){return o(e.onChangeOpen)},closeAll:function(){return a(e.onChangeOpen)}}});var l=Wr().getMonitor(),u=e.canDrop,d=e.canDrag,f=Q(Q({extraAcceptTypes:[],listComponent:`ul`,listItemComponent:`li`,placeholderComponent:`li`,sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},e),{openIds:n,onDrop:function(t,n,r){if(t){var i={dragSourceId:t.id,dropTargetId:n,dragSource:t,dropTarget:ig(e.tree,n),monitor:l},a=e.tree;if(ig(a,t.id)||(a=$($([],a,!0),[t],!1)),e.sort===!1){i.destinationIndex=dg(a,t.id,n,r)[1],i.relativeIndex=r,e.onDrop(pg(a,t.id,n,r),i);return}e.onDrop(cg(a,t.id,n),i)}else{var i={dropTargetId:n,dropTarget:ig(e.tree,n),monitor:l};e.sort===!1&&(i.destinationIndex=lg(e.tree,n,r),i.relativeIndex=r),e.onDrop(e.tree,i)}},canDrop:u?function(t,n){return u(e.tree,{dragSourceId:t??void 0,dropTargetId:n,dragSource:l.getItem(),dropTarget:ig(e.tree,n),monitor:l})}:void 0,canDrag:d?function(t){return d(ig(e.tree,t))}:void 0,onToggle:function(t){return i(t,e.onChangeOpen)}});return E.createElement(Sg.Provider,{value:f},e.children)},wg=function(e){return E.createElement(Cg,Q({},e),E.createElement($h,null,E.createElement(ng,null,e.children)))},Tg=function(e){var t=(0,E.useContext)(Zh);(0,E.useEffect)(function(){if(e.current){var n=e.current,r=function(e){var n=e.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&t.lock()},i=function(e){var n=e.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&t.unlock()},a=function(e){return r(e)},o=function(e){return i(e)},s=function(e){return r(e)},c=function(e){return i(e)},l=new MutationObserver(function(){document.activeElement===document.body&&t.unlock()});return l.observe(n,{subtree:!0,childList:!0}),n.addEventListener(`mouseover`,a),n.addEventListener(`mouseout`,o),n.addEventListener(`focusin`,s),n.addEventListener(`focusout`,c),function(){l.disconnect(),n.removeEventListener(`mouseover`,a),n.removeEventListener(`mouseout`,o),n.removeEventListener(`focusin`,s),n.removeEventListener(`focusout`,c)}}},[e,t]),(0,E.useEffect)(function(){var n;(n=e.current)==null||n.setAttribute(`draggable`,t.isLock?`false`:`true`)},[e,t.isLock])},Eg={TREE_ITEM:Symbol()},Dg=null,Og=function(e){var t=e.target;if(t instanceof HTMLElement){var n=t.closest(`[role="listitem"]`);e.currentTarget===n&&(Dg=n)}},kg=function(e){return Og(e)},Ag=function(e){return Og(e)},jg=function(e,t){var n=Lg();(0,E.useEffect)(function(){var e=t.current;return e?.addEventListener(`dragstart`,kg),e?.addEventListener(`touchstart`,Ag,{passive:!0}),function(){e?.removeEventListener(`dragstart`,kg),e?.removeEventListener(`touchstart`,Ag)}},[t]);var r=Zr({type:Eg.TREE_ITEM,item:function(r){var i=Q({ref:t},e);return n.onDragStart&&n.onDragStart(i,r),i},end:function(e,t){var r=e;n.onDragEnd&&n.onDragEnd(r,t)},canDrag:function(){var r=n.canDrag;return Dg===t.current?r?r(e.id):!0:!1},collect:function(e){return{isDragging:e.isDragging()}}});return[r[0].isDragging,r[1],r[2]]},Mg=function(e,t,n){var r=(0,E.useRef)(0),i=(0,E.useRef)(0);return{onDragEnter:function(){r.current+=1,r.current===1&&!t&&(i.current=window.setTimeout(function(){return n(e)},500))},onDragLeave:function(){--r.current,r.current===0&&window.clearTimeout(i.current)},onDrop:function(){i.current>0&&window.clearTimeout(i.current),r.current=0,i.current=0}}},Ng=function(e){var t=Lg(),n=(0,E.useContext)(eg),r=oi({accept:$([Eg.TREE_ITEM],t.extraAcceptTypes,!0),drop:function(e,r){var i=t.rootId,a=t.onDrop,o=n.dropTargetId,s=n.index;r.isOver({shallow:!0})&&o!==void 0&&s!==void 0&&a(og(e)?e:null,i,s),n.hidePlaceholder()},canDrop:function(e,n){var r=t.rootId;return n.isOver({shallow:!0})?e===void 0?!1:sg(e,r,t):!1},hover:function(r,i){if(i.isOver({shallow:!0})){var a=t.rootId,o=n.dropTargetId,s=n.index,c=n.showPlaceholder,l=n.hidePlaceholder,u=vg(null,e.current,i,t);if(u===null||!sg(r,a,t)){l();return}(u.id!==o||u.index!==s)&&c(u.id,u.index)}},collect:function(e){var t=e.getItem();return{isOver:e.isOver({shallow:!0})&&e.canDrop(),dragSource:t}}}),i=r[0];return[i.isOver,i.dragSource,r[1]]},Pg=function(e,t){var n=Lg(),r=(0,E.useContext)(eg),i=oi({accept:$([Eg.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(e,t){var i=r.dropTargetId,a=r.index;t.isOver({shallow:!0})&&i!==void 0&&a!==void 0&&n.onDrop(og(e)?e:null,i,a),r.hidePlaceholder()},canDrop:function(r,i){if(i.isOver({shallow:!0})){var a=vg(e,t.current,i,n);return a===null?!1:sg(r,a.id,n)}return!1},hover:function(i,a){if(a.isOver({shallow:!0})){var o=r.dropTargetId,s=r.index,c=r.showPlaceholder,l=r.hidePlaceholder,u=vg(e,t.current,a,n);if(u===null||!sg(i,u.id,n)){l();return}(u.id!==o||u.index!==s)&&c(u.id,u.index)}},collect:function(e){var t=e.getItem();return{isOver:e.isOver({shallow:!0})&&e.canDrop(),dragSource:t}}}),a=i[0];return[a.isOver,a.dragSource,i[1]]},Fg=function(e,t){var n=(0,E.useMemo)(function(){return t===!0?e.filter(function(t){return xg(e,t.id)}).map(function(e){return e.id}):Array.isArray(t)?t:[]},[t]),r=(0,E.useState)(n),i=r[0],a=r[1];return(0,E.useEffect)(function(){return a(n)},[n]),[i,{handleToggle:function(e,t){var n=i.includes(e)?i.filter(function(t){return t!==e}):$($([],i,!0),[e],!1);a(n),t&&t(n)},handleCloseAll:function(e){a([]),e&&e([])},handleOpenAll:function(t){var n=e.filter(function(t){return xg(e,t.id)}).map(function(e){return e.id});a(n),t&&t(n)},handleOpen:function(t,n){var r=[];if(Array.isArray(t)){var o=e.filter(function(n){return t.includes(n.id)&&xg(e,n.id)});r=$($([],i,!0),o.map(function(e){return e.id}),!0).filter(function(e,t,n){return n.indexOf(e)===t})}else r=i.includes(t)?i:$($([],i,!0),[t],!1);a(r),n&&n(r)},handleClose:function(e,t){var n=i.filter(function(t){return Array.isArray(e)?!e.includes(t):t!==e});a(n),t&&t(n)}}]},Ig=function(){return Qr(function(e){var t=e.getItemType();return{item:e.getItem(),clientOffset:e.getClientOffset(),isDragging:e.isDragging()&&t===Eg.TREE_ITEM}})},Lg=function(){var e=(0,E.useContext)(Sg);if(!e)throw Error(`useTreeContext must be used under TreeProvider`);return e},Rg=function(e,t){var n=Lg(),r=n.rootId,i=n.rootProps,a=n.classes,o=a?.container||``;return t&&a?.dropTarget&&(o=`${o} ${a.dropTarget}`),e===r&&a?.root&&(o=`${o} ${a.root}`),e===r&&i?.className&&(o=`${o} ${i.className}`),o=o.trim(),o},zg=function(e,t,n){t.current?n(t):n(e),(0,E.useEffect)(function(){t.current?n(t):n(e)},[t.current])},Bg=function(e){var t=Lg(),n=(0,E.useContext)(eg),r=(0,E.useRef)(null),i=(0,E.useRef)(null),a=t.tree.find(function(t){return t.id===e.id}),o=t.openIds,s=t.classes,c=t.enableAnimateExpand,l=o.includes(e.id),u=jg(a,r),d=u[0],f=u[1],p=u[2],m=Pg(a,r),h=m[0],g=m[1],_=m[2];zg(r,i,f),sg(g,e.id,t)&&_(r),(0,E.useEffect)(function(){t.dragPreviewRender?p(Fi(),{captureDraggingState:!0}):i.current&&p(r)},[p,t.dragPreviewRender]),Tg(r);var v=(0,E.useCallback)(function(){t.onToggle(a.id)},[a.id,t]),y=t.listItemComponent,b=t.canDrag?t.canDrag(e.id):!0,x=n.dropTargetId===e.id,S={depth:e.depth,isOpen:l,isDragging:d,isDropTarget:x,draggable:b,hasChild:xg(t.tree,e.id),containerRef:r,handleRef:i,onToggle:v},C=``;return s?.listItem&&(C=typeof s.listItem==`string`?s.listItem:s.listItem(a,S)),h&&s?.dropTarget&&(C=`${C} ${s.dropTarget}`),d&&s?.draggingSource&&(C=`${C} ${s.draggingSource}`),E.createElement(y,{ref:r,className:C,role:`listitem`},t.render(a,S),c&&S.hasChild&&E.createElement(Yh,{isVisible:l},E.createElement(Hg,{parentId:e.id,depth:e.depth+1})),!c&&S.hasChild&&l&&E.createElement(Hg,{parentId:e.id,depth:e.depth+1}))},Vg=function(e){var t=Lg(),n=t.placeholderRender,r=t.placeholderComponent,i=t.classes,a=(0,E.useContext)(eg),o=Wr().getMonitor(),s=o.getItem();if(!n||!s)return null;var c=e.dropTargetId===a.dropTargetId&&(e.index===a.index||e.index===void 0&&e.listCount===a.index),l=o.getTargetIds();return!c||!l.length?null:E.createElement(r,{className:i?.placeholder||``},n(s,{depth:e.depth}))},Hg=function(e){var t=Lg(),n=(0,E.useRef)(null),r=t.tree.filter(function(t){return t.parent===e.parentId}),i=r,a=typeof t.sort==`function`?t.sort:rg;if(t.insertDroppableFirst){var o=r.filter(function(e){return e.droppable}),s=r.filter(function(e){return!e.droppable});t.sort===!1?i=$($([],o,!0),s,!0):(o=o.sort(a),s=s.sort(a),i=$($([],o,!0),s,!0))}else t.sort!==!1&&(i=r.sort(a));var c=Ng(n),l=c[0],u=c[1],d=c[2];e.parentId===t.rootId&&sg(u,t.rootId,t)&&d(n);var f=Rg(e.parentId,l),p=t.rootProps||{},m=t.listComponent;return E.createElement(m,Q({ref:n,role:`list`},p,{className:f}),i.map(function(t,n){return E.createElement(E.Fragment,{key:t.id},E.createElement(Vg,{depth:e.depth,listCount:i.length,dropTargetId:e.parentId,index:n}),E.createElement(Bg,{id:t.id,depth:e.depth}))}),E.createElement(Vg,{depth:e.depth,listCount:i.length,dropTargetId:e.parentId}))},Ug={height:`100%`,left:0,pointerEvents:`none`,position:`fixed`,top:0,width:`100%`,zIndex:100},Wg=function(e){var t=e.clientOffset;return t?{pointerEvents:`none`,transform:`translate(${t.x}px, ${t.y}px)`}:{}},Gg=function(){var e=Lg(),t=Ig(),n=t.isDragging,r=t.clientOffset;return!n||!r?null:E.createElement(`div`,{style:Ug},E.createElement(`div`,{style:Wg(t)},e.dragPreviewRender&&e.dragPreviewRender(t)))};function Kg(e,t){return E.createElement(wg,Q({},e,{treeRef:t}),e.dragPreviewRender&&E.createElement(Gg,null),E.createElement(Hg,{parentId:e.rootId,depth:0}))}var qg=(0,E.forwardRef)(Kg),Jg=i(We(),1);function Yg({filter:e,setFilter:t,closeModal:n}){let[r,i]=(0,E.useState)(e.isShowZeroedAccounts??!1),{control:a,handleSubmit:o}=xe({defaultValues:{...e}}),{selectableBusinesses:s,fetching:c}=Se(),{userContext:l}=(0,E.useContext)(at),u=e=>{e.isShowZeroedAccounts=r??!1,e.fromDate?.trim()===``&&(e.fromDate=void 0),e.toDate?.trim()===``&&(e.toDate=void 0),t(e),n()};function d(){t({}),n()}return(0,A.jsxs)(A.Fragment,{children:[c?(0,A.jsx)(`div`,{children:`Loading...`}):(0,A.jsx)(`div`,{}),(0,A.jsxs)(`form`,{onSubmit:o(u),className:`flex flex-col gap-2`,children:[(0,A.jsx)(Ae,{name:`ownerIds`,control:a,defaultValue:void 0,render:({field:e,fieldState:t})=>(0,A.jsx)(ct,{...e,data:s,value:e.value??(l?.context.adminBusinessId?[l?.context.adminBusinessId]:void 0),disabled:c,label:`Owners`,placeholder:`Scroll to see all options`,maxDropdownHeight:160,searchable:!0,error:t.error?.message})}),(0,A.jsx)(Ae,{name:`fromDate`,control:a,defaultValue:e.fromDate,rules:{pattern:{value:S,message:`Date must be im format yyyy-mm-dd`}},render:({field:e,fieldState:t})=>(0,A.jsx)(_e,{...e,onChange:t=>{let n=t?typeof t==`string`?t:Ke(t,`yyyy-MM-dd`):void 0;n!==e.value&&e.onChange(n)},value:e.value?new Date(e.value):void 0,label:`From Date`,error:t.error?.message})}),(0,A.jsx)(Ae,{name:`toDate`,control:a,defaultValue:e.toDate,rules:{pattern:{value:S,message:`Date must be im format yyyy-mm-dd`}},render:({field:e,fieldState:t})=>(0,A.jsx)(_e,{...e,onChange:t=>{let n=t?typeof t==`string`?t:Ke(t,`yyyy-MM-dd`):void 0;n!==e.value&&e.onChange(n)},value:e.value?new Date(e.value):void 0,label:`To Date`,error:t.error?.message})}),(0,A.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,A.jsx)(Ee,{checked:r??!1,onCheckedChange:()=>i(e=>!e)}),(0,A.jsx)(ie,{htmlFor:`enable-dnd`,children:`Show zeroed accounts`})]}),(0,A.jsxs)(`div`,{className:`flex justify-center mt-5 gap-3`,children:[(0,A.jsx)(`button`,{type:`submit`,className:`text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg`,children:`Filter`}),(0,A.jsx)(`button`,{type:`button`,className:`text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg`,onClick:d,children:`Clear`}),(0,A.jsx)(`button`,{type:`button`,className:`text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg`,onClick:n,children:`Cancel`})]})]})]})}function Xg({filter:e,setFilter:t}){let[n,r]=(0,E.useState)(!1),[i,a]=(0,E.useState)(!x(e)),{get:o,set:s}=pt();function c(e){return Object.entries(e??{}).filter(([e,t])=>t!==void 0&&Array.isArray(t)&&t.length>0).length>0}function l(n){(0,Jg.default)(n,e)||(t(n),a(c(n)))}return(0,E.useEffect)(()=>{let t=x(e)?null:encodeURIComponent(JSON.stringify(e));t!==o(`contoReportFilters`)&&s(b,t)},[e,o,s]),(0,A.jsxs)(oe,{open:n,onOpenChange:r,children:[(0,A.jsx)(ae,{asChild:!0,children:(0,A.jsx)(Ce,{inline:!0,size:16,disabled:!i,children:(0,A.jsx)(T,{variant:`outline`,onClick:()=>r(!0),className:`p-2`,children:(0,A.jsx)(He,{size:20})})})}),(0,A.jsxs)(C,{className:`w-100 max-w-screen-md`,children:[(0,A.jsx)(w,{children:(0,A.jsx)(te,{children:`Conto report filters`})}),(0,A.jsx)(Yg,{filter:e,setFilter:l,closeModal:()=>r(!1)})]})]})}var Zg=`deleteDynamicReportTemplate`,Qg=()=>{let[{fetching:e},t]=d(l);return{fetching:e,deleteDynamicReportTemplate:(0,E.useCallback)(async e=>{let n=`Error deleting report template "${e.name}"`,r=`${Zg}-${e.name}`;h.loading(`Deleting report template`,{id:r});try{let i=g(await t(e),n,r);if(i)return h.success(`Success`,{id:r,description:`Report template "${i.deleteDynamicReportTemplate}" deleted`}),i.deleteDynamicReportTemplate}catch(e){console.error(`${n}: ${e}`),h.error(`Error`,{id:r,description:n,duration:1e5,closeButton:!0})}},[t])}};function $g({closeModal:e,setTemplate:t,template:n}){let[r,i]=(0,E.useState)([]),[a,o]=(0,E.useState)({}),[s,c]=(0,E.useState)([]),[{data:l,fetching:d},f]=m({query:u}),{deleteDynamicReportTemplate:p}=Qg(),h=(0,E.useCallback)(async e=>{await p({name:e}),f()},[p,f]),g=(0,E.useCallback)(n=>{t(n),e()},[t,e]),_=(0,E.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,A.jsxs)(T,{variant:`ghost`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,A.jsx)(je,{})]}),cell:({row:e})=>(0,A.jsx)(`div`,{className:`lowercase`,children:e.getValue(`name`)})},{accessorKey:`updated`,header:({column:e})=>(0,A.jsxs)(T,{variant:`ghost`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last Updated`,(0,A.jsx)(je,{})]}),cell:({row:e})=>(0,A.jsx)(`div`,{className:`lowercase`,children:Ke(e.getValue(`updated`),`dd/MM/yyyy HH:mm:ss`)})},{id:`actions`,cell:({row:e})=>{let{name:t}=e.original;return(0,A.jsxs)(Ie,{children:[(0,A.jsx)(Fe,{asChild:!0,children:(0,A.jsxs)(T,{variant:`ghost`,className:`h-8 w-8 p-0`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:`Open menu`}),(0,A.jsx)(Me,{})]})}),(0,A.jsxs)(Re,{align:`end`,children:[(0,A.jsx)(Le,{children:`Actions`}),(0,A.jsx)(Ve,{}),(0,A.jsx)(Ne,{onClick:()=>h(t),children:`Delete`}),(0,A.jsx)(Ne,{onClick:()=>g(t),children:`Select`})]})]})}}],[h,g]),v=qe({data:l?.allDynamicReports||[],columns:_,onSortingChange:i,getCoreRowModel:it(),getPaginationRowModel:et(),getSortedRowModel:Ze(),onRowSelectionChange:o,onColumnFiltersChange:c,getFilteredRowModel:Je(),state:{sorting:r,rowSelection:a,columnFilters:s}});return(0,A.jsxs)(`div`,{className:`w-full h-[450px] relative`,children:[d&&(0,A.jsx)(`div`,{className:`absolute bg-white/60 z-10 h-full w-full flex items-center justify-center`,children:(0,A.jsx)(`div`,{className:`flex items-center`,children:(0,A.jsx)(`span`,{className:`text-3xl mr-4`,children:(0,A.jsx)(ee,{className:`h-10 w-10 animate-spin mr-2 self-center`})})})}),(0,A.jsx)(`div`,{className:`flex items-center py-4`,children:(0,A.jsx)(ze,{placeholder:`Filter templates...`,value:v.getColumn(`name`)?.getFilterValue()??``,onChange:e=>v.getColumn(`name`)?.setFilterValue(e.target.value),className:`max-w-sm`})}),(0,A.jsx)(`div`,{className:`rounded-md border`,children:(0,A.jsxs)(rt,{children:[(0,A.jsx)(Ge,{children:v.getHeaderGroups().map(e=>(0,A.jsx)($e,{children:e.headers.map(e=>(0,A.jsx)(Xe,{children:e.isPlaceholder?null:nt(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,A.jsx)(Qe,{children:v.getRowModel().rows?.length?v.getRowModel().rows.map(e=>(0,A.jsx)($e,{"data-state":e.original.name===n&&`selected`,children:e.getVisibleCells().map(e=>(0,A.jsx)(tt,{children:nt(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,A.jsx)($e,{children:(0,A.jsx)(tt,{colSpan:_.length,className:`h-24 text-center`,children:`No results.`})})})]})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end space-x-2 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex-1 text-sm text-muted-foreground`,children:[v.getFilteredSelectedRowModel().rows.length,` of`,` `,v.getFilteredRowModel().rows.length,` row(s) selected.`]}),(0,A.jsxs)(`div`,{className:`space-x-2`,children:[(0,A.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>v.previousPage(),disabled:!v.getCanPreviousPage(),children:`Previous`}),(0,A.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>v.nextPage(),disabled:!v.getCanNextPage(),children:`Next`})]})]})]})}function e_({template:e,setTemplate:t}){let[n,r]=(0,E.useState)(!1);return(0,A.jsxs)(oe,{open:n,onOpenChange:r,children:[(0,A.jsx)(Oe,{content:`Manage templates`,children:(0,A.jsx)(ae,{asChild:!0,children:(0,A.jsx)(T,{variant:`outline`,onClick:()=>r(!0),className:`p-2`,children:(0,A.jsx)(ht,{size:20})})})}),(0,A.jsxs)(C,{className:`max-w-screen-md`,children:[(0,A.jsx)(w,{children:(0,A.jsx)(te,{children:`Conto report templates`})}),(0,A.jsx)($g,{closeModal:()=>r(!1),template:e,setTemplate:t})]})]})}var t_=`insertDynamicReportTemplate`,n_=()=>{let[{fetching:e},t]=d(c);return{fetching:e,insertDynamicReportTemplate:(0,E.useCallback)(async e=>{let n=`Error inserting report template "${e.name}"`,r=`${t_}-${e.name}`;h.loading(`Saving report template`,{id:r});try{let i=g(await t(e),n,r);if(i)return h.success(`Success`,{id:r,description:`Report template "${i.insertDynamicReportTemplate.name}" saved`}),i.insertDynamicReportTemplate}catch(e){console.error(`${n}: ${e}`),h.error(`Error`,{id:r,description:n,duration:1e5,closeButton:!0})}},[t])}},r_=de({name:De().min(5,{message:`Name must be at least 5 characters long`}),template:De()});function i_({tree:e,setFetching:t,closeModal:n}){let r=(0,E.useMemo)(()=>{let t=e.filter(e=>e.data?.sortCode==null&&e.data?.value==null);return JSON.stringify(t.map(e=>({id:e.id,parent:e.parent,text:e.text,droppable:e.droppable??void 0,data:e.data?{hebrewText:e.data.hebrewText??void 0,value:e.data.value,sortCode:e.data.sortCode,isOpen:e.data.isOpen,descendantSortCodes:e.data.descendantSortCodes,descendantFinancialEntities:e.data.descendantFinancialEntities,mergedSortCodes:e.data.mergedSortCodes}:void 0})))},[e]),i=xe({resolver:fe(r_),defaultValues:{name:`template-${Ke(new Date,`yyyy-MM-dd`)}`,template:r}}),{insertDynamicReportTemplate:a,fetching:o}=n_(),s=(0,E.useCallback)(async e=>{try{await a({...e,template:r}),n()}catch(e){console.error(e),i.setError(`root`,{message:`Failed to save template`})}},[n,i,a,r]);return(0,E.useEffect)(()=>{t(o)},[o,t]),(0,A.jsx)(le,{...i,children:(0,A.jsxs)(`form`,{onSubmit:i.handleSubmit(s),className:`flex flex-col gap-2`,children:[(0,A.jsx)(ge,{control:i.control,name:`name`,render:({field:e})=>(0,A.jsxs)(ve,{children:[(0,A.jsx)(ue,{children:`Template Name`}),(0,A.jsx)(Te,{children:(0,A.jsx)(ze,{...e,required:!0})}),(0,A.jsx)(pe,{})]})}),(0,A.jsxs)(se,{children:[(0,A.jsx)(T,{disabled:o,type:`submit`,children:`Save`}),(0,A.jsx)(T,{disabled:o,variant:`outline`,onClick:n,children:`Cancel`})]})]})})}function a_({tree:e}){let[t,n]=(0,E.useState)(!1),[r,i]=(0,E.useState)(!1);return(0,A.jsxs)(oe,{open:t,onOpenChange:n,children:[(0,A.jsx)(ae,{asChild:!0,children:(0,A.jsx)(Oe,{content:`Save template`,children:(0,A.jsx)(T,{variant:`outline`,disabled:r,onClick:()=>n(!0),className:`p-2`,children:(0,A.jsx)(gt,{size:20})})})}),(0,A.jsxs)(C,{className:`w-100 max-w-screen-md`,children:[(0,A.jsx)(w,{children:(0,A.jsx)(te,{children:`Save Conto report template`})}),(0,A.jsx)(i_,{tree:e,setFetching:i,closeModal:()=>n(!1)})]})]})}var o_=({tree:e,filters:t})=>{let n=(0,E.useCallback)(async()=>{let n=s_(t.fromDate,t.toDate);return{fileContent:c_(e),fileName:`conto_report`+n}},[t.fromDate,t.toDate,e]);return e.length?(0,A.jsx)(ye,{createFileVariables:n}):(0,A.jsx)(`div`,{})};function s_(e,t){return e&&t?`_${e}_to_${t}`:e?`_since_${e}`:t?`_until_${t}`:``}var c_=e=>{let t=e.filter(e=>e.parent===v_);if(!t.length)return`No Report Data`;let n=[{content:`Account`,depth:0,amount:`ILS Amount`,suffix:``,type:`CATEGORY`}],{rows:r,maxDepth:i}=l_(t,e,0);return n.push(...r),n.map(e=>{let{depth:t}=e,n=t,r=i-t;switch(e.type){case`SORT_CODE`:n=i-1,r=1;break;case`FINANCIAL_ENTITY`:n=i,r=0;break}return`${`,`.repeat(n)}${u_(e.content)},${u_(e.suffix??``)}${`,`.repeat(r)},${u_(e.amount)}`}).join(`\r
`)};function l_(e,t,n){if(e.length===0)return{rows:[],maxDepth:n,sum:0};let r=n,i=[],a=0;return e.map(e=>{if(e.data?.value!=null){a+=e.data.value;let t={content:e.text,depth:n,amount:e.data.value,suffix:``,type:`FINANCIAL_ENTITY`};i.push(t);return}let o=yg(t,e.id),s=o.filter(t=>t.parent===e.id),c={content:e.text,suffix:e.data?.sortCode??``,depth:n,amount:o.reduce((e,t)=>e+(t.data?.value??0),0),type:e.data?.sortCode?`SORT_CODE`:`CATEGORY`};i.push(c);let l=l_(s,t,n+1);i.push(...l.rows),l.maxDepth>r&&(r=l.maxDepth)}),{rows:i,maxDepth:r,sum:a}}function u_(e){return e===``?``:Number.isNaN(Number(e))?e.replace(/"/g,`""`).replace(/,/g,`.`):Number(e).toFixed(2)}var d_=e=>e.droppable?e.open?(0,A.jsx)(_t,{size:30}):(0,A.jsx)(yt,{size:30}):(0,A.jsx)(lt,{}),f_=e=>{let{item:t}=e.monitorProps;return(0,A.jsxs)(`div`,{className:`items-center bg-zinc-600 rounded shadow-[0_12px_24px_-6px_rgba(0,0,0,0.25),0_0_0_1px_rgba(0,0,0,0.08)] text-white text-sm inline-grid grid-cols-[auto_auto] gap-2 py-1 px-2 pointer-events-none`,children:[(0,A.jsx)(`div`,{className:`items-center flex`,children:(0,A.jsx)(d_,{droppable:t.droppable||!1})}),(0,A.jsx)(`div`,{className:`items-center flex`,children:t.text})]})},p_=ke(f.Ils,{trailingZeroDisplay:`stripIfInteger`}),m_=e=>{let{id:t,text:n,droppable:r}=e.node,[i,a]=(0,E.useState)(!1),[o,s]=(0,E.useState)(n),[c,l]=(0,E.useState)(!0),u=e.depth*24,d=t=>{t.stopPropagation(),e.onToggle(e.node.id)},f=()=>{a(!0)},p=()=>{s(n),a(!1)},m=e=>{s(e.target.value)},h=()=>{a(!1),e.onTextChange(t,o)},g=Mg(t,e.isOpen,e.onToggle),_=r&&!e.node.data?.sortCode;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`items-center grid grid-cols-[auto_auto_1fr_auto] h-10 pe-2`,style:{paddingInlineStart:u},...g,children:[e.node.droppable?(0,A.jsxs)(`button`,{className:`cursor-pointer`,onClick:d,children:[(0,A.jsx)(d_,{droppable:r||!1,open:e.isOpen}),!e.isOpen&&(0,A.jsx)(`div`,{className:`relative -top-5 font-bold text-xs`,children:e.descendants.filter(e=>!e.droppable).length})]}):(0,A.jsx)(d_,{droppable:r||!1,open:e.isOpen}),(0,A.jsx)(`div`,{className:`ps-2`,children:i&&_?(0,A.jsxs)(`div`,{className:`items-center grid grid-cols-[repeat(3,auto)] justify-start `,children:[(0,A.jsx)(ze,{className:`text-sm py-2 w-48`,value:o,onChange:m}),(0,A.jsx)(ot,{className:`p-1`,onClick:h,disabled:o===``,children:(0,A.jsx)(re,{className:`text-xl`})}),(0,A.jsx)(ot,{className:`p-1`,onClick:p,children:(0,A.jsx)(ce,{className:`text-xl`})})]}):(0,A.jsxs)(`div`,{className:`items-center grid grid-cols-[repeat(4,auto)] justify-start`,children:[(0,A.jsx)(st,{variant:`body2`,className:`pr-2`,children:e.node.text}),e.node.data?.sortCode&&(0,A.jsxs)(Ye,{variant:`outline`,children:[`Sort Code `,e.node.data?.sortCode]}),(0,A.jsx)(Ye,{children:p_.format(e.node.data?.value==null?e.descendants.filter(e=>!e.droppable).reduce((e,t)=>e+(t.data?.value??0),0):e.node.data.value)}),_&&(0,A.jsxs)(Ie,{children:[(0,A.jsx)(Fe,{asChild:!0,children:(0,A.jsx)(T,{variant:`ghost`,size:`sm`,className:`p-1`,children:(0,A.jsx)(Me,{size:20})})}),(0,A.jsx)(Re,{className:`w-56`,children:(0,A.jsxs)(Be,{children:[(0,A.jsxs)(Ne,{onClick:f,children:[`Edit Category`,(0,A.jsx)(Pe,{children:(0,A.jsx)(Ue,{size:15})})]}),_&&(0,A.jsxs)(Ne,{onClick:()=>e.onDeleteCategory(t),children:[`Delete Category`,(0,A.jsx)(Pe,{children:(0,A.jsx)(we,{size:15,color:`red`})})]})]})})]}),!r&&(0,A.jsx)(`div`,{className:`pl-2`,children:(0,A.jsx)(Oe,{content:`Expand records`,children:(0,A.jsx)(T,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>l(e=>!e),children:c?(0,A.jsx)(be,{className:`size-5`}):(0,A.jsx)(me,{className:`size-5`})})})})]})})]}),!r&&c&&(0,A.jsx)(`div`,{children:(0,A.jsx)(mt,{businessID:e.node.id,filter:e.filter})})]})},h_=e=>(0,A.jsx)(`div`,{className:`bg-[#1967d2] h-0.5 absolute -translate-y-2/4 right-0 top-0`,style:{left:e.depth*24}}),g_=({tree:e,onDrop:t,rootId:n,handleIsOpenChange:r,handleTextChange:i,handleDeleteCategory:a,filter:o,enableDnd:s})=>(0,A.jsx)(qg,{tree:e,onDrop:t,rootId:n,classes:{root:`box-border h-full p-4`,draggingSource:`opacity-30`,placeholder:`relative`},render:(0,E.useCallback)((t,{depth:n,isOpen:s,onToggle:c})=>(0,A.jsx)(m_,{node:t,depth:n,isOpen:s,onToggle:()=>{c(),r(t.id,!s)},onTextChange:i,onDeleteCategory:a,descendants:yg(e,t.id),filter:o}),[e,i,a,r,o]),dragPreviewRender:(0,E.useCallback)(e=>(0,A.jsx)(f_,{monitorProps:e}),[]),sort:!1,insertDroppableFirst:!1,canDrag:()=>s,canDrop:(e,{dragSource:t,dropTargetId:n})=>{if(!s)return!1;if(t?.parent===n)return!0},dropTargetOffset:10,placeholderRender:(e,{depth:t})=>(0,A.jsx)(h_,{node:e,depth:t}),initialOpen:e.filter(e=>e.data?.isOpen).map(e=>e.id)}),__=`bank`,v_=`report`;function y_(e){let t=new Map,n=new Map;return e.map(({data:e,id:r})=>{e?.descendantSortCodes?.length&&e.descendantSortCodes.map(e=>t.set(e,r)),e?.descendantFinancialEntities?.length&&e.descendantFinancialEntities.map(e=>n.set(e,r))}),{sortCodeMap:t,financialEntitiesMap:n}}function b_(e,t,n){let r=[...e];return t.map(e=>{if(r.find(t=>t.id===e.id))return;let t=n.get(e.key)??void 0;r.push({id:e.id,parent:t??__,droppable:!0,text:e.name,data:{sortCode:e.key,isOpen:!1}})}),r}function x_(e,t,n,r){let i=[...e];return t.map(e=>{let t=e.total.raw*-1;if(!r&&Math.abs(t)<.005)return;let a=i.find(t=>t.id===e.business.id);if(a){a.data?.value!==t&&(a.data={...a.data,isOpen:!1,value:t});return}let o=n.get(e.business.id);o||=i.find(t=>t.id===e.business.sortCode?.id)?e.business.sortCode.id:__,i.push({id:e.business.id,parent:o,droppable:!1,text:e.business.name,data:{value:t,isOpen:!1}})}),i}function S_(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`.split(``);e||=Math.floor(Math.random()*t.length);let n=``;for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}var C_=()=>{let{setFiltersContext:e}=(0,E.useContext)(dt),[t,n]=(0,E.useState)([]),[r,i]=(0,E.useState)(!1),[a,o]=(0,E.useState)(void 0),{get:s}=pt(),[c,l]=(0,E.useState)(s(`contoReportFilters`)?JSON.parse(decodeURIComponent(s(b))):{}),[{data:u,fetching:d,error:f}]=m({query:_,variables:{filters:{fromDate:c?.fromDate,toDate:c?.toDate,ownerIds:c?.ownerIds}}}),{sortCodes:g,fetching:v}=he(),[{data:y,fetching:x,error:S},C]=m({query:p,variables:{name:a??``},pause:!0}),w=(0,E.useCallback)((e,{dragSourceId:r,dropTargetId:i,dragSource:a})=>{let o=new Set(e.map(e=>e.id)),s=a?.parent,c=a?.data?.sortCode!=null,l=a?.data?.value!=null;n([...e,...t.filter(e=>!o.has(e.id))].map(e=>{if(e.id===r)return{...e,parent:i};if(c||l){if(e.id===i)return{...e,data:{isOpen:!0,...e.data,descendantFinancialEntities:l?[...e.data?.descendantFinancialEntities??[],r]:e.data?.descendantFinancialEntities,descendantSortCodes:c?[...e.data?.descendantSortCodes??[],r]:e.data?.descendantSortCodes}};if(e.id===s)return{...e,data:{isOpen:!0,...e.data,descendantFinancialEntities:l&&e.data?.descendantFinancialEntities?.length?e.data.descendantFinancialEntities.filter(e=>e!==r):e.data?.descendantFinancialEntities,descendantSortCodes:l&&e.data?.descendantSortCodes?.length?e.data.descendantSortCodes.filter(e=>e!==r):e.data?.descendantSortCodes}}}return e}))},[n,t]),te=(0,E.useCallback)(e=>{n(t.filter(t=>t.id!==e).map(t=>t.parent===e?{...t,parent:__}:t))},[n,t]),ne=(0,E.useCallback)(()=>{let e={id:`synthetic-${S_(8)}`,parent:__,droppable:!0,text:`New Category`,data:{isOpen:!1}};n([...t,e])},[n,t]),re=(e,r)=>{n(t.map(t=>t.id===e?{...t,text:r}:t))},ae=(e,r)=>{n(t.map(t=>t.id===e?{...t,data:{...t.data,isOpen:r}}:t))};(0,E.useEffect)(()=>{a&&a!==``&&C()},[a,C]),(0,E.useEffect)(()=>{e((0,A.jsxs)(`div`,{className:`flex flex-row gap-2`,children:[(0,A.jsx)(o_,{tree:t,filters:c}),(0,A.jsx)(e_,{template:a,setTemplate:o}),(0,A.jsx)(a_,{tree:t}),(0,A.jsx)(Oe,{content:`Add new category`,children:(0,A.jsx)(T,{variant:`outline`,onClick:ne,className:`gap-2 p-2`,children:(0,A.jsx)(vt,{size:20})})}),(0,A.jsx)(Xg,{filter:c,setFilter:l}),(0,A.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,A.jsx)(Ee,{id:`enable-dnd`,checked:r,onCheckedChange:()=>{i(e=>!e)}}),(0,A.jsxs)(ie,{htmlFor:`enable-dnd`,children:[`Form is `,r?`editable`:`locked`]})]})]}))},[e,r,c,l,ne,t,a]);let oe=(0,E.useMemo)(()=>u&&u?.businessTransactionsSumFromLedgerRecords.__typename!==`CommonError`?u.businessTransactionsSumFromLedgerRecords.businessTransactionsSum:[],[u]),se=(0,E.useCallback)(()=>{n(e=>{let{sortCodeMap:t,financialEntitiesMap:n}=y_(e);return x_(b_(e,g,t),oe,n,c.isShowZeroedAccounts)})},[g,oe,c.isShowZeroedAccounts,n]);(0,E.useEffect)(()=>{!x&&y&&(n(y.dynamicReport.template.map(e=>({...e,data:{...e.data,hebrewText:e.data.hebrewText??void 0}}))),se())},[y,x,se]),(0,E.useEffect)(()=>{se()},[g,oe,c.isShowZeroedAccounts,se]),(0,E.useEffect)(()=>{f&&(console.error(f),h.error(`Error`,{description:`Unable to fetch businesses summary`}))},[f]),(0,E.useEffect)(()=>{S&&(console.error(S),h.error(`Error`,{description:`Unable to fetch template`}))},[S]);let ce=yg(t,v_),le=yg(t,__),ue=(0,E.useMemo)(()=>!g&&v||!u&&d,[g,v,u,d]);return(0,A.jsx)(hr,{backend:Oh,options:bg(),children:(0,A.jsxs)(`div`,{className:`h-full grid grid-cols-[auto_1fr] relative`,children:[ue&&(0,A.jsx)(`div`,{className:`absolute bg-white/60 z-10 h-full w-full flex items-center justify-center`,children:(0,A.jsx)(`div`,{className:`flex items-center`,children:(0,A.jsx)(`span`,{className:`text-3xl mr-4`,children:(0,A.jsx)(ee,{className:`h-10 w-10 animate-spin mr-2 self-center`})})})}),(0,A.jsxs)(`div`,{className:`border-r border-solid corder-color-zinc-100 relative`,children:[(0,A.jsx)(st,{variant:`h5`,className:`px-4`,children:`Bank`}),(0,A.jsx)(g_,{rootId:__,tree:le,onDrop:w,handleTextChange:re,handleDeleteCategory:te,handleIsOpenChange:ae,enableDnd:r,filter:c})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(st,{variant:`h5`,className:`px-4`,children:`Report`}),(0,A.jsx)(g_,{rootId:v_,tree:ce,onDrop:w,handleTextChange:re,handleDeleteCategory:te,handleIsOpenChange:ae,enableDnd:r,filter:c})]})]})})};export{C_ as ContoReport};