realtimex-crm 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var zo=Object.defineProperty;var o=(e,t)=>zo(e,"name",{value:t,configurable:!0});import{u as Yo,a as Ko,b as Jo,c as Xo,d as Qo,e as Wt,r as v,f as ur,g as Zo,h as fr,i as es,j as ts,k as ns,l as Dn,m as g,F as pr,n as gr,o as mr,p as hr,C as rs,B as br,X as os,_ as ss,q as is,s as as,t as ls,I as xr,v as vr,R as cs,w as ds,x as us,y as fs,z as ps,A as L,D as gs,E as yr,G as he,H as Dr,J as ms,K as Vt,L as Ut,M as it,N as at,O as lt,P as ct,Q as dt,S as hs,T as bs,U as Sr,V as Sn,W as Ae,Y as Ir,Z as xs,$ as vs,a0 as $e,a1 as Ot,a2 as ys,a3 as Ht,a4 as ut,a5 as Ds,a6 as Ss,a7 as Cr,a8 as Is,a9 as Cs,aa as qt,ab as ws,ac as Es,ad as wr,ae as Er,af as zt,ag as Nr,ah as Je,ai as Ns,aj as Ps,ak as Pr,al as Ar,am as As,an as Rs,ao as Os,ap as Ts,aq as Bs,ar as js,as as Ls,at as Ms,au as _s,av as Fs,aw as Rr,ax as Gs,ay as $s,az as ks,aA as Ws,aB as Vs,aC as Us,aD as Hs,aE as qs,aF as qe,aG as zs,aH as Ys,aI as Ks}from"./index-Ce7mf_H5.js";var Re=function(){return Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Re.apply(this,arguments)},Js=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},Xs=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},Qs=o(function(e){var t,n=e.debounce,r=e.enableGetChoices,s=e.filter,i=e.page,a=i===void 0?1:i,l=e.perPage,c=l===void 0?25:l,d=e.sort,p=d===void 0?{field:"id",order:"DESC"}:d,f=e.queryOptions,u=f===void 0?{}:f,m=e.reference,h=e.source,x=Yo().getValues,b=Ko(h),D=(t=Jo({name:b}))!==null&&t!==void 0?t:x(b),S=u.meta,E=Js(u,["meta"]),I=Xo(m,{ids:D||Zs,meta:S},{enabled:D!=null&&D.length>0}),C=I.data,N=I.error,O=I.isLoading,T=I.isFetching,$=I.isPaused,P=I.isPending,A=I.isPlaceholderData,k=I.refetch,K=Qo({resource:m,page:a,perPage:c,sort:p,debounce:n,filter:s}),j=K[0],F=K[1],se=C?C.filter(Boolean):[],ye=r?r(j.filterValues):!0,W=Wt(m,{pagination:{page:j.page,perPage:j.perPage},sort:{field:j.sort,order:j.order},filter:Re(Re({},j.filter),s),meta:S},Re({retry:!1,enabled:ye,placeholderData:o(function(H){return H},"placeholderData")},E)),ee=W.data,de=W.total,te=W.pageInfo,De=W.error,ie=W.isLoading,Ve=W.isFetching,Se=W.isPaused,Ie=W.isPending,Ue=W.isPlaceholderData,He=W.refetch,ue=ee&&ee.length>0?ei(ee,se):se.length>0?se:ee,Ce=v.useCallback(function(){k(),He()},[k,He]),yn=v.useMemo(function(){return{field:j.sort,order:j.order}},[j.sort,j.order]);return{sort:yn,allChoices:ue,availableChoices:ee,selectedChoices:se,displayedFilters:j.displayedFilters,error:N||De,filter:s,filterValues:j.filterValues,hideFilter:F.hideFilter,isFetching:T||Ve,isLoading:O||ie,isPaused:$||Se,isPending:P||Ie,isPlaceholderData:A||Ue,page:j.page,perPage:j.perPage,refetch:Ce,resource:m,setFilters:F.setFilters,setPage:F.setPage,setPerPage:F.setPerPage,setSort:F.setSort,showFilter:F.showFilter,source:h,total:de,hasNextPage:te?te.hasNextPage:de!=null?j.page*j.perPage<de:void 0,hasPreviousPage:te?te.hasPreviousPage:j.page>1,isFromReference:!0}},"useReferenceArrayInputController"),Zs=[],ei=o(function(e,t){var n=Xs([],e,!0),r=e.map(function(s){return s.id});return t.forEach(function(s){r.includes(s.id)||(r.push(s.id),n.push(s))}),n},"mergeReferences");const ti=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],ni=ur("archive-restore",ti);const ri=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],oi=ur("archive",ri),Or=o(e=>{const{filterToQuery:t=si,inputText:n}=e,{allChoices:r=[],source:s,resource:i,isFromReference:a,setFilters:l}=Zo(e),{id:c,field:d,isRequired:p}=fr({...e,source:s}),f=es(),{placeholder:u=f("ra.action.search",{_:"Search..."})}=e,m=ts(i),{getChoiceText:h,getChoiceValue:x}=ns({optionText:e.optionText??(a?m:"name"),optionValue:e.optionValue??"id",disableValue:e.disableValue,translateChoice:e.translateChoice??!a}),b=v.useRef(null),[D,S]=v.useState(!1),E=Dn(P=>{d.onChange(d.value.filter(A=>A!==x(P)))}),I=Dn(P=>{const A=b.current;A&&((P.key==="Delete"||P.key==="Backspace")&&A.value===""&&d.onChange(d.value.slice(0,-1)),P.key==="Escape"&&A.blur())}),C=r.filter(P=>!d.value.includes(x(P))),N=r.filter(P=>d.value.includes(x(P))),[O,T]=v.useState(""),$=v.useCallback(P=>typeof n=="function"?n(P):n!==void 0?n:h(P),[n,h]);return g.jsxs(pr,{className:e.className,id:c,name:d.name,children:[e.label!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:e.label,source:e.source??s,resource:i,isRequired:p})}),g.jsx(hr,{children:g.jsxs(rs,{onKeyDown:I,shouldFilter:!a,className:"overflow-visible bg-transparent",children:[g.jsx("div",{className:"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.map(P=>g.jsxs(br,{variant:"outline",children:[$(P),g.jsxs("button",{className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",onKeyDown:o(A=>{A.key==="Enter"&&E(P)},"onKeyDown"),onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onClick:o(A=>{A.preventDefault(),E(P)},"onClick"),children:[g.jsx("span",{className:"sr-only",children:f("ra.action.remove",{_:"Remove"})}),g.jsx(os,{className:"h-3 w-3"})]})]},x(P))),g.jsx(ss.Input,{ref:b,value:O,onValueChange:o(P=>{T(P),a&&l(t(P),void 0,!0)},"onValueChange"),onBlur:o(()=>S(!1),"onBlur"),onFocus:o(()=>S(!0),"onFocus"),placeholder:u,className:"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"})]})}),g.jsx("div",{className:"relative",children:g.jsx(is,{children:D&&C.length>0?g.jsx("div",{className:"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:g.jsx(as,{className:"h-full overflow-auto",children:C.map(P=>g.jsx(ls,{onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onSelect:o(()=>{T(""),a&&l(t("")),d.onChange([...d.value,x(P)])},"onSelect"),className:"cursor-pointer",children:h(P)},x(P)))})}):null})})]})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"AutocompleteArrayInput"),si=o(e=>({q:e}),"DefaultFilterToQuery"),ii=o(e=>{const{children:t=ai,reference:n,sort:r,filter:s=li}=e;if(v.Children.count(t)!==1)throw new Error("<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)");const i=Qs({...e,sort:r,filter:s});return g.jsx(cs,{value:n,children:g.jsx(ds,{value:i,children:t})})},"ReferenceArrayInput"),ai=g.jsx(Or,{}),li={},ci=o(e=>{const{label:t,source:n,className:r,resource:s,validate:i,format:a,parse:l=di,onFocus:c,...d}=e,p=us({resource:s}),{id:f,field:u,isRequired:m}=fr(e),h=o(I=>{const C=I.target.value,N=l(C);b(C),u.onChange(N??0)},"handleChange"),[x,b]=v.useState(u.value?.toString()??""),D=v.useRef(!1),S=o(I=>{c?.(I),D.current=!0},"handleFocus"),E=o(I=>{u.onBlur?.(I),D.current=!1,b(u.value?.toString()??"")},"handleBlur");return v.useEffect(()=>{D.current||b(u.value?.toString()??"")},[u.value]),g.jsxs(pr,{id:f,className:r,name:u.name,children:[t!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:t,source:n,resource:p,isRequired:m})}),g.jsx(hr,{children:g.jsx(fs,{...d,...u,type:"number",value:x,onChange:h,onFocus:S,onBlur:E})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"NumberInput"),di=o(e=>{if(e==null||e==="")return null;const t=parseFloat(e);return isNaN(t)?0:t},"convertStringToNumber");function U(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. `}o(U,"formatProdErrorMessage");var ui=typeof Symbol=="function"&&Symbol.observable||"@@observable",In=ui,Cn=o(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),fi={INIT:`@@redux/INIT${Cn()}`,REPLACE:`@@redux/REPLACE${Cn()}`},wn=fi;function pi(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}o(pi,"isPlainObject");function Tr(e,t,n){if(typeof e!="function")throw new Error(U(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(U(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(U(1));return n(Tr)(e,t)}let r=e,s=t,i=new Map,a=i,l=0,c=!1;function d(){a===i&&(a=new Map,i.forEach((b,D)=>{a.set(D,b)}))}o(d,"ensureCanMutateNextListeners");function p(){if(c)throw new Error(U(3));return s}o(p,"getState");function f(b){if(typeof b!="function")throw new Error(U(4));if(c)throw new Error(U(5));let D=!0;d();const S=l++;return a.set(S,b),o(function(){if(D){if(c)throw new Error(U(6));D=!1,d(),a.delete(S),i=null}},"unsubscribe")}o(f,"subscribe");function u(b){if(!pi(b))throw new Error(U(7));if(typeof b.type>"u")throw new Error(U(8));if(typeof b.type!="string")throw new Error(U(17));if(c)throw new Error(U(9));try{c=!0,s=r(s,b)}finally{c=!1}return(i=a).forEach(S=>{S()}),b}o(u,"dispatch");function m(b){if(typeof b!="function")throw new Error(U(10));r=b,u({type:wn.REPLACE})}o(m,"replaceReducer");function h(){const b=f;return{subscribe(D){if(typeof D!="object"||D===null)throw new Error(U(11));function S(){const I=D;I.next&&I.next(p())}return o(S,"observeState"),S(),{unsubscribe:b(S)}},[In](){return this}}}return o(h,"observable"),u({type:wn.INIT}),{dispatch:u,subscribe:f,getState:p,replaceReducer:m,[In]:h}}o(Tr,"createStore$1");function En(e,t){return function(...n){return t(e.apply(this,n))}}o(En,"bindActionCreator");function Nn(e,t){if(typeof e=="function")return En(e,t);if(typeof e!="object"||e===null)throw new Error(U(16));const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=En(s,t))}return n}o(Nn,"bindActionCreators$1");function Br(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}o(Br,"compose");function gi(...e){return t=>(n,r)=>{const s=t(n,r);let i=o(()=>{throw new Error(U(15))},"dispatch");const a={getState:s.getState,dispatch:o((c,...d)=>i(c,...d),"dispatch")},l=e.map(c=>c(a));return i=Br(...l)(s.dispatch),{...s,dispatch:i}}}o(gi,"applyMiddleware");var vt={exports:{}},yt={};var Pn;function mi(){if(Pn)return yt;Pn=1;var e=ps();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}o(t,"is");var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return yt.useSyncExternalStoreWithSelector=function(c,d,p,f,u){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function b(C){if(!D){if(D=!0,S=C,C=f(C),u!==void 0&&h.hasValue){var N=h.value;if(u(N,C))return E=N}return E=C}if(N=E,n(S,C))return N;var O=f(C);return u!==void 0&&u(N,O)?(S=C,N):(S=C,E=O)}o(b,"memoizedSelector");var D=!1,S,E,I=p===void 0?null:p;return[function(){return b(d())},I===null?void 0:function(){return b(I())}]},[d,p,f,u]);var x=r(c,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=x},[x]),l(x),x},yt}o(mi,"requireUseSyncExternalStoreWithSelector_production");var An;function hi(){return An||(An=1,vt.exports=mi()),vt.exports}o(hi,"requireWithSelector");hi();var bi=v.version.startsWith("19"),xi=Symbol.for(bi?"react.transitional.element":"react.element"),vi=Symbol.for("react.portal"),yi=Symbol.for("react.fragment"),Di=Symbol.for("react.strict_mode"),Si=Symbol.for("react.profiler"),Ii=Symbol.for("react.consumer"),Ci=Symbol.for("react.context"),jr=Symbol.for("react.forward_ref"),wi=Symbol.for("react.suspense"),Ei=Symbol.for("react.suspense_list"),Yt=Symbol.for("react.memo"),Ni=Symbol.for("react.lazy"),Pi=jr,Ai=Yt;function Ri(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case xi:switch(e=e.type,e){case yi:case Si:case Di:case wi:case Ei:return e;default:switch(e=e&&e.$$typeof,e){case Ci:case jr:case Ni:case Yt:return e;case Ii:return e;default:return t}}case vi:return t}}}o(Ri,"typeOf");function Oi(e){return Ri(e)===Yt}o(Oi,"isMemo");function Ti(e,t,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:a}){let l=!1,c,d,p,f,u;function m(S,E){return c=S,d=E,p=e(c,d),f=t(r,d),u=n(p,f,d),l=!0,u}o(m,"handleFirstCall");function h(){return p=e(c,d),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(h,"handleNewPropsAndNewState");function x(){return e.dependsOnOwnProps&&(p=e(c,d)),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(x,"handleNewProps");function b(){const S=e(c,d),E=!a(S,p);return p=S,E&&(u=n(p,f,d)),u}o(b,"handleNewState");function D(S,E){const I=!i(E,d),C=!s(S,c,E,d);return c=S,d=E,I&&C?h():I?x():C?b():u}return o(D,"handleSubsequentCalls"),o(function(E,I){return l?D(E,I):m(E,I)},"pureFinalPropsSelector")}o(Ti,"pureFinalPropsSelectorFactory");function Bi(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=t(e,s),a=n(e,s),l=r(e,s);return Ti(i,a,l,e,s)}o(Bi,"finalPropsSelectorFactory");function ji(e,t){const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=(...i)=>t(s(...i)))}return n}o(ji,"bindActionCreators");function Tt(e){return o(function(n){const r=e(n);function s(){return r}return o(s,"constantSelector"),s.dependsOnOwnProps=!1,s},"initConstantSelector")}o(Tt,"wrapMapToPropsConstant");function Rn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}o(Rn,"getDependsOnOwnProps");function Lr(e,t){return o(function(r,{displayName:s}){const i=o(function(l,c){return i.dependsOnOwnProps?i.mapToProps(l,c):i.mapToProps(l,void 0)},"mapToPropsProxy");return i.dependsOnOwnProps=!0,i.mapToProps=o(function(l,c){i.mapToProps=e,i.dependsOnOwnProps=Rn(e);let d=i(l,c);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Rn(d),d=i(l,c)),d},"detectFactoryAndVerify"),i},"initProxySelector")}o(Lr,"wrapMapToPropsFunc");function Kt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}o(Kt,"createInvalidArgFactory");function Li(e){return e&&typeof e=="object"?Tt(t=>ji(e,t)):e?typeof e=="function"?Lr(e):Kt(e,"mapDispatchToProps"):Tt(t=>({dispatch:t}))}o(Li,"mapDispatchToPropsFactory");function Mi(e){return e?typeof e=="function"?Lr(e):Kt(e,"mapStateToProps"):Tt(()=>({}))}o(Mi,"mapStateToPropsFactory");function _i(e,t,n){return{...n,...e,...t}}o(_i,"defaultMergeProps");function Fi(e){return o(function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,a;return o(function(c,d,p){const f=e(c,d,p);return i?s(f,a)||(a=f):(i=!0,a=f),a},"mergePropsProxy")},"initMergePropsProxy")}o(Fi,"wrapMergePropsFunc");function Gi(e){return e?typeof e=="function"?Fi(e):Kt(e,"mergeProps"):()=>_i}o(Gi,"mergePropsFactory");function $i(e){e()}o($i,"defaultNoopBatch");function ki(){let e=null,t=null;return{clear(){e=null,t=null},notify(){$i(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,o(function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)},"unsubscribe")}}}o(ki,"createListenerCollection");var On={notify(){},get:o(()=>[],"get")};function Mr(e,t){let n,r=On,s=0,i=!1;function a(x){p();const b=r.subscribe(x);let D=!1;return()=>{D||(D=!0,b(),f())}}o(a,"addNestedSub");function l(){r.notify()}o(l,"notifyNestedSubs");function c(){h.onStateChange&&h.onStateChange()}o(c,"handleChangeWrapper");function d(){return i}o(d,"isSubscribed");function p(){s++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=ki())}o(p,"trySubscribe");function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=On)}o(f,"tryUnsubscribe");function u(){i||(i=!0,p())}o(u,"trySubscribeSelf");function m(){i&&(i=!1,f())}o(m,"tryUnsubscribeSelf");const h={addNestedSub:a,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:u,tryUnsubscribe:m,getListeners:o(()=>r,"getListeners")};return h}o(Mr,"createSubscription");var Wi=o(()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u","canUseDOM"),Vi=Wi(),Ui=o(()=>typeof navigator<"u"&&navigator.product==="ReactNative","isRunningInReactNative"),Hi=Ui(),qi=o(()=>Vi||Hi?v.useLayoutEffect:v.useEffect,"getUseIsomorphicLayoutEffect"),Qe=qi();function Tn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}o(Tn,"is");function Dt(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Tn(e[n[s]],t[n[s]]))return!1;return!0}o(Dt,"shallowEqual");var zi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ki={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ji={[Pi]:Ki,[Ai]:_r};function Bn(e){return Oi(e)?_r:Ji[e.$$typeof]||zi}o(Bn,"getStatics");var Xi=Object.defineProperty,Qi=Object.getOwnPropertyNames,jn=Object.getOwnPropertySymbols,Zi=Object.getOwnPropertyDescriptor,ea=Object.getPrototypeOf,Ln=Object.prototype;function Bt(e,t){if(typeof t!="string"){if(Ln){const i=ea(t);i&&i!==Ln&&Bt(e,i)}let n=Qi(t);jn&&(n=n.concat(jn(t)));const r=Bn(e),s=Bn(t);for(let i=0;i<n.length;++i){const a=n[i];if(!Yi[a]&&!(s&&s[a])&&!(r&&r[a])){const l=Zi(t,a);try{Xi(e,a,l)}catch{}}}}return e}o(Bt,"hoistNonReactStatics");var ta=Symbol.for("react-redux-context"),na=typeof globalThis<"u"?globalThis:{};function ra(){if(!v.createContext)return{};const e=na[ta]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}o(ra,"getContext");var Fr=ra(),oa=[null,null];function sa(e,t,n){Qe(()=>e(...t),n)}o(sa,"useIsomorphicLayoutEffectWithArgs");function ia(e,t,n,r,s,i){e.current=r,n.current=!1,s.current&&(s.current=null,i())}o(ia,"captureWrapperProps");function aa(e,t,n,r,s,i,a,l,c,d,p){if(!e)return()=>{};let f=!1,u=null;const m=o(()=>{if(f||!l.current)return;const x=t.getState();let b,D;try{b=r(x,s.current)}catch(S){D=S,u=S}D||(u=null),b===i.current?a.current||d():(i.current=b,c.current=b,a.current=!0,p())},"checkForUpdates");return n.onStateChange=m,n.trySubscribe(),m(),o(()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u},"unsubscribeWrapper")}o(aa,"subscribeUpdates");function la(e,t){return e===t}o(la,"strictEqual");function ca(e,t,n,{pure:r,areStatesEqual:s=la,areOwnPropsEqual:i=Dt,areStatePropsEqual:a=Dt,areMergedPropsEqual:l=Dt,forwardRef:c=!1,context:d=Fr}={}){const p=d,f=Mi(e),u=Li(t),m=Gi(n),h=!!e;return o(b=>{const D=b.displayName||b.name||"Component",S=`Connect(${D})`,E={shouldHandleStateChanges:h,displayName:S,wrappedComponentName:D,WrappedComponent:b,initMapStateToProps:f,initMapDispatchToProps:u,initMergeProps:m,areStatesEqual:s,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:l};function I(O){const[T,$,P]=v.useMemo(()=>{const{reactReduxForwardedRef:H,...we}=O;return[O.context,H,we]},[O]),A=v.useMemo(()=>{let H=p;return T?.Consumer,H},[T,p]),k=v.useContext(A),K=!!O.store&&!!O.store.getState&&!!O.store.dispatch,j=!!k&&!!k.store,F=K?O.store:k.store,se=j?k.getServerState:F.getState,ye=v.useMemo(()=>Bi(F.dispatch,E),[F]),[W,ee]=v.useMemo(()=>{if(!h)return oa;const H=Mr(F,K?void 0:k.subscription),we=H.notifyNestedSubs.bind(H);return[H,we]},[F,K,k]),de=v.useMemo(()=>K?k:{...k,subscription:W},[K,k,W]),te=v.useRef(void 0),De=v.useRef(P),ie=v.useRef(void 0),Ve=v.useRef(!1),Se=v.useRef(!1),Ie=v.useRef(void 0);Qe(()=>(Se.current=!0,()=>{Se.current=!1}),[]);const Ue=v.useMemo(()=>o(()=>ie.current&&P===De.current?ie.current:ye(F.getState(),P),"selector"),[F,P]),He=v.useMemo(()=>o(we=>W?aa(h,F,W,ye,De,te,Ve,Se,ie,ee,we):()=>{},"subscribe"),[W]);sa(ia,[De,te,Ve,P,ie,ee]);let ue;try{ue=v.useSyncExternalStore(He,Ue,se?()=>ye(se(),P):Ue)}catch(H){throw Ie.current&&(H.message+=`
1
+ var zo=Object.defineProperty;var o=(e,t)=>zo(e,"name",{value:t,configurable:!0});import{u as Yo,a as Ko,b as Jo,c as Xo,d as Qo,e as Wt,r as v,f as ur,g as Zo,h as fr,i as es,j as ts,k as ns,l as Dn,m as g,F as pr,n as gr,o as mr,p as hr,C as rs,B as br,X as os,_ as ss,q as is,s as as,t as ls,I as xr,v as vr,R as cs,w as ds,x as us,y as fs,z as ps,A as L,D as gs,E as yr,G as he,H as Dr,J as ms,K as Vt,L as Ut,M as it,N as at,O as lt,P as ct,Q as dt,S as hs,T as bs,U as Sr,V as Sn,W as Ae,Y as Ir,Z as xs,$ as vs,a0 as $e,a1 as Ot,a2 as ys,a3 as Ht,a4 as ut,a5 as Ds,a6 as Ss,a7 as Cr,a8 as Is,a9 as Cs,aa as qt,ab as ws,ac as Es,ad as wr,ae as Er,af as zt,ag as Nr,ah as Je,ai as Ns,aj as Ps,ak as Pr,al as Ar,am as As,an as Rs,ao as Os,ap as Ts,aq as Bs,ar as js,as as Ls,at as Ms,au as _s,av as Fs,aw as Rr,ax as Gs,ay as $s,az as ks,aA as Ws,aB as Vs,aC as Us,aD as Hs,aE as qs,aF as qe,aG as zs,aH as Ys,aI as Ks}from"./index-D5uatqhL.js";var Re=function(){return Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Re.apply(this,arguments)},Js=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},Xs=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},Qs=o(function(e){var t,n=e.debounce,r=e.enableGetChoices,s=e.filter,i=e.page,a=i===void 0?1:i,l=e.perPage,c=l===void 0?25:l,d=e.sort,p=d===void 0?{field:"id",order:"DESC"}:d,f=e.queryOptions,u=f===void 0?{}:f,m=e.reference,h=e.source,x=Yo().getValues,b=Ko(h),D=(t=Jo({name:b}))!==null&&t!==void 0?t:x(b),S=u.meta,E=Js(u,["meta"]),I=Xo(m,{ids:D||Zs,meta:S},{enabled:D!=null&&D.length>0}),C=I.data,N=I.error,O=I.isLoading,T=I.isFetching,$=I.isPaused,P=I.isPending,A=I.isPlaceholderData,k=I.refetch,K=Qo({resource:m,page:a,perPage:c,sort:p,debounce:n,filter:s}),j=K[0],F=K[1],se=C?C.filter(Boolean):[],ye=r?r(j.filterValues):!0,W=Wt(m,{pagination:{page:j.page,perPage:j.perPage},sort:{field:j.sort,order:j.order},filter:Re(Re({},j.filter),s),meta:S},Re({retry:!1,enabled:ye,placeholderData:o(function(H){return H},"placeholderData")},E)),ee=W.data,de=W.total,te=W.pageInfo,De=W.error,ie=W.isLoading,Ve=W.isFetching,Se=W.isPaused,Ie=W.isPending,Ue=W.isPlaceholderData,He=W.refetch,ue=ee&&ee.length>0?ei(ee,se):se.length>0?se:ee,Ce=v.useCallback(function(){k(),He()},[k,He]),yn=v.useMemo(function(){return{field:j.sort,order:j.order}},[j.sort,j.order]);return{sort:yn,allChoices:ue,availableChoices:ee,selectedChoices:se,displayedFilters:j.displayedFilters,error:N||De,filter:s,filterValues:j.filterValues,hideFilter:F.hideFilter,isFetching:T||Ve,isLoading:O||ie,isPaused:$||Se,isPending:P||Ie,isPlaceholderData:A||Ue,page:j.page,perPage:j.perPage,refetch:Ce,resource:m,setFilters:F.setFilters,setPage:F.setPage,setPerPage:F.setPerPage,setSort:F.setSort,showFilter:F.showFilter,source:h,total:de,hasNextPage:te?te.hasNextPage:de!=null?j.page*j.perPage<de:void 0,hasPreviousPage:te?te.hasPreviousPage:j.page>1,isFromReference:!0}},"useReferenceArrayInputController"),Zs=[],ei=o(function(e,t){var n=Xs([],e,!0),r=e.map(function(s){return s.id});return t.forEach(function(s){r.includes(s.id)||(r.push(s.id),n.push(s))}),n},"mergeReferences");const ti=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],ni=ur("archive-restore",ti);const ri=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],oi=ur("archive",ri),Or=o(e=>{const{filterToQuery:t=si,inputText:n}=e,{allChoices:r=[],source:s,resource:i,isFromReference:a,setFilters:l}=Zo(e),{id:c,field:d,isRequired:p}=fr({...e,source:s}),f=es(),{placeholder:u=f("ra.action.search",{_:"Search..."})}=e,m=ts(i),{getChoiceText:h,getChoiceValue:x}=ns({optionText:e.optionText??(a?m:"name"),optionValue:e.optionValue??"id",disableValue:e.disableValue,translateChoice:e.translateChoice??!a}),b=v.useRef(null),[D,S]=v.useState(!1),E=Dn(P=>{d.onChange(d.value.filter(A=>A!==x(P)))}),I=Dn(P=>{const A=b.current;A&&((P.key==="Delete"||P.key==="Backspace")&&A.value===""&&d.onChange(d.value.slice(0,-1)),P.key==="Escape"&&A.blur())}),C=r.filter(P=>!d.value.includes(x(P))),N=r.filter(P=>d.value.includes(x(P))),[O,T]=v.useState(""),$=v.useCallback(P=>typeof n=="function"?n(P):n!==void 0?n:h(P),[n,h]);return g.jsxs(pr,{className:e.className,id:c,name:d.name,children:[e.label!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:e.label,source:e.source??s,resource:i,isRequired:p})}),g.jsx(hr,{children:g.jsxs(rs,{onKeyDown:I,shouldFilter:!a,className:"overflow-visible bg-transparent",children:[g.jsx("div",{className:"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.map(P=>g.jsxs(br,{variant:"outline",children:[$(P),g.jsxs("button",{className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",onKeyDown:o(A=>{A.key==="Enter"&&E(P)},"onKeyDown"),onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onClick:o(A=>{A.preventDefault(),E(P)},"onClick"),children:[g.jsx("span",{className:"sr-only",children:f("ra.action.remove",{_:"Remove"})}),g.jsx(os,{className:"h-3 w-3"})]})]},x(P))),g.jsx(ss.Input,{ref:b,value:O,onValueChange:o(P=>{T(P),a&&l(t(P),void 0,!0)},"onValueChange"),onBlur:o(()=>S(!1),"onBlur"),onFocus:o(()=>S(!0),"onFocus"),placeholder:u,className:"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"})]})}),g.jsx("div",{className:"relative",children:g.jsx(is,{children:D&&C.length>0?g.jsx("div",{className:"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:g.jsx(as,{className:"h-full overflow-auto",children:C.map(P=>g.jsx(ls,{onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onSelect:o(()=>{T(""),a&&l(t("")),d.onChange([...d.value,x(P)])},"onSelect"),className:"cursor-pointer",children:h(P)},x(P)))})}):null})})]})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"AutocompleteArrayInput"),si=o(e=>({q:e}),"DefaultFilterToQuery"),ii=o(e=>{const{children:t=ai,reference:n,sort:r,filter:s=li}=e;if(v.Children.count(t)!==1)throw new Error("<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)");const i=Qs({...e,sort:r,filter:s});return g.jsx(cs,{value:n,children:g.jsx(ds,{value:i,children:t})})},"ReferenceArrayInput"),ai=g.jsx(Or,{}),li={},ci=o(e=>{const{label:t,source:n,className:r,resource:s,validate:i,format:a,parse:l=di,onFocus:c,...d}=e,p=us({resource:s}),{id:f,field:u,isRequired:m}=fr(e),h=o(I=>{const C=I.target.value,N=l(C);b(C),u.onChange(N??0)},"handleChange"),[x,b]=v.useState(u.value?.toString()??""),D=v.useRef(!1),S=o(I=>{c?.(I),D.current=!0},"handleFocus"),E=o(I=>{u.onBlur?.(I),D.current=!1,b(u.value?.toString()??"")},"handleBlur");return v.useEffect(()=>{D.current||b(u.value?.toString()??"")},[u.value]),g.jsxs(pr,{id:f,className:r,name:u.name,children:[t!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:t,source:n,resource:p,isRequired:m})}),g.jsx(hr,{children:g.jsx(fs,{...d,...u,type:"number",value:x,onChange:h,onFocus:S,onBlur:E})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"NumberInput"),di=o(e=>{if(e==null||e==="")return null;const t=parseFloat(e);return isNaN(t)?0:t},"convertStringToNumber");function U(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. `}o(U,"formatProdErrorMessage");var ui=typeof Symbol=="function"&&Symbol.observable||"@@observable",In=ui,Cn=o(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),fi={INIT:`@@redux/INIT${Cn()}`,REPLACE:`@@redux/REPLACE${Cn()}`},wn=fi;function pi(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}o(pi,"isPlainObject");function Tr(e,t,n){if(typeof e!="function")throw new Error(U(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(U(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(U(1));return n(Tr)(e,t)}let r=e,s=t,i=new Map,a=i,l=0,c=!1;function d(){a===i&&(a=new Map,i.forEach((b,D)=>{a.set(D,b)}))}o(d,"ensureCanMutateNextListeners");function p(){if(c)throw new Error(U(3));return s}o(p,"getState");function f(b){if(typeof b!="function")throw new Error(U(4));if(c)throw new Error(U(5));let D=!0;d();const S=l++;return a.set(S,b),o(function(){if(D){if(c)throw new Error(U(6));D=!1,d(),a.delete(S),i=null}},"unsubscribe")}o(f,"subscribe");function u(b){if(!pi(b))throw new Error(U(7));if(typeof b.type>"u")throw new Error(U(8));if(typeof b.type!="string")throw new Error(U(17));if(c)throw new Error(U(9));try{c=!0,s=r(s,b)}finally{c=!1}return(i=a).forEach(S=>{S()}),b}o(u,"dispatch");function m(b){if(typeof b!="function")throw new Error(U(10));r=b,u({type:wn.REPLACE})}o(m,"replaceReducer");function h(){const b=f;return{subscribe(D){if(typeof D!="object"||D===null)throw new Error(U(11));function S(){const I=D;I.next&&I.next(p())}return o(S,"observeState"),S(),{unsubscribe:b(S)}},[In](){return this}}}return o(h,"observable"),u({type:wn.INIT}),{dispatch:u,subscribe:f,getState:p,replaceReducer:m,[In]:h}}o(Tr,"createStore$1");function En(e,t){return function(...n){return t(e.apply(this,n))}}o(En,"bindActionCreator");function Nn(e,t){if(typeof e=="function")return En(e,t);if(typeof e!="object"||e===null)throw new Error(U(16));const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=En(s,t))}return n}o(Nn,"bindActionCreators$1");function Br(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}o(Br,"compose");function gi(...e){return t=>(n,r)=>{const s=t(n,r);let i=o(()=>{throw new Error(U(15))},"dispatch");const a={getState:s.getState,dispatch:o((c,...d)=>i(c,...d),"dispatch")},l=e.map(c=>c(a));return i=Br(...l)(s.dispatch),{...s,dispatch:i}}}o(gi,"applyMiddleware");var vt={exports:{}},yt={};var Pn;function mi(){if(Pn)return yt;Pn=1;var e=ps();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}o(t,"is");var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return yt.useSyncExternalStoreWithSelector=function(c,d,p,f,u){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function b(C){if(!D){if(D=!0,S=C,C=f(C),u!==void 0&&h.hasValue){var N=h.value;if(u(N,C))return E=N}return E=C}if(N=E,n(S,C))return N;var O=f(C);return u!==void 0&&u(N,O)?(S=C,N):(S=C,E=O)}o(b,"memoizedSelector");var D=!1,S,E,I=p===void 0?null:p;return[function(){return b(d())},I===null?void 0:function(){return b(I())}]},[d,p,f,u]);var x=r(c,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=x},[x]),l(x),x},yt}o(mi,"requireUseSyncExternalStoreWithSelector_production");var An;function hi(){return An||(An=1,vt.exports=mi()),vt.exports}o(hi,"requireWithSelector");hi();var bi=v.version.startsWith("19"),xi=Symbol.for(bi?"react.transitional.element":"react.element"),vi=Symbol.for("react.portal"),yi=Symbol.for("react.fragment"),Di=Symbol.for("react.strict_mode"),Si=Symbol.for("react.profiler"),Ii=Symbol.for("react.consumer"),Ci=Symbol.for("react.context"),jr=Symbol.for("react.forward_ref"),wi=Symbol.for("react.suspense"),Ei=Symbol.for("react.suspense_list"),Yt=Symbol.for("react.memo"),Ni=Symbol.for("react.lazy"),Pi=jr,Ai=Yt;function Ri(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case xi:switch(e=e.type,e){case yi:case Si:case Di:case wi:case Ei:return e;default:switch(e=e&&e.$$typeof,e){case Ci:case jr:case Ni:case Yt:return e;case Ii:return e;default:return t}}case vi:return t}}}o(Ri,"typeOf");function Oi(e){return Ri(e)===Yt}o(Oi,"isMemo");function Ti(e,t,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:a}){let l=!1,c,d,p,f,u;function m(S,E){return c=S,d=E,p=e(c,d),f=t(r,d),u=n(p,f,d),l=!0,u}o(m,"handleFirstCall");function h(){return p=e(c,d),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(h,"handleNewPropsAndNewState");function x(){return e.dependsOnOwnProps&&(p=e(c,d)),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(x,"handleNewProps");function b(){const S=e(c,d),E=!a(S,p);return p=S,E&&(u=n(p,f,d)),u}o(b,"handleNewState");function D(S,E){const I=!i(E,d),C=!s(S,c,E,d);return c=S,d=E,I&&C?h():I?x():C?b():u}return o(D,"handleSubsequentCalls"),o(function(E,I){return l?D(E,I):m(E,I)},"pureFinalPropsSelector")}o(Ti,"pureFinalPropsSelectorFactory");function Bi(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=t(e,s),a=n(e,s),l=r(e,s);return Ti(i,a,l,e,s)}o(Bi,"finalPropsSelectorFactory");function ji(e,t){const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=(...i)=>t(s(...i)))}return n}o(ji,"bindActionCreators");function Tt(e){return o(function(n){const r=e(n);function s(){return r}return o(s,"constantSelector"),s.dependsOnOwnProps=!1,s},"initConstantSelector")}o(Tt,"wrapMapToPropsConstant");function Rn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}o(Rn,"getDependsOnOwnProps");function Lr(e,t){return o(function(r,{displayName:s}){const i=o(function(l,c){return i.dependsOnOwnProps?i.mapToProps(l,c):i.mapToProps(l,void 0)},"mapToPropsProxy");return i.dependsOnOwnProps=!0,i.mapToProps=o(function(l,c){i.mapToProps=e,i.dependsOnOwnProps=Rn(e);let d=i(l,c);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Rn(d),d=i(l,c)),d},"detectFactoryAndVerify"),i},"initProxySelector")}o(Lr,"wrapMapToPropsFunc");function Kt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}o(Kt,"createInvalidArgFactory");function Li(e){return e&&typeof e=="object"?Tt(t=>ji(e,t)):e?typeof e=="function"?Lr(e):Kt(e,"mapDispatchToProps"):Tt(t=>({dispatch:t}))}o(Li,"mapDispatchToPropsFactory");function Mi(e){return e?typeof e=="function"?Lr(e):Kt(e,"mapStateToProps"):Tt(()=>({}))}o(Mi,"mapStateToPropsFactory");function _i(e,t,n){return{...n,...e,...t}}o(_i,"defaultMergeProps");function Fi(e){return o(function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,a;return o(function(c,d,p){const f=e(c,d,p);return i?s(f,a)||(a=f):(i=!0,a=f),a},"mergePropsProxy")},"initMergePropsProxy")}o(Fi,"wrapMergePropsFunc");function Gi(e){return e?typeof e=="function"?Fi(e):Kt(e,"mergeProps"):()=>_i}o(Gi,"mergePropsFactory");function $i(e){e()}o($i,"defaultNoopBatch");function ki(){let e=null,t=null;return{clear(){e=null,t=null},notify(){$i(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,o(function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)},"unsubscribe")}}}o(ki,"createListenerCollection");var On={notify(){},get:o(()=>[],"get")};function Mr(e,t){let n,r=On,s=0,i=!1;function a(x){p();const b=r.subscribe(x);let D=!1;return()=>{D||(D=!0,b(),f())}}o(a,"addNestedSub");function l(){r.notify()}o(l,"notifyNestedSubs");function c(){h.onStateChange&&h.onStateChange()}o(c,"handleChangeWrapper");function d(){return i}o(d,"isSubscribed");function p(){s++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=ki())}o(p,"trySubscribe");function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=On)}o(f,"tryUnsubscribe");function u(){i||(i=!0,p())}o(u,"trySubscribeSelf");function m(){i&&(i=!1,f())}o(m,"tryUnsubscribeSelf");const h={addNestedSub:a,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:u,tryUnsubscribe:m,getListeners:o(()=>r,"getListeners")};return h}o(Mr,"createSubscription");var Wi=o(()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u","canUseDOM"),Vi=Wi(),Ui=o(()=>typeof navigator<"u"&&navigator.product==="ReactNative","isRunningInReactNative"),Hi=Ui(),qi=o(()=>Vi||Hi?v.useLayoutEffect:v.useEffect,"getUseIsomorphicLayoutEffect"),Qe=qi();function Tn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}o(Tn,"is");function Dt(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Tn(e[n[s]],t[n[s]]))return!1;return!0}o(Dt,"shallowEqual");var zi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ki={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ji={[Pi]:Ki,[Ai]:_r};function Bn(e){return Oi(e)?_r:Ji[e.$$typeof]||zi}o(Bn,"getStatics");var Xi=Object.defineProperty,Qi=Object.getOwnPropertyNames,jn=Object.getOwnPropertySymbols,Zi=Object.getOwnPropertyDescriptor,ea=Object.getPrototypeOf,Ln=Object.prototype;function Bt(e,t){if(typeof t!="string"){if(Ln){const i=ea(t);i&&i!==Ln&&Bt(e,i)}let n=Qi(t);jn&&(n=n.concat(jn(t)));const r=Bn(e),s=Bn(t);for(let i=0;i<n.length;++i){const a=n[i];if(!Yi[a]&&!(s&&s[a])&&!(r&&r[a])){const l=Zi(t,a);try{Xi(e,a,l)}catch{}}}}return e}o(Bt,"hoistNonReactStatics");var ta=Symbol.for("react-redux-context"),na=typeof globalThis<"u"?globalThis:{};function ra(){if(!v.createContext)return{};const e=na[ta]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}o(ra,"getContext");var Fr=ra(),oa=[null,null];function sa(e,t,n){Qe(()=>e(...t),n)}o(sa,"useIsomorphicLayoutEffectWithArgs");function ia(e,t,n,r,s,i){e.current=r,n.current=!1,s.current&&(s.current=null,i())}o(ia,"captureWrapperProps");function aa(e,t,n,r,s,i,a,l,c,d,p){if(!e)return()=>{};let f=!1,u=null;const m=o(()=>{if(f||!l.current)return;const x=t.getState();let b,D;try{b=r(x,s.current)}catch(S){D=S,u=S}D||(u=null),b===i.current?a.current||d():(i.current=b,c.current=b,a.current=!0,p())},"checkForUpdates");return n.onStateChange=m,n.trySubscribe(),m(),o(()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u},"unsubscribeWrapper")}o(aa,"subscribeUpdates");function la(e,t){return e===t}o(la,"strictEqual");function ca(e,t,n,{pure:r,areStatesEqual:s=la,areOwnPropsEqual:i=Dt,areStatePropsEqual:a=Dt,areMergedPropsEqual:l=Dt,forwardRef:c=!1,context:d=Fr}={}){const p=d,f=Mi(e),u=Li(t),m=Gi(n),h=!!e;return o(b=>{const D=b.displayName||b.name||"Component",S=`Connect(${D})`,E={shouldHandleStateChanges:h,displayName:S,wrappedComponentName:D,WrappedComponent:b,initMapStateToProps:f,initMapDispatchToProps:u,initMergeProps:m,areStatesEqual:s,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:l};function I(O){const[T,$,P]=v.useMemo(()=>{const{reactReduxForwardedRef:H,...we}=O;return[O.context,H,we]},[O]),A=v.useMemo(()=>{let H=p;return T?.Consumer,H},[T,p]),k=v.useContext(A),K=!!O.store&&!!O.store.getState&&!!O.store.dispatch,j=!!k&&!!k.store,F=K?O.store:k.store,se=j?k.getServerState:F.getState,ye=v.useMemo(()=>Bi(F.dispatch,E),[F]),[W,ee]=v.useMemo(()=>{if(!h)return oa;const H=Mr(F,K?void 0:k.subscription),we=H.notifyNestedSubs.bind(H);return[H,we]},[F,K,k]),de=v.useMemo(()=>K?k:{...k,subscription:W},[K,k,W]),te=v.useRef(void 0),De=v.useRef(P),ie=v.useRef(void 0),Ve=v.useRef(!1),Se=v.useRef(!1),Ie=v.useRef(void 0);Qe(()=>(Se.current=!0,()=>{Se.current=!1}),[]);const Ue=v.useMemo(()=>o(()=>ie.current&&P===De.current?ie.current:ye(F.getState(),P),"selector"),[F,P]),He=v.useMemo(()=>o(we=>W?aa(h,F,W,ye,De,te,Ve,Se,ie,ee,we):()=>{},"subscribe"),[W]);sa(ia,[De,te,Ve,P,ie,ee]);let ue;try{ue=v.useSyncExternalStore(He,Ue,se?()=>ye(se(),P):Ue)}catch(H){throw Ie.current&&(H.message+=`
2
2
  The error may be correlated with this previous error:
3
3
  ${Ie.current.stack}
4
4
 
@@ -56,4 +56,4 @@ ${Ie.current.stack}
56
56
  -ms-user-select: none;
57
57
  overflow-anchor: none;
58
58
  `}}];return{always:Ne(a,"always"),resting:Ne(a,"resting"),dragging:Ne(a,"dragging"),dropAnimating:Ne(a,"dropAnimating"),userCancel:Ne(a,"userCancel")}},"getStyles$1");const Y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect,Nt=o(()=>{const e=document.querySelector("head");return e||y(),e},"getHead"),Zn=o(e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},"createStyleEl");function Wc(e,t){const n=R(()=>kc(e),[e]),r=v.useRef(null),s=v.useRef(null),i=w(M(f=>{const u=s.current;u||y(),u.textContent=f}),[]),a=w(f=>{const u=r.current;u||y(),u.textContent=f},[]);Y(()=>{!r.current&&!s.current||y();const f=Zn(t),u=Zn(t);return r.current=f,s.current=u,f.setAttribute(`${ge}-always`,e),u.setAttribute(`${ge}-dynamic`,e),Nt().appendChild(f),Nt().appendChild(u),a(n.always),i(n.resting),()=>{const m=o(h=>{const x=h.current;x||y(),Nt().removeChild(x),h.current=null},"remove");m(r),m(s)}},[t,a,i,n.always,n.resting,e]);const l=w(()=>i(n.dragging),[i,n.dragging]),c=w(f=>{if(f==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=w(()=>{s.current&&i(n.resting)},[i,n.resting]);return R(()=>({dragging:l,dropping:c,resting:d}),[l,c,d])}o(Wc,"useStyleMarshal");function Eo(e,t){return Array.from(e.querySelectorAll(t))}o(Eo,"querySelectorAll");var No=o(e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window,"getWindowFromEl");function ht(e){return e instanceof No(e).HTMLElement}o(ht,"isHtmlElement");function Vc(e,t){const n=`[${me.contextId}="${e}"]`,r=Eo(document,n);if(!r.length)return null;const s=r.find(i=>i.getAttribute(me.draggableId)===t);return!s||!ht(s)?null:s}o(Vc,"findDragHandle");function Uc(e){const t=v.useRef({}),n=v.useRef(null),r=v.useRef(null),s=v.useRef(!1),i=w(o(function(u,m){const h={id:u,focus:m};return t.current[u]=h,o(function(){const b=t.current;b[u]!==h&&delete b[u]},"unregister")},"register2"),[]),a=w(o(function(u){const m=Vc(e,u);m&&m!==document.activeElement&&m.focus()},"tryGiveFocus2"),[e]),l=w(o(function(u,m){n.current===u&&(n.current=m)},"tryShiftRecord2"),[]),c=w(o(function(){r.current||s.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&a(u)}))},"tryRestoreFocusRecorded2"),[a]),d=w(o(function(u){n.current=null;const m=document.activeElement;m&&m.getAttribute(me.draggableId)===u&&(n.current=u)},"tryRecordFocus2"),[]);return Y(()=>(s.current=!0,o(function(){s.current=!1;const u=r.current;u&&cancelAnimationFrame(u)},"clearFrameOnUnmount")),[]),R(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[i,d,c,l])}o(Uc,"useFocusMarshal");function Hc(){const e={draggables:{},droppables:{}},t=[];function n(f){return t.push(f),o(function(){const m=t.indexOf(f);m!==-1&&t.splice(m,1)},"unsubscribe")}o(n,"subscribe");function r(f){t.length&&t.forEach(u=>u(f))}o(r,"notify");function s(f){return e.draggables[f]||null}o(s,"findDraggableById");function i(f){const u=s(f);return u||y(),u}o(i,"getDraggableById");const a={register:o(f=>{e.draggables[f.descriptor.id]=f,r({type:"ADDITION",value:f})},"register"),update:o((f,u)=>{const m=e.draggables[u.descriptor.id];m&&m.uniqueId===f.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[f.descriptor.id]=f)},"update"),unregister:o(f=>{const u=f.descriptor.id,m=s(u);m&&f.uniqueId===m.uniqueId&&(delete e.draggables[u],e.droppables[f.descriptor.droppableId]&&r({type:"REMOVAL",value:f}))},"unregister"),getById:i,findById:s,exists:o(f=>!!s(f),"exists"),getAllByType:o(f=>Object.values(e.draggables).filter(u=>u.descriptor.type===f),"getAllByType")};function l(f){return e.droppables[f]||null}o(l,"findDroppableById");function c(f){const u=l(f);return u||y(),u}o(c,"getDroppableById");const d={register:o(f=>{e.droppables[f.descriptor.id]=f},"register"),unregister:o(f=>{const u=l(f.descriptor.id);u&&f.uniqueId===u.uniqueId&&delete e.droppables[f.descriptor.id]},"unregister"),getById:c,findById:l,exists:o(f=>!!l(f),"exists"),getAllByType:o(f=>Object.values(e.droppables).filter(u=>u.descriptor.type===f),"getAllByType")};function p(){e.draggables={},e.droppables={},t.length=0}return o(p,"clean2"),{draggable:a,droppable:d,subscribe:n,clean:p}}o(Hc,"createRegistry");function qc(){const e=R(Hc,[]);return v.useEffect(()=>o(function(){e.clean()},"unmount"),[e]),e}o(qc,"useRegistry");var pn=L.createContext(null),ot=o(()=>{const e=document.body;return e||y(),e},"getBodyElement");const zc={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Yc=o(e=>`rfd-announcement-${e}`,"getId");function Kc(e){const t=R(()=>Yc(e),[e]),n=v.useRef(null);return v.useEffect(o(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),tt(i.style,zc),ot().appendChild(i),o(function(){setTimeout(o(function(){const c=ot();c.contains(i)&&c.removeChild(i),i===n.current&&(n.current=null)},"remove"))},"cleanup")},"setup"),[t]),w(s=>{const i=n.current;if(i){i.textContent=s;return}},[])}o(Kc,"useAnnouncer");const Jc={separator:"::"};function gn(e,t=Jc){const n=L.useId();return R(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}o(gn,"useUniqueId");function Xc({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}o(Xc,"getElementId");function Qc({contextId:e,text:t}){const n=gn("hidden-text",{separator:"-"}),r=R(()=>Xc({contextId:e,uniqueId:n}),[n,e]);return v.useEffect(o(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",ot().appendChild(i),o(function(){const l=ot();l.contains(i)&&l.removeChild(i)},"unmount")},"mount"),[r,t]),r}o(Qc,"useHiddenTextElement");var bt=L.createContext(null);function Po(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),t}o(Po,"usePrevious");function Zc(){let e=null;function t(){return!!e}o(t,"isClaimed");function n(a){return a===e}o(n,"isActive2");function r(a){e&&y();const l={abandon:a};return e=l,l}o(r,"claim");function s(){e||y(),e=null}o(s,"release");function i(){e&&(e.abandon(),s())}return o(i,"tryAbandon"),{isClaimed:t,isActive:n,claim:r,release:s,tryAbandon:i}}o(Zc,"create");function Ge(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}o(Ge,"isDragging");const ed=9,td=13,mn=27,Ao=32,nd=33,rd=34,od=35,sd=36,id=37,ad=38,ld=39,cd=40,dd={[td]:!0,[ed]:!0};var Ro=o(e=>{dd[e.keyCode]&&e.preventDefault()},"preventStandardKeyEvents");const xt=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Oo=0,er=5;function ud(e,t){return Math.abs(t.x-e.x)>=er||Math.abs(t.y-e.y)>=er}o(ud,"isSloppyClickThresholdExceeded");const tr={type:"IDLE"};function fd({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o(s=>{const{button:i,clientX:a,clientY:l}=s;if(i!==Oo)return;const c={x:a,y:l},d=n();if(d.type==="DRAGGING"){s.preventDefault(),d.actions.move(c);return}d.type!=="PENDING"&&y();const p=d.point;if(!ud(p,c))return;s.preventDefault();const f=d.actions.fluidLift(c);r({type:"DRAGGING",actions:f})},"fn")},{eventName:"mouseup",fn:o(s=>{const i=n();if(i.type!=="DRAGGING"){e();return}s.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()},"fn")},{eventName:"mousedown",fn:o(s=>{n().type==="DRAGGING"&&s.preventDefault(),e()},"fn")},{eventName:"keydown",fn:o(s=>{if(n().type==="PENDING"){e();return}if(s.keyCode===mn){s.preventDefault(),e();return}Ro(s)},"fn")},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:o(()=>{n().type==="PENDING"&&e()},"fn")},{eventName:"webkitmouseforcedown",fn:o(s=>{const i=n();if(i.type==="IDLE"&&y(),i.actions.shouldRespectForcePress()){e();return}s.preventDefault()},"fn")},{eventName:xt,fn:e}]}o(fd,"getCaptureBindings");function pd(e){const t=v.useRef(tr),n=v.useRef(ne),r=R(()=>({eventName:"mousedown",fn:o(function(f){if(f.defaultPrevented||f.button!==Oo||f.ctrlKey||f.metaKey||f.shiftKey||f.altKey)return;const u=e.findClosestDraggableId(f);if(!u)return;const m=e.tryGetLock(u,a,{sourceEvent:f});if(!m)return;f.preventDefault();const h={x:f.clientX,y:f.clientY};n.current(),d(m,h)},"onMouseDown")}),[e]),s=R(()=>({eventName:"webkitmouseforcewillbegin",fn:o(p=>{if(p.defaultPrevented)return;const f=e.findClosestDraggableId(p);if(!f)return;const u=e.findOptionsForDraggable(f);u&&(u.shouldRespectForcePress||e.canGetLock(f)&&p.preventDefault())},"fn")}),[e]),i=w(o(function(){const f={passive:!1,capture:!0};n.current=X(window,[s,r],f)},"listenForCapture2"),[s,r]),a=w(()=>{t.current.type!=="IDLE"&&(t.current=tr,n.current(),i())},[i]),l=w(()=>{const p=t.current;a(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[a]),c=w(o(function(){const f={capture:!0,passive:!1},u=fd({cancel:l,completed:a,getPhase:o(()=>t.current,"getPhase"),setPhase:o(m=>{t.current=m},"setPhase")});n.current=X(window,u,f)},"bindCapturingEvents2"),[l,a]),d=w(o(function(f,u){t.current.type!=="IDLE"&&y(),t.current={type:"PENDING",point:u,actions:f},c()},"startPendingDrag2"),[c]);Y(o(function(){return i(),o(function(){n.current()},"unmount")},"mount"),[i])}o(pd,"useMouseSensor");function gd(){}o(gd,"noop$1");const md={[rd]:!0,[nd]:!0,[sd]:!0,[od]:!0};function hd(e,t){function n(){t(),e.cancel()}o(n,"cancel");function r(){t(),e.drop()}return o(r,"drop2"),[{eventName:"keydown",fn:o(s=>{if(s.keyCode===mn){s.preventDefault(),n();return}if(s.keyCode===Ao){s.preventDefault(),r();return}if(s.keyCode===cd){s.preventDefault(),e.moveDown();return}if(s.keyCode===ad){s.preventDefault(),e.moveUp();return}if(s.keyCode===ld){s.preventDefault(),e.moveRight();return}if(s.keyCode===id){s.preventDefault(),e.moveLeft();return}if(md[s.keyCode]){s.preventDefault();return}Ro(s)},"fn")},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:xt,fn:n}]}o(hd,"getDraggingBindings");function bd(e){const t=v.useRef(gd),n=R(()=>({eventName:"keydown",fn:o(function(i){if(i.defaultPrevented||i.keyCode!==Ao)return;const a=e.findClosestDraggableId(i);if(!a)return;const l=e.tryGetLock(a,p,{sourceEvent:i});if(!l)return;i.preventDefault();let c=!0;const d=l.snapLift();t.current();function p(){c||y(),c=!1,t.current(),r()}o(p,"stop"),t.current=X(window,hd(d,p),{capture:!0,passive:!1})},"onKeyDown")}),[e]),r=w(o(function(){const i={passive:!1,capture:!0};t.current=X(window,[n],i)},"tryStartCapture"),[n]);Y(o(function(){return r(),o(function(){t.current()},"unmount")},"mount"),[r])}o(bd,"useKeyboardSensor");const Pt={type:"IDLE"},xd=120,vd=.15;function yd({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:o(n=>{n.preventDefault()},"fn")},{eventName:"keydown",fn:o(n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===mn&&n.preventDefault(),e()},"fn")},{eventName:xt,fn:e}]}o(yd,"getWindowBindings");function Dd({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:o(r=>{const s=n();if(s.type!=="DRAGGING"){e();return}s.hasMoved=!0;const{clientX:i,clientY:a}=r.touches[0],l={x:i,y:a};r.preventDefault(),s.actions.move(l)},"fn")},{eventName:"touchend",fn:o(r=>{const s=n();if(s.type!=="DRAGGING"){e();return}r.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),t()},"fn")},{eventName:"touchcancel",fn:o(r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()},"fn")},{eventName:"touchforcechange",fn:o(r=>{const s=n();s.type==="IDLE"&&y();const i=r.touches[0];if(!i||!(i.force>=vd))return;const l=s.actions.shouldRespectForcePress();if(s.type==="PENDING"){l&&e();return}if(l){if(s.hasMoved){r.preventDefault();return}e();return}r.preventDefault()},"fn")},{eventName:xt,fn:e}]}o(Dd,"getHandleBindings");function Sd(e){const t=v.useRef(Pt),n=v.useRef(ne),r=w(o(function(){return t.current},"getPhase2"),[]),s=w(o(function(m){t.current=m},"setPhase2"),[]),i=R(()=>({eventName:"touchstart",fn:o(function(m){if(m.defaultPrevented)return;const h=e.findClosestDraggableId(m);if(!h)return;const x=e.tryGetLock(h,l,{sourceEvent:m});if(!x)return;const b=m.touches[0],{clientX:D,clientY:S}=b,E={x:D,y:S};n.current(),f(x,E)},"onTouchStart")}),[e]),a=w(o(function(){const m={capture:!0,passive:!1};n.current=X(window,[i],m)},"listenForCapture2"),[i]),l=w(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),s(Pt),n.current(),a())},[a,s]),c=w(()=>{const u=t.current;l(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[l]),d=w(o(function(){const m={capture:!0,passive:!1},h={cancel:c,completed:l,getPhase:r},x=X(window,Dd(h),m),b=X(window,yd(h),m);n.current=o(function(){x(),b()},"unbindAll")},"bindCapturingEvents2"),[c,r,l]),p=w(o(function(){const m=r();m.type!=="PENDING"&&y();const h=m.actions.fluidLift(m.point);s({type:"DRAGGING",actions:h,hasMoved:!1})},"startDragging2"),[r,s]),f=w(o(function(m,h){r().type!=="IDLE"&&y();const x=setTimeout(p,xd);s({type:"PENDING",point:h,actions:m,longPressTimerId:x}),d()},"startPendingDrag2"),[d,r,s,p]);Y(o(function(){return a(),o(function(){n.current();const h=r();h.type==="PENDING"&&(clearTimeout(h.longPressTimerId),s(Pt))},"unmount")},"mount"),[r,a,s]),Y(o(function(){return X(window,[{eventName:"touchmove",fn:o(()=>{},"fn"),options:{capture:!1,passive:!1}}])},"webkitHack"),[])}o(Sd,"useTouchSensor");const Id=["input","button","textarea","select","option","optgroup","video","audio"];function To(e,t){if(t==null)return!1;if(Id.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:To(e,t.parentElement)}o(To,"isAnInteractiveElement");function Cd(e,t){const n=t.target;return ht(n)?To(e,n):!1}o(Cd,"isEventInInteractiveElement");var wd=o(e=>Z(e.getBoundingClientRect()).center,"getBorderBoxCenterPosition");function Ed(e){return e instanceof No(e).Element}o(Ed,"isElement");const Nd=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function Bo(e,t){return e==null?null:e[Nd](t)?e:Bo(e.parentElement,t)}o(Bo,"closestPonyfill");function Pd(e,t){return e.closest?e.closest(t):Bo(e,t)}o(Pd,"closest");function Ad(e){return`[${me.contextId}="${e}"]`}o(Ad,"getSelector");function Rd(e,t){const n=t.target;if(!Ed(n))return null;const r=Ad(e),s=Pd(n,r);return!s||!ht(s)?null:s}o(Rd,"findClosestDragHandleFromEvent");function Od(e,t){const n=Rd(e,t);return n?n.getAttribute(me.draggableId):null}o(Od,"tryGetClosestDraggableIdFromEvent");function Td(e,t){const n=`[${Gt.contextId}="${e}"]`,s=Eo(document,n).find(i=>i.getAttribute(Gt.id)===t);return!s||!ht(s)?null:s}o(Td,"findDraggable");function Bd(e){e.preventDefault()}o(Bd,"preventDefault");function Ye({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}o(Ye,"isActive");function jo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const s=n.draggable.findById(r);return!(!s||!s.options.isEnabled||!So(t.getState(),r))}o(jo,"canStart");function jd({lockAPI:e,contextId:t,store:n,registry:r,draggableId:s,forceSensorStop:i,sourceEvent:a}){if(!jo({lockAPI:e,store:n,registry:r,draggableId:s}))return null;const c=r.draggable.getById(s),d=Td(t,c.descriptor.id);if(!d||a&&!c.options.canDragInteractiveElements&&Cd(d,a))return null;const p=e.claim(i||ne);let f="PRE_DRAG";function u(){return c.options.shouldRespectForcePress}o(u,"getShouldRespectForcePress");function m(){return e.isActive(p)}o(m,"isLockActive");function h(C,N){Ye({expected:C,phase:f,isLockActive:m,shouldWarn:!0})&&n.dispatch(N())}o(h,"tryDispatch");const x=h.bind(null,"DRAGGING");function b(C){function N(){e.release(),f="COMPLETED"}o(N,"completed"),f!=="PRE_DRAG"&&(N(),y()),n.dispatch(Pl(C.liftActionArgs)),f="DRAGGING";function O(T,$={shouldBlockNextClick:!1}){if(C.cleanup(),$.shouldBlockNextClick){const P=X(window,[{eventName:"click",fn:Bd,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(P)}N(),n.dispatch(go({reason:T}))}return o(O,"finish2"),{isActive:o(()=>Ye({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),"isActive"),shouldRespectForcePress:u,drop:o(T=>O("DROP",T),"drop"),cancel:o(T=>O("CANCEL",T),"cancel"),...C.actions}}o(b,"lift2");function D(C){const N=Be(T=>{x(()=>po({client:T}))});return{...b({liftActionArgs:{id:s,clientSelection:C,movementMode:"FLUID"},cleanup:o(()=>N.cancel(),"cleanup"),actions:{move:N}}),move:N}}o(D,"fluidLift");function S(){const C={moveUp:o(()=>x(_l),"moveUp"),moveRight:o(()=>x(Gl),"moveRight"),moveDown:o(()=>x(Fl),"moveDown"),moveLeft:o(()=>x($l),"moveLeft")};return b({liftActionArgs:{id:s,clientSelection:wd(d),movementMode:"SNAP"},cleanup:ne,actions:C})}o(S,"snapLift");function E(){Ye({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0})&&e.release()}return o(E,"abortPreDrag"),{isActive:o(()=>Ye({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),"isActive"),shouldRespectForcePress:u,fluidLift:D,snapLift:S,abort:E}}o(jd,"tryStart");const Ld=[pd,bd,Sd];function Md({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:s}){const i=[...s?Ld:[],...r||[]],a=v.useState(()=>Zc())[0],l=w(o(function(b,D){Ge(b)&&!Ge(D)&&a.tryAbandon()},"tryAbandonLock2"),[a]);Y(o(function(){let b=t.getState();return t.subscribe(()=>{const S=t.getState();l(b,S),b=S})},"listenToStore"),[a,t,l]),Y(()=>a.tryAbandon,[a.tryAbandon]);const c=w(x=>jo({lockAPI:a,registry:n,store:t,draggableId:x}),[a,n,t]),d=w((x,b,D)=>jd({lockAPI:a,registry:n,contextId:e,store:t,draggableId:x,forceSensorStop:b||null,sourceEvent:D&&D.sourceEvent?D.sourceEvent:null}),[e,a,n,t]),p=w(x=>Od(e,x),[e]),f=w(x=>{const b=n.draggable.findById(x);return b?b.options:null},[n.draggable]),u=w(o(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(sn()))},"tryReleaseLock2"),[a,t]),m=w(()=>a.isClaimed(),[a]),h=R(()=>({canGetLock:c,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:f,tryReleaseLock:u,isLockClaimed:m}),[c,d,p,f,u,m]);for(let x=0;x<i.length;x++)i[x](h)}o(Md,"useSensorMarshal");const _d=o(e=>({onBeforeCapture:o(t=>{const n=o(()=>{e.onBeforeCapture&&e.onBeforeCapture(t)},"onBeforeCapureCallback");yr.flushSync(n)},"onBeforeCapture"),onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),"createResponders"),Fd=o(e=>({...Fe,...e.autoScrollerOptions,durationDampening:{...Fe.durationDampening,...e.autoScrollerOptions}}),"createAutoScrollerOptions");function Pe(e){return e.current||y(),e.current}o(Pe,"getStore");function Gd(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:s,dragHandleUsageInstructions:i}=e,a=v.useRef(null),l=Po(e),c=w(()=>_d(l.current),[l]),d=w(()=>Fd(l.current),[l]),p=Kc(t),f=Qc({contextId:t,text:i}),u=Wc(t,s),m=w(P=>{Pe(a).dispatch(P)},[]),h=R(()=>Nn({publishWhileDragging:Rl,updateDroppableScroll:Tl,updateDroppableIsEnabled:Bl,updateDroppableIsCombineEnabled:jl,collectionStarting:Ol},m),[m]),x=qc(),b=R(()=>yc(x,h),[x,h]),D=R(()=>_c({scrollWindow:Dc,scrollDroppable:b.scrollDroppable,getAutoScrollerOptions:d,...Nn({move:po},m)}),[b.scrollDroppable,m,d]),S=Uc(t),E=R(()=>hc({announce:p,autoScroller:D,dimensionMarshal:b,focusMarshal:S,getResponders:c,styleMarshal:u}),[p,D,b,S,c,u]);a.current=E;const I=w(()=>{const P=Pe(a);P.getState().phase!=="IDLE"&&P.dispatch(sn())},[]),C=w(()=>{const P=Pe(a).getState();return P.phase==="DROP_ANIMATING"?!0:P.phase==="IDLE"?!1:P.isDragging},[]),N=R(()=>({isDragging:C,tryAbort:I}),[C,I]);n(N);const O=w(P=>So(Pe(a).getState(),P),[]),T=w(()=>le(Pe(a).getState()),[]),$=R(()=>({marshal:b,focus:S,contextId:t,canLift:O,isMovementAllowed:T,dragHandleUsageInstructionsId:f,registry:x}),[t,b,f,S,O,T,x]);return Md({contextId:t,store:E,registry:x,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),v.useEffect(()=>I,[I]),L.createElement(bt.Provider,{value:$},L.createElement(ua,{context:pn,store:E},e.children))}o(Gd,"App");function $d(){return L.useId()}o($d,"useUniqueContextId");function kd(e){const t=$d(),n=e.dragHandleUsageInstructions||Xe.dragHandleUsageInstructions;return L.createElement(jt,null,r=>L.createElement(Gd,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}o(kd,"DragDropContext");const nr={dragging:5e3,dropAnimating:4500},Wd=o((e,t)=>t?Te.drop(t.duration):e?Te.snap:Te.fluid,"getDraggingTransition"),Vd=o((e,t)=>{if(e)return t?_e.opacity.drop:_e.opacity.combining},"getDraggingOpacity"),Ud=o(e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP","getShouldDraggingAnimate");function Hd(e){const n=e.dimension.client,{offset:r,combineWith:s,dropping:i}=e,a=!!s,l=Ud(e),c=!!i,d=c?_t.drop(r,a):_t.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Wd(l,i),transform:d,opacity:Vd(a,c),zIndex:c?nr.dropAnimating:nr.dragging,pointerEvents:"none"}}o(Hd,"getDraggingStyle");function qd(e){return{transform:_t.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}o(qd,"getSecondaryStyle");function zd(e){return e.type==="DRAGGING"?Hd(e):qd(e)}o(zd,"getStyle$1");function Yd(e,t,n=_){const r=window.getComputedStyle(t),s=t.getBoundingClientRect(),i=$r(s,r),a=et(i,n),l={client:i,tagName:t.tagName.toLowerCase(),display:r.display},c={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:l,displaceBy:c,client:i,page:a}}o(Yd,"getDimension$1");function Kd(e){const t=gn("draggable"),{descriptor:n,registry:r,getDraggableRef:s,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:l}=e,c=R(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:l}),[i,l,a]),d=w(m=>{const h=s();return h||y(),Yd(n,h,m)},[n,s]),p=R(()=>({uniqueId:t,descriptor:n,options:c,getDimension:d}),[n,d,c,t]),f=v.useRef(p),u=v.useRef(!0);Y(()=>(r.draggable.register(f.current),()=>r.draggable.unregister(f.current)),[r.draggable]),Y(()=>{if(u.current){u.current=!1;return}const m=f.current;f.current=p,r.draggable.update(p,m)},[p,r.draggable])}o(Kd,"useDraggablePublisher");var hn=L.createContext(null);function st(e){const t=v.useContext(e);return t||y(),t}o(st,"useRequiredContext");function Jd(e){e.preventDefault()}o(Jd,"preventHtml5Dnd");const Xd=o(e=>{const t=v.useRef(null),n=w((N=null)=>{t.current=N},[]),r=w(()=>t.current,[]),{contextId:s,dragHandleUsageInstructionsId:i,registry:a}=st(bt),{type:l,droppableId:c}=st(hn),d=R(()=>({id:e.draggableId,index:e.index,type:l,droppableId:c}),[e.draggableId,e.index,l,c]),{children:p,draggableId:f,isEnabled:u,shouldRespectForcePress:m,canDragInteractiveElements:h,isClone:x,mapped:b,dropAnimationFinished:D}=e;if(!x){const N=R(()=>({descriptor:d,registry:a,getDraggableRef:r,canDragInteractiveElements:h,shouldRespectForcePress:m,isEnabled:u}),[d,a,r,h,m,u]);Kd(N)}const S=R(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":s,draggable:!1,onDragStart:Jd}:null,[s,i,f,u]),E=w(N=>{b.type==="DRAGGING"&&b.dropping&&N.propertyName==="transform"&&yr.flushSync(D)},[D,b]),I=R(()=>{const N=zd(b),O=b.type==="DRAGGING"&&b.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":s,"data-rfd-draggable-id":f,style:N,onTransitionEnd:O},dragHandleProps:S}},[s,S,f,b,E,n]),C=R(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return L.createElement(L.Fragment,null,p(I,b.snapshot,C))},"Draggable");var Lo=o((e,t)=>e===t,"isStrictEqual"),Mo=o(e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null},"whatIsDraggedOverFromResult");const Qd=o(e=>e.combine?e.combine.draggableId:null,"getCombineWithFromResult"),Zd=o(e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null,"getCombineWithFromImpact");function eu(){const e=M((s,i)=>({x:s,y:i})),t=M((s,i,a=null,l=null,c=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!c,dropAnimation:c,mode:s,draggingOver:a,combineWith:l,combineTargetFor:null})),n=M((s,i,a,l,c=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:d,mode:i,offset:s,dimension:a,forceShouldAnimate:p,snapshot:t(i,l,c,d,null)}}));return o((s,i)=>{if(Ge(s)){if(s.critical.draggable.id!==i.draggableId)return null;const a=s.current.client.offset,l=s.dimensions.draggables[i.draggableId],c=z(s.impact),d=Zd(s.impact),p=s.forceShouldAnimate;return n(e(a.x,a.y),s.movementMode,l,i.isClone,c,d,p)}if(s.phase==="DROP_ANIMATING"){const a=s.completed;if(a.result.draggableId!==i.draggableId)return null;const l=i.isClone,c=s.dimensions.draggables[i.draggableId],d=a.result,p=d.mode,f=Mo(d),u=Qd(d),h={duration:s.dropDuration,curve:ln.drop,moveTo:s.newHomeClientOffset,opacity:u?_e.opacity.drop:null,scale:u?_e.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:c,dropping:h,draggingOver:f,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,l,f,u,h)}}}return null},"selector")}o(eu,"getDraggableSelector");function _o(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}o(_o,"getSecondarySnapshot");const tu={mapped:{type:"SECONDARY",offset:_,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:_o(null)}};function nu(){const e=M((a,l)=>({x:a,y:l})),t=M(_o),n=M((a,l=null,c)=>({mapped:{type:"SECONDARY",offset:a,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}})),r=o(a=>a?n(_,a,!0):null,"getFallback"),s=o((a,l,c,d)=>{const p=c.displaced.visible[a],f=!!(d.inVirtualList&&d.effected[a]),u=pt(c),m=u&&u.draggableId===a?l:null;if(!p){if(!f)return r(m);if(c.displaced.invisible[a])return null;const b=be(d.displacedBy.point),D=e(b.x,b.y);return n(D,m,!0)}if(f)return r(m);const h=c.displacedBy.point,x=e(h.x,h.y);return n(x,m,p.shouldAnimate)},"getProps");return o((a,l)=>{if(Ge(a))return a.critical.draggable.id===l.draggableId?null:s(l.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){const c=a.completed;return c.result.draggableId===l.draggableId?null:s(l.draggableId,c.result.draggableId,c.impact,c.afterCritical)}return null},"selector")}o(nu,"getSecondarySelector");const ru=o(()=>{const e=eu(),t=nu();return o((r,s)=>e(r,s)||t(r,s)||tu,"selector")},"makeMapStateToProps$1"),ou={dropAnimationFinished:mo},su=Gr(ru,ou,null,{context:pn,areStatePropsEqual:Lo})(Xd);function Fo(e){return st(hn).isUsingCloneFor===e.draggableId&&!e.isClone?null:L.createElement(su,e)}o(Fo,"PrivateDraggable");function iu(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return L.createElement(Fo,tt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}o(iu,"PublicDraggable");const Go=o(e=>t=>e===t,"isEqual"),au=Go("scroll"),lu=Go("auto"),rr=o((e,t)=>t(e.overflowX)||t(e.overflowY),"isEither"),cu=o(e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return rr(n,au)||rr(n,lu)},"isElementScrollable"),du=o(()=>!1,"isBodyScrollable"),$o=o(e=>e==null?null:e===document.body?du()?e:null:e===document.documentElement?null:cu(e)?e:$o(e.parentElement),"getClosestScrollable");var $t=o(e=>({x:e.scrollLeft,y:e.scrollTop}),"getScroll");const ko=o(e=>e?window.getComputedStyle(e).position==="fixed"?!0:ko(e.parentElement):!1,"getIsFixed");var uu=o(e=>{const t=$o(e),n=ko(e);return{closestScrollable:t,isFixedOnPage:n}},"getEnv"),fu=o(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:s,client:i,page:a,closest:l})=>{const c=(()=>{if(!l)return null;const{scrollSize:u,client:m}=l,h=vo({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:m,scrollSize:u,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:h,diff:{value:_,displacement:_}}}})(),d=s==="vertical"?en:Xr,p=pe({page:a,withPlaceholder:null,axis:d,frame:c});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:a,frame:c,subject:p}},"getDroppableDimension");const pu=o((e,t)=>{const n=kr(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,s=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=s+t.scrollWidth,c=Jt({top:r,right:a,bottom:i,left:s},n.border);return Xt({borderBox:c,margin:n.margin,border:n.border,padding:n.padding})},"getClient");var gu=o(({ref:e,descriptor:t,env:n,windowScroll:r,direction:s,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:l})=>{const c=n.closestScrollable,d=pu(e,c),p=et(d,r),f=(()=>{if(!c)return null;const m=kr(c),h={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:m,page:et(m,r),scroll:$t(c),scrollSize:h,shouldClipSubject:l}})();return fu({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:s,client:d,page:p,closest:f})},"getDimension");const mu={passive:!1},hu={passive:!0};var or=o(e=>e.shouldPublishImmediately?mu:hu,"getListenerOptions");const Ke=o(e=>e&&e.env.closestScrollable||null,"getClosestScrollableFromDrag");function bu(e){const t=v.useRef(null),n=st(bt),r=gn("droppable"),{registry:s,marshal:i}=n,a=Po(e),l=R(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),c=v.useRef(l),d=R(()=>M((I,C)=>{t.current||y();const N={x:I,y:C};i.updateDroppableScroll(l.id,N)}),[l.id,i]),p=w(()=>{const I=t.current;return!I||!I.env.closestScrollable?_:$t(I.env.closestScrollable)},[]),f=w(()=>{const I=p();d(I.x,I.y)},[p,d]),u=R(()=>Be(f),[f]),m=w(()=>{const I=t.current,C=Ke(I);if(I&&C||y(),I.scrollOptions.shouldPublishImmediately){f();return}u()},[u,f]),h=w((I,C)=>{t.current&&y();const N=a.current,O=N.getDroppableRef();O||y();const T=uu(O),$={ref:O,descriptor:l,env:T,scrollOptions:C};t.current=$;const P=gu({ref:O,descriptor:l,env:T,windowScroll:I,direction:N.direction,isDropDisabled:N.isDropDisabled,isCombineEnabled:N.isCombineEnabled,shouldClipSubject:!N.ignoreContainerClipping}),A=T.closestScrollable;return A&&(A.setAttribute(Qn.contextId,n.contextId),A.addEventListener("scroll",m,or($.scrollOptions))),P},[n.contextId,l,m,a]),x=w(()=>{const I=t.current,C=Ke(I);return I&&C||y(),$t(C)},[]),b=w(()=>{const I=t.current;I||y();const C=Ke(I);t.current=null,C&&(u.cancel(),C.removeAttribute(Qn.contextId),C.removeEventListener("scroll",m,or(I.scrollOptions)))},[m,u]),D=w(I=>{const C=t.current;C||y();const N=Ke(C);N||y(),N.scrollTop+=I.y,N.scrollLeft+=I.x},[]),S=R(()=>({getDimensionAndWatchScroll:h,getScrollWhileDragging:x,dragStopped:b,scroll:D}),[b,h,x,D]),E=R(()=>({uniqueId:r,descriptor:l,callbacks:S}),[S,l,r]);Y(()=>(c.current=E.descriptor,s.droppable.register(E),()=>{t.current&&b(),s.droppable.unregister(E)}),[S,l,b,E,i,s.droppable]),Y(()=>{t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),Y(()=>{t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}o(bu,"useDroppablePublisher");function At(){}o(At,"noop");const sr={width:0,height:0,margin:Ca},xu=o(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?sr:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},"getSize"),vu=o(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=xu({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Te.placeholder:null}},"getStyle"),yu=o(e=>{const t=v.useRef(null),n=w(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:s,onClose:i,contextId:a}=e,[l,c]=v.useState(e.animate==="open");v.useEffect(()=>l?r!=="open"?(n(),c(!1),At):t.current?At:(t.current=setTimeout(()=>{t.current=null,c(!1)}),n):At,[r,l,n]);const d=w(f=>{f.propertyName==="height"&&(s(),r==="close"&&i())},[r,i,s]),p=vu({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return L.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})},"Placeholder");var Du=L.memo(yu);const vn=class vn extends L.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}};o(vn,"AnimateInOut");let kt=vn;const Su=o(e=>{const t=v.useContext(bt);t||y();const{contextId:n,isMovementAllowed:r}=t,s=v.useRef(null),i=v.useRef(null),{children:a,droppableId:l,type:c,mode:d,direction:p,ignoreContainerClipping:f,isDropDisabled:u,isCombineEnabled:m,snapshot:h,useClone:x,updateViewportMaxScroll:b,getContainerForClone:D}=e,S=w(()=>s.current,[]),E=w((A=null)=>{s.current=A},[]);w(()=>i.current,[]);const I=w((A=null)=>{i.current=A},[]),C=w(()=>{r()&&b({maxScroll:Do()})},[r,b]);bu({droppableId:l,type:c,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:m,ignoreContainerClipping:f,getDroppableRef:S});const N=R(()=>L.createElement(kt,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:A,data:k,animate:K})=>L.createElement(Du,{placeholder:k,onClose:A,innerRef:I,animate:K,contextId:n,onTransitionEnd:C})),[n,C,e.placeholder,e.shouldAnimatePlaceholder,I]),O=R(()=>({innerRef:E,placeholder:N,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":n}}),[n,l,N,E]),T=x?x.dragging.draggableId:null,$=R(()=>({droppableId:l,type:c,isUsingCloneFor:T}),[l,T,c]);function P(){if(!x)return null;const{dragging:A,render:k}=x,K=L.createElement(Fo,{draggableId:A.draggableId,index:A.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(j,F)=>k(j,F,A));return gs.createPortal(K,D())}return o(P,"getClone"),L.createElement(hn.Provider,{value:$},a(O,h),P())},"Droppable");function Iu(){return document.body||y(),document.body}o(Iu,"getBody");const ir={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Iu},Wo=o(e=>{let t={...e},n;for(n in ir)e[n]===void 0&&(t={...t,[n]:ir[n]});return t},"attachDefaultPropsToOwnProps"),Rt=o((e,t)=>e===t.droppable.type,"isMatchingType"),ar=o((e,t)=>t.draggables[e.draggable.id],"getDraggable"),Cu=o(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,a,l,c,d,p)=>{const f=d.descriptor.id;if(d.descriptor.droppableId===i){const h=p?{render:p,dragging:n(d.descriptor)}:null,x={isDraggingOver:l,draggingOverWith:l?f:null,draggingFromThisWith:f,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:x,useClone:h}}if(!a)return t;if(!c)return e;const m={isDraggingOver:l,draggingOverWith:f,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:m,useClone:null}});return o((i,a)=>{const l=Wo(a),c=l.droppableId,d=l.type,p=!l.isDropDisabled,f=l.renderClone;if(Ge(i)){const u=i.critical;if(!Rt(d,u))return t;const m=ar(u,i.dimensions),h=z(i.impact)===c;return r(c,p,h,h,m,f)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!Rt(d,u.critical))return t;const m=ar(u.critical,i.dimensions);return r(c,p,Mo(u.result)===c,z(u.impact)===c,m,f)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!Rt(d,u.critical))return t;const m=z(u.impact)===c,h=!!(u.impact.at&&u.impact.at.type==="COMBINE"),x=u.critical.droppable.id===c;return m?h?e:t:x?e:t}return t},"selector")},"makeMapStateToProps"),wu={updateViewportMaxScroll:Ml},Eu=Gr(Cu,wu,(e,t,n)=>({...Wo(n),...e,...t}),{context:pn,areStatePropsEqual:Lo})(Su),Nu=o(({deal:e,index:t})=>e?g.jsx(iu,{draggableId:String(e.id),index:t,children:o((n,r)=>g.jsx(Vo,{provided:n,snapshot:r,deal:e}),"children")}):null,"DealCard"),Vo=o(({provided:e,snapshot:t,deal:n})=>{const r=he(),s=o(()=>{r(`/deals/${n.id}/show`,void 0,void 0,void 0,{_scrollToTop:!1})},"handleClick");return g.jsx("div",{className:"cursor-pointer",...e?.draggableProps,...e?.dragHandleProps,ref:e?.innerRef,onClick:s,children:g.jsx(Dr,{className:`py-4 transition-all duration-200 ${t?.isDragging?"opacity-90 transform rotate-1 shadow-lg":"shadow-sm hover:shadow-md"}`,children:g.jsxs(ms,{className:"px-4 flex",children:[g.jsx(Vt,{source:"company_id",record:n,reference:"companies",link:!1,children:g.jsx(Ut,{width:20,height:20})}),g.jsxs("div",{className:"ml-3",children:[g.jsx("p",{className:"text-sm font-medium mb-2",children:n.name}),g.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.amount.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3}),n.category?`, ${n.category}`:""]})]})]})})})},"DealCardContent"),lr=o(()=>{const{identity:e}=it(),{data:t,total:n,isPending:r}=Wt("deals",{pagination:{page:1,perPage:1e3},sort:{field:"archived_at",order:"DESC"},filter:{"archived_at@not.is":null}}),[s,i]=v.useState(!1);if(v.useEffect(()=>{!r&&n===0&&i(!1)},[r,n]),v.useEffect(()=>{i(!1)},[t]),!e||r||!n||!t)return null;const a=t.reduce((l,c)=>{const d=new Date(c.archived_at).toDateString();return l[d]||(l[d]=[]),l[d].push(c),l},{});return g.jsxs("div",{className:"w-full flex flex-row items-center justify-center",children:[g.jsx(at,{variant:"ghost",onClick:o(()=>i(!0),"onClick"),className:"my-4",children:"View archived deals"}),g.jsx(lt,{open:s,onOpenChange:o(()=>i(!1),"onOpenChange"),children:g.jsxs(ct,{className:"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:[g.jsx(dt,{children:"Archived Deals"}),g.jsx("div",{className:"flex flex-col gap-8",children:Object.entries(a).map(([l,c])=>g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsx("h4",{className:"font-bold",children:Pu(l)}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8",children:c.map(d=>g.jsx("div",{children:g.jsx(Vo,{deal:d})},d.id))})]},l))})]})})]})},"DealArchivedList");function Pu(e){const t=new Date(e);t.setHours(0,0,0,0);const n=new Date;n.setHours(0,0,0,0);const r=t.getTime()-n.getTime(),s=Math.round(r/(1e3*60*60*24));if(Math.abs(s)>7)return new Intl.DateTimeFormat(void 0,{day:"numeric",month:"long"}).format(t);const i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});return Au(i.format(s,"day"))}o(Pu,"getRelativeTimeString");function Au(e){return e.charAt(0).toUpperCase()+e.slice(1)}o(Au,"ucFirst");function Uo({...e}){return g.jsx(hs,{"data-slot":"visually-hidden",...e})}o(Uo,"VisuallyHidden");const Ho=o(()=>{const e=bs();return g.jsxs("div",{className:"flex flex-col gap-8",children:[g.jsx(Ru,{}),g.jsxs("div",{className:`flex gap-6 ${e?"flex-col":"flex-row"}`,children:[g.jsx(Ou,{}),g.jsx(Sr,{orientation:e?"horizontal":"vertical"}),g.jsx(Tu,{})]})]})},"DealInputs"),Ru=o(()=>g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx(Sn,{source:"name",label:"Deal name",validate:Ae(),helperText:!1}),g.jsx(Sn,{source:"description",multiline:!0,rows:3,helperText:!1})]}),"DealInfoInputs"),Ou=o(()=>g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx("h3",{className:"text-base font-medium",children:"Linked to"}),g.jsx(Ir,{source:"company_id",reference:"companies",children:g.jsx(xs,{validate:Ae()})}),g.jsx(ii,{source:"contact_ids",reference:"contacts_summary",children:g.jsx(Or,{label:"Contacts",optionText:vs,helperText:!1})})]}),"DealLinkedToInputs"),Tu=o(()=>{const{dealStages:e,dealCategories:t}=$e();return g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx("h3",{className:"text-base font-medium",children:"Misc"}),g.jsx(Ot,{source:"category",label:"Category",choices:t.map(n=>({id:n,name:n})),helperText:!1}),g.jsx(ci,{source:"amount",defaultValue:0,helperText:!1,validate:Ae()}),g.jsx(ys,{validate:Ae(),source:"expected_closing_date",helperText:!1,defaultValue:new Date().toISOString().split("T")[0]}),g.jsx(Ot,{source:"stage",choices:e.map(n=>({id:n.value,name:n.label})),defaultValue:"opportunity",helperText:!1,validate:Ae()})]})},"DealMiscInputs"),qo=o(({open:e})=>{const t=he(),n=Ht(),{data:r}=ut(),s=o(()=>{t("/deals")},"handleClose"),i=Ds(),a=o(async c=>{if(!r){t("/deals");return}const d=r.filter(u=>u.stage===c.stage&&u.id!==c.id);await Promise.all(d.map(async u=>n.update("deals",{id:u.id,data:{index:u.index+1},previousData:u})));const p=d.reduce((u,m)=>({...u,[m.id]:{...m,index:m.index+1}}),{}),f=Date.now();i.setQueriesData({queryKey:["deals","getList"]},u=>u&&{...u,data:u.data.map(m=>p[m.id]||m)},{updatedAt:f}),t("/deals")},"onSuccess"),{identity:l}=it();return g.jsx(lt,{open:e,onOpenChange:o(()=>s(),"onOpenChange"),children:g.jsxs(ct,{className:"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:[g.jsx(Uo,{children:g.jsx(dt,{children:"Create Deal"})}),g.jsx(Ss,{resource:"deals",mutationOptions:{onSuccess:a},children:g.jsxs(Cr,{defaultValues:{sales_id:l?.id,contact_ids:[],index:0},children:[g.jsx(Ho,{}),g.jsx(Is,{children:g.jsx(Cs,{})})]})})]})})},"DealCreate"),Bu=o(({open:e,id:t})=>{const n=he(),r=qt(),s=o(()=>{n("/deals",void 0,void 0,void 0,{_scrollToTop:!1})},"handleClose");return g.jsx(lt,{open:e,onOpenChange:o(()=>s(),"onOpenChange"),children:g.jsx(ct,{className:"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:t?g.jsxs(ws,{id:t,mutationMode:"pessimistic",mutationOptions:{onSuccess:o(()=>{r("Deal updated"),n(`/deals/${t}/show`,void 0,void 0,void 0,{_scrollToTop:!1})},"onSuccess")},children:[g.jsx(ju,{}),g.jsxs(Cr,{children:[g.jsx(Ho,{}),g.jsx(Es,{})]})]}):null})})},"DealEdit");function ju(){const e=wr();return e?g.jsx(dt,{className:"pb-0",children:g.jsxs("div",{className:"flex justify-between items-start mb-8",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Vt,{source:"company_id",reference:"companies",link:"show",children:g.jsx(Ut,{})}),g.jsxs("h2",{className:"text-2xl font-semibold",children:["Edit ",e.name," deal"]})]}),g.jsxs("div",{className:"flex gap-2 pr-12",children:[g.jsx(Er,{}),g.jsx(at,{asChild:!0,variant:"outline",className:"h-9",children:g.jsx(zt,{to:`/deals/${e.id}/show`,children:"Back to deal"})})]})]})}):null}o(ju,"EditHeader");const Lu=o(({children:e})=>{const t=Nr(),n=Je("/deals/create",t.pathname),r=Ns(),{data:s,isPending:i}=Wt("contacts",{pagination:{page:1,perPage:1}});return i?g.jsx(Ps,{value:50}):g.jsxs("div",{className:"flex flex-col justify-center items-center gap-12",style:{height:`calc(100dvh - ${r}px)`},children:[g.jsx("img",{src:"./img/empty.svg",alt:"No deals found"}),s&&s.length>0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("h3",{className:"text-lg font-bold",children:"No deals found"}),g.jsx("p",{className:"text-sm text-center text-muted-foreground mb-4",children:"It seems your deal list is empty."})]}),g.jsx("div",{className:"flex space-x-8",children:g.jsx(Pr,{label:"Create deal"})}),g.jsx(qo,{open:!!n}),e]}):g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("h3",{className:"text-lg font-bold",children:"No deals found"}),g.jsxs("p",{className:"text-sm text-center text-muted-foreground mb-4",children:["It seems your contact list is empty.",g.jsx("br",{}),g.jsx(zt,{to:"/contacts/create",className:"hover:underline",children:"Add your first contact"})," ","before creating a deal."]})]})]})},"DealEmpty"),Mu=o(({stage:e,deals:t})=>{const n=t.reduce((s,i)=>s+i.amount,0),{dealStages:r}=$e();return g.jsxs("div",{className:"flex-1 pb-8",children:[g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("h3",{className:"text-base font-medium",children:Ar(r,e)}),g.jsx("p",{className:"text-sm text-muted-foreground",children:n.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3})})]}),g.jsx(Eu,{droppableId:e,children:o((s,i)=>g.jsxs("div",{ref:s.innerRef,...s.droppableProps,className:`flex flex-col rounded-2xl mt-2 gap-2 ${i.isDraggingOver?"bg-muted":""}`,children:[t.map((a,l)=>g.jsx(Nu,{deal:a,index:l},a.id)),s.placeholder]}),"children")})]})},"DealColumn"),cr=o((e,t)=>{if(!t)return{};const n=e.reduce((r,s)=>(r[s.stage]&&r[s.stage].push(s),r),t.reduce((r,s)=>({...r,[s.value]:[]}),{}));return t.forEach(r=>{n[r.value]=n[r.value].sort((s,i)=>s.index-i.index)}),n},"getDealsByStage"),_u=o(()=>{const{dealStages:e}=$e(),{data:t,isPending:n,refetch:r}=ut(),s=Ht(),[i,a]=v.useState(cr([],e));if(v.useEffect(()=>{if(t){const c=cr(t,e);As(c,i)||a(c)}},[t]),n)return null;const l=o(c=>{const{destination:d,source:p}=c;if(!d||d.droppableId===p.droppableId&&d.index===p.index)return;const f=p.droppableId,u=d.droppableId,m=i[f][p.index],h=i[u][d.index]??{stage:u,index:void 0};a(Fu(m,{stage:f,index:p.index},{stage:u,index:d.index},i)),Gu(m,h,s).then(()=>{r()})},"onDragEnd");return g.jsx(kd,{onDragEnd:l,children:g.jsx("div",{className:"flex gap-4",children:e.map(c=>g.jsx(Mu,{stage:c.value,deals:i[c.value]},c.value))})})},"DealListContent"),Fu=o((e,t,n,r)=>{if(t.stage===n.stage){const s=r[t.stage];return s.splice(t.index,1),s.splice(n.index??s.length+1,0,e),{...r,[n.stage]:s}}else{const s=r[t.stage],i=r[n.stage];return s.splice(t.index,1),i.splice(n.index??i.length+1,0,e),{...r,[t.stage]:s,[n.stage]:i}}},"updateDealStageLocal"),Gu=o(async(e,t,n)=>{if(e.stage===t.stage){const{data:r}=await n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:e.stage}}),s=t.index??r.length+1;e.index>s?await Promise.all([...r.filter(i=>i.index>=s&&i.index<e.index).map(i=>n.update("deals",{id:i.id,data:{index:i.index+1},previousData:i})),n.update("deals",{id:e.id,data:{index:s},previousData:e})]):await Promise.all([...r.filter(i=>i.index<=s&&i.index>e.index).map(i=>n.update("deals",{id:i.id,data:{index:i.index-1},previousData:i})),n.update("deals",{id:e.id,data:{index:s},previousData:e})])}else{const[{data:r},{data:s}]=await Promise.all([n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:e.stage}}),n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:t.stage}})]),i=t.index??s.length+1;await Promise.all([...r.filter(a=>a.index>e.index).map(a=>n.update("deals",{id:a.id,data:{index:a.index-1},previousData:a})),...s.filter(a=>a.index>=i).map(a=>n.update("deals",{id:a.id,data:{index:a.index+1},previousData:a})),n.update("deals",{id:e.id,data:{index:i,stage:t.stage},previousData:e})])}},"updateDealStage"),$u=o(()=>{const{data:e,error:t,isPending:n}=ut();return n||t?g.jsx("div",{className:"h-8"}):g.jsx("div",{className:"flex flex-row flex-wrap gap-4 mt-4",children:e.map(r=>g.jsxs("div",{className:"flex flex-row gap-4 items-center",children:[g.jsx(Rs,{record:r}),g.jsxs("div",{className:"flex flex-col",children:[g.jsxs(zt,{to:`/contacts/${r.id}/show`,className:"text-sm hover:underline",children:[r.first_name," ",r.last_name]}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.title,r.title&&r.company_name&&" at ",r.company_name]})]})]},r.id))})},"ContactList"),dr=o(({open:e,id:t})=>{const n=he(),r=o(()=>{n("list","deals")},"handleClose");return g.jsx(lt,{open:e,onOpenChange:o(s=>!s&&r(),"onOpenChange"),children:g.jsxs(ct,{className:"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:[g.jsx(Uo,{children:g.jsx(dt,{children:"Deal Details"})}),t?g.jsx(Os,{id:t,children:g.jsx(ku,{})}):null]})})},"DealShow"),ku=o(()=>{const{dealStages:e}=$e(),t=wr();return t?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"space-y-2",children:[t.archived_at?g.jsx(Wu,{}):null,g.jsxs("div",{className:"flex-1",children:[g.jsxs("div",{className:"flex justify-between items-start mb-8",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Vt,{source:"company_id",reference:"companies",link:"show",children:g.jsx(Ut,{})}),g.jsx("h2",{className:"text-2xl font-semibold",children:t.name})]}),g.jsx("div",{className:`flex gap-2 ${t.archived_at?"":"pr-12"}`,children:t.archived_at?g.jsxs(g.Fragment,{children:[g.jsx(Uu,{record:t}),g.jsx(Er,{})]}):g.jsxs(g.Fragment,{children:[g.jsx(Vu,{record:t}),g.jsx(Ts,{})]})})]}),g.jsxs("div",{className:"flex gap-8 m-4",children:[g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Expected closing date"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm",children:js(new Date(t.expected_closing_date))?Bs(new Date(t.expected_closing_date),"PP"):"Invalid date"}),new Date(t.expected_closing_date)<new Date?g.jsx(br,{variant:"destructive",children:"Past"}):null]})]}),g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Budget"}),g.jsx("span",{className:"text-sm",children:t.amount.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3})})]}),t.category&&g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Category"}),g.jsx("span",{className:"text-sm",children:t.category})]}),g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Stage"}),g.jsx("span",{className:"text-sm",children:Ar(e,t.stage)})]})]}),!!t.contact_ids?.length&&g.jsx("div",{className:"m-4",children:g.jsxs("div",{className:"flex flex-col min-h-12 mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Contacts"}),g.jsx(Ls,{source:"contact_ids",reference:"contacts_summary",children:g.jsx($u,{})})]})}),t.description&&g.jsxs("div",{className:"m-4 whitespace-pre-line",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Description"}),g.jsx("p",{className:"text-sm leading-6",children:t.description})]}),g.jsxs("div",{className:"m-4",children:[g.jsx(Sr,{className:"mb-4"}),g.jsx(Ms,{target:"deal_id",reference:"dealNotes",sort:{field:"date",order:"DESC"},empty:g.jsx(Fs,{reference:"deals"}),children:g.jsx(_s,{reference:"deals"})})]})]})]})}):null},"DealShowContent"),Wu=o(()=>g.jsx("div",{className:"bg-orange-500 px-6 py-4",children:g.jsx("h3",{className:"text-lg font-bold text-white",children:"Archived Deal"})}),"ArchivedTitle"),Vu=o(({record:e})=>{const[t]=$s(),n=he(),r=qt(),s=Rr(),i=o(()=>{t("deals",{id:e.id,data:{archived_at:new Date().toISOString()},previousData:e},{onSuccess:o(()=>{n("list","deals"),r("Deal archived",{type:"info",undoable:!1}),s()},"onSuccess"),onError:o(()=>{r("Error: deal not archived",{type:"error"})},"onError")})},"handleClick");return g.jsxs(at,{onClick:i,size:"sm",variant:"outline",className:"flex items-center gap-2 h-9",children:[g.jsx(oi,{className:"w-4 h-4"}),"Archive"]})},"ArchiveButton"),Uu=o(({record:e})=>{const t=Ht(),n=he(),r=qt(),s=Rr(),{mutate:i}=Gs({mutationFn:o(()=>t.unarchiveDeal(e),"mutationFn"),onSuccess:o(()=>{n("list","deals"),r("Deal unarchived",{type:"info",undoable:!1}),s()},"onSuccess"),onError:o(()=>{r("Error: deal not unarchived",{type:"error"})},"onError")}),a=o(()=>{i()},"handleClick");return g.jsxs(at,{onClick:a,size:"sm",variant:"outline",className:"flex items-center gap-2 h-9",children:[g.jsx(ni,{className:"w-4 h-4"}),"Send back to the board"]})},"UnarchiveButton"),Hu=o(e=>{const{filterValues:t,displayedFilters:n,setFilters:r}=ks(),{identity:s}=it(),i=o(()=>{const a={...t};typeof t.sales_id<"u"?delete a.sales_id:a.sales_id=s&&s?.id,r(a,n)},"handleChange");return g.jsx("div",{className:"mt-auto pb-2.25",children:g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(Ws,{id:"only-mine",checked:typeof t.sales_id<"u",onCheckedChange:i}),g.jsx(Vs,{htmlFor:"only-mine",children:"Only companies I manage"})]})})},"OnlyMineInput"),Ju=o(()=>{const{dealCategories:e}=$e(),t=[g.jsx(Us,{source:"q",alwaysOn:!0}),g.jsx(Ir,{source:"company_id",reference:"companies",children:g.jsx(Hs,{label:!1,placeholder:"Company"})}),g.jsx(Ot,{source:"category",emptyText:"Category",choices:e.map(n=>({id:n,name:n}))}),g.jsx(Hu,{source:"sales_id",alwaysOn:!0})];return g.jsx(qs,{perPage:100,filter:{"archived_at@is":null},title:!1,sort:{field:"index",order:"DESC"},filters:t,actions:g.jsx(zu,{}),pagination:null,children:g.jsx(qu,{})})},"DealList"),qu=o(()=>{const e=Nr(),t=Je("/deals/create",e.pathname),n=Je("/deals/:id/show",e.pathname),r=Je("/deals/:id",e.pathname),{data:s,isPending:i,filterValues:a}=ut(),{identity:l}=it(),c=a&&Object.keys(a).length>0;return!l||i?g.jsx("div",{className:"w-full",children:g.jsx(Dr,{className:"p-4",children:g.jsxs("div",{className:"flex gap-4",children:[g.jsx(qe,{className:"h-96 w-1/4"}),g.jsx(qe,{className:"h-96 w-1/4"}),g.jsx(qe,{className:"h-96 w-1/4"}),g.jsx(qe,{className:"h-96 w-1/4"})]})})}):!s?.length&&!c?g.jsx(g.Fragment,{children:g.jsxs(Lu,{children:[g.jsx(dr,{open:!!n,id:n?.params.id}),g.jsx(lr,{})]})}):g.jsxs("div",{className:"w-full",children:[g.jsx(_u,{}),g.jsx(lr,{}),g.jsx(qo,{open:!!t}),g.jsx(Bu,{open:!!r&&!t,id:r?.params.id}),g.jsx(dr,{open:!!n,id:n?.params.id})]})},"DealLayout"),zu=o(()=>g.jsxs(zs,{children:[g.jsx(Ys,{}),g.jsx(Ks,{}),g.jsx(Pr,{label:"New Deal"})]}),"DealActions");export{Ju as default};
59
- //# sourceMappingURL=DealList-BrMu9tSP.js.map
59
+ //# sourceMappingURL=DealList-CRBXwi1I.js.map